/* =============================================================
   DAMROBF – Premium Furniture Store | Custom Stylesheet
   Complements Tailwind CSS (CDN). Do NOT duplicate utilities.
   ============================================================= */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
    --bg-primary:        #faf9f6;
    --bg-secondary:      #f4f3ee;
    --bg-white:          #ffffff;
    --text-primary:      #1a1a1a;
    --text-secondary:    #5a5a57;
    --text-muted:        #959490;
    --brand-primary:     #b0c636;
    --brand-dark:        #121212;
    --brand-accent:      #b0c636;
    --brand-light:       #f7f5f0;
    --border-color:      #e5e3dd;
    --border-light:      #f0ede6;
    --danger:            #b33939;
    --font-serif:        'Playfair Display', Georgia, serif;
    --shadow-sm:         0 2px 8px rgba(0,0,0,0.04);
    --shadow-md:         0 12px 30px -10px rgba(18,18,18,0.06);
    --shadow-lg:         0 22px 50px -15px rgba(18,18,18,0.12);
    --shadow-gold:       0 12px 30px -10px rgba(176,198,54,0.25);
    --transition-fast:   all 0.2s ease;
    --transition-smooth: all 0.4s cubic-bezier(0.16,1,0.3,1);
}

/* ── Base Reset ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; transition: var(--transition-fast); }
img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5, h6 { font-weight: 500; line-height: 1.25; }

/* ── Scrollbar Hide Helper ─────────────────────────────────── */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ── Typography Helpers ────────────────────────────────────── */
.text-gold  { color: var(--brand-primary); }

/* ── Btn Gold ──────────────────────────────────────────────── */
.btn-gold {
    background-color: var(--brand-primary);
    color: var(--brand-dark);
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 700;
    display: inline-block;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 15px rgba(176,198,54,0.3);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}
.btn-gold:hover {
    background-color: var(--brand-accent);
    color: var(--bg-white);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(176,198,54,0.4);
}

/* ── Section Title ─────────────────────────────────────────── */
.section-title { text-align: center; margin-bottom: 3rem; }
.section-title h2 {
    font-size: 2.2rem;
    color: var(--brand-dark);
    position: relative;
    display: inline-block;
    padding-bottom: 12px;
}
.section-title h2::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 60px; height: 2px;
    background-color: var(--brand-primary);
}
.section-title p { color: var(--text-secondary); font-size: 0.95rem; margin-top: 8px; }

/* ── Product Grid ──────────────────────────────────────────── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}
@media (max-width: 1024px) { .product-grid { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; } }
@media (max-width: 768px)  { .product-grid { grid-template-columns: repeat(2, 1fr); gap: 0.875rem; } }

/* ── Product Card ──────────────────────────────────────────── */
.product-card {
    background-color: var(--bg-white);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    transition: var(--transition-smooth);
}
.product-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.product-card-img-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: var(--bg-white);
}
.product-card-img-wrapper img {
    width: 100%;
    height: auto;
    transition: var(--transition-smooth);
}
.product-card:hover .product-card-img-wrapper img { transform: scale(1.04); }

.product-card-info {
    padding: 0.625rem 0.875rem 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    background-color: var(--bg-white);
    border-top: 1px solid #f3f3f3;
    text-align: center;
}

/* ── Child Category Sections ───────────────────────────────── */
.child-category-section {
    margin-bottom: 3.5rem;
    padding-bottom: 1rem;
}

.child-category-header {
    border-left: 3px solid var(--brand-primary);
    padding-left: 1rem;
    margin-bottom: 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.child-category-title {
    font-size: 1.7rem;
    color: var(--brand-dark);
}

.child-category-count {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Subcategory divider row */
.sub-cat-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
    margin-bottom: 1.5rem;
}
.sub-cat-divider h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #6b7280;
    white-space: nowrap;
    margin: 0;
}
.sub-cat-divider-line {
    height: 1px;
    flex-grow: 1;
    background-color: #e5e7eb;
}

/* Empty sub-cat message */
.sub-cat-empty {
    padding: 1.5rem 0;
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.95rem;
}

/* Empty category / error states */
.state-empty {
    padding: 6rem 2rem;
    text-align: center;
    color: var(--text-secondary);
}
.state-empty-icon {
    font-size: 4rem;
    opacity: 0.12;
    margin-bottom: 1.5rem;
}
.state-error {
    max-width: 80rem;
    margin: 0 auto;
    padding: 6rem 2rem;
    text-align: center;
}

/* ── Hero Slider Overrides ─────────────────────────────────── */
/* Override legacy fading styles for the new sliding-track approach */
.hero-slider-container .hero-slide {
    position: relative !important;
    opacity: 1 !important;
    visibility: visible !important;
    transition: none !important;
}

/* ── Product Page: Gallery ─────────────────────────────────── */
.product-gallery-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin: 3rem 0;
}
@media (max-width: 900px) {
    .product-gallery-layout { grid-template-columns: 1fr; gap: 2rem; }
}

.gallery-left-col { display: flex; gap: 20px; align-items: flex-start; min-width: 0; }

/* Thumbnail carousel */
.thumb-carousel-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
    flex-shrink: 0;
}
.thumb-carousel-viewport { overflow: hidden; width: 80px; }
.thumb-carousel-track {
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.35s ease;
}
.thumb-item {
    border: 1px solid var(--border-light);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    background: white;
    flex-shrink: 0;
}
.thumb-item.active { border-color: var(--brand-primary); }

.thumb-nav-arrow {
    width: 80px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.9);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    cursor: pointer;
    color: #6b7280;
    font-size: 0.7rem;
    transition: var(--transition-fast);
    flex-shrink: 0;
}
.thumb-nav-arrow:hover { background: var(--brand-primary); color: white; border-color: var(--brand-primary); }
.thumb-nav-arrow.hidden { visibility: hidden; pointer-events: none; }

/* Main gallery slider */
.gallery-slider-container {
    position: relative;
    flex-grow: 1;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    background: white;
    overflow: hidden;
    min-width: 0;
    transition: height 0.4s ease;
}

.gallery-slider-track {
    display: flex;
    align-items: flex-start;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    width: 100%;
}

.gallery-slide { flex: 0 0 100%; width: 100%; box-sizing: border-box; }
.gallery-slide img { width: 100%; height: auto; display: block; cursor: zoom-in; }
.gallery-slide a { display: block; width: 100%; }

.gallery-no-image {
    width: 100%;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-secondary);
    color: var(--text-muted);
}

/* Nav arrows for gallery */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.85);
    border: 1px solid var(--border-light);
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #4b5563;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    transition: var(--transition-fast);
    opacity: 0;
    pointer-events: none;
    z-index: 10;
    font-size: 0.9rem;
}
.nav-arrow.prev-arrow { left: 15px; }
.nav-arrow.next-arrow { right: 15px; }
.gallery-slider-container:hover .nav-arrow { opacity: 1; pointer-events: auto; }
.nav-arrow:hover { background: var(--brand-primary); color: white; border-color: var(--brand-primary); }

/* ── Product Detail: Meta Panel ────────────────────────────── */
.product-meta-panel { display: flex; flex-direction: column; }

.product-detail-title {
    font-size: 1.5rem;
    color: #4b5563;
    font-weight: 400;
    margin-bottom: 1rem;
}

.product-sale-price {
    color: var(--brand-primary);
    font-size: 1.8rem;
    font-weight: 700;
}
.product-retail-price {
    color: #9ca3af;
    text-decoration: line-through;
    font-size: 0.95rem;
    margin-top: 0.25rem;
}
.product-price-block { margin-bottom: 2rem; }

/* ── Variations ────────────────────────────────────────────── */
.variation-block { margin-top: 1rem; border-top: 1px solid var(--border-light); padding-top: 1.5rem; }
.variation-section { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.variation-title {
    font-size: 0.9rem; font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: block;
}
.variation-options { display: flex; flex-wrap: wrap; gap: 8px; }
.variation-option {
    border: 1px solid var(--border-color);
    background-color: var(--bg-white);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
}
.variation-option:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.variation-option.active { background-color: var(--brand-dark); border-color: var(--brand-dark); color: var(--bg-white); }
.variation-color-dot {
    width: 16px; height: 16px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid rgba(0,0,0,0.1);
}

/* ── Purchase Controls ─────────────────────────────────────── */
.purchase-controls { display: flex; gap: 1rem; margin-top: 2rem; margin-bottom: 2rem; }

.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 30px;
    overflow: hidden;
    height: 50px;
    background-color: var(--bg-white);
}
.qty-btn {
    border: none; background: none;
    width: 40px; height: 100%;
    cursor: pointer; font-size: 1.1rem;
    transition: var(--transition-fast);
    display: flex; align-items: center; justify-content: center;
}
.qty-btn:hover { background-color: var(--border-light); }
.qty-input {
    border: none; width: 50px; height: 100%;
    text-align: center; font-weight: 700;
    font-size: 1rem; outline: none;
}
.btn-purchase {
    flex-grow: 1; border: none;
    border-radius: 30px; font-weight: 700;
    cursor: pointer; font-size: 0.95rem;
    text-transform: uppercase; letter-spacing: 1px;
    height: 50px;
    transition: var(--transition-smooth);
    display: flex; align-items: center;
    justify-content: center; gap: 8px;
}
.btn-cart  { background-color: var(--bg-white); border: 2px solid var(--brand-dark); color: var(--brand-dark); }
.btn-cart:hover  { background-color: var(--brand-dark); color: var(--bg-white); }
.btn-buy   { background-color: var(--brand-primary); color: var(--brand-dark); box-shadow: var(--shadow-gold); }
.btn-buy:hover   { background-color: var(--brand-accent); color: var(--bg-white); }

/* ── Description Box ───────────────────────────────────────── */
.desc-box {
    margin-top: 3rem;
    margin-bottom: 4rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.desc-box-header {
    background-color: #e5e7eb;
    padding: 1rem 2rem;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #d1d5db;
}
.desc-box-body {
    background-color: #f3f3f3;
    padding: 2rem;
}
.desc-box-body h4 {
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}
.product-info-content {
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}
.product-info-content ul { list-style-type: disc; margin-left: 1.5rem; margin-bottom: 1rem; }
.product-info-content li { margin-bottom: 0.25rem; }
.product-dims-content { color: #6b7280; font-size: 0.9rem; margin-bottom: 2rem; }
.product-warranty-content { color: #6b7280; font-size: 0.9rem; }

/* ── Related Products Section ──────────────────────────────── */
.related-section {
    margin-top: 5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 4rem;
}

/* ── Cart Toast Notification ───────────────────────────────── */
.cart-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #121212;
    color: #ffffff;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border-left: 4px solid #c5a880;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: sans-serif;
    font-size: 0.95rem;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.35s ease, transform 0.35s ease;
    pointer-events: none;
}
.cart-toast--visible { opacity: 1; transform: translateY(0); }
.cart-toast-icon { color: #c5a880; }

/* ── Animations ────────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}