/* ============================================
   Luxury Fabric Catalog - Elegant Design
   ============================================ */

/* Google Fonts - Add Playfair Display for headings */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&display=swap');

:root {
    /* Luxury color palette */
    --color-primary: #b8860b;
    --color-primary-hover: #996f0a;
    --color-primary-light: rgba(184, 134, 11, 0.1);
    --color-primary-muted: #d4af37;

    --color-secondary: #6b7280;
    --color-success: #059669;
    --color-warning: #d97706;
    --color-danger: #dc2626;

    /* Warm, elegant backgrounds */
    --color-bg: #faf9f7;
    --color-bg-warm: #f5f3ef;
    --color-bg-card: #ffffff;
    --color-bg-sidebar: #ffffff;
    --color-bg-modal: #ffffff;
    --color-bg-header: #1a1a1a;

    /* Sophisticated text colors */
    --color-text: #1f1f1f;
    --color-text-secondary: #525252;
    --color-text-muted: #9ca3af;
    --color-text-light: #ffffff;

    /* Refined borders */
    --color-border: #e5e5e5;
    --color-border-light: #f0eeea;
    --color-border-gold: rgba(184, 134, 11, 0.2);

    /* Elegant shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.06);
    --shadow-gold: 0 4px 20px rgba(184, 134, 11, 0.15);

    /* Refined corners */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 10px;
    --radius-xl: 14px;

    --header-height: 72px;
    --sidebar-width: 300px;

    /* Smooth transitions */
    --transition-fast: 180ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 280ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    /* Prevent horizontal scroll */
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    /* Prevent horizontal scroll */
    width: 100%;
}

/* ============================================
   Header - Dark & Elegant
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--color-bg-header);
    z-index: 100;
    border-bottom: 1px solid rgba(184, 134, 11, 0.3);
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-primary-muted), transparent);
}

.header-content {
    max-width: 1800px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--color-text-light);
}

.logo-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-muted));
    color: white;
    font-weight: 600;
    font-size: 20px;
    border-radius: var(--radius-md);
    letter-spacing: -0.5px;
    box-shadow: var(--shadow-gold);
}

.logo-text {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 600;
    font-size: 24px;
    letter-spacing: 0.02em;
    color: var(--color-text-light);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-left: auto;
    margin-right: 24px;
}

.header-nav .nav-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.header-nav .nav-link:hover {
    color: var(--color-primary-muted);
}

.header-stats {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.03em;
}

.header-stats span {
    font-weight: 600;
    color: var(--color-primary-muted);
}

.mobile-filter-btn {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    letter-spacing: 0.02em;
}

.mobile-filter-btn:hover {
    background: var(--color-primary-hover);
    box-shadow: var(--shadow-gold);
}

/* ============================================
   Main Content Layout
   ============================================ */
.main-content {
    display: flex;
    max-width: 1800px;
    margin: 0 auto;
    padding-top: var(--header-height);
    min-height: 100vh;
}

/* ============================================
   Sidebar - Clean & Refined
   ============================================ */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--color-bg-sidebar);
    border-right: 1px solid var(--color-border-light);
    overflow-y: auto;
    padding: 28px;
    z-index: 90;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-border-light);
}

.sidebar-header h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: 0.02em;
}

.close-sidebar {
    display: none;
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast);
}

.close-sidebar:hover {
    color: var(--color-text);
}

/* Search - Elegant Input */
.search-wrapper {
    position: relative;
    margin-bottom: 8px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 12px 14px 12px 44px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--color-text);
    background: var(--color-bg-warm);
    transition: all var(--transition-fast);
    letter-spacing: 0.01em;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    background: var(--color-bg-card);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.search-input::placeholder {
    color: var(--color-text-muted);
}

/* Filter Sections */
.filter-section {
    margin-bottom: 28px;
}

.filter-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 14px;
}

.filter-count {
    font-size: 10px;
    font-weight: 500;
    padding: 3px 10px;
    background: var(--color-bg-warm);
    border-radius: 20px;
    color: var(--color-text-muted);
    letter-spacing: 0.02em;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 220px;
    overflow-y: auto;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
}

.filter-option:hover {
    background: var(--color-bg-warm);
}

.filter-option input {
    width: 16px;
    height: 16px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.filter-option label {
    flex: 1;
    font-size: 14px;
    color: var(--color-text);
    cursor: pointer;
    letter-spacing: 0.01em;
}

.filter-option-count {
    font-size: 12px;
    color: var(--color-text-muted);
    background: var(--color-bg-warm);
    padding: 2px 10px;
    border-radius: 12px;
}

/* Color Filter Options - Elegant Pills */
.color-filter-options {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    gap: 8px;
    max-height: 280px;
}

.color-filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 24px;
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
    background: var(--color-bg-warm);
    border: 1px solid transparent;
    font-size: 13px;
}

.color-filter-option:hover {
    border-color: var(--color-border);
    background: var(--color-bg-card);
    box-shadow: var(--shadow-sm);
}

.color-filter-option.selected {
    background: var(--color-primary-light);
    border-color: var(--color-primary);
    color: var(--color-primary-hover);
}

.color-filter-option input {
    display: none;
}

.color-filter-option .color-name {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.color-filter-option .color-circle {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid;
    flex-shrink: 0;
}

.color-filter-option .color-count {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-left: auto;
}

/* Small color circle for modal swatches */
.color-circle-small {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid;
    margin-right: 4px;
    vertical-align: middle;
}

/* Feature Filter Options - Refined Tags */
.feature-filter-options {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    gap: 8px;
    max-height: 280px;
}

.feature-filter-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 24px;
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
    background: var(--color-bg-warm);
    border: 1px solid transparent;
    font-size: 12px;
}

.feature-filter-option:hover {
    border-color: var(--color-border);
    background: var(--color-bg-card);
    box-shadow: var(--shadow-sm);
}

.feature-filter-option.selected {
    background: rgba(5, 150, 105, 0.1);
    border-color: var(--color-success);
    color: var(--color-success);
}

.feature-filter-option input {
    display: none;
}

.feature-filter-option .feature-name {
    font-size: 12px;
    font-weight: 500;
}

.feature-filter-option .feature-icon {
    width: 16px;
    height: 16px;
}

/* Clear Filters Button - Subtle */
.clear-filters-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    letter-spacing: 0.02em;
}

.clear-filters-btn:hover {
    background: rgba(220, 38, 38, 0.05);
    border-color: var(--color-danger);
    color: var(--color-danger);
}

/* ============================================
   Products Section
   ============================================ */
.products-section {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px;
    min-height: calc(100vh - var(--header-height));
    background: var(--color-bg);
}

/* Active Filters - Elegant Tags */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
    min-height: 0;
}

.active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--color-primary-light);
    color: var(--color-primary-hover);
    border-radius: 24px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.01em;
    border: 1px solid var(--color-border-gold);
}

.active-filter-tag button {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    padding: 2px;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.active-filter-tag button:hover {
    background: rgba(184, 134, 11, 0.2);
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 100px 20px;
    color: var(--color-text-secondary);
}

.spinner {
    width: 44px;
    height: 44px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 100px 20px;
    color: var(--color-text-secondary);
    text-align: center;
}

.empty-state svg {
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.empty-state h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text);
}

.empty-state p {
    font-size: 14px;
    max-width: 320px;
    line-height: 1.6;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
}

/* Product Card - Elegant & Refined */
.product-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border-light);
    cursor: pointer;
    transition: all var(--transition-normal);
}

@media (hover: hover) {
    .product-card:hover {
        transform: translateY(-6px);
        box-shadow: var(--shadow-lg);
        border-color: var(--color-border);
    }
}

.product-card:active {
    transform: scale(0.98);
    transition: transform 0.1s;
}

.product-image {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--color-bg-warm);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

@media (hover: hover) {
    .product-card:hover .product-image img {
        transform: scale(1.04);
    }
}

.product-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-bg-warm) 0%, var(--color-border-light) 100%);
    color: var(--color-text-muted);
}

.product-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 6px 14px;
    background: rgba(26, 26, 26, 0.85);
    color: white;
    font-size: 10px;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    backdrop-filter: blur(4px);
}

.product-color-count {
    position: absolute;
    bottom: 14px;
    right: 14px;
    padding: 6px 14px;
    background: var(--color-primary);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: var(--shadow-gold);
    letter-spacing: 0.02em;
}

.product-color-count svg {
    width: 12px;
    height: 12px;
}

.product-info {
    padding: 20px;
}

.product-category {
    font-size: 10px;
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 8px;
}

.product-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 6px;
    line-height: 1.3;
    letter-spacing: 0.01em;
}

.product-manufacturer {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-bottom: 14px;
}

.product-properties {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.product-property-tag {
    font-size: 11px;
    padding: 5px 10px;
    background: var(--color-bg-warm);
    color: var(--color-text-secondary);
    border-radius: 4px;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

/* ============================================
   Modal - Sophisticated Design
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal {
    position: relative;
    width: 100%;
    max-width: 1200px;
    max-height: 90vh;
    background: var(--color-bg-modal);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    transform: scale(0.96);
    transition: transform var(--transition-normal);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-warm);
    border: 1px solid var(--color-border-light);
    border-radius: 50%;
    color: var(--color-text-secondary);
    cursor: pointer;
    z-index: 10;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--color-bg-card);
    border-color: var(--color-border);
    color: var(--color-text);
    transform: rotate(90deg);
}

.modal-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 90vh;
}

/* Modal Left Panel */
.modal-left {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: 90vh;
}

/* Modal Gallery */
.modal-gallery {
    background: var(--color-bg-warm);
    padding: 28px;
    flex-shrink: 0;
}

.modal-main-image {
    position: relative;
    aspect-ratio: 4/3;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-border-light);
    box-shadow: var(--shadow-md);
}

.modal-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-current-color {
    position: absolute;
    bottom: 14px;
    left: 14px;
    padding: 8px 18px;
    background: rgba(26, 26, 26, 0.85);
    color: white;
    font-size: 13px;
    font-weight: 500;
    border-radius: 24px;
    backdrop-filter: blur(8px);
    letter-spacing: 0.02em;
}

/* Modal Details */
.modal-details {
    padding: 28px;
    flex: 1;
    overflow-y: auto;
}

/* Modal Right Panel - Color Grid */
.modal-right {
    background: var(--color-bg-warm);
    border-left: 1px solid var(--color-border-light);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-colors-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border-light);
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.modal-color-count {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 500;
    padding: 5px 12px;
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-radius: 16px;
    letter-spacing: 0.02em;
}

.modal-color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    grid-auto-rows: min-content;
    gap: 12px;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 0;
    min-height: 0;
}

.color-swatch {
    display: block;
    cursor: pointer;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid transparent;
    background: var(--color-bg-card);
    transition: all var(--transition-fast);
}

.color-swatch:hover {
    border-color: var(--color-border);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.color-swatch.active {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-gold);
}

.color-swatch-image {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
    background: var(--color-border-light);
}

.color-swatch-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.color-swatch:hover .color-swatch-image img {
    transform: scale(1.05);
}

.color-swatch-name {
    padding: 10px;
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: var(--color-bg-card);
    letter-spacing: 0.01em;
}

.modal-header {
    margin-bottom: 24px;
}

.modal-category {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 10px;
}

.modal-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 32px;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.2;
    margin-bottom: 10px;
    letter-spacing: 0.01em;
}

.modal-manufacturer {
    font-size: 14px;
    color: var(--color-text-secondary);
}

.modal-description {
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.8;
    margin-bottom: 28px;
}

.modal-properties {
    margin-bottom: 24px;
}

/* Modal Features (Pictogram badges) */
.modal-features {
    margin-bottom: 28px;
}

.modal-features-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 14px;
}

.modal-features-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.modal-feature-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(5, 150, 105, 0.1);
    color: var(--color-success);
    border-radius: 24px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.modal-feature-badge img {
    width: 16px;
    height: 16px;
}

.modal-property {
    display: flex;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--color-border-light);
}

.modal-property:last-child {
    border-bottom: none;
}

.modal-property-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
}

.modal-property-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text);
    text-align: right;
    max-width: 60%;
}

.modal-source-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: var(--color-primary);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
    letter-spacing: 0.02em;
    box-shadow: var(--shadow-gold);
}

.modal-source-link:hover {
    background: var(--color-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(184, 134, 11, 0.25);
}

/* ============================================
   Lightbox - Immersive
   ============================================ */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.96);
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.lightbox-overlay.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-content img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
}

.lightbox-color-name {
    margin-top: 20px;
    padding: 10px 24px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
    font-weight: 500;
    border-radius: 24px;
    backdrop-filter: blur(8px);
    letter-spacing: 0.02em;
}

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 10;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1) rotate(90deg);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 24px;
}

.lightbox-next {
    right: 24px;
}

/* Make modal main image clickable */
.modal-main-image {
    cursor: zoom-in;
}

.modal-main-image img {
    cursor: zoom-in;
}

@media (max-width: 768px) {
    .lightbox-nav {
        width: 48px;
        height: 48px;
    }

    .lightbox-prev {
        left: 12px;
    }

    .lightbox-next {
        right: 12px;
    }

    .lightbox-close {
        top: 12px;
        right: 12px;
        width: 44px;
        height: 44px;
    }
}

/* ============================================
   Admin Panel - Link Generator
   ============================================ */
.admin-panel {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.admin-panel-content {
    background: var(--color-bg-card);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 28px;
}

.admin-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.admin-panel-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0;
}

.admin-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--color-text-muted);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.admin-close:hover {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
}

.admin-description {
    color: var(--color-text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

.admin-categories {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.admin-category-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: var(--color-text-primary);
}

.admin-category-btn:hover {
    border-color: var(--color-primary);
    background: var(--color-bg-hover);
}

.admin-category-btn.active {
    border-color: var(--color-primary);
    background: rgba(59, 130, 246, 0.1);
}

.admin-category-btn .count {
    color: var(--color-text-muted);
    font-size: 12px;
}

.admin-result {
    background: var(--color-bg);
    border-radius: 10px;
    padding: 16px;
}

.admin-result label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
}

.admin-link-wrapper {
    display: flex;
    gap: 8px;
}

.admin-link-wrapper input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 13px;
    font-family: monospace;
    background: var(--color-bg-card);
    color: var(--color-text-primary);
}

.admin-copy-btn {
    padding: 10px 16px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.admin-copy-btn:hover {
    background: var(--color-primary-hover);
}

.admin-copy-success {
    color: #10b981;
    font-size: 13px;
    margin-top: 8px;
    margin-bottom: 0;
}

/* ============================================
   Footer - Subtle & Refined
   ============================================ */
.footer {
    background: linear-gradient(to bottom, var(--color-bg-card), var(--color-bg));
    border-top: 1px solid var(--color-border-light);
    margin-left: var(--sidebar-width);
}

.footer-promo {
    position: relative;
    padding: 60px 28px;
    background:
        linear-gradient(to right, rgba(41, 37, 30, 0.95), rgba(41, 37, 30, 0.75)),
        url('https://images.unsplash.com/photo-1555041469-a586c61ea9bc?w=1920&q=80') center/cover no-repeat;
    overflow: hidden;
}

.footer-promo::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-primary-muted), transparent);
}

.footer-promo-content {
    position: relative;
    max-width: 680px;
    margin: 0 auto;
    text-align: center;
    z-index: 1;
}

.promo-label {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-primary-muted);
    margin-bottom: 16px;
}

.promo-text {
    color: white;
    font-size: 22px;
    font-weight: 300;
    line-height: 1.5;
    margin: 0 0 8px 0;
}

.promo-text strong {
    font-weight: 600;
    color: var(--color-primary-muted);
}

.promo-subtext {
    color: rgba(255, 255, 255, 0.6);
    font-size: 15px;
    font-weight: 300;
    margin: 0 0 28px 0;
}

.promo-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    color: white;
    padding: 14px 32px;
    border: 1px solid rgba(212, 175, 55, 0.6);
    border-radius: 4px;
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.03em;
    text-decoration: none;
    transition: all 0.3s ease;
}

.promo-btn:hover {
    background: var(--color-primary-muted);
    border-color: var(--color-primary-muted);
    color: #29251e;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.25);
}

.promo-btn svg {
    transition: transform 0.3s ease;
}

.promo-btn:hover svg {
    transform: translateX(4px);
}

.footer-content {
    padding: 24px 28px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    color: var(--color-text-muted);
    font-size: 13px;
    letter-spacing: 0.02em;
}

.footer-content p {
    margin: 0;
}

.footer-content a {
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-content a:hover {
    color: var(--color-primary);
}

@media (max-width: 600px) {
    .footer-content {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 20px;
    }

    .modal-content {
        grid-template-columns: 1fr;
        height: auto;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-left {
        flex-shrink: 0;
        max-height: none;
        overflow-y: visible;
    }

    .modal-right {
        border-left: none;
        border-top: 1px solid var(--color-border-light);
        min-height: 350px;
        max-height: 450px;
        flex-shrink: 0;
    }

    .modal-color-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 64px;
    }

    .header-stats {
        display: none;
    }

    /* Mobile header spacing fix */
    .header-nav {
        margin-left: 16px;
        margin-right: 12px;
        gap: 16px;
    }

    .header-nav .nav-link {
        font-size: 13px;
    }

    .mobile-filter-btn {
        display: flex;
    }

    .sidebar {
        position: fixed;
        left: -100%;
        width: 100%;
        max-width: 340px;
        transition: left var(--transition-normal);
        z-index: 150;
    }

    .sidebar.active {
        left: 0;
    }

    .close-sidebar {
        display: block;
    }

    .products-section {
        margin-left: 0;
        padding: 16px;
        /* Reduced padding for more space */
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
        /* Allow 2 columns on small screens */
        gap: 12px;
        /* Slightly tighter gap */
    }

    .product-info {
        padding: 14px;
    }

    .product-title {
        font-size: 15px;
    }

    .product-properties {
        display: none;
    }

    .footer {
        margin-left: 0;
    }

    .footer-promo {
        padding: 40px 20px;
    }

    .promo-label {
        font-size: 10px;
    }

    .promo-text {
        font-size: 18px;
    }

    .promo-subtext {
        font-size: 14px;
    }

    .promo-btn {
        padding: 12px 24px;
        font-size: 13px;
        width: 100%;
        justify-content: center;
    }

    /* Mobile Modal - Full Screen, Single Scroll */
    .modal {
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
        overflow: hidden;
        /* Don't scroll the container */
        display: flex;
        flex-direction: column;
    }

    .modal-overlay {
        padding: 0;
    }

    .modal-content {
        display: block;
        flex: 1;
        /* Fill remaining space */
        height: 100%;
        max-height: none;
        overflow-y: auto;
        /* Scroll content explicitly */
        -webkit-overflow-scrolling: touch;
    }

    .modal-close {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
        background: rgba(255, 255, 255, 0.95);
        box-shadow: var(--shadow-md);
        z-index: 10;
    }

    /* Mobile Modal Left - Product Info */
    .modal-left {
        display: block;
        max-height: none;
        overflow: visible;
    }

    .modal-gallery {
        padding: 16px;
    }

    .modal-main-image {
        aspect-ratio: 16/10;
    }

    .modal-details {
        padding: 20px;
    }

    .modal-title {
        font-size: 22px;
    }

    .modal-header {
        margin-bottom: 16px;
    }

    .modal-description {
        margin-bottom: 16px;
    }

    .modal-features {
        margin-bottom: 16px;
    }

    .modal-source-link {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
    }

    /* Mobile Modal Right - Color Grid */
    .modal-right {
        display: block;
        min-height: auto;
        max-height: none;
        border-top: 1px solid var(--color-border-light);
        overflow: visible;
        padding-bottom: 40px;
    }

    .modal-colors-title {
        padding: 16px 20px;
        font-size: 14px;
    }

    .modal-color-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        padding: 16px;
        padding-bottom: 30px;
        overflow: visible;
        max-height: none;
    }

    .color-swatch-name {
        padding: 8px 6px;
        font-size: 10px;
    }

    .logo-text {
        font-size: 20px;
    }
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 140;
}

.sidebar-overlay.active {
    display: block;
}

@media (max-width: 768px) {
    body.sidebar-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
    }
}

/* ============================================
   Extra Small Mobile (480px and below)
   ============================================ */
@media (max-width: 480px) {
    .header-content {
        padding: 0 12px;
    }

    .logo {
        gap: 8px;
    }

    .logo-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .logo-text {
        font-size: 16px;
    }

    .header-nav {
        margin-left: 12px;
        margin-right: 8px;
        gap: 12px;
    }

    .header-nav .nav-link {
        font-size: 12px;
    }

    .mobile-filter-btn {
        padding: 8px 14px;
        font-size: 12px;
    }
}

/* ============================================
   Very Small Mobile (360px and below)
   ============================================ */
@media (max-width: 360px) {
    .logo-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .logo-text {
        font-size: 14px;
    }

    .header-nav {
        margin-left: 8px;
        gap: 8px;
    }

    .header-nav .nav-link {
        font-size: 11px;
    }

    .mobile-filter-btn {
        padding: 6px 10px;
        font-size: 11px;
        gap: 4px;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {

    .header,
    .sidebar,
    .modal-overlay,
    .footer {
        display: none;
    }

    .products-section {
        margin-left: 0;
    }

    .product-card {
        break-inside: avoid;
    }
}