/* ============================================================
 *  İlkay Optik — Global Storefront Stilleri
 *  Bu dosya tarayıcı tarafından önbelleğe alınır.
 *  Renkler ve fontlar `:root` CSS değişkenleri üzerinden header.php'de
 *  inline `<style>` bloğu olarak tema-başına atanır (bkz. header.php).
 * ============================================================ */

/* ── Material Symbols ──
 * font-family normalde Google Fonts CSS'inden gelir, ancak Tailwind preflight'ı
 * veya inline font-family bildirimleri zaman zaman bu kuralı override edebiliyor.
 * Class spesifikliğinde sabit bir font-family bildirimi ile sızıntıyı engelliyoruz. */
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined', sans-serif;
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}

.fill-icon {
    font-variation-settings: 'FILL' 1, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}

/* ── Mobil hamburger menü — her zaman açık tema ── */
#menuDrawer.menu-drawer-light,
#menuDrawer.menu-drawer-light nav,
#menuDrawer.menu-drawer-light .drawer-link {
    color-scheme: light;
}
#menuDrawer.menu-drawer-light {
    background: #ffffff !important;
    color: #18181b !important;
}
#menuDrawer.menu-drawer-light .material-symbols-outlined {
    font-family: 'Material Symbols Outlined', sans-serif !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}
#menuDrawer.menu-drawer-light .drawer-link span:not(.material-symbols-outlined) {
    color: #3f3f46;
}

.glass-nav {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ── Global Scrollbar ───────────────────────────── */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--theme-primary) #ececec;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #ececec; border-radius: 9999px; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--theme-primary-container) 0%, var(--theme-primary) 100%);
    border: 2px solid #ececec;
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--theme-primary) 0%, #7f2b00 100%);
}

body {
    font-family: var(--theme-font-body), sans-serif;
    background-color: var(--theme-bg);
    min-height: max(884px, 100dvh);
}
h1, h2, h3, .font-headline {
    font-family: var(--theme-font-headline), sans-serif;
}

/* ── Sayfa Geçiş Animasyonları ──────────────────── */
@view-transition { navigation: auto; }

@keyframes vt-out {
    from { opacity: 1; transform: translateY(0);   }
    to   { opacity: 0; transform: translateY(-8px); }
}
@keyframes vt-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0);    }
}
::view-transition-old(root) { animation: vt-out 0.14s ease-in both; }
::view-transition-new(root) { animation: vt-in 0.22s cubic-bezier(0.22, 1, 0.36, 1) both; }

#siteHeader        { view-transition-name: site-header; }
#bottomNav         { view-transition-name: bottom-nav;  }
#announcementBar   { view-transition-name: ann-bar; }
::view-transition-old(site-header),
::view-transition-new(site-header),
::view-transition-old(bottom-nav),
::view-transition-new(bottom-nav),
::view-transition-old(ann-bar),
::view-transition-new(ann-bar) { animation: none; }

@keyframes mainSlideUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0);    }
}
@keyframes mainFadeOut { to { opacity: 0; transform: translateY(-6px); } }

body.no-vt { opacity: 0; }
body.page-ready { opacity: 1; transition: opacity 0.18s ease-out; }
body.page-ready main { animation: mainSlideUp 0.32s cubic-bezier(0.22, 1, 0.36, 1) both; }
body.page-leaving main { animation: mainFadeOut 0.13s ease-in forwards; }

/* ── Üst Yükleme Çubuğu ─────────────────────────── */
#topLoadBar {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--theme-primary), var(--theme-primary-container));
    z-index: 9999;
    transition: width 0.25s ease, opacity 0.4s ease;
    border-radius: 0 3px 3px 0;
    box-shadow: 0 0 8px var(--theme-primary-50);
    pointer-events: none;
}
#topLoadBar.loading { width: 85%; }
#topLoadBar.done    { width: 100%; opacity: 0; }

/* ── Safe Area — Fixed Header & Nav ─────────────── */
:root {
    --header-h: 64px;
    --nav-h: 80px;
}
html { scroll-padding-top: var(--header-h); }
#siteHeader { padding-top: env(safe-area-inset-top, 0px); }
main { min-height: calc(100dvh - var(--header-h) - var(--nav-h)); }

/* ── Announcement Bar Marquee ───────────────────── */
@keyframes marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}
.marquee-track {
    display: flex;
    width: max-content;
    animation: marquee 22s linear infinite;
    will-change: transform;
}
.marquee-copy {
    display: flex;
    align-items: center;
    justify-content: space-around;
    min-width: 100vw;
    flex-shrink: 0;
    padding: 0 1.5rem;
    gap: 1.5rem;
}
#announcementBar:hover .marquee-track { animation-play-state: paused; }

/* ── Arama Overlay ──────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }

#searchOverlay {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}
#searchOverlay.open { opacity: 1; pointer-events: auto; }
#searchPanel {
    transform: translateY(-12px);
    transition: transform 0.22s cubic-bezier(0.22,1,0.36,1);
}
#searchOverlay.open #searchPanel { transform: translateY(0); }
#searchList li a:hover { background-color: #f9f9f9; }

.search-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    border: 1.5px solid var(--theme-outline-variant);
    color: var(--theme-primary);
    background: #fff;
    transition: background 0.12s, color 0.12s;
}
.search-chip:hover,
.search-chip.active {
    background: var(--theme-primary);
    color: #fff;
    border-color: var(--theme-primary);
}

/* ── Scroll Reveal ──────────────────────────────── */
.sr { opacity: 0; transform: translateY(22px); }
.sr.sr-in {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.48s ease, transform 0.52s cubic-bezier(0.22, 1, 0.36, 1);
}
.sr.sr-delay-1 { transition-delay: 60ms;  }
.sr.sr-delay-2 { transition-delay: 120ms; }
.sr.sr-delay-3 { transition-delay: 180ms; }
.sr.sr-delay-4 { transition-delay: 240ms; }
.sr.sr-delay-5 { transition-delay: 280ms; }

/* ── Skeleton Shimmer ───────────────────────────── */
@keyframes shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position:  600px 0; }
}
.skeleton {
    background: linear-gradient(90deg, #e8e8e8 25%, #f0f0f0 37%, #e8e8e8 63%);
    background-size: 1200px 100%;
    animation: shimmer 1.4s ease-in-out infinite;
    border-radius: 0.75rem;
}

/* ── Desktop Container — dar gövde ──────────────── */
.site-wrap {
    width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
    box-sizing: border-box;
}
@media (min-width: 1024px) {
    .site-wrap {
        width: 100%;
        max-width: 1180px;
        margin-left: auto;
        margin-right: auto;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}
@media (min-width: 1440px) {
    .site-wrap { max-width: 1180px; }
}

/* ── Ürün kartı grid — satırda eşit yükseklik ── */
.product-card-grid {
    align-items: stretch;
}
.product-card-grid > .product-card,
.product-card-grid > div,
.product-card-grid > * > .product-card {
    height: 100%;
}
.product-card-grid > div {
    display: flex;
    flex-direction: column;
}
.product-card-grid > div > .product-card {
    flex: 1 1 auto;
    width: 100%;
}

/* ── Ürün Kartı (görseli tam dolduran, sabit gövde yüksekliği) ── */
.product-card {
    min-height: 100%;
}
.product-img-box,
.product-card-media {
    position: relative;
    overflow: hidden;
    background: #ffffff;
    border-radius: 1rem;
    border: 1px solid rgba(228, 228, 231, 0.7);
}
.product-card-media {
    margin-bottom: 0.75rem;
}
.product-img-box > img,
.product-card-media > a > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.product-img-box > .product-img-fallback,
.product-card-media .product-img-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
}
.group:hover .product-img-box > img,
.group:hover .product-card-media > a > img {
    transform: scale(1.04);
}

.product-card-badge {
    display: inline-flex;
    align-items: center;
    height: 1.25rem;
    padding: 0 0.375rem;
    font-size: 9px;
    font-weight: 800;
    border-radius: 0.375rem;
    line-height: 1;
}
.product-card-fav {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    border-radius: 9999px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    transition: transform 0.15s ease;
}
.product-card-fav:active {
    transform: scale(0.9);
}
.product-card-quickview {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    height: 1.75rem;
    padding: 0 0.75rem;
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    white-space: nowrap;
    opacity: 0;
    transform: translateY(0.5rem);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.group:hover .product-card-quickview {
    opacity: 1;
    transform: translateY(0);
}
.product-card-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}
.product-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    min-height: 1.125rem;
    margin-bottom: 0.25rem;
}
.product-card-title-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.product-card-title {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--theme-on-surface, #18181b);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6rem;
}
.product-card-engage {
    flex: 1 1 auto;
    min-height: 3.35rem;
    margin-top: 0.375rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.25rem;
}
.product-card-engage-line {
    margin: 0;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.25;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid transparent;
}
.product-card-footer {
    margin-top: auto;
    min-height: 2.25rem;
    padding-top: 0.5rem;
    display: flex;
    align-items: flex-end;
}
.product-card-cart-btn {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #18181b;
    color: #fff;
    border-radius: 9999px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    transition: transform 0.15s ease;
}
.product-card-cart-btn:active {
    transform: scale(0.9);
}

/* ── Desktop nav aktif link ─────────────────────── */
.desktop-nav-link {
    position: relative;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #52525b;
    transition: color 0.15s;
    white-space: nowrap;
}
.desktop-nav-link:hover  { color: var(--theme-primary); }
.desktop-nav-link.active { color: var(--theme-primary); }
.desktop-nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px; left: 0; right: 0;
    height: 2px;
    background: var(--theme-primary);
    border-radius: 1px;
}

/* ── Quill Editör HTML Çıktısı ──────────────────── */
.ql-align-center  { text-align: center; }
.ql-align-left    { text-align: left; }
.ql-align-right   { text-align: right; }
.ql-align-justify { text-align: justify; }
.product-desc p          { margin-bottom: 0.5rem; }
.product-desc p:last-child { margin-bottom: 0; }
.product-desc strong { font-weight: 700; }
.product-desc br + br { display: none; }

/* ── Toast Bildirimleri ─────────────────────────── */
#toastContainer {
    position: fixed;
    bottom: 5.5rem;
    right: 1rem;
    z-index: 9990;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.5rem;
    pointer-events: none;
}
@media (min-width: 1024px) {
    #toastContainer { bottom: 1.5rem; right: 1.5rem; }
}
.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 1rem;
    background: #1a1c1c;
    color: #f1f1f1;
    border-radius: 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    max-width: 320px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.26s cubic-bezier(0.22,1,0.36,1), opacity 0.2s ease;
    will-change: transform;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast.success .toast-icon { color: #4ade80; }
.toast.error   .toast-icon { color: #f87171; }
.toast.info    .toast-icon { color: #60a5fa; }

/* ── Mini Sepet Drawer ──────────────────────────── */
#mcOverlay {
    position: fixed; inset: 0; z-index: 70;
    background: rgba(0,0,0,0.4);
    opacity: 0; pointer-events: none;
    transition: opacity 0.22s ease;
}
#mcOverlay.open { opacity: 1; pointer-events: auto; }
#miniCart {
    position: fixed; top: 0; right: 0; bottom: 0;
    z-index: 71;
    width: min(380px, 100vw);
    background: #fff;
    box-shadow: -4px 0 24px rgba(0,0,0,0.12);
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.22,1,0.36,1);
    display: flex; flex-direction: column;
}
#miniCart.open { transform: translateX(0); }

/* ── Quick View Modal ───────────────────────────── */
#qvOverlay {
    position: fixed; inset: 0; z-index: 80;
    background: rgba(0,0,0,0.5);
    opacity: 0; pointer-events: none;
    transition: opacity 0.22s ease;
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
}
#qvOverlay.open { opacity: 1; pointer-events: auto; }
#qvModal {
    background: #fff;
    border-radius: 1.25rem;
    width: 100%;
    max-width: 720px;
    max-height: 90dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: scale(0.95) translateY(12px);
    transition: transform 0.28s cubic-bezier(0.22,1,0.36,1);
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
#qvOverlay.open #qvModal { transform: scale(1) translateY(0); }
