/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --black: #0B0B0B;
    --gold: #C6A75E;
    --bg: #EDE9E3;
    --dark: #1A1A1A;
    --muted: #B5B5B5;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--black);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

/* Typography */
h1, h2, h3, h4, .brand-name {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    letter-spacing: -0.5px;
}

/* Language Switcher */
.lang-switcher {
    position: fixed;
    bottom: 30px;
    inset-inline-end: 30px;
    z-index: 1000;
    background: rgba(11, 11, 11, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 5px;
    display: flex;
    gap: 5px;
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    transition: var(--transition);
}

.lang-btn.active {
    background: var(--gold);
    color: var(--black);
    font-weight: 500;
}

/* Header */
.main-header {
    position: absolute;
    top: 0;
    width: 100%;
    padding: 30px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.logo .brand-name {
    font-size: 24px;
    color: var(--gold);
    text-decoration: none;
}

.logo-subtitle {
    font-size: 14px;
    color: var(--muted);
    margin-block-start: 5px;
}

.main-nav {
    display: flex;
    gap: 40px;
}

.main-nav a {
    color: var(--bg);
    text-decoration: none;
    font-size: 16px;
    position: relative;
    transition: var(--transition);
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    inset-inline-start: 0;
    width: 0;
    height: 1px;
    background: var(--gold);
    transition: var(--transition);
}

.main-nav a:hover::after {
    width: 100%;
}

/* Hero */
.hero {
    min-height: 100vh;
    height: 100vh;
    background: url(../images/hero-showroom.jpeg) center center/cover no-repeat;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(11,11,11,0.7) 0%, rgba(26,26,26,0.4) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--bg);
    max-width: 800px;
    padding: 0 20px;
}

.hero-logo {
    font-family: 'Playfair Display', serif;
    font-size: 120px;
    color: var(--gold);
    margin-block-end: 20px;
    opacity: 0;
    animation: fadeUp 1s ease 0.3s forwards;
}

.hero-title {
    font-size: 48px;
    margin-block-end: 20px;
    opacity: 0;
    animation: fadeUp 1s ease 0.5s forwards;
}

.hero-subtitle {
    font-size: 20px;
    color: var(--muted);
    opacity: 0;
    animation: fadeUp 1s ease 0.7s forwards;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Sections */
.categories-section,
.circular-gallery-section {
    padding: 120px 0;
}

@keyframes goldBoxReveal {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.section-title {
    display: inline-block;
    padding: 14px 42px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(194,164,93,0.22), rgba(194,164,93,0.06));
    box-shadow: 0 0 0 rgba(194,164,93,0), 0 10px 25px rgba(0,0,0,0.12);
    border: 1px solid rgba(194,164,93,0.55);
    color: var(--black);
    font-size: 36px;
    letter-spacing: 1px;
    text-align: center;
    margin-block-end: 40px;
    opacity: 0;
    animation: goldBoxReveal 0.8s ease-out forwards;
}

.section-title:hover {
    box-shadow: 0 0 18px rgba(194,164,93,0.35), 0 12px 30px rgba(0,0,0,0.15);
}

.circular-gallery-section,
.categories-section {
    text-align: center;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    padding: 0 20px;
}

.category-card {
    height: 400px;
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: block;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 11, 11, 0.4);
    z-index: 1;
    transition: var(--transition);
}

.category-card:hover::before {
    background: rgba(11, 11, 11, 0.6);
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(11, 11, 11, 0.2);
}

.category-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.category-card:hover .category-bg {
    transform: scale(1.05);
}

.category-content {
    position: absolute;
    bottom: 40px;
    inset-inline-start: 40px;
    z-index: 2;
    text-align: start;
}

.category-code {
    font-family: 'Playfair Display', serif;
    font-size: 80px;
    color: var(--gold);
    line-height: 0.8;
    margin-block-end: 15px;
}

.category-name {
    color: var(--bg);
    font-size: 28px;
    font-weight: 500;
}

/* 3D Circular Gallery */
.circular-gallery-section {
    position: relative;
    min-height: 700px;
}

.circular-gallery-container {
    position: relative;
    width: 100%;
    height: 600px;
    perspective: 2000px;
    margin-block-start: 40px;
}

.circular-gallery {
    position: absolute;
    top: 20%;
    left: 50%;
    width: 0;
    height: 0;
    transform-style: preserve-3d;
    transition: transform 1.5s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.gallery-item {
    position: absolute;
    inset-inline-start: -150px;
    display: block;
    width: 300px;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transform-style: preserve-3d;
    transform-origin: center center;
    box-shadow: 0 15px 35px rgba(11, 11, 11, 0.2);
    border: 2px solid var(--gold);
    transition: opacity 0.35s ease, filter 0.35s ease, transform 0.35s ease;
    text-decoration: none;
}

.gallery-inner {
    width: 100%;
    height: 100%;
    transform: translateZ(0);
    transform-style: preserve-3d;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), filter 0.35s ease, opacity 0.35s ease;
    backface-visibility: hidden;
}

.gallery-item:hover {
    z-index: 50;
}

.circular-gallery:hover .gallery-item:not(:hover) .gallery-inner {
    opacity: 0.45;
    transform: scale(0.96);
}

.gallery-item:hover .gallery-inner {
    transform: translateZ(160px) scale(1.08);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover .gallery-inner img {
    transform: scale(1.1);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(11, 11, 11, 0.85);
    color: var(--bg);
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-caption {
    transform: translateY(0);
}

.gallery-caption h3 {
    font-size: 18px;
    margin-block-end: 5px;
    color: var(--gold);
}

.gallery-caption .code {
    font-size: 14px;
    opacity: 0.8;
}

.gallery-nav {
    position: absolute;
    bottom: -90px;
    left: 50%;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(11, 11, 11, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(198, 167, 94, 0.6);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 24px;
}

.gallery-nav.prev {
    transform: translateX(-70px);
}

.gallery-nav.next {
    transform: translateX(24px);
}

.gallery-nav:hover {
    background: var(--gold);
    color: var(--black);
}

/* Category Page Styles */
.category-header {
    background: var(--dark);
    color: var(--bg);
    padding: 150px 0 80px;
    text-align: center;
}

.breadcrumb {
    font-size: 14px;
    margin-block-end: 20px;
    opacity: 0.7;
}

.breadcrumb a {
    color: var(--gold);
    text-decoration: none;
}

.category-title {
    font-size: 48px;
    margin-block-end: 15px;
    color: var(--gold);
}

.category-description {
    font-size: 18px;
    color: var(--muted);
}

.products-section {
    padding: 80px 0;
    min-height: 400px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-block-end: 60px;
}

.product-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(11, 11, 11, 0.1);
    transition: var(--transition);
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(11, 11, 11, 0.2);
}

.product-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
}

.product-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(11,11,11,0.9), transparent);
    padding: 20px;
    transform: translateY(100%);
    transition: var(--transition);
}

.product-card:hover .product-overlay {
    transform: translateY(0);
}

.product-code {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    color: var(--gold);
}

.loading {
    text-align: center;
    padding: 60px 20px;
    font-size: 18px;
    color: var(--muted);
}

.error-message {
    text-align: center;
    padding: 60px 20px;
}

.error-message p {
    font-size: 20px;
    margin-block-end: 30px;
    color: var(--dark);
}

.back-home {
    text-align: center;
    padding: 40px 0 80px;
}

.back-btn {
    display: inline-block;
    padding: 15px 40px;
    background: var(--gold);
    color: var(--black);
    text-decoration: none;
    border-radius: 30px;
    font-weight: 500;
    transition: var(--transition);
}

.back-btn:hover {
    background: var(--dark);
    color: var(--gold);
    transform: translateX(-5px);
}

/* Footer */
.main-footer {
    background: var(--black);
    color: var(--bg);
    padding: 80px 0 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 60px;
    margin-block-end: 60px;
}

.footer-title {
    font-size: 24px;
    margin-block-end: 25px;
    color: var(--gold);
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-info a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    text-decoration: none;
    transition: var(--transition);
    font-size: 15px;
}

.contact-info a:hover {
    color: var(--gold);
    padding-inline-start: 10px;
}

.footer-logo {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    color: var(--gold);
    margin-block-end: 15px;
    display: block;
    text-decoration: none;
}

.footer-tagline {
    color: var(--muted);
    font-size: 16px;
    line-height: 1.8;
    margin-block-start: 20px;
}

.copyright {
    text-align: center;
    padding-block-start: 40px;
    border-top: 1px solid rgba(198, 167, 94, 0.2);
    color: var(--muted);
    font-size: 14px;
}

.social-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Responsive - Tablet */
@media (max-width: 992px) {
    .container {
        padding: 0 20px;
    }
    
    .hero {
        min-height: 100vh;
    }
    
    .hero-logo {
        font-size: 80px;
    }
    
    .hero-title {
        font-size: 36px;
    }
    
    .hero-subtitle {
        font-size: 18px;
    }
    
    .categories-section,
    .circular-gallery-section {
        padding: 80px 0;
    }
    
    .section-title {
        font-size: 28px;
        padding: 12px 32px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    
    .category-card {
        height: 350px;
    }
    
    .category-code {
        font-size: 60px;
    }
    
    .category-name {
        font-size: 24px;
    }
    
    .main-header {
        padding: 20px;
        flex-direction: column;
        gap: 20px;
    }
    
    .main-nav {
        gap: 20px;
        font-size: 14px;
    }
    
    .lang-switcher {
        bottom: 20px;
        inset-inline-end: 20px;
    }
    
    .circular-gallery-section {
        min-height: 550px;
        padding-block-end: 100px;
    }
    
    .circular-gallery-container {
        height: 450px;
        margin-block-start: 20px;
    }
    
    .gallery-item {
        width: 220px;
        height: 320px;
        inset-inline-start: -110px;
    }
    
    .gallery-nav {
        bottom: -70px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 25px;
    }
    
    .category-header {
        padding: 130px 0 60px;
    }
    
    .category-title {
        font-size: 40px;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    /* CRITICAL: Prevent horizontal overflow */
    html, body {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }
    
    * {
        max-width: 100vw;
    }
    
    .container {
        padding: 0 15px;
        width: 100%;
        max-width: 100%;
    }
    
    /* Hero Mobile Fixes */
    .hero {
        min-height: 100vh;
        min-height: -webkit-fill-available;
        width: 100%;
        overflow: hidden;
    }
    
    .hero-content {
        padding: 20px 15px;
        width: 100%;
        max-width: 100%;
    }
    
    .hero-logo {
        font-size: 60px;
        margin-block-end: 15px;
    }
    
    .hero-title {
        font-size: 28px;
        margin-block-end: 15px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    /* Sections Mobile */
    .categories-section,
    .circular-gallery-section {
        padding: 60px 0;
        width: 100%;
        overflow: hidden;
    }
    
    .section-title {
        font-size: 24px;
        padding: 10px 24px;
        margin-block-end: 30px;
    }
    
    /* Categories Mobile */
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 15px;
        width: 100%;
    }
    
    .category-card {
        height: 320px;
        width: 100%;
    }
    
    .category-content {
        bottom: 30px;
        inset-inline-start: 30px;
    }
    
    .category-code {
        font-size: 50px;
        margin-block-end: 10px;
    }
    
    .category-name {
        font-size: 20px;
    }
    
    /* MOBILE GALLERY FIX - Replace 3D with horizontal scroll */
    .circular-gallery-section {
        min-height: auto;
        padding: 60px 0;
        overflow: hidden;
        width: 100%;
    }
    
    .circular-gallery-container {
        position: relative;
        width: 100%;
        height: auto;
        perspective: none;
        margin-block-start: 20px;
        overflow: hidden;
    }
    
    .circular-gallery {
        position: relative;
        top: 0;
        left: 0;
        width: 100%;
        height: auto;
        transform: none !important;
        transform-style: flat;
        display: flex;
        gap: 16px;
        padding: 20px 15px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }
    
    .gallery-item {
        position: relative !important;
        transform: none !important;
        inset-inline-start: 0 !important;
        flex: 0 0 75%;
        max-width: 280px;
        width: 75%;
        height: 360px;
        scroll-snap-align: center;
        margin: 0;
    }
    
    .gallery-inner {
        transform: none !important;
        transform-style: flat;
    }
    
    .gallery-item:hover .gallery-inner {
        transform: none !important;
    }
    
    .circular-gallery:hover .gallery-item:not(:hover) .gallery-inner {
        opacity: 1;
        transform: none !important;
    }
    
    .gallery-caption {
        padding: 15px;
    }
    
    .gallery-caption h3 {
        font-size: 16px;
    }
    
    .gallery-caption .code {
        font-size: 12px;
    }
    
    /* Hide 3D navigation on mobile */
    .gallery-nav {
        display: none;
    }
    
    /* Header Mobile */
    .main-header {
        padding: 15px;
        width: 100%;
    }
    
    .logo .brand-name {
        font-size: 20px;
    }
    
    .logo-subtitle {
        font-size: 12px;
    }
    
    .main-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
    
    .main-nav a {
        font-size: 14px;
    }
    
    /* Language Switcher Mobile */
    .lang-switcher {
        bottom: 15px;
        inset-inline-end: 15px;
        padding: 4px;
    }
    
    .lang-btn {
        padding: 6px 15px;
        font-size: 12px;
    }
    
    /* Category Page Mobile */
    .category-header {
        padding: 100px 0 50px;
        width: 100%;
    }
    
    .category-title {
        font-size: 32px;
    }
    
    .category-description {
        font-size: 16px;
    }
    
    /* Products Mobile */
    .products-section {
        padding: 60px 0;
        width: 100%;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        width: 100%;
    }
    
    .product-card {
        width: 100%;
    }
    
    .product-image {
        height: 320px;
    }
    
    .product-code {
        font-size: 20px;
    }
    
    /* Footer Mobile */
    .main-footer {
        padding: 60px 0 30px;
        width: 100%;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        margin-block-end: 40px;
        width: 100%;
    }
    
    .footer-title {
        font-size: 20px;
        margin-block-end: 20px;
    }
    
    .footer-logo {
        font-size: 28px;
    }
    
    .footer-tagline {
        font-size: 15px;
    }
    
    .back-home {
        padding: 30px 0 60px;
    }
    
    .back-btn {
        padding: 12px 30px;
        font-size: 14px;
    }
}

/* Extra Small Mobile */
@media (max-width: 480px) {
    .hero-logo {
        font-size: 48px;
    }
    
    .hero-title {
        font-size: 24px;
    }
    
    .hero-subtitle {
        font-size: 14px;
    }
    
    .section-title {
        font-size: 20px;
        padding: 8px 20px;
    }
    
    .category-code {
        font-size: 40px;
    }
    
    .category-name {
        font-size: 18px;
    }
    
    .gallery-item {
        flex: 0 0 85%;
        max-width: 260px;
        width: 85%;
        height: 320px;
    }
}