* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    overflow: hidden;
    background: #f5f5f5;
    position: fixed;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    -webkit-overflow-scrolling: touch;
}

/* Loading Ekranı */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ffffff 0%, #f8f8f8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    animation: fadeInUp 0.8s ease-out;
}

.loading-logo {
    height: 80px;
    margin-bottom: 30px;
    animation: logoPulse 2s ease-in-out infinite;
}


.loading-text {
    color: #333;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 1px;
    animation: textFade 1.5s ease-in-out infinite;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes logoPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}


@keyframes textFade {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Header */
header {
    z-index: 1000;
    position: relative; /* Z-index'in çalışması için */
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 0.5rem 0;
    background: #fff; /* Header'ın arka planı */
}

.navbar {
    padding: 0.5rem 1rem;
}

.navbar-brand {
    display: flex;
    align-items: center;
}

.header-logo {
    height: 45px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

/* Hamburger Button */
.hamburger-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: all 0.3s;
}

.hamburger-btn span {
    width: 25px;
    height: 3px;
    background: #000;
    border-radius: 2px;
    transition: all 0.3s;
}

.hamburger-btn:hover span {
    background: #666;
}

/* Search Button */
.search-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.search-btn:hover {
    opacity: 0.7;
}

/* Side Menu */
.side-menu {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background: #fff;
    box-shadow: 2px 0 20px rgba(0,0,0,0.1);
    z-index: 2000;
    transition: left 0.3s ease;
    overflow-y: auto;
}

.side-menu.active {
    left: 0;
}

.side-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.side-menu-header h5 {
    margin: 0;
    font-weight: 600;
}

.close-menu {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.side-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.side-menu-list li {
    border-bottom: 1px solid #f0f0f0;
}

.side-menu-list a {
    display: block;
    padding: 1rem 1.5rem;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    position: relative;
}

.side-menu-list a:hover {
    background: #f5f5f5;
    padding-left: 2rem;
}

.side-menu-list li.active > a {
    background: #000;
    color: #fff;
}

/* Alt menü stilleri */
.side-menu-list .sub-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #f9f9f9;
}

.side-menu-list .has-submenu.open > .sub-menu {
    max-height: 1000px;
}

.side-menu-list .sub-menu a {
    padding-left: 2.5rem;
    font-size: 0.9rem;
    font-weight: 400;
}

.side-menu-list .sub-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #f0f0f0;
}

.side-menu-list .has-submenu.open > .sub-submenu,
.side-menu-list .sub-menu .has-submenu.open > .sub-submenu {
    max-height: 800px;
}

.side-menu-list .sub-submenu a {
    padding-left: 3.5rem;
    font-size: 0.85rem;
}

.menu-toggle .arrow {
    float: right;
    font-size: 0.8rem;
    transition: transform 0.3s;
}

.has-submenu.open > .menu-toggle .arrow {
    transform: rotate(180deg);
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Search Modal */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.98);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
}

.search-modal.active {
    display: flex;
}

.search-modal-content {
    width: 90%;
    max-width: 600px;
    position: relative;
}

.close-search {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    font-size: 3rem;
    cursor: pointer;
    color: #333;
    line-height: 1;
}

.search-box {
    display: flex;
    border: 2px solid #000;
    border-radius: 50px;
    overflow: hidden;
}

.search-input {
    flex: 1;
    border: none;
    padding: 1.5rem 2rem;
    font-size: 1.2rem;
    outline: none;
}

.search-submit {
    background: #000;
    border: none;
    padding: 1rem 2rem;
    cursor: pointer;
    color: #fff;
}

.search-submit:hover {
    background: #333;
}

/* 3D Sahne */
#scene-container {
    width: 100vw;
    height: 100vh;
    height: -webkit-fill-available;
    perspective: 1500px;
    perspective-origin: 50% 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f8f8 0%, #e8e8e8 100%);
    cursor: grab;
    position: fixed;
    top: 0;
    left: 0;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    touch-action: pan-y;
    /* Görüntü kalitesi iyileştirmeleri */
    image-rendering: -webkit-optimize-contrast;
    -webkit-font-smoothing: antialiased;
}

#scene-container:active {
    cursor: grabbing;
}

.products-space {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    transition: transform 0.3s ease-out;
    will-change: transform;
}

/* Ürün Kartı - 370x370px + etiket alanı */
.product-item {
    position: absolute;
    width: 600px; /* Resim (370px) + Info alanı için yeterli genişlik */
    height: 370px;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    transition: opacity 0.6s ease, z-index 0s linear; /* z-index geçişini anında yap */
    opacity: 1;
    overflow: visible; /* Product-info'nun görünmesi için */
    will-change: transform, z-index;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    z-index: 1; /* Başlangıç, JS ile dinamik olarak güncellenir */
    /* Görüntü kalitesi iyileştirmeleri */
    image-rendering: -webkit-optimize-contrast;
    -webkit-font-smoothing: antialiased;
}


.product-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    cursor: pointer;
    position: relative; /* Product-info'nun absolute pozisyonlanması için */
}

.product-item:hover {
    z-index: 1001 !important; /* Header'ın üstünde (header z-index: 1000), dinamik z-index'i override et */
}

.product-inner {
    width: 370px; /* Sadece resim genişliği */
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.4s;
    display: flex;
    align-items: flex-start; /* Üstten hizala - product-info ile aynı hizada */
    justify-content: flex-start;
    padding-left: 0;
    padding-top: 0;
    overflow: visible; /* Product-info'nun görünmesi için */
    gap: 0; /* Resim ve yazı arasında boşluk yok */
    flex-shrink: 0; /* Genişliği sabit tut */
    /* Product-info için referans noktası */
}

.product-item:hover .product-inner {
    transform: rotateY(0deg);
}

/* Ürün Görsel - 3D Soft Görünüm (Hafif Gölgeli) */
.product-image {
    flex-shrink: 0;
    width: 370px;
    height: 370px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border-radius: 0;
    border: none;
    box-shadow: none;
    overflow: visible;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    position: relative;
    z-index: 1; /* Resim arka planda */
    margin: 0;
    padding: 0;
    top: 0; /* Üstten başla - product-info ile aynı hizada */
    /* Görüntü kalitesi iyileştirmeleri */
    image-rendering: -webkit-optimize-contrast;
    transform-origin: center center;
}

.product-item:hover .product-image {
    transform: translateZ(15px);
}

.product-image img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.08)) 
            drop-shadow(0 8px 24px rgba(0,0,0,0.06));
    transition: all 0.4s ease;
    /* Görüntü kalitesi iyileştirmeleri - scale ile büyütüldüğünde bulanıklaşmayı önle */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
    will-change: transform;
}

.product-item:hover .product-image img {
    transform: scale(1.08);
    filter: drop-shadow(0 6px 18px rgba(0,0,0,0.12)) 
            drop-shadow(0 12px 32px rgba(0,0,0,0.08));
}

/* Ürün Bilgisi - Resmin sağında sabit */
.product-info {
    position: absolute !important; /* Product-item'a göre absolute - product-link içinde */
    display: flex !important;
    flex-direction: column;
    align-items: flex-start;
    gap: 0; /* Boşluk yok, birleşik görünüm */
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10001 !important; /* Çok yüksek z-index - kesinlikle üstte */
    pointer-events: none;
    flex-shrink: 0;
    white-space: normal; /* Uzun metinler için wrap */
    padding-left: 0;
    margin-left: 0 !important; /* Resmin hemen yanında, boşluk yok */
    /* Product-inner'ın sağında, üstte - resim genişliği kadar sağa ama 150px daha yakın */
    left: 220px !important; /* Resim genişliği (370px) - 150px = 220px - daha yakın */
    top: 45px !important; /* Product-inner'ın üst kenarından 45px aşağı */
    transform: translate(0, 0) !important; /* Transform yok - product-item'ın transform'u ile birlikte hareket eder */
    -webkit-transform: translate(0, 0) !important;
    backface-visibility: visible !important;
    -webkit-backface-visibility: visible !important;
    /* Stacking context sorunlarını önle */
    isolation: isolate;
    /* Görüntü kalitesi iyileştirmeleri - bulanıklığı önle */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Product-info opacity JavaScript ile kontrol ediliyor */

.info-title {
    background: #000;
    color: #fff;
    padding: 6px 12px;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    line-height: 1.3;
    border: none;
    white-space: nowrap;
    margin: 0;
    /* Görüntü kalitesi iyileştirmeleri */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.info-author {
    background: #fff;
    color: #000;
    padding: 6px 12px;
    font-weight: 500;
    font-size: 0.65rem;
    line-height: 1.4;
    border: none;
    border-top: none;
    letter-spacing: 0.2px;
    max-width: 280px;
    word-wrap: break-word;
    white-space: normal;
    overflow-wrap: break-word;
    margin: 0;
    /* Görüntü kalitesi iyileştirmeleri */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Kontroller - Modern Stil */
.controls {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 1000;
}

.control-btn {
    padding: 16px 32px;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 1.2px;
    text-decoration: none;
    border-radius: 50px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12), 
                0 2px 8px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    text-transform: uppercase;
    line-height: 1;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16), 
                0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.control-btn.active {
    background: linear-gradient(135deg, #000000 0%, #2c2c2c 100%);
    color: white;
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.25), 
                0 3px 10px rgba(0, 0, 0, 0.15),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.control-btn.active:hover {
    background: linear-gradient(135deg, #1a1a1a 0%, #3a3a3a 100%);
    transform: translateY(-2px);
}

.control-btn svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    display: block;
    transition: transform 0.3s;
    align-self: center;
}

.control-btn:hover svg {
    transform: scale(1.1);
}

/* Grid Modu */
.products-space.grid-mode .product-item {
    animation: none !important;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.products-space.grid-mode .product-item:hover {
    transform: scale(1.05) translateZ(50px) !important;
}

/* Yükleme Animasyonu */
.product-item.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* Responsive - Mobil Uyumlu */
@media (max-width: 1200px) {
    .product-item {
        width: 500px; /* Tablet için yeterli genişlik */
        height: 370px;
    }
    
    .product-image {
        width: 300px;
        height: 300px;
    }
    
    .product-inner {
        width: 300px; /* Tablet için resim genişliği */
    }
    
    .product-info {
        left: 150px !important; /* Tablet: resim genişliği (300px) - 150px = 150px - daha yakın */
        top: 40px !important; /* Product-inner'ın üst kenarından 40px aşağı */
    }
}

@media (max-width: 768px) {
    .product-item {
        width: 400px; /* Mobil için resim + info alanı */
        height: 140px;
    }
    
    .product-image {
        width: 140px;
        height: 140px;
    }
    
    .product-inner {
        width: 140px; /* Mobil için resim genişliği */
    }
    
    .product-info {
        left: 70px !important; /* Mobil: resim genişliği (140px) - 70px = 70px - daha yakın */
        top: 35px !important; /* Product-inner'ın üst kenarından 35px aşağı */
        z-index: 10001 !important; /* Mobilde de üstte */
        white-space: normal; /* Mobilde wrap */
    }
    
    /* Mobilde gölgeleri kaldır - performans */
    .product-image img {
        filter: none;
    }
    
    .product-item:hover .product-image img {
        filter: none;
        transform: scale(1.05);
    }
    
    .control-btn {
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
        backdrop-filter: none;
    }
    
    .header-logo {
        height: 35px;
    }
    
    .controls {
        bottom: 120px;
    }
    
    .control-btn {
        padding: 10px 18px;
        font-size: 0.75rem;
        white-space: nowrap;
    }
    
    .info-title {
        font-size: 0.85rem;
        padding: 8px 10px;
    }
    
    .info-author {
        font-size: 0.65rem;
        padding: 5px 8px;
        max-width: 250px;
    }
}

@media (max-width: 480px) {
    .product-item {
        width: 300px; /* Küçük ekranlar için resim + info alanı */
        height: 110px;
    }
    
    .product-image {
        width: 110px;
        height: 110px;
    }
    
    .product-inner {
        width: 110px; /* Küçük ekranlar için resim genişliği */
    }
    
    .product-info {
        left: 55px !important; /* Küçük ekranlar: resim genişliği (110px) - 55px = 55px - daha yakın */
        top: 33px !important; /* Product-inner'ın üst kenarından 33px aşağı */
        z-index: 10001 !important; /* Küçük ekranlarda da üstte */
        white-space: normal; /* Küçük ekranlarda wrap */
    }
    
    .header-logo {
        height: 30px;
    }
    
    .side-menu {
        width: 280px;
        left: -280px;
    }
    
    .controls {
        bottom: 110px;
        gap: 8px;
    }
    
    .control-btn {
        padding: 8px 14px;
        font-size: 0.7rem;
        white-space: nowrap;
        gap: 6px;
    }
    
    .info-title {
        font-size: 0.75rem;
        padding: 6px 8px;
    }
    
    .info-author {
        font-size: 0.6rem;
        padding: 4px 6px;
        max-width: 200px;
    }
    
    .search-input {
        font-size: 1rem;
        padding: 1rem 1.5rem;
    }
}
