/* ==============================================
   BASE.CSS — TilbeHome Pro
   Reset, typography, containers, utility.
   Loads after tokens.css, before legacy.css.
   Uses --th-* token system exclusively.
   ============================================== */

/* ── Box Model Reset ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── HTML Root ── */
html {
  -webkit-text-size-adjust: 100%;
}

/* ── Body Defaults ── */
body {
  margin: 0;
  font-family: var(--th-font-primary);
  font-size: var(--th-text-base);
  line-height: var(--th-leading-normal);
  color: var(--th-color-text);
  background: var(--th-color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  position: relative;
  left: 0;
  transition: all .4s;
}

/* ── Typography Scale ── */
h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  margin-bottom: var(--th-space-3);
  font-weight: var(--th-font-bold);
  line-height: var(--th-leading-tight);
  color: var(--th-color-text);
}
h1 { font-size: var(--th-text-2xl); }
/* Platform nötralizasyon: h1.title { border-bottom: 1px solid rgba(0,0,0,.1) } */
h1.title { border-bottom: none; }
h2 { font-size: var(--th-text-xl); }
h3 { font-size: var(--th-text-lg); }
h4 { font-size: var(--th-text-md); }
h5 { font-size: var(--th-text-base); }
h6 { font-size: var(--th-text-sm); }

p { margin-top: 0; margin-bottom: var(--th-space-3); }

a {
  color: var(--th-color-text-link);
  text-decoration: none;
  transition: var(--th-transition-fast);
}
a:hover { text-decoration: none; color: var(--th-color-accent-hover); }

img { max-width: 100%; height: auto; display: block; }
svg, video { max-width: 100%; display: block; }

/* ── Element Reset ── */
button {
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
}
ul, ol {
  list-style: none;
  padding: 0;
  margin: 0;
}
input, textarea, select {
  font: inherit;
}
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* ── Focus Visible (A11y) ── */
:focus-visible {
  outline: var(--th-focus-ring-width) var(--th-focus-ring-style) var(--th-focus-ring-color);
  outline-offset: var(--th-focus-ring-offset);
}

/* ── Selection ── */
::selection {
  background: var(--th-color-primary);
  color: var(--th-color-text-inverse);
}


/* ── Smooth Scroll ── */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   BOLUM 8: MICRO DETAILS & POLISH
   ═══════════════════════════════════════════════════════════════════ */

/* ── 8A: Custom Scrollbar ── */
::-webkit-scrollbar { width: var(--th-scrollbar-width); }
::-webkit-scrollbar-track { background: var(--th-scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--th-scrollbar-thumb); border-radius: var(--th-scrollbar-radius); }
::-webkit-scrollbar-thumb:hover { background: var(--th-scrollbar-thumb-hover); }
* { scrollbar-width: thin; scrollbar-color: var(--th-scrollbar-thumb) var(--th-scrollbar-track); }

/* ── 8D: Image Drag Prevention ── */
.th-card__image img,
.th-pdp__gallery img,
.tilbe-anasayfa01-image img {
  -webkit-user-drag: none;
  user-select: none;
}

/* ── 8E: Mobile Tap Highlight ── */
* { -webkit-tap-highlight-color: transparent; }

/* ── 8G: Content Visibility (off-screen rendering skip) ── */
.th-card,
.tilbe-anasayfa01-card-product,
.th-section {
  content-visibility: auto;
  contain-intrinsic-size: auto 400px;
}

/* ── 8H: Global Spin Animation ── */
@keyframes th-spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════════
   BOLUM 7: CROSS-BROWSER FALLBACKS
   ═══════════════════════════════════════════════════════════════════ */

/* ── 7A: Safari aspect-ratio fallback ── */
@supports not (aspect-ratio: 1/1) {
  .th-card__image { padding-top: 100%; position: relative; }
  .th-card__image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
}


/* ── 7A: Safari :focus-visible fallback ── */
@supports not selector(:focus-visible) {
  :focus { outline: var(--th-focus-ring-width) var(--th-focus-ring-style) var(--th-focus-ring-color); outline-offset: var(--th-focus-ring-offset); }
}


/* === legacy.css'ten taşındı — 5B Mobile-only === */
@media (min-width: 1024px) {
    .mobile-only {
        display: none
    }
}

@media (max-width: 1023px) {
    .mobile-only {
        display: block;
        text-align: center
    }
}

/* === legacy.css'ten taşındı — B3 overflow-x reset === */

body, html {
  overflow-x: clip;  /* hidden yerine clip — sticky position'ı kırmaz */
  max-width: 100%;
}

/* === legacy.css'ten taşındı — B5 clearfix === */
.clearfix::after {
    content: "";
    display: table;
    clear: both
}
/* === misc.css'ten taşındı — 9A Form Input Focus Transitions === */
input,
select,
textarea,
.th-form .form-control {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input:focus,
select:focus,
textarea:focus,
.th-form .form-control:focus {
  border-color: var(--th-color-primary);
  box-shadow: 0 0 0 3px rgba(20, 97, 58, 0.1);
  outline: none;
}

/* ── Platform Nötralizasyon — Z-3 ── */
/* Platform: .form-control:focus { border-color: #000 !important; box-shadow: 0 0 0 1px #000 !important } */
.form-control:focus {
  border-color: var(--th-color-primary) !important;
  box-shadow: 0 0 0 3px var(--th-color-primary-ring) !important;
  outline: none;
}
