/* Product Detail Page Styles */

/* Line clamp for 15 lines */
.line-clamp-15 {
    display: -webkit-box;
    -webkit-line-clamp: 15;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.75; /* leading-loose için uyumlu */
    text-overflow: ellipsis;
    word-wrap: break-word;
}

/* Ensure text containers are visible */
.story-text,
.source-text {
    min-height: 1em;
    color: rgb(209, 213, 219); /* text-gray-300 */
}

.story-text a,
.source-text a {
    color: rgba(168, 159, 145, 0.95); /* marque-gold – premium gövde linki (in-stock / art-design ile uyumlu) */
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.story-text a:hover,
.source-text a:hover {
    color: #c4bbaf;
}

/* Story Frame - No height limit, let content flow */
.story-frame {
    transition: all 0.5s ease-in-out;
}

/* Source Frame - No height limit, let content flow */
.source-frame {
    transition: all 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Light mode - Remove backdrop blur and fix gradient overlay */
body.theme-light .story-frame,
body.theme-light .source-frame {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(249, 250, 251, 0.6) !important;
}

/* Ensure text is visible in light mode */
body.theme-light .story-text,
body.theme-light .source-text {
    position: relative;
    z-index: 20;
    color: #374151 !important;
}

body.theme-light .story-text a,
body.theme-light .source-text a {
    color: var(--marque-gold, #a89f91);
}

body.theme-light .story-text a:hover,
body.theme-light .source-text a:hover {
    color: #8b7d6f;
}

body.theme-light .story-frame .relative.z-10,
body.theme-light .source-frame .relative.z-10 {
    position: relative;
    z-index: 20;
}

/* Product detail hero text - Light mode: white text, NO shadow (override global light-theme rules) */
html body.theme-light section.product-hero h1.product-hero-title,
html body.theme-light section.product-hero p.product-hero-slogan {
    text-shadow: none !important;
}

html body.theme-light section.product-hero h1.product-hero-title {
    color: rgba(255, 255, 255, 0.95) !important;
}

html body.theme-light section.product-hero p.product-hero-slogan {
    /* Slightly "dirty" off-white */
    color: rgba(245, 242, 235, 0.90) !important;
}

/* Product code (MQ-xxx) in hero - dirty off-white for BOTH themes */
section.product-hero .product-hero-code,
section.product-hero span.product-hero-code,
section.product-hero span.product-hero-code.text-marque-gold,
section.product-hero .product-hero-code.text-marque-gold,
html body.theme-dark section.product-hero .product-hero-code,
html body.theme-dark section.product-hero span.product-hero-code.text-marque-gold,
html body.theme-light section.product-hero .product-hero-code,
html body.theme-light section.product-hero span.product-hero-code,
html body.theme-light section.product-hero span.product-hero-code.text-marque-gold,
html body.theme-light section.product-hero .product-hero-code.text-marque-gold {
    /* Slightly "dirty" off-white */
    color: rgba(245, 242, 235, 0.80) !important;
    text-shadow: none !important;
}

/* Hero video/image full viewport sizing */
.product-hero-media {
    max-width: 100%;
    max-height: 100vh;
    width: 100%;
    height: 100%;
}

/* Specs card fixed height */
.specs-card-fixed {
    height: 750px;
}

/* Gallery image positioning */
.gallery-image-bottom {
    object-position: center bottom;
}

/* Gallery Image 1 container - Desktop'ta da padding olmamalı */
.specs-card-fixed .flex-1.group.relative.overflow-hidden.rounded-sm {
    padding: 0;
}

/* Text clamping styles - using fixed max-height (no inline styles) */
.story-text.text-clamped,
.source-text.text-clamped {
    max-height: 200px;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
    position: relative;
}

.story-text.text-expanded,
.source-text.text-expanded {
    max-height: none;
    overflow: visible;
    transition: max-height 0.3s ease-in-out;
}

/* Story and Source images - Mobile responsive fix */
/* Mobil ekranlarda görsellerin tamamını göstermek için object-contain kullan */

/* ÖNEMLİ: Container yüksekliğini ve img'leri override et - media query dışında da geçerli */
@media (max-width: 1023px) {
    /* TÜM STORY VE SOURCE CONTAINER'LARINI OVERRIDE ET - EN ÜST ÖNCELİK */
    .story-frame .relative.overflow-hidden.rounded-sm,
    .story-frame .relative.overflow-hidden.rounded-sm.h-\[320px\],
    .story-frame .relative.overflow-hidden.rounded-sm[class*="h-"],
    .source-frame .relative.overflow-hidden.rounded-sm,
    .source-frame .relative.overflow-hidden.rounded-sm.h-\[320px\],
    .source-frame .relative.overflow-hidden.rounded-sm[class*="h-"] {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        padding: 0 !important;
        aspect-ratio: auto !important;
    }
    
    /* TÜM IMG'LERİ OVERRIDE ET - ÖNCE CONTAINER SONRA IMG */
    .story-frame .relative.overflow-hidden.rounded-sm img,
    .story-frame .relative.overflow-hidden.rounded-sm picture img,
    .story-frame .relative.overflow-hidden.rounded-sm img.h-full,
    .story-frame .relative.overflow-hidden.rounded-sm img.w-full,
    .story-frame .relative.overflow-hidden.rounded-sm img.object-cover,
    .story-frame .relative.overflow-hidden.rounded-sm img.object-cover.object-center,
    .story-frame .relative.overflow-hidden.rounded-sm picture img.object-cover,
    .story-frame .relative.overflow-hidden.rounded-sm picture img.object-cover.object-center,
    .source-frame .relative.overflow-hidden.rounded-sm img,
    .source-frame .relative.overflow-hidden.rounded-sm picture img,
    .source-frame .relative.overflow-hidden.rounded-sm img.h-full,
    .source-frame .relative.overflow-hidden.rounded-sm img.w-full,
    .source-frame .relative.overflow-hidden.rounded-sm img.object-cover,
    .source-frame .relative.overflow-hidden.rounded-sm img.object-cover.object-center,
    .source-frame .relative.overflow-hidden.rounded-sm picture img.object-cover,
    .source-frame .relative.overflow-hidden.rounded-sm picture img.object-cover.object-center {
        width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
        object-position: center !important;
        display: block !important;
        max-width: 100% !important;
        max-height: none !important;
    }
    
    /* PICTURE ELEMENTİNİ OVERRIDE ET */
    .story-frame .relative.overflow-hidden.rounded-sm picture,
    .source-frame .relative.overflow-hidden.rounded-sm picture {
        width: 100% !important;
        height: auto !important;
        display: block !important;
        max-width: 100% !important;
    }
}

@media (max-width: 1023px) {
    /* Specs card - mobilde yüksekliği auto yap */
    .specs-card-fixed {
        height: auto;
        min-height: 400px;
    }
    
    /* Gallery Image 1 - mobilde object-contain kullan */
    .specs-card-fixed .flex-1.group.relative.overflow-hidden.rounded-sm img {
        object-fit: contain !important;
        object-position: center;
    }
    
    /* Gallery Image 1 container - padding kaldırıldı, görsel container'ı tam doldurmalı */
    .specs-card-fixed .flex-1.group.relative.overflow-hidden.rounded-sm {
        padding: 0;
        display: block;
        min-height: 300px;
    }
    
    /* Gallery Image 1 picture element - padding olmadan tam doldur */
    .specs-card-fixed .flex-1.group.relative.overflow-hidden.rounded-sm picture {
        width: 100%;
        height: 100%;
        display: block;
    }
    
    /* Gallery Image 2 - görselin genişliği container genişliğine eşit, yükseklik oranına göre */
    .specs-card-fixed img.gallery-image-bottom {
        width: 100%;
        height: auto;
        object-fit: contain;
        object-position: center;
        display: block;
    }
    
    /* Gallery Image 2 container - yüksekliği görselin oranına göre ayarla */
    .specs-card-fixed .flex.flex-col.gap-4 > .flex-1:last-child {
        flex: 0 0 auto;
        height: auto;
        min-height: 0;
        max-height: none;
        display: block;
    }
    
    /* Gallery Image 2 picture element - görselin genişliğine göre ayarla */
    .specs-card-fixed .flex.flex-col.gap-4 > .flex-1:last-child picture {
        width: 100%;
        height: auto;
        display: block;
    }
    
    /* Gallery Image 2 container içindeki img - genişlik 100%, yükseklik auto (oran korunur) */
    .specs-card-fixed .flex.flex-col.gap-4 > .flex-1:last-child img {
        width: 100%;
        height: auto;
        display: block;
    }
    
    /* Story görseli (Slab Image) - yukarıdaki global rule'lar zaten uygulanıyor, burada sadece ekstra güvenlik için */
    
    /* Source görseli (Block Image) - yukarıdaki global rule'lar zaten uygulanıyor, burada sadece ekstra güvenlik için */
}

/* Desktop'ta object-cover kullanmaya devam et */
@media (min-width: 1024px) {
    .story-frame .relative.overflow-hidden.rounded-sm img,
    .source-frame .relative.overflow-hidden.rounded-sm img {
        object-fit: cover !important;
        object-position: center !important;
    }
    
    .specs-card-fixed .flex-1.group.relative.overflow-hidden.rounded-sm img {
        object-fit: cover !important;
        object-position: center !important;
    }
    
    .specs-card-fixed img.gallery-image-bottom {
        object-fit: cover !important;
        object-position: center bottom !important;
    }
}

/* =================================
   Motion Reduction – Product Detail
   ================================= */

@media (prefers-reduced-motion: reduce) {
    /* Story/Source frames */
    .story-frame,
    .story-frame *,
    .source-frame,
    .source-frame * {
        transition: none !important;
    }

    /* Specs cards */
    .specs-card-fixed,
    .specs-card-fixed * {
        transition: none !important;
    }

    /* Text clamp expand/collapse */
    .story-text.text-clamped,
    .story-text.text-expanded,
    .source-text.text-clamped,
    .source-text.text-expanded {
        transition: none !important;
    }

    /* Related product cards */
    .related-product-card,
    .related-product-card * {
        transition: none !important;
        transform: none !important;
    }

    .related-product-card:hover {
        transform: none !important;
    }

    .related-product-card:hover img {
        transform: none !important;
    }

    /* Scroll indicator bounce */
    .scroll-indicator.animate-bounce,
    .scroll-indicator .animate-bounce {
        animation: none !important;
    }
}

/* Related Products Section */
.related-products-section {
    position: relative;
    width: 100%;
}

.related-products-grid {
    width: 100%;
    /* Display ve gap Tailwind class'larından geliyor */
}

/* Related Product Card - Consistent with collection product cards */
.related-product-card {
    position: relative;
    overflow: hidden;
    border-radius: 0.125rem; /* rounded-sm */
    transition: all 0.5s ease;
}

.related-product-card:hover {
    transform: scale(1.02);
}

/* Ensure product card images are properly contained */
.related-product-card .relative.aspect-\[16\/9\] {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-color: rgb(17, 24, 39); /* bg-gray-900 */
}

/* Product card image hover effect */
.related-product-card img {
    transition: transform 0.7s ease;
}

.related-product-card:hover img {
    transform: scale(1.1);
}

/* Responsive adjustments for related products grid - sadece grid-auto class'i varsa (4+ urun) */
@media (max-width: 639px) {
    /* Mobile: 1 column */
    .related-products-grid.grid-auto {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (min-width: 640px) and (max-width: 1023px) {
    /* Tablet: 2 columns */
    .related-products-grid.grid-auto {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 1024px) and (max-width: 1279px) {
    /* Desktop: 3 columns */
    .related-products-grid.grid-auto {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem; /* gap-8 */
    }
}

@media (min-width: 1280px) {
    /* Large Desktop: 4 columns */
    .related-products-grid.grid-auto {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem; /* gap-8 */
    }
}

/* Light mode adjustments for related products */
body.theme-light .related-product-card {
    background-color: rgba(249, 250, 251, 0.05);
}

body.theme-light .related-product-card:hover {
    background-color: rgba(249, 250, 251, 0.1);
}

/* Related product card overlay - ALL text white with strong dark shadow (works on any background) */
.related-product-card .absolute.inset-0.flex,
.related-product-card .absolute.inset-0.flex h3,
.related-product-card .absolute.inset-0.flex p,
.related-product-card .absolute.inset-0.flex span,
.related-product-card .absolute.inset-0.flex div {
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9), 0 4px 12px rgba(0, 0, 0, 0.7) !important;
}

/* Related product card overlay - MQ code - soluk beyaz */
.related-product-card .absolute.inset-0.flex .text-marque-gold {
    color: rgba(255, 255, 255, 0.75) !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9), 0 4px 12px rgba(0, 0, 0, 0.7) !important;
}

/* Override grid when flex class is present - for centering single products */
.related-products-grid.flex {
    display: flex !important;
}

/* Centered Carousel - for less than 4 items - ONLY DESKTOP */
@media (min-width: 1024px) {
    .products-carousel[data-count="1"],
    .products-carousel[data-count="2"],
    .products-carousel[data-count="3"] {
        justify-content: center;
    }
}

/* Hide navigation arrows on desktop when 2-3 products - mobile shows always when 2+ products */
@media (min-width: 1024px) {
    .related-products-carousel-nav[data-count="2"],
    .related-products-carousel-nav[data-count="3"] {
        display: none;
    }
}

/* Product detail inquire CTA row: Get in Touch + WhatsApp side by side */
.product-inquire-cta-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: center;
    gap: 0.75rem;
}

@media (max-width: 639px) {
    .product-inquire-cta-row {
        width: 100%;
        gap: 0.5rem;
    }
}

.product-inquire-btn {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
}

/* İki CTA: metin sıkışmasın (min-content) ama flex-grow yok — aksi halde WhatsApp alt satıra düşünce üst buton satırı tam genişlikte uzuyordu */
.product-inquire-cta-row > a.product-inquire-btn:not(.product-wa-btn):not(:only-child) {
    flex: 0 0 auto;
    min-width: min-content;
}

.product-inquire-cta-row .product-wa-btn {
    flex: 0 0 auto;
    min-width: 0;
}

@media (max-width: 639px) {
    .product-inquire-btn {
        white-space: nowrap;
    }
}

@media (min-width: 1024px) {
    .product-inquire-btn {
        flex: 0 0 auto;
    }

    .product-inquire-cta-row > a.product-inquire-btn:not(.product-wa-btn):not(:only-child) {
        flex: 0 0 auto;
    }
}

.product-wa-btn {
    text-decoration: none;
    font-size: 0.9375rem;
}

@media (min-width: 640px) {
    .product-wa-btn {
        font-size: 1rem;
    }
}

.product-wa-btn svg {
    width: 22px;
    height: 22px;
}

@media (min-width: 640px) {
    .product-wa-btn svg {
        width: 24px;
        height: 24px;
    }
}

.product-wa-btn:hover,
.product-wa-btn:focus {
    background-color: rgba(37, 211, 102, 0.09);
    color: #25d366;
}

body.theme-light .product-wa-btn:hover,
body.theme-light .product-wa-btn:focus {
    background-color: rgba(37, 211, 102, 0.08);
    color: #128c7e;
}

/* READ MORE / READ LESS: no focus ring or outline at all */
.read-more-btn:focus,
.read-more-btn:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}
