/**
 * Enbirinci teması - Ürün detay sayfası özel CSS'i
 * (product.blade.php ve product-detail.blade.php içindeki inline <style> bloklarından taşındı)
 * Vurgu rengi admin'den: theme_option('product_accent_color') -> :root{--evname-accent}
 */

/* ============================================================
   1) MOBİL BAŞLIK DÜZENİ  (product.blade)
   ============================================================ */
@media (max-width: 991px) {
    .col-lg-4 .tp-product-details-title,
    .col-lg-4 .tp-product-details-inventory,
    .col-lg-4 .tp-product-details-stock { display: none !important; }
    .mobile-header-wrapper { margin-bottom: 15px; }
}

/* ============================================================
   2) PAKET (BUNDLE) MODÜLÜ  (product.blade)
   ============================================================ */
.furniture-bundle-wrapper { background: #fff; border: 1px solid #f0f0f0; border-radius: 8px; margin-top: 15px; overflow: hidden; }
@media (min-width: 992px) { .furniture-bundle-wrapper { margin-top: 30px !important; margin-right: 12px !important; } }
.bundle-header { background-color: #f8f9fa; padding: 20px 25px; border-bottom: 1px solid #eee; margin: -24px -24px 20px -24px; }
.bundle-item { border-bottom: 1px dashed #f0f0f0; transition: background-color 0.2s ease; border-radius: 8px; padding: 12px; }
.bundle-item:hover { background-color: #fcfcfc; }

.item-img { position: relative; width: 100px; height: 75px; border-radius: 4px; transition: all 0.3s ease; }
.item-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; border: 1px solid #f0f0f0; background: #fff; transition: all 0.3s ease; }
.item-img.selected-product-img img { border: 2px solid #198754 !important; box-shadow: 0 4px 8px rgba(25, 135, 84, 0.15); }
.item-img.selected-product-img::after { content: '✓'; position: absolute; top: -8px; right: -8px; background: #198754; color: #fff; width: 20px; height: 20px; border-radius: 50%; font-size: 12px; font-weight: bold; display: flex; align-items: center; justify-content: center; z-index: 10; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }

.bundle-qty-wrapper { background: #fff; border: 1px solid #e5e5e5; border-radius: 50px; padding: 2px; display: flex; align-items: center; justify-content: center; width: 100px; height: 36px; flex-shrink: 0; }
.bundle-qty-btn { width: 30px; height: 30px; min-width: 30px; border-radius: 50% !important; border: none; background: #f8f9fa; color: #212529; font-weight: bold; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; padding: 0; line-height: 1; }
.bundle-qty-btn:hover { background: #dc3545; color: #fff; }
.bundle-qty-input { border: none !important; background: transparent !important; font-weight: 700; color: #212529; width: 35px !important; height: 30px !important; padding: 0 !important; text-align: center; font-size: 14px; line-height: 30px; }

.bundle-footer-ribbon { position: relative; background: #f8f9fa; border: 1px dashed #dc3545; border-radius: 8px; padding: 25px; margin-top: 30px; }
.bundle-footer-ribbon::before { content: ''; position: absolute; top: -10px; left: 50%; transform: translateX(-50%); width: 60px; height: 10px; background: #dc3545; border-radius: 5px; opacity: 0.8; }
.bundle-footer-ribbon::after { content: 'PAKET TOPLAMI'; position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: #fff; color: #dc3545; padding: 0 15px; font-size: 11px; font-weight: 800; letter-spacing: 1px; border: 1px solid #dc3545; border-radius: 20px; }

/* Fiyat Formatlama Stilleri */
.bundle-price-text { font-size: 16px; font-weight: 700; color: #dc3545; display: inline-flex; align-items: baseline; }
.bundle-grand-price { font-size: 28px; font-weight: 800; color: #212529; letter-spacing: -1px; display: inline-flex; align-items: baseline; }

.bundle-decimal { font-size: 0.6em; position: relative; top: -0.3em; font-weight: 700; opacity: 0.85; margin-left: 1px; }
.bundle-currency { font-weight: 400 !important; margin-left: 4px; font-size: 0.8em; opacity: 0.9; }
.savings-text { font-size: 13px; color: #198754; font-weight: 700; display: block; margin-top: 2px; }

/* SEPETE EKLE BUTONU STİLİ */
#btn-add-bundle-to-cart {
    background-color: var(--evname-accent, #d71b0c);
    color: #fff;
    border: none;
    border-radius: 7px !important;
    padding: 12px 35px !important;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: capitalize;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#btn-add-bundle-to-cart:hover {
    background-color: #1b5e20;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(46, 125, 50, 0.4);
}

#btn-add-bundle-to-cart:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(46, 125, 50, 0.2);
}

@media (max-width: 576px) {
    .furniture-bundle-wrapper { padding: 15px !important; margin-right: 0 !important; }
    .bundle-item { flex-wrap: wrap; gap: 10px !important; }
    .bundle-footer-ribbon { flex-direction: column; text-align: center; gap: 15px !important; padding: 20px 15px; }
    .total-area { width: 100%; border-bottom: 1px solid #eee; padding-bottom: 10px; margin-bottom: 5px; }
    #btn-add-bundle-to-cart { width: 100%; padding: 14px !important; }
}

/* ============================================================
   3) SMART SIDEBAR (TAKIM ÖZETİ)  (product.blade)
   ============================================================ */
#smart-summary-trigger {
    position: fixed; top: 60%; right: 0;
    transform: translateY(-50%) rotate(-90deg); transform-origin: right bottom;
    z-index: 1030; margin-right: -50px; border-radius: 8px 8px 0 0 !important;
    transition: right 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: #212529; border: 1px solid rgba(255,255,255,0.2);
    padding: 5px;
}
#smart-summary-trigger.active-trigger { margin-right: 0; right: 0; display: block !important; }

#smart-footer-total { display: inline-flex !important; align-items: baseline !important; flex-wrap: nowrap !important; }
#smart-footer-total span, #smart-footer-total sup, #smart-footer-total small { display: inline !important; font-size: inherit !important; line-height: 1 !important; margin: 0 !important; padding: 0 !important; }
#smart-footer-total .bundle-decimal, #smart-footer-total .bundle-currency { font-size: 0.7em !important; font-weight: 600 !important; opacity: 0.8; }

.smart-bundle-sidebar { width: 400px !important; border-left: 5px solid #dc3545; }
.hover-scale { transition: transform 0.2s; } .hover-scale:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.2); }
.fw-800 { font-weight: 800 !important; }

/* --- MOBİL GENIE ANİMASYONU --- */
@media (max-width: 576px) {
    .smart-bundle-sidebar {
        width: 90% !important;
        border: none !important;
        border-left: 5px solid #dc3545 !important;
        transform-origin: 100% 60% !important;
        transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                    opacity 0.5s ease,
                    visibility 0.5s ease !important;
    }

    .offcanvas-end:not(.show) {
        transform: scale(0.1) translate(50%, 20%) !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }

    .offcanvas-end.show {
        transform: scale(1) translate(0, 0) !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    #smart-summary-trigger {
        padding: 8px 16px !important;
        top: 60%;
    }
    #smart-summary-trigger .trigger-text { font-size: 12px; font-weight: 600; }
    #smart-summary-trigger .trigger-icon { width: 14px; height: 14px; }
}

/* ============================================================
   4) MODERN FİYAT KARTI  (product-detail.blade)
   ============================================================ */
@keyframes signal-blink {
    0% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.5); }
    50% { opacity: 0.8; transform: scale(1.2); box-shadow: 0 0 0 5px rgba(46, 125, 50, 0); }
    100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(46, 125, 50, 0); }
}

.modern-price-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
}

.modern-price-card .tp-product-details-price-wrapper {
    display: flex !important;
    align-items: baseline !important;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px !important;
}

.modern-price-card .tp-product-details-price.new-price {
    font-size: 34px !important;
    font-weight: 800 !important;
    color: #212529 !important;
    line-height: 1;
    border-right: 2px solid #e0e0e0;
    padding-right: 15px;
    margin-right: 5px;
    display: inline-flex;
    align-items: baseline;
}

.price-decimal-part {
    font-size: 0.55em !important;
    position: relative;
    top: -0.35em;
    font-weight: 700;
    opacity: 0.8;
    margin-left: 1px;
}

.modern-price-card .tp-product-details-price.old-price {
    font-size: 18px !important;
    color: #999 !important;
    font-weight: 500;
    text-decoration: line-through;
}

.savings-highlight-box {
    position: relative;
    background: linear-gradient(to right, #e8f5e9, #f1f8e9);
    border: 1px solid #c8e6c9;
    border-radius: 8px;
    padding: 12px 15px 12px 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    transition: all 0.3s ease;
}

.signal-dot {
    position: absolute;
    top: 8px; left: 8px; width: 6px; height: 6px;
    background-color: #2e7d32; border-radius: 50%;
    animation: signal-blink 1.5s infinite ease-out; z-index: 2;
}

.savings-icon-circle {
    width: 32px; height: 32px;
    background-color: #2e7d32; color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.savings-content { display: flex; flex-direction: column; }
.savings-title { font-size: 10px; text-transform: uppercase; color: #66bb6a; font-weight: 700; letter-spacing: 0.5px; margin-bottom: 2px; }
.savings-text { color: #1b5e20; font-size: 13px; font-weight: 600; line-height: 1.2; }

.savings-amount {
    color: #1b5e20;
    font-weight: 800;
    background-color: rgba(255,255,255,0.6);
    padding: 0 4px;
    border-radius: 3px;
    display: inline-block;
}

.currency-symbol {
    font-weight: 400 !important;
    margin-left: 4px;
    opacity: 0.9;
    font-size: 0.8em;
}

@media (max-width: 576px) {
    .modern-price-card { padding: 15px; }
    .modern-price-card .tp-product-details-price.new-price {
        font-size: 26px !important;
        padding-right: 10px;
        border-right: 1px solid #e0e0e0;
    }
    .modern-price-card .tp-product-details-price.old-price { font-size: 14px !important; }
    .savings-highlight-box { padding: 10px 10px 10px 20px; gap: 10px; }
    .savings-icon-circle { width: 28px; height: 28px; }
    .savings-text { font-size: 12px; }
}

/* ============================================================
   5) ELDEN SENETLİ TAKSİT TABLOSU  (product-detail.blade)
   ============================================================ */
#senet-options-wrapper {
    margin-top: 30px;
    margin-bottom: 30px;
    font-family: inherit;
}

.senet-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 7px;
    overflow: hidden;
}

.senet-header {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #eaeaea;
    display: flex;
    align-items: center;
    gap: 15px;
}

.senet-icon-box {
    width: 50px; height: 40px;
    background: #198754;
    color: #fff;
    border-radius: 5px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.senet-title-area h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 700;
    color: #212529;
}
.senet-title-area p {
    margin: 0;
    font-size: 13px;
    color: #6c757d;
}

.senet-table {
    width: 100%;
    border-collapse: collapse;
}
.senet-table th {
    background: #fff;
    color: #6c757d;
    font-size: 12px;
    font-weight: bold;
    text-transform: capitalize;
    padding: 12px 20px;
    border-bottom: 1px solid #eee;
    letter-spacing: 0.5px;
}
.senet-table td {
    padding: 14px 20px;
    border-bottom: 1px solid #f1f1f1;
    font-size: 14px;
    color: #212529;
    vertical-align: middle;
}
.senet-table tr:last-child td { border-bottom: none; }

.row-cash { background-color: #19875417; }
.badge-cash {
    background-color: #198754; color: #fff;
    padding: 4px 10px; border-radius: 2px;
    font-size: 11px; font-weight: 800; letter-spacing: 0.5px;
}
.month-label { font-weight: 600; color: #495057; }
.monthly-price { font-weight: 700; color: #212529; }
.total-price { font-weight: 800; color: #198754; font-size: 15px; }
.total-price-muted { color: #888; font-size: 13px; }

.senet-footer {
    background: #f8f9fa;
    padding: 12px 20px;
    border-top: 1px solid #eaeaea;
    font-size: 12px;
    color: #666;
    display: flex; gap: 8px; align-items: start;
}

@media (max-width: 576px) {
    .senet-header { padding: 15px; }
    .senet-title-area h4 { font-size: 15px; }
    .senet-table th, .senet-table td { padding: 12px 15px; }
    .senet-table { font-size: 13px; }
}

/* ============================================================
   6) ÜRÜN ÖZELLİKLERİ TABLOSU  (theme override: product-specification)
   ============================================================ */
.ev-spec {
    border: 1px solid #eee;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 5px;
}
.ev-spec-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}
.ev-spec-table tr { border-bottom: 1px solid #f0f0f0; }
.ev-spec-table tr:last-child { border-bottom: none; }
.ev-spec-label {
    width: 40%;
    text-align: left;
    font-weight: 600;
    color: #495057;
    background: #f8f9fa;
    border-right: 1px solid #f0f0f0;
    padding: 12px 16px;
    font-size: 14px;
    vertical-align: middle;
}
.ev-spec-value {
    padding: 12px 16px;
    color: #212529;
    font-size: 14px;
    vertical-align: middle;
    word-break: break-word;
}
.ev-spec-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.ev-spec-badge--yes { background: #e8f5e9; color: #198754; }
.ev-spec-badge--no { background: #fdecea; color: #dc3545; }

@media (max-width: 575px) {
    .ev-spec-label { width: 42%; padding: 10px 12px; font-size: 13px; }
    .ev-spec-value { padding: 10px 12px; font-size: 13px; }
}

/* Tema varsayılan tablo border'ını kaldır (.ev-spec sarmalayıcı zaten çerçeveli) */
.tp-product-details-additional-info table { border: none !important; }

/* Özellikler bölümü ile paket bölümü yapışmasın */
.tp-product-details-additional-info { margin-bottom: 22px; }

/* ============================================================
   7) ÜRÜN DETAY ÜST HİZALAMA
      - Galeri position:sticky başlangıçta ~22px aşağı kaydırıyordu -> static
      - Sağ sütun (#sticky-sidebar-parent) padding-top:10px -> 0
      Böylece sol galeri ile sağ bilgi sütunu aynı üst hizadan başlar.
   ============================================================ */
@media (min-width: 992px) {
    .tp-product-details-top .row { align-items: flex-start; }
    .tp-product-details-top .tp-product-details-thumb-wrapper { position: static !important; margin-top: 0 !important; }
    .tp-product-details-top #sticky-sidebar-parent { padding-top: 0 !important; }
    .tp-product-details-top .tp-product-details-wrapper { margin-top: 10px !important; }
    /* Bozuk JS sticky kapatıldı; CSS has-sticky de nötrlensin -> sütun normal aksın */
    .tp-product-details-top .tp-product-details-wrapper.has-sticky { position: static !important; }
}


/* "Şimdi Satın Al" butonu z-index:100 ile yapışkan header'ın (z:99) üstüne çıkıyordu -> altına indir */
.tp-product-details-buy-now-btn,
.tp-product-details-add-to-cart-btn { z-index: 1 !important; }

/* ============================================================
   8) GALERİ NOKTA GÖSTERGELERİ (slider dots)
      Ana görselin alt-ortasına özel nokta navigasyonu (product-detail.js).
      Slick'in kendi dots'u kapalı; bunlar JS ile oluşturulup slick'e bağlanır.
   ============================================================ */
.bb-product-gallery-images { position: relative; }

/* Tüm küçük resimler görünür alana sığıyorsa thumbnail şeridini sabitle:
   asNavFor'un autoplay sırasında şeridi kaydırıp zıplatmasını engeller.
   (product-detail.js, sığma durumunu ölçüp .evname-thumbs-fit sınıfını ekler.
    Sığmıyorsa sınıf eklenmez -> normal kaydırma korunur.) */
.bb-product-gallery.evname-thumbs-fit .bb-product-gallery-thumbnails .slick-track {
    transform: none !important;
}

.evname-gallery-dots {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 30px;
    background: rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    pointer-events: auto;
}

.evname-gallery-dots .evname-gallery-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    transition: all 0.25s ease;
}

.evname-gallery-dots .evname-gallery-dot:hover { background: rgba(255, 255, 255, 0.85); }

.evname-gallery-dots .evname-gallery-dot.is-active {
    width: 22px;
    border-radius: 5px;
    background: #fff;
}

@media (max-width: 576px) {
    .evname-gallery-dots { bottom: 10px; gap: 6px; padding: 6px 10px; }
    .evname-gallery-dots .evname-gallery-dot { width: 7px; height: 7px; }
    .evname-gallery-dots .evname-gallery-dot.is-active { width: 18px; }
}

/* ============================================================
   9) TAM EKRAN (LIGHTGALLERY) STİLLERİ -> custom.css'e taşındı
      LightGallery'nin TÜM tam ekran stili (kapatma tuşu + ▶ autoplay düğmesi
      + hizalama) artık tek yerde: custom.css (yerelde) / admin "Tema > Custom CSS"
      (sunucuda). Burada tutulmuyor ki tek kaynak olsun.
      Autoplay düğmesini DOM'a ekleyen JS ise product-detail.js içindedir.
   ============================================================ */

/* ============================================================
   10) GALERİ FOUC ENGELLEME (sayfa ilk açılışında görsellerin alt alta
       yığılması). slick JS (jQuery+slick+front-ecommerce) yüklenip
       başlatılana kadar HTML düz bir <a><img></a> listesidir ve hepsi
       blok olarak alt alta görünür. slick-initialized sınıfı gelene kadar
       SADECE ilk görseli göster; böylece yığılma hiç görünmez, layout
       sıçraması olmaz. Bu kurallar <head>'de yüklendiği için ilk boyamadan
       önce devreye girer (sunucu/cache sorunu değil, başlatma gecikmesidir).
   ============================================================ */
/* ANA GÖRSELLER: slick kurulana kadar SADECE ilkini göster (dev görsellerin
   alt alta yığılmasını önler). slick-initialized gelince kural otomatik düşer. */
.bb-product-gallery-images:not(.slick-initialized) > *:not(:first-child) {
    display: none !important;
}
.bb-product-gallery-images:not(.slick-initialized) {
    overflow: hidden;
}
.bb-product-gallery-images:not(.slick-initialized) > *:first-child img {
    width: 100%;
    height: auto;
    display: block;
}

/* KÜÇÜK RESİMLER: GİZLEME. Dikey sütunda alt alta dizilmeleri zaten son
   görünümdür; gizleyince "tek görsel var" gibi oluyordu. slick kurulana kadar
   düzgün dursun diye 70x70 boyut + aralık ver (slick-slide kuralı henüz yok). */
.bb-product-gallery-thumbnails:not(.slick-initialized) > * {
    margin-bottom: 15px;
}
.bb-product-gallery-thumbnails:not(.slick-initialized) > * img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    display: block;
    background-color: #f4f5f7;
    cursor: pointer;
}
