@layer reset, tokens, base, components, utilities, theme;

@layer reset {
    *, *::before, *::after { box-sizing: border-box; }
    * { margin: 0; }
    html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
    body { min-height: 100dvh; line-height: 1.55; -webkit-font-smoothing: antialiased; }
    img, picture, svg, video { display: block; max-width: 100%; }
    /* width/height öznitelikleri yalnız oranı bildirir: yükseklik genişlikten ya da aspect-ratio'dan hesaplanır. */
    img, video { height: auto; }
    input, button, textarea, select { font: inherit; color: inherit; }
    p, h1, h2, h3, h4 { overflow-wrap: break-word; }
    h1, h2, h3, h4 { text-wrap: balance; line-height: 1.15; }
    p { text-wrap: pretty; }
    ul[class], ol[class] { list-style: none; padding: 0; }
}

@layer base {
    body {
        font-family: var(--font-body);
        font-size: var(--step-0);
        color: var(--ink);
        background: var(--surface);
        display: flex;
        flex-direction: column;
    }

    main { flex: 1; }
    main:focus { outline: none; }

    a { color: var(--brand); text-underline-offset: 0.2em; }

    :focus-visible {
        outline: 3px solid var(--focus);
        outline-offset: 2px;
        border-radius: 4px;
    }

    /*
     * Kaydırma çubukları: ince, oksuz, yuvarlak; rengi temanın yazı renginden türer,
     * üzerine gelince marka rengine döner. Temalar --scrollbar-* ile ayar yapabilir.
     * Chromium/Safari ::-webkit-scrollbar ile, Firefox standart özelliklerle çizilir.
     * (Chromium, scrollbar-width/color görürse ::-webkit-scrollbar'ı yok sayar; bu yüzden
     * standart özellikler yalnızca ::-webkit-scrollbar'ı desteklemeyen tarayıcıya verilir.)
     */
    :root {
        --scrollbar-size: 10px;
        --scrollbar-thumb: color-mix(in oklab, var(--ink) 24%, transparent);
        --scrollbar-thumb-hover: color-mix(in oklab, var(--brand) 75%, transparent);
        --scrollbar-radius: 999px;
    }
    @supports not selector(::-webkit-scrollbar) {
        * { scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb) transparent; }
    }
    ::-webkit-scrollbar { width: var(--scrollbar-size); height: var(--scrollbar-size); }
    ::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
    ::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
    ::-webkit-scrollbar-thumb {
        /* Saydam kenarlık çubuğu kanalın ortasına inceltir */
        border: 3px solid transparent;
        border-radius: var(--scrollbar-radius);
        background: var(--scrollbar-thumb) padding-box;
    }
    ::-webkit-scrollbar-thumb:hover, ::-webkit-scrollbar-thumb:active { background-color: var(--scrollbar-thumb-hover); }
    /* Sayfa içindeki küçük kaydırma alanları (filtre listesi, yatay raflar) daha da ince */
    body *::-webkit-scrollbar { width: 8px; height: 8px; }
    body *::-webkit-scrollbar-thumb { border-width: 2px; }

    /* Fiyatlar ve sayılar hizalı dursun */
    .error-page__code { font-variant-numeric: tabular-nums; }

    @media (prefers-reduced-motion: reduce) {
        *, *::before, *::after {
            animation-duration: 0.01ms !important;
            transition-duration: 0.01ms !important;
            scroll-behavior: auto !important;
        }
    }
}

@layer components {
    .container {
        width: 100%;
        max-width: var(--container);
        margin-inline: auto;
        padding-inline: var(--space-4);
    }

    @media (min-width: 768px) {
        .container { padding-inline: var(--space-8); }
    }

    .skip-link {
        position: absolute;
        inset-inline-start: var(--space-4);
        top: -100px;
        z-index: 100;
        padding: var(--space-2) var(--space-4);
        /* Marka rengi açık olabilir; atlama bağlantısı her temada okunaklı kalsın (koyu zemin). */
        background: var(--ink);
        color: var(--surface-raised);
        border-radius: var(--radius);
    }
    .skip-link:focus { top: var(--space-2); }

    /* ---- Başlık ---------------------------------------------------------- */
    .site-header {
        position: sticky;
        top: 0;
        z-index: 50;
        background: color-mix(in oklab, var(--surface-raised) 92%, transparent);
        backdrop-filter: saturate(1.4) blur(12px);
    }

    .site-header__bar {
        display: grid;
        grid-template-columns: auto 1fr auto;
        grid-template-areas: "brand . actions";
        align-items: center;
        gap: var(--space-3) var(--space-4);
        padding-block: var(--space-3);
    }

    @media (min-width: 900px) {
        .site-header__bar {
            justify-content: space-between;
            min-height: var(--header-height);
            padding-block: var(--space-2);
        }
    }

    .brand {
        grid-area: brand;
        display: inline-flex;
        align-items: center;
        gap: var(--space-2);
        color: var(--ink);
        text-decoration: none;
        font-weight: 800;
        font-size: var(--step-1);
        letter-spacing: -0.02em;
    }

    /* Çini göbeği: dört yapraklı motif */
    .brand__mark {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background:
            radial-gradient(circle at 50% 50%, var(--surface-raised) 0 18%, transparent 19%),
            conic-gradient(from 45deg, var(--brand) 0 25%, var(--accent) 0 50%, var(--brand) 0 75%, var(--accent) 0);
        mask: radial-gradient(circle at 50% 0, transparent 0 22%, #000 23%) top / 100% 50% no-repeat,
              radial-gradient(circle at 50% 100%, transparent 0 22%, #000 23%) bottom / 100% 50% no-repeat;
    }

    .announcement {
        margin: 0;
        padding: 6px var(--space-4);
        background: var(--ink);
        color: var(--surface-raised);
        font-size: 0.75rem;
        font-weight: 600;
        letter-spacing: 0.04em;
        text-align: center;
    }

    .icon-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: var(--space-2);
        min-width: 44px;
        min-height: 44px;
        border: 0;
        border-radius: var(--radius-pill);
        background: transparent;
        color: var(--ink);
        text-decoration: none;
        cursor: pointer;
        transition: background-color 0.15s var(--ease);
    }
    .icon-button:hover { background: color-mix(in oklab, var(--ink) 7%, transparent); }

    /* ---- Butonlar -------------------------------------------------------- */
    .button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 48px;
        padding: var(--space-3) var(--space-6);
        border-radius: var(--radius);
        border: 1px solid transparent;
        font-weight: 650;
        text-decoration: none;
        transition: transform 0.12s var(--ease), background-color 0.15s var(--ease), border-color 0.15s var(--ease);
    }
    .button:active { transform: translateY(1px); }

    .button--primary { background: var(--brand); color: var(--brand-ink); }
    .button--primary:hover { background: color-mix(in oklab, var(--brand) 88%, var(--ink)); }

    .button--secondary { background: transparent; color: var(--ink); border-color: var(--line); }
    .button--secondary:hover { border-color: var(--ink-muted); }

    /* ---- Ana sayfa ------------------------------------------------------- */
    .hero {
        padding-block: var(--space-12) var(--space-16);
        border-bottom: 1px solid var(--line);
        background:
            radial-gradient(60rem 30rem at 100% 0%, color-mix(in oklab, var(--brand) 9%, transparent), transparent 70%),
            var(--surface-raised);
    }

    .hero__inner { display: grid; gap: var(--space-4); justify-items: start; }

    .hero__eyebrow {
        display: inline-flex;
        align-items: center;
        gap: var(--space-2);
        font-size: var(--step--1);
        font-weight: 600;
        color: var(--accent);
    }
    .hero__eyebrow::before {
        content: "";
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: currentColor;
        box-shadow: 0 0 0 4px color-mix(in oklab, currentColor 20%, transparent);
    }

    .hero__title {
        max-width: 14ch;
        font-family: var(--font-display);
        font-size: var(--step-4);
        font-weight: 850;
        letter-spacing: -0.035em;
    }

    .hero__lead {
        max-width: 52ch;
        color: var(--ink-muted);
        font-size: var(--step-1);
    }

    .hero__actions {
        display: flex;
        flex-wrap: wrap;
        gap: var(--space-3);
        margin-top: var(--space-2);
    }

    .promises {
        display: grid;
        gap: var(--space-4);
        padding-block: var(--space-12);
    }
    @media (min-width: 768px) { .promises { grid-template-columns: repeat(3, 1fr); } }

    .promise {
        padding: var(--space-6);
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: var(--surface-raised);
    }
    .promise p { color: var(--ink-muted); margin-top: var(--space-2); }

    .promise__title {
        font-size: var(--step-1);
        letter-spacing: -0.01em;
    }

    /* ---- Bloklar (ana sayfa düzenleyici) -------------------------------- */
    .hero__content { display: grid; gap: var(--space-4); justify-items: start; }
    .hero--center .hero__content { justify-items: center; text-align: center; }
    .hero--center .hero__inner { justify-items: center; }
    .hero__media { width: 100%; }
    .hero__media img, .banner__media img { width: 100%; height: auto; border-radius: var(--radius); }
    @media (min-width: 900px) {
        .hero--media .hero__inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: var(--space-8); }
    }
    .section-title + .promises { padding-top: var(--space-4); }
    @media (min-width: 768px) {
        .promises--2 { grid-template-columns: repeat(2, 1fr); }
        .promises--4 { grid-template-columns: repeat(4, 1fr); }
    }

    .banner {
        display: grid;
        gap: var(--space-6);
        align-items: center;
        padding: var(--space-8);
        border-radius: var(--radius);
        background: var(--brand);
        color: var(--brand-ink);
    }
    .banner--accent { background: var(--accent); color: #fff; }
    .banner--dark { background: var(--ink); color: var(--surface); }
    .banner--light { background: var(--surface-raised); color: var(--ink); border: 1px solid var(--line); }
    .banner__content { display: grid; gap: var(--space-3); justify-items: start; }
    .banner__title { font-family: var(--font-display); font-size: var(--step-3, calc(var(--step-2) * 1.3)); letter-spacing: -0.02em; }
    .banner__text { opacity: .9; max-width: 60ch; }
    .banner__button { background: var(--surface); color: var(--ink); }
    .banner--light .banner__button { background: var(--brand); color: var(--brand-ink); }
    @media (min-width: 900px) { .banner--media { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

    .brand-list { display: flex; flex-wrap: wrap; gap: var(--space-2); padding: 0; list-style: none; }
    .brand-chip {
        display: inline-block;
        padding: var(--space-2) var(--space-4);
        border: 1px solid var(--line);
        border-radius: 999px;
        background: var(--surface-raised);
        color: var(--ink);
        font-weight: 600;
        text-decoration: none;
    }
    .brand-chip:hover { border-color: var(--ink-muted); }

    .empty-showcase {
        padding-block: var(--space-8) var(--space-16);
        text-align: center;
        color: var(--ink-muted);
    }
    .empty-showcase h2 { color: var(--ink); font-size: var(--step-2); margin-bottom: var(--space-2); }

    .notice {
        margin-top: var(--space-6);
        padding: var(--space-3) var(--space-4);
        border-inline-start: 4px solid var(--accent);
        border-radius: var(--radius);
        background: color-mix(in oklab, var(--accent) 10%, var(--surface-raised));
    }

    /* ---- Hata sayfaları -------------------------------------------------- */
    .error-page {
        display: grid;
        justify-items: center;
        gap: var(--space-4);
        padding-block: var(--space-16);
        text-align: center;
    }
    .error-page__code {
        font-size: clamp(4rem, 3rem + 6vw, 8rem);
        font-weight: 850;
        line-height: 1;
        letter-spacing: -0.05em;
        color: var(--brand);
    }
    .error-page__message { font-size: var(--step-2); max-width: 26ch; }
    .error-page__reference { color: var(--ink-muted); font-size: var(--step--1); }

    /* ---- Alt bilgi ------------------------------------------------------- */
    /* Renkler değişkendir: temalar --footer-* değerlerini değiştirir (bkz. site.css yerleşimi). */
    .site-footer {
        --footer-bg: var(--night, #111827);
        --footer-ink: var(--night-ink, #cbd5e1);
        --footer-title: #ffffff;
        --footer-muted: color-mix(in srgb, var(--footer-ink) 78%, var(--footer-bg));
        --footer-line: var(--night-line, #273244);
        --footer-accent: color-mix(in srgb, var(--accent) 55%, #ffffff);
        background: var(--footer-bg);
        color: var(--footer-ink);
        font-size: 0.9375rem;
    }

    /* Altbilgi notu (yasal uyarı, sicil bilgisi). */
    .site-footer__note { margin: 0; max-width: 90ch; font-size: 0.8125rem; line-height: 1.6; }

    /* Künye (yasal zorunluluk): sade, küçük, tek blok. */
    .seller-info { padding: 0; border: 0; }
    .seller-info__list { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); margin: 0; font-size: 0.8125rem; line-height: 1.5; }
    .seller-info__item { display: inline; }
    .seller-info__item dt, .seller-info__item dd { display: inline; margin: 0; }
    .seller-info__item dt { font-weight: 600; }

}

@layer utilities {
    .visually-hidden {
        position: absolute !important;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
        border: 0;
    }
}
