/* assets/css/style.css - V2.1 Premium Fixed */

:root {
    --primary: #c19b6c;
    --primary-light: #fdf5ea;
    --primary-dark: #a17f54;
    --text-main: #1a1a1a;
    --text-muted: #555555;
    --bg-card: rgba(255, 255, 255, 0.85);
    /* Glassmorphism */
    --bg-nav: rgba(255, 255, 255, 0.90);
    --border-color: rgba(255, 255, 255, 0.7);
    --border-solid: rgba(193, 155, 108, 0.3);
    --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.15);
    --glass-blur: blur(16px);
    --radius-md: 20px;
    --radius-lg: 30px;
}

[data-theme="dark"] {
    --primary: #d4af37;
    --primary-light: #2a2315;
    --primary-dark: #b5952f;
    --text-main: #fcfcfc;
    --text-muted: #a0a0a0;
    --bg-card: rgba(18, 18, 20, 0.7);
    --bg-nav: rgba(18, 18, 20, 0.85);
    --border-color: rgba(255, 255, 255, 0.1);
    --border-solid: rgba(212, 175, 55, 0.2);
    --shadow-sm: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 10px 40px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.9);
}

* {
    box-sizing: border-box;
}

html {
    background-color: #050505;
    /* This acts as the absolute bottom layer fallback */
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    /* The body MUST be transparent for Three.js (which has z-index: -1) to show! */
    background-color: transparent !important;
}

.three-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

.content-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding-bottom: 50px;
}

.glass-panel {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.header {
    padding: 40px 20px 20px 20px;
    text-align: center;
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.theme-toggle-btn {
    position: fixed;
    /* Fixed so it doesn't move when scrolling or on wide screens */
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.theme-toggle-btn:hover {
    color: var(--primary);
    transform: scale(1.1);
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    width: 100%;
}

.brand-logo {
    max-width: 210px;
    height: auto;
    filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.4));
    margin-bottom: 5px;
}

.premium-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    color: var(--primary);
    letter-spacing: 1px;
}

.premium-subtitle {
    font-size: 0.85rem;
    font-weight: 300;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin: 0;
    color: var(--text-muted);
}

/* Category Nav FIX: Centered and constrained width */
.category-nav {
    position: sticky;
    top: 20px;
    z-index: 100;
    max-width: 860px;
    width: calc(100% - 40px);
    margin: 20px auto 30px auto;
    /* Centers it perfectly */
    border-radius: 30px;
    padding: 8px 10px;
    transition: all 0.3s ease;
}

.category-scroll {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    scrollbar-width: none;
}

.category-scroll::-webkit-scrollbar {
    display: none;
}

.cat-btn {
    white-space: nowrap;
    background: transparent;
    border: 1px solid transparent;
    padding: 10px 24px;
    border-radius: 20px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
}

.cat-btn.active {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(193, 155, 108, 0.4);
}

[data-theme="dark"] .cat-btn.active {
    color: #050505;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
}

/* Main Menu Area */
.menu-container {
    padding: 20px 20px 60px 20px;
    max-width: 900px;
    margin: 0 auto;
    /* CENTERED */
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    font-weight: 600;
    margin: 40px 0 25px 0;
    color: var(--text-main);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 650px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.product-card {
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.product-card:active {
    transform: scale(0.98);
}

.product-img-container {
    width: 85px;
    height: 85px;
    flex-shrink: 0;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.05);
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 5px;
    transition: transform 0.4s ease;
}

.product-card:hover .product-img {
    transform: scale(1.1);
}

.product-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--border-solid);
}

.product-info {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.product-name {
    margin: 0 0 6px 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
}

.product-desc {
    margin: 0 0 10px 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.product-price {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.2rem;
    margin-top: auto;
}

/* Modal */
.product-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    /* Center horizontally on large screens */
    visibility: hidden;
    opacity: 0;
    transition: all 0.4s ease;
}

.product-modal.active {
    visibility: visible;
    opacity: 1;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-content {
    width: 100%;
    max-width: 500px;
    /* Constrained width so the image doesn't look huge */
    max-height: 90vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    position: relative;
    z-index: 2001;
    transform: translateY(100%);
    transition: transform 0.4s ease;
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--border-color);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

.product-modal.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
}

.modal-img-wrapper {
    width: 100%;
    height: auto;
    max-height: 40vh;
    /* Prevents it from taking up the whole screen height */
    min-height: 200px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow: hidden;
    position: relative;
    background: rgba(0, 0, 0, 0.03);
    /* Subtle backdrop for transparent/contained images */
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-img-wrapper img {
    width: 100%;
    height: 100%;
    max-height: 40vh;
    object-fit: contain;
    /* Prevents cropping and awkward zoom for tall images */
    padding: 15px;
    /* Adds a little breathing room inside the wrapper */
}

.modal-details {
    padding: 25px;
    overflow-y: auto;
}

.modal-details h3 {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.modal-details p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 25px;
}

.modal-footer {
    padding-top: 15px;
    border-top: 1px solid var(--border-solid);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-price {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
}

.footer {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.branding {
    font-weight: 700;
    color: var(--text-main);
    margin-top: 5px;
}