:root {
    --bg-color: #f8f9fc;
    --text-color: #1a1a2e;
    --header-bg: #ffffff;
    --card-bg: #ffffff;
    --border-color: #e0e4f0;
    --primary-color: #6366f1;
    /* Vibrant indigo */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --hover-color: #4f46e5;
    --tag-bg: #f1f5f9;
    --shadow-light: rgba(99, 102, 241, 0.08);
    --shadow-medium: rgba(99, 102, 241, 0.15);
    --shadow-strong: rgba(99, 102, 241, 0.25);

    /* ─── SEMANTIC MAPPINGS (for shared components) ─── */
    --bg-base: var(--bg-color);
    --bg-card: var(--card-bg);
    --text-primary: var(--text-color);
    --text-secondary: #64748b;
    --accent: var(--primary-color);
}

[data-theme="dark"] {
    --bg-color: #0f0f1e;
    --text-color: #e5e7eb;
    --header-bg: #1a1a2e;
    --card-bg: #1e1e2e;
    --border-color: #2a2a3e;
    --primary-color: #818cf8;
    --primary-gradient: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
    --secondary-gradient: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);
    --accent-gradient: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    --hover-color: #a78bfa;
    --tag-bg: #2a2a3e;
    --shadow-light: rgba(129, 140, 248, 0.15);
    --shadow-medium: rgba(129, 140, 248, 0.25);
    --shadow-strong: rgba(129, 140, 248, 0.35);

    /* Semantic Mappings */
    --text-secondary: #94a3b8;
}

[data-theme="brown"] {
    --bg-color: #f5f1ed;
    --text-color: #2d1f1a;
    --header-bg: #faf7f4;
    --card-bg: #ffffff;
    --border-color: #e8ddd4;
    --primary-color: #8b5a3c;
    --primary-gradient: linear-gradient(135deg, #a06b4a 0%, #7d4e2d 100%);
    --secondary-gradient: linear-gradient(135deg, #d4a574 0%, #b8865f 100%);
    --accent-gradient: linear-gradient(135deg, #c9a882 0%, #a67c52 100%);
    --hover-color: #6d4428;
    --tag-bg: #f0e6dc;
    --shadow-light: rgba(139, 90, 60, 0.08);
    --shadow-medium: rgba(139, 90, 60, 0.15);
    --shadow-strong: rgba(139, 90, 60, 0.25);

    /* Semantic Mappings */
    --text-secondary: #8c7a6b;
}

/* Global Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden;
    width: 100%;
}

html {
    overflow-x: hidden;
    width: 100%;
}

/* Header */
header {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 40px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px var(--shadow-light);
    backdrop-filter: blur(10px);
    background: var(--header-bg);
    opacity: 0.98;
}

[data-theme="dark"] header {
    background: rgba(17, 17, 17, 0.97);
    border-bottom: 1px solid #2A2A2A;
    box-shadow: 0 1px 0 #2A2A2A;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--primary-color);
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: var(--bg-color);
    border-radius: 8px;
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    width: 400px;
}

.search-bar input {
    border: none;
    background: transparent;
    color: var(--text-color);
    padding: 0 10px;
    flex-grow: 1;
    font-size: 1em;
}

.search-bar input:focus {
    outline: none;
}

.search-bar i {
    color: var(--text-color);
    opacity: 0.6;
}

.actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.add-product-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow-light);
}

.add-product-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--shadow-medium);
}

/* Build PC Button */
.build-pc-btn {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.build-pc-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 25px var(--shadow-medium);
}

.build-pc-btn i {
    font-size: 1.1em;
}


/* Theme Toggle Dropdown */
.theme-toggle {
    position: relative;
}

#theme-toggle-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.2em;
    padding: 10px;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color 0.2s;
}

#theme-toggle-btn:hover {
    background-color: var(--tag-bg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow-light);
    overflow: hidden;
    width: 120px;
    padding: 5px 0;
}

.dropdown-menu button {
    display: block;
    width: 100%;
    padding: 10px 15px;
    text-align: left;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.dropdown-menu button:hover {
    background-color: var(--tag-bg);
}

.dropdown-menu button.theme-active {
    background-color: var(--tag-bg);
    color: var(--primary-color);
    font-weight: 700;
}

.dropdown-menu button.theme-active::after {
    content: '✓';
    float: right;
    font-size: 12px;
}

/* Specific button colors in the dropdown for better visibility */
.dropdown-menu button[data-theme="light"] {
    color: #1a1a2e;
}

.dropdown-menu button[data-theme="dark"] {
    color: #e5e7eb;
}

.dropdown-menu button[data-theme="brown"] {
    color: #8b5a3c;
}

[data-theme="dark"] .dropdown-menu {
    background-color: #1A1A1A;
    border-color: #2A2A2A;
}

/* User Profile Icon & Dropdown Panel */
.profile-container {
    position: relative;
}

.profile-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--card-bg);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.profile-icon:hover {
    transform: scale(1.05);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px var(--shadow-light);
}

.profile-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-initials {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
}

/* Profile Upload Overlay */
.profile-upload-overlay {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 11px;
    cursor: pointer;
    border: 2px solid var(--card-bg);
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.profile-icon:hover .profile-upload-overlay {
    opacity: 1;
    transform: scale(1);
}

.profile-upload-overlay:hover {
    background: var(--hover-color);
    transform: scale(1.1) !important;
}

/* Profile Dropdown Panel */
.profile-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 360px;
    max-height: 80vh;
    overflow-y: auto;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 8px 32px var(--shadow-medium);
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
}

.profile-dropdown:not(.hidden) {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

/* Custom Scrollbar for Profile Dropdown */
.profile-dropdown::-webkit-scrollbar {
    width: 6px;
}

.profile-dropdown::-webkit-scrollbar-track {
    background: var(--tag-bg);
    border-radius: 10px;
}

.profile-dropdown::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.profile-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--hover-color);
}

/* Profile Header Section */
.profile-header {
    padding: 24px;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    gap: 16px;
    border-radius: 16px 16px 0 0;
}

.dropdown-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    object-fit: cover;
    background: rgba(255, 255, 255, 0.2);
}

.profile-info {
    flex: 1;
}

.profile-greeting {
    font-size: 14px;
    opacity: 0.9;
    margin: 0 0 4px 0;
    font-weight: 500;
}

.profile-name {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Profile Menu */
.profile-menu {
    padding: 12px 0;
}

.profile-menu-section {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.profile-menu-section:last-child {
    border-bottom: none;
}

.section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-color);
    opacity: 0.6;
    padding: 8px 20px 4px;
    margin: 0;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 15px;
}

.profile-menu-item:hover {
    background: var(--tag-bg);
    color: var(--primary-color);
}

.profile-menu-item i {
    font-size: 18px;
    width: 20px;
    text-align: center;
    color: var(--primary-color);
    opacity: 0.8;
}

.profile-menu-item:hover i {
    opacity: 1;
    transform: scale(1.1);
}

.menu-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.menu-item-title {
    font-weight: 600;
    font-size: 15px;
}

.menu-item-desc {
    font-size: 12px;
    opacity: 0.7;
    color: var(--text-color);
}

.profile-menu-item .fa-chevron-right {
    font-size: 14px;
    opacity: 0.4;
    margin-left: auto;
}

.profile-menu-item:hover .fa-chevron-right {
    opacity: 0.8;
    transform: translateX(3px);
}

/* Logout Button Special Styling */
.logout-btn {
    color: #ef4444;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.logout-btn i {
    color: #ef4444;
}

.logout-btn:hover i {
    color: #dc2626;
}

.hidden {
    display: none;
}

/* Hero Section */
.hero-section {
    background: var(--primary-gradient);
    padding: 80px 40px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-text {
    color: white;
    z-index: 2;
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.hero-title {
    font-size: 3.5em;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.2;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.hero-description {
    font-size: 1.2em;
    margin-bottom: 30px;
    opacity: 0.95;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 40px;
}

.hero-btn {
    padding: 14px 32px;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.hero-btn.primary {
    background: white;
    color: var(--primary-color);
}

.hero-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

.hero-btn.secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
    backdrop-filter: blur(10px);
}

.hero-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.hero-stats {
    display: flex;
    gap: 40px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2em;
    font-weight: 800;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9em;
    opacity: 0.9;
}

/* Hero Visual Elements */
.hero-visual {
    position: relative;
    height: 400px;
    z-index: 1;
}

.floating-card {
    position: absolute;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    padding: 20px 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-weight: 600;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    animation: float 3s ease-in-out infinite;
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.floating-card:hover {
    transform: translateZ(20px) scale(1.05);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.floating-card i {
    font-size: 1.5em;
}

.floating-card.card-1 {
    top: 50px;
    left: 50px;
    animation-delay: 0s;
}

.floating-card.card-2 {
    top: 180px;
    right: 80px;
    animation-delay: 1s;
}

.floating-card.card-3 {
    bottom: 80px;
    left: 120px;
    animation-delay: 2s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px) translateZ(0);
    }

    50% {
        transform: translateY(-20px) translateZ(10px);
    }
}

.hero-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    animation: pulse 4s ease-in-out infinite;
}

.hero-circle.circle-1 {
    width: 300px;
    height: 300px;
    top: -100px;
    right: -50px;
    animation-delay: 0s;
}

.hero-circle.circle-2 {
    width: 200px;
    height: 200px;
    bottom: -50px;
    right: 150px;
    animation-delay: 2s;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.3;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.5;
    }
}


/* Main Layout */
.container {
    display: flex;
    max-width: 1400px;
    margin: 20px auto 40px;
    padding: 0 40px;
    gap: 30px;
}

/* Sidebar (Filters) */
.sidebar {
    width: 250px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
    height: fit-content;
}

.mobile-filter-toggle {
    display: none;
}

.mobile-sidebar-actions {
    display: none;
}

/* Clear All Filters Button */
.clear-all-filters-btn {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.clear-all-filters-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.clear-all-filters-btn:active {
    transform: translateY(0);
}

[data-theme="dark"] .clear-all-filters-btn {
    background: linear-gradient(135deg, #E50914 0%, #B20710 100%);
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.35);
}

.filter-section {
    margin-bottom: 20px;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 2px 10px var(--shadow-light);
    transition: all 0.3s ease;
}

.filter-section:hover {
    box-shadow: 0 4px 15px var(--shadow-light);
}

.filter-section:last-child {
    margin-bottom: 0;
}

.filter-section h3 {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 15px;
}

.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.collapsible-header:hover {
    color: var(--primary-color);
}

.collapsible-header i {
    transition: transform 0.3s ease;
}

.collapsible-header i.fa-chevron-down {
    transform: rotate(0deg);
}

.collapsible-header i.fa-chevron-up {
    transform: rotate(180deg);
}

.filter-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

/* Custom Checkbox Style */
.checkbox-container {
    display: block;
    position: relative;
    padding-left: 25px;
    padding: 8px 8px 8px 25px;
    margin-bottom: 2px;
    cursor: pointer;
    font-size: 0.95em;
    user-select: none;
    font-weight: 400;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.checkbox-container:hover {
    background: var(--tag-bg);
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkbox-container:before {
    content: '';
    position: absolute;
    top: 10px;
    left: 8px;
    height: 14px;
    width: 14px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    transition: background-color 0.2s, border-color 0.2s;
}

.checkbox-container:has(input:checked):before {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-container:after {
    content: "\f00c";
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 10px;
    color: white;
    display: none;
}

.checkbox-container:has(input:checked):after {
    display: block;
}

.checkbox-container:has(input:checked) {
    font-weight: 600;
    color: var(--primary-color);
}

/* Price Range Slider */
.price-slider-container {
    padding-top: 5px;
}

#price-range-slider {
    width: 100%;
    margin-bottom: 10px;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--border-color);
    border-radius: 5px;
}

#price-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid var(--card-bg);
    box-shadow: 0 0 0 1px var(--primary-color);
}

.price-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    color: var(--text-color);
    opacity: 0.7;
}

/* Content Area */
.content {
    flex-grow: 1;
}

.trending-section {
    margin-bottom: 40px;
}

.trending-section h2 {
    font-size: 1.8em;
    margin-bottom: 5px;
}

.trending-section p {
    color: var(--text-color);
    opacity: 0.7;
    margin-bottom: 20px;
}

.trending-products {
    display: flex;
    align-items: center;
    gap: 10px;
}

.product-carousel {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    scroll-snap-type: x mandatory;
    padding-bottom: 10px;
}

.product-carousel::-webkit-scrollbar {
    display: none;
}

.slider-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.2em;
    cursor: pointer;
    padding: 10px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.slider-btn:hover {
    opacity: 1;
}


/* Product Card - Base */
.product-card {
    background-color: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow-light);
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    transform-style: preserve-3d;
    perspective: 1000px;
    height: 480px;
    /* Fixed height for consistency */
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.4s ease;
    border-radius: 16px;
    z-index: 0;
}

.product-card:hover::before {
    opacity: 0.03;
}

.product-card:hover {
    transform: translateY(-8px) rotateX(2deg);
    box-shadow: 0 12px 40px var(--shadow-medium);
}

.product-card.trending {
    width: 280px;
    /* Slightly wider for better proportions */
    height: 450px;
    flex-shrink: 0;
    scroll-snap-align: start;
}

.product-image-container {
    height: 220px;
    width: 100%;
    overflow: hidden;
    position: relative;
    background: #f0f0f0;
    flex-shrink: 0;
}

/* Removed trending override to maintain consistent 220px height */
/* .product-card.trending .product-image-container { height: 180px; } */

.product-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card .product-info {
    padding: 18px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.category-tag {
    font-size: 0.75em;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 8px;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--tag-bg);
    padding: 4px 10px;
    border-radius: 6px;
    align-self: flex-start;
    /* Prevent stretching */
}

.product-name {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    /* Limit to 2 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 2.8em;
    /* Fixed height for alignment */
    line-height: 1.4;
    color: var(--text-color);
}

.vendor-name {
    font-size: 0.85em;
    color: var(--text-color);
    opacity: 0.6;
    margin-bottom: auto;
    /* Pushes content below to the bottom */
    display: block;
}

.price-rating {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    margin-bottom: 15px;
}

.price {
    font-size: 1.25em;
    font-weight: 700;
    color: var(--text-color);
}

.original-price {
    font-size: 0.9em;
    color: #999;
    text-decoration: line-through;
    margin-left: 5px;
}

.rating {
    font-size: 0.9em;
    color: #f59e0b;
    display: flex;
    align-items: center;
    gap: 4px;
}

.add-to-cart-btn {
    width: 100%;
    background: var(--primary-color);
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.add-to-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-medium);
}

/* Discount Badge */
.product-card.has-discount .product-image-container {
    position: relative;
}

.discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #ff4d4d;
    color: white;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 0.75em;
    font-weight: 600;
}

/* Out of Stock Badge */
.product-card.out-of-stock .product-image-container {
    position: relative;
    opacity: 0.7;
}

.stock-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 0.9em;
    font-weight: 600;
    z-index: 10;
}

/* All Products Section */
.all-products-section h2 {
    font-size: 1.8em;
    margin-bottom: 5px;
}

.all-products-section p {
    color: var(--text-color);
    opacity: 0.7;
    margin-bottom: 20px;
}

.sort-bar {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    font-size: 0.9em;
}

.sort-label {
    font-weight: 600;
    margin-right: 10px;
}

.dropdown-sort {
    position: relative;
    display: inline-block;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.sort-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 8px 30px 8px 15px;
    font-size: 0.95em;
    border: none;
    background-color: transparent;
    color: var(--text-color);
    cursor: pointer;
}

.dropdown-icon {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-color);
    opacity: 0.6;
    font-size: 0.7em;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}


/* --- MODAL AND FORM STYLES (NEW) --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    z-index: 2000;
    overflow-y: auto;
    padding-top: 50px;
}

.modal.hidden {
    display: none;
}

.modal-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 40px 50px;
}

.form-title {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 5px;
}

.form-subtitle {
    font-size: 1.1em;
    color: var(--text-color);
    opacity: 0.7;
    margin-bottom: 30px;
}

.form-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 12px var(--shadow-light);
    margin-bottom: 25px;
}

.form-card h3 {
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 20px;
}

/* Vendor Verification Card Styling */
.vendor-verification .vendor-header {
    display: flex;
    align-items: center;
    color: #f7a900;
    margin-bottom: 10px;
}

.vendor-verification .vendor-header i {
    font-size: 1.8em;
    margin-right: 10px;
}

.vendor-verification p {
    margin-bottom: 25px;
    opacity: 0.8;
}

/* Form Layout */
#add-product-form {
    width: 100%;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.form-group {
    flex: 1;
}

.form-group.full-width {
    flex: none;
    width: 100%;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.form-group input:not([type="checkbox"]),
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 1em;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--primary-color);
}

.form-group textarea {
    resize: vertical;
}

/* Input Placeholder Text Style */
::placeholder {
    color: var(--text-color);
    opacity: 0.4;
}

/* Button Styles */
.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
}

.btn-confirm,
.btn-submit {
    background-color: var(--primary-color);
    color: white;
}

.btn-confirm:hover,
.btn-submit:hover {
    background-color: #4b4bd4;
}

.btn-submit {
    width: 200px;
    display: block;
    margin: 20px auto 0;
}

.form-actions-footer {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

/* Image Upload Section */
.image-upload-section p {
    color: var(--text-color);
    opacity: 0.7;
    margin-bottom: 15px;
}

.image-upload-box {
    width: 150px;
    height: 150px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: border-color 0.2s;
}

.image-upload-box:hover {
    border-color: var(--primary-color);
}

.image-upload-box i {
    font-size: 2.5em;
    color: var(--text-color);
    opacity: 0.5;
    margin-bottom: 5px;
}

.image-upload-box span {
    font-size: 0.9em;
    color: var(--text-color);
    opacity: 0.7;
}

/* Image Preview Container */
.image-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.image-preview-item {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--border-color);
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-item .remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.2s;
}

.image-preview-item .remove-image:hover {
    background: rgba(255, 0, 0, 1);
}

/* Custom Fields */
.form-custom-fields label {
    display: block;
    font-size: 1em;
    margin-bottom: 15px;
    cursor: pointer;
    color: var(--primary-color);
    font-weight: 600;
}

.form-custom-fields i {
    margin-right: 5px;
    font-size: 0.9em;
}

/* Footer in Modal */
.copyright-footer {
    text-align: center;
    font-size: 0.85em;
    color: var(--text-color);
    opacity: 0.5;
    margin-top: 50px;
}

/* Dropdown for Category (Reusing existing sort-select style) */

/* Horizontal Scrolling styles removed to enforce Grid layout matching All Products */

/* Pagination Controls */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 40px;
    margin-bottom: 20px;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
}

.pagination-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background-color: white;
    color: #333;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: #f0f9ff;
}

.pagination-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f5f5f5;
}

.pagination-dots {
    color: #999;
    padding: 0 5px;
}

.pagination-info {
    width: 100%;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    margin-top: 10px;
}

/* Cart Icon and Badge */
.cart-icon-link {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.cart-icon {
    position: relative;
    background: var(--tag-bg);
    color: var(--text-color);
    padding: 12px 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2em;
}

.cart-icon:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--shadow-medium);
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    font-size: 0.7em;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    padding: 2px 5px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.cart-badge.updating {
    animation: badgeUpdate 0.4s ease;
}

@keyframes badgeUpdate {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }
}

/* Add to Cart Button */
.add-to-cart-btn {
    width: 100%;
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px var(--shadow-light);
}

.add-to-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--shadow-medium);
}

.add-to-cart-btn:active {
    transform: scale(0.95);
}

.add-to-cart-btn i {
    font-size: 1.1em;
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    animation: slideInRight 0.4s ease;
    opacity: 0;
    transform: translateX(100%);
    pointer-events: none;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.toast-notification.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-notification i {
    font-size: 1.3em;
}

/* Product Card Filter Animations */
.product-card.filtering-out {
    animation: fadeOut 0.3s ease forwards;
}

.product-card.filtering-in {
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Popular Vendors Section */
.popular-vendors-section {
    margin-bottom: 50px;
}

.section-heading {
    margin-bottom: 30px;
}

.section-heading h2 {
    font-size: 1.8em;
    margin-bottom: 5px;
    color: var(--text-color);
}

.section-heading p {
    color: var(--text-color);
    opacity: 0.7;
    font-size: 1em;
}

.vendors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.vendor-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 20px var(--shadow-light);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    height: 480px;
    /* Aligned height */
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUp 0.6s ease forwards;
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.vendor-card:nth-child(1) {
    animation-delay: 0.1s;
}

.vendor-card:nth-child(2) {
    animation-delay: 0.2s;
}

.vendor-card:nth-child(3) {
    animation-delay: 0.3s;
}

.vendor-card:nth-child(4) {
    animation-delay: 0.4s;
}

.vendor-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 0;
}

.vendor-card:hover::before {
    opacity: 0.05;
}

.vendor-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 40px var(--shadow-medium);
}

.vendor-card>* {
    position: relative;
    z-index: 1;
}

.vendor-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2em;
    color: white;
    box-shadow: 0 4px 15px var(--shadow-medium);
    transition: transform 0.5s ease;
}

.vendor-card:hover .vendor-logo {
    transform: rotate(360deg) scale(1.1);
}

.vendor-name {
    font-size: 1.2em;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-color);
}

.vendor-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
    color: gold;
    font-weight: 600;
}

.vendor-stats {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
    padding: 15px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.vendor-stat {
    text-align: center;
}

.vendor-stat-value {
    display: block;
    font-size: 1.2em;
    font-weight: 700;
    color: var(--primary-color);
}

.vendor-stat-label {
    display: block;
    font-size: 0.85em;
    color: var(--text-color);
    opacity: 0.7;
    margin-top: 5px;
}

.visit-store-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow-light);
    width: 100%;
    margin-top: 15px;
}

.visit-store-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--shadow-medium);
}

/* New Arrivals Section */
.new-arrivals-section {
    margin-bottom: 50px;
}

.new-arrivals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.new-arrival-card {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow-light);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    height: 480px;
    /* Fixed height for consistency */
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.new-arrival-card:nth-child(1) {
    animation-delay: 0.1s;
}

.new-arrival-card:nth-child(2) {
    animation-delay: 0.2s;
}

.new-arrival-card:nth-child(3) {
    animation-delay: 0.3s;
}

.new-arrival-card:nth-child(4) {
    animation-delay: 0.4s;
}

.new-arrival-card:nth-child(5) {
    animation-delay: 0.5s;
}

.new-arrival-card:nth-child(6) {
    animation-delay: 0.6s;
}

.new-arrival-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 40px var(--shadow-medium);
}

.new-arrival-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, var(--tag-bg) 0%, var(--bg-color) 100%);
    flex-shrink: 0;
}

.new-arrival-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.new-arrival-card:hover .new-arrival-image img {
    transform: scale(1.15);
}

.new-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.new-arrival-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.new-arrival-category {
    font-size: 0.75em;
    color: var(--primary-color);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: inline-block;
}

.new-arrival-name {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 2.8em;
    line-height: 1.4;
}

.new-arrival-vendor {
    font-size: 0.9em;
    color: var(--text-color);
    opacity: 0.7;
    margin-bottom: 5px;
}

.new-arrival-date {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85em;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.new-arrival-date i {
    font-size: 0.9em;
}

.new-arrival-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.new-arrival-price {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--text-color);
}

.new-arrival-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    color: gold;
    font-weight: 600;
}

/* Responsive Design for New Sections */
@media (max-width: 768px) {
    .vendors-grid {
        grid-template-columns: 1fr;
    }

    .new-arrivals-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .section-heading h2 {
        font-size: 1.5em;
    }
}

/* Product Detail Modal Styles */
.product-detail-content {
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2em;
    cursor: pointer;
    z-index: 10;
    color: var(--text-color);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-btn:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: rotate(90deg);
}

.product-detail-grid {
    display: flex;
    flex-direction: row;
    height: 100%;
    overflow-y: auto;
}

.detail-image-gallery {
    flex: 1.2;
    background: var(--tag-bg);
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 400px;
}

.main-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-image-container img {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.2));
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.main-image-container img:hover {
    transform: scale(1.05);
}

.detail-info-section {
    flex: 1;
    padding: 40px;
    background: var(--card-bg);
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.detail-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.detail-category {
    font-size: 0.9em;
    color: var(--primary-color);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 8px;
    display: block;
}

.detail-title {
    font-size: 2.2em;
    font-weight: 800;
    margin: 5px 0 15px;
    color: var(--text-color);
    line-height: 1.2;
}

.detail-vendor {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-color);
    opacity: 0.8;
    font-size: 1.1em;
}

.detail-rating {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fbbf24;
    font-weight: 600;
    font-size: 1.2em;
}

.detail-price-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.detail-price {
    font-size: 2.5em;
    font-weight: 800;
    color: var(--text-color);
}

.stock-status {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9em;
}

.stock-status.in-stock {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.stock-status.out-of-stock {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.detail-description h3 {
    font-size: 1.2em;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-color);
}

.detail-description p {
    color: var(--text-color);
    line-height: 1.6;
    opacity: 0.8;
}

.detail-specs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    background: var(--tag-bg);
    padding: 20px;
    border-radius: 12px;
}

.spec-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.spec-label {
    font-size: 0.8em;
    color: var(--text-color);
    opacity: 0.6;
    text-transform: uppercase;
    font-weight: 600;
}

.spec-value {
    font-weight: 700;
    color: var(--text-color);
    font-size: 1.1em;
}

.large-btn {
    width: 100%;
    padding: 18px;
    font-size: 1.2em;
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

@media (max-width: 900px) {
    .product-detail-grid {
        flex-direction: column;
    }

    /* Old modal styles fallback overrides */
    .detail-image-gallery,
    .detail-info-section {
        display: none !important;
        /* Hide old structure styles if they persist */
    }
}

/* --- Dynamic Form Fields (Add Product) --- */
.custom-field-group {
    margin-bottom: 20px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.field-header label {
    font-weight: 600;
    color: var(--text-color);
}

.add-field-btn {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 5px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.3s ease;
}

.add-field-btn:hover {
    background: var(--primary-color);
    color: white;
}

.dynamic-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    animation: fadeIn 0.3s ease;
}

.dynamic-input-row input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.remove-field-btn {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    width: 36px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.remove-field-btn:hover {
    background: #fecaca;
}

.form-actions-footer .btn-cancel {
    background: #e5e7eb;
    color: #374151;
    margin-right: 10px;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.form-actions-footer .btn-cancel:hover {
    background: #d1d5db;
}

/* --- Redesigned Product Detail Modal --- */
.product-detail-content {
    max-width: 1100px;
    width: 95%;
    max-height: 85vh;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Prevent double scrollbars */
}

.product-detail-grid {
    display: flex;
    flex-direction: row;
    height: 100%;
    overflow: hidden;
}

/* 1. Left: Thumbnail Nav */
.detail-gallery-nav {
    width: 90px;
    padding: 20px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-right: 1px solid #f0f0f0;
    background: white;
    z-index: 2;
    overflow: hidden;
}

.thumbnail-list {
    flex: 1;
    overflow-y: hidden;
    /* Hidden by default, scrolled via buttons */
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 10px 0;
    scroll-behavior: smooth;
    width: 100%;
    align-items: center;
}

.thumbnail-item {
    width: 60px;
    height: 60px;
    border: 1px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s;
    flex-shrink: 0;
    object-fit: cover;
    padding: 2px;
}

.thumbnail-item:hover,
.thumbnail-item.active {
    opacity: 1;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--primary-color);
}

.gallery-nav-btn {
    background: #f3f4f6;
    border: none;
    width: 100%;
    padding: 5px;
    border-radius: 4px;
    cursor: pointer;
    color: #9ca3af;
    transition: all 0.2s;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-nav-btn:hover {
    background: #e5e7eb;
    color: var(--primary-color);
}

/* 2. Center: Main Image */
.detail-main-view {
    flex: 1.6;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

.main-image-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-image-wrapper img {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.05));
}

/* 3. Right: Info Panel */
.detail-info-panel {
    flex: 1.2;
    padding: 30px;
    background: #fff;
    overflow-y: auto;
    border-left: 1px solid #f0f0f0;
}

.info-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.detail-category {
    font-size: 0.85em;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.detail-title {
    font-size: 1.8em;
    font-weight: 800;
    color: var(--text-color);
    margin: 8px 0;
    line-height: 1.3;
}

.detail-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9em;
    color: #6b7280;
}

.divider {
    color: #d1d5db;
}

.vendor-link {
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
}

.detail-pricing {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.detail-price {
    font-size: 2.2em;
    font-weight: 700;
    color: #111827;
}

.stock-badge {
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

.stock-badge.in-stock {
    background: #ecfdf5;
    color: #059669;
}

.stock-badge.out-of-stock {
    background: #fef2f2;
    color: #dc2626;
}

.detail-description-box {
    margin-bottom: 30px;
}

.detail-description-box h3 {
    font-size: 1.1em;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--text-color);
}

.detail-description-box p {
    color: #4b5563;
    line-height: 1.6;
    font-size: 0.95em;
    margin-bottom: 20px;
}

.spec-grid {
    background: #f9fafb;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.spec-row {
    display: flex;
    margin-bottom: 8px;
}

.spec-row:last-child {
    margin-bottom: 0;
}

.spec-row .label {
    width: 100px;
    color: #6b7280;
    font-size: 0.9em;
}

.spec-row .value {
    color: #111827;
    font-weight: 600;
    font-size: 0.9em;
}

.detail-actions {
    display: flex;
    gap: 15px;
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
    height: 50px;
}

.quantity-selector button {
    background: #f9fafb;
    border: none;
    width: 40px;
    height: 100%;
    cursor: pointer;
    font-weight: bold;
    color: #374151;
    font-size: 1.2em;
    transition: background 0.2s;
}

.quantity-selector button:hover {
    background: #e5e7eb;
}

.quantity-selector input {
    width: 50px;
    text-align: center;
    border: none;
    font-weight: 600;
    height: 100%;
    font-size: 1rem;
    -moz-appearance: textfield;
    appearance: textfield;
}

.detail-actions .add-to-cart-btn {
    flex: 1;
    margin-top: 0;
    border-radius: 8px;
    height: 50px;
    font-size: 1.1em;
}

/* Badge for Color/Feature */
.dynamic-tag {
    display: inline-block;
    background: #eef2ff;
    color: #4f46e5;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    margin-right: 8px;
    margin-bottom: 8px;
    font-weight: 500;
    border: 1px solid #e0e7ff;
}

@media (max-width: 900px) {
    .product-detail-grid {
        flex-direction: column;
        overflow-y: auto;
    }

    .detail-gallery-nav {
        flex-direction: row;
        width: 100%;
        height: 80px;
        order: 2;
        border-right: none;
        border-top: 1px solid #f0f0f0;
        padding: 5px;
    }

    .thumbnail-list {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        margin: 0 10px;
        gap: 10px;
        width: auto;
        height: 100%;
    }

    .detail-main-view {
        flex: none;
        height: 300px;
        padding: 20px;
        order: 1;
    }

    .main-image-wrapper {
        padding-top: 0;
        height: 100%;
    }

    .main-image-wrapper img {
        max-height: 100%;
        position: static;
        transform: none;
    }

    .detail-info-panel {
        flex: none;
        padding: 20px;
        order: 3;
        border-left: none;
    }

    .gallery-nav-btn {
        width: 30px;
        height: 100%;
    }

    .gallery-nav-btn.up i {
        transform: rotate(-90deg);
    }

    .gallery-nav-btn.down i {
        transform: rotate(-90deg);
    }
}

/* Main Image Navigation Arrows (< >) */
.main-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #e5e7eb;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #374151;
    font-size: 1.1em;
    z-index: 10;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    opacity: 0;
}

.main-image-wrapper:hover .main-nav-btn {
    opacity: 1;
}

.main-nav-btn:hover {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-50%) scale(1.1);
}

.main-nav-btn.prev {
    left: 10px;
}

.main-nav-btn.next {
    right: 10px;
}

@media (max-width: 900px) {
    .main-nav-btn {
        opacity: 1;
        /* Always visible on mobile */
        width: 36px;
        height: 36px;
    }
}

/* Trending Product Cards */
.trending-card {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow-light);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    width: 280px;
    flex-shrink: 0;
    scroll-snap-align: start;
    position: relative;
}

.trending-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px var(--shadow-medium);
}

.trending-image {
    height: 220px;
    width: 100%;
    overflow: hidden;
    position: relative;
    background: #f0f0f0;
    flex-shrink: 0;
}

.trending-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.trending-card:hover .trending-image img {
    transform: scale(1.1);
}

.trending-badge {
    position: absolute;
    top: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 700;
    backdrop-filter: blur(10px);
    z-index: 2;
}

.trending-badge.hot {
    right: 12px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.trending-badge.discount {
    left: 12px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.4);
}

.trending-info {
    padding: 16px;
}

.trending-category {
    font-size: 0.75em;
    color: var(--primary-color);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--tag-bg);
    padding: 4px 10px;
    border-radius: 6px;
    display: inline-block;
    margin-bottom: 8px;
}

.trending-name {
    font-size: 1.05em;
    font-weight: 600;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    min-height: 2.8em;
}

.trending-vendor {
    font-size: 0.85em;
    color: var(--text-color);
    opacity: 0.6;
    margin-bottom: 12px;
}

.trending-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.trending-price-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.trending-price {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--primary-color);
}

.trending-original-price {
    font-size: 0.85em;
    text-decoration: line-through;
    opacity: 0.5;
}

.trending-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9em;
}

.trending-rating i {
    color: #f59e0b;
}

.trending-rating .review-count {
    opacity: 0.6;
    font-size: 0.9em;
}

/* ========================================= */
/* New Arrival Card Styles                   */
/* ========================================= */

.new-arrival-card {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 20px var(--shadow-light);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.new-arrival-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px var(--shadow-medium);
}

.new-arrival-image {
    height: 220px;
    width: 100%;
    overflow: hidden;
    position: relative;
    background: #f0f0f0;
    flex-shrink: 0;
}

.new-arrival-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.new-arrival-card:hover .new-arrival-image img {
    transform: scale(1.05);
}

.new-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--secondary-gradient);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.new-arrival-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 8px;
}

.new-arrival-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--primary-color);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.new-arrival-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.new-arrival-vendor {
    font-size: 0.85rem;
    color: var(--text-color);
    opacity: 0.7;
    margin: 0;
}

.new-arrival-date {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: #888;
    margin-top: auto;
    padding-top: 10px;
}

.new-arrival-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    margin-bottom: 10px;
}

.new-arrival-price {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-color);
}

.new-arrival-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #f59e0b;
}

/* Reuse .add-to-cart-btn styles but scoped if needed, relies on global btn class usually */
.new-arrival-card .add-to-cart-btn {
    width: 100%;
    padding: 10px;
    background: var(--tag-bg);
    color: var(--text-color);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.new-arrival-card .add-to-cart-btn:hover {
    background: var(--primary-color);
    color: white;
}


/* Responsive Styles for Profile Panel */
@media (max-width: 768px) {
    .profile-dropdown {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
        transform: translateY(100%);
        z-index: 2200;
        /* Ensure it stays above everything on mobile */
    }

    .profile-dropdown:not(.hidden) {
        transform: translateY(0);
    }

    .profile-header {
        border-radius: 0;
        padding: 32px 20px 24px;
    }

    .profile-menu {
        padding-bottom: 80px;
        /* Extra space for safe area */
    }
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVENESS
   ========================================================================== */

/* Large Tablets / Small Laptops (< 1200px) */
@media (max-width: 1200px) {
    .header-content {
        padding: 0 20px;
    }

    .search-bar {
        width: 300px;
    }

    .container {
        padding: 0 15px;
        gap: 15px;
    }

    .hero-content {
        gap: 30px;
    }

    .hero-title {
        font-size: 2.8em;
    }
}

/* Tablets (< 1024px) */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
        padding: 0 15px;
    }

    .mobile-filter-toggle {
        display: flex;
        width: 100%;
        padding: 12px;
        background: var(--card-bg);
        border: 1px solid var(--border-color);
        color: var(--text-color);
        border-radius: 8px;
        align-items: center;
        justify-content: center;
        gap: 10px;
        font-weight: 600;
        margin-bottom: 20px;
        cursor: pointer;
        font-size: 16px;
        transition: all 0.3s ease;
    }

    .mobile-filter-toggle:hover {
        background: var(--hover-color);
    }

    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        width: 100%;
        background: var(--card-bg);
        padding: 20px;
        z-index: 1000;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        max-height: 85vh;
        overflow-y: auto;
        border-radius: 20px 20px 0 0;
        border-top: 1px solid var(--border-color);
        display: block;
        box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.5);
    }

    .sidebar.filters-open {
        transform: translateY(0);
    }

    .mobile-sidebar-actions {
        display: flex;
        gap: 10px;
        margin-top: 20px;
        padding-top: 15px;
        border-top: 1px solid var(--border-color);
        position: sticky;
        bottom: 0;
        background: var(--card-bg);
    }

    .mobile-action-btn {
        flex: 1;
        padding: 12px 10px;
        border-radius: 8px;
        font-weight: bold;
        cursor: pointer;
        font-size: 14px;
        border: none;
        text-align: center;
        transition: all 0.3s ease;
    }

    .mobile-action-btn.exit-btn {
        background: transparent;
        border: 1px solid var(--text-color);
        color: var(--text-color);
    }

    .mobile-action-btn.browse-btn {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border: 1px solid transparent;
    }

    [data-theme="dark"] .mobile-action-btn.browse-btn {
        background: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
    }

    [data-theme="brown"] .mobile-action-btn.browse-btn {
        background: linear-gradient(135deg, #a06b4a 0%, #7d4e2d 100%);
    }

    .clear-all-filters-btn {
        width: 100%;
        margin-bottom: 10px;
    }

    .filter-section {
        flex: 1;
        min-width: 200px;
        margin-bottom: 0;
    }

    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }

    .hero-text {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-stats {
        justify-content: center;
    }

    .hero-visual {
        height: 300px;
        max-width: 500px;
        margin: 0 auto;
    }

    .floating-card.card-2 {
        right: 20px;
    }

    .floating-card.card-1 {
        left: 20px;
    }
}

/* Mobile Devices (< 768px) */
@media (max-width: 768px) {
    header {
        padding: 10px 15px;
    }

    .header-content {
        flex-wrap: wrap;
        gap: 10px;
    }

    .logo {
        font-size: 1.5em;
        order: 1;
    }

    .actions {
        order: 2;
        gap: 8px;
    }

    .search-bar {
        width: 100%;
        order: 3;
        margin-top: 5px;
    }

    .back-btn span {
        display: none;
        /* Hide 'Back' text on mobile, keep icon */
    }

    .build-pc-btn {
        padding: 10px 15px;
        font-size: 0.9em;
    }

    .hero-section {
        padding: 40px 15px;
        overflow: hidden;
        width: 100%;
    }

    .hero-title {
        font-size: 2.2em;
    }

    .hero-description {
        font-size: 1em;
    }

    .hero-stats {
        gap: 20px;
        flex-wrap: wrap;
    }

    .stat-number {
        font-size: 1.5em;
    }

    .hero-visual {
        display: none;
        /* Hide complex visual on small mobile to save vertical space */
    }

    .filter-section {
        width: 100%;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
        width: 100%;
    }

    .product-card,
    .new-arrival-card,
    .trending-card {
        height: auto;
    }

    .product-card.trending {
        width: 240px;
        /* Slightly narrower for mobile viewport */
    }

    .product-image-container,
    .new-arrival-image,
    .trending-image {
        height: 160px;
    }

    .product-info {
        padding: 12px;
    }

    .product-name {
        font-size: 0.95em;
        height: 2.8em;
    }

    .price {
        font-size: 1.1em;
    }

    .trending-products {
        padding: 0 10px;
    }

    .product-carousel {
        -webkit-overflow-scrolling: touch;
        padding-bottom: 20px;
    }

    .slider-btn {
        display: none;
        /* Rely on touch scrolling on mobile */
    }

    .vendors-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
        width: 100%;
    }

    .vendor-card {
        padding: 15px 10px;
    }

    .new-arrivals-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
        width: 100%;
    }

    /* Modal Adjustments */
    .modal-content {
        padding: 0 15px 30px;
    }

    .form-title {
        font-size: 1.8em;
    }

    .form-row {
        flex-direction: column;
        gap: 10px;
    }

    .form-card {
        padding: 20px;
    }

    /* Product Detail Modal Mobile */
    .product-detail-grid {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
        gap: 20px;
        width: 100%;
    }

    .detail-specs {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 15px;
    }

    .detail-gallery-nav {
        order: 2;
        flex-direction: row;
        width: 100%;
        overflow-x: auto;
        padding: 10px 0;
    }

    .thumbnail-list {
        flex-direction: row;
        width: auto;
    }

    .gallery-nav-btn {
        display: none;
    }

    .detail-main-view {
        order: 1;
    }

    .detail-info-panel {
        order: 3;
    }

    .detail-actions {
        flex-direction: column;
        gap: 15px;
    }

    .quantity-selector {
        width: 100%;
        justify-content: center;
    }
}

/* Very Small Screen (< 480px) */
@media (max-width: 768px) {
    .header-content {
        justify-content: center;
        padding: 0 10px;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
    }

    .product-card.trending {
        width: 200px;
        /* Even narrower for very small screens */
    }

    .hero-title {
        font-size: 1.8em;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .hero-btn {
        width: 100%;
    }

    .stat-item {
        flex: 1;
        min-width: 80px;
        text-align: center;
    }

    .stat-number {
        font-size: 1.25em;
    }

    /* Mobile Profile Dropdown (Bottom Sheet) */
    .profile-dropdown {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        right: 0 !important;
        left: 0 !important;
        width: 100% !important;
        max-height: 85vh !important;
        border-radius: 24px 24px 0 0 !important;
        background: var(--card-bg) !important;
        transform: translateY(0) !important;
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease !important;
        margin: 0 !important;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5) !important;
        display: block !important;
        z-index: 10001 !important;
        /* Above overlay */
        pointer-events: all !important;
        visibility: visible !important;
        opacity: 1 !important;
        backdrop-filter: none !important;
    }

    .profile-dropdown.hidden {
        transform: translateY(100%) !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    .profile-header {
        border-radius: 24px 24px 0 0 !important;
        padding: 20px !important;
    }

    .profile-menu-item {
        padding: 16px 20px !important;
        /* Larger touch target */
    }

    /* Add a drag handle indicator */
    .profile-dropdown::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: rgba(255, 255, 255, 0.3);
        border-radius: 2px;
        z-index: 1001;
    }

    /* Dropdown Overlay */
    .dropdown-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(8px);
        z-index: 9000;
        /* Below dropdown but above page content */
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .dropdown-overlay.show {
        display: block;
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 0 5px;
    }
}
/* ═══════════════════════════════════════════
   BTN-53 Animated Button (Uiverse.io/doniaskima)
   ═══════════════════════════════════════════ */
.btn-53, .btn-53 *, .btn-53 :after, .btn-53 :before, .btn-53:after, .btn-53:before { box-sizing: border-box; }
.btn-53 {
  -webkit-tap-highlight-color: transparent;
  -webkit-mask-image: -webkit-radial-gradient(#000, #fff);
  overflow: hidden; position: relative;
  display: inline-block; font-weight: 900;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.btn-53 .original {
  background: inherit; color: inherit;
  display: grid; inset: 0; place-content: center;
  position: absolute;
  transition: transform 0.2s cubic-bezier(0.87, 0, 0.13, 1);
}
.btn-53:hover .original { transform: translateY(100%); }
.btn-53 .letters { display: inline-flex; }
.btn-53 .letters span {
  opacity: 0; transform: translateY(-15px); display: inline-block;
  transition: transform 0.2s cubic-bezier(0.87, 0, 0.13, 1), opacity 0.2s;
}
.btn-53 .letters span:nth-child(2n) { transform: translateY(15px); }
.btn-53:hover .letters span { opacity: 1; transform: translateY(0); }
.btn-53:hover .letters span:nth-child(2)  { transition-delay: 0.05s; }
.btn-53:hover .letters span:nth-child(3)  { transition-delay: 0.10s; }
.btn-53:hover .letters span:nth-child(4)  { transition-delay: 0.15s; }
.btn-53:hover .letters span:nth-child(5)  { transition-delay: 0.20s; }
.btn-53:hover .letters span:nth-child(6)  { transition-delay: 0.25s; }
.btn-53:hover .letters span:nth-child(7)  { transition-delay: 0.30s; }
.btn-53:hover .letters span:nth-child(8)  { transition-delay: 0.35s; }
.btn-53:hover .letters span:nth-child(9)  { transition-delay: 0.40s; }
.btn-53:hover .letters span:nth-child(10) { transition-delay: 0.45s; }
.btn-53:hover .letters span:nth-child(11) { transition-delay: 0.50s; }
.btn-53:hover .letters span:nth-child(12) { transition-delay: 0.55s; }
.btn-53:hover .letters span:nth-child(13) { transition-delay: 0.60s; }
.btn-53:hover .letters span:nth-child(14) { transition-delay: 0.65s; }
.btn-53:hover .letters span:nth-child(15) { transition-delay: 0.70s; }

/* ═══════════════════════════════════════════
   Page Speed Loader Overlay
   ═══════════════════════════════════════════ */
#page-loader-overlay {
  position: fixed; inset: 0; z-index: 999999;
  background: rgba(11,11,11,0.88);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
#page-loader-overlay.active { opacity: 1; pointer-events: all; }
#page-loader-overlay .loader {
  position: relative; animation: speeder 0.4s linear infinite;
}
#page-loader-overlay .loader > span {
  height: 5px; width: 35px; background: #E31E24;
  position: absolute; top: -19px; left: 60px; border-radius: 2px 10px 1px 0;
}
#page-loader-overlay .base span {
  position: absolute; width: 0; height: 0;
  border-top: 6px solid transparent;
  border-right: 100px solid #E31E24;
  border-bottom: 6px solid transparent;
}
#page-loader-overlay .base span:before {
  content: ""; height: 22px; width: 22px; border-radius: 50%;
  background: #E31E24; position: absolute; right: -110px; top: -16px;
}
#page-loader-overlay .base span:after {
  content: ""; position: absolute; width: 0; height: 0;
  border-top: 0 solid transparent; border-right: 55px solid #E31E24;
  border-bottom: 16px solid transparent; top: -16px; right: -98px;
}
#page-loader-overlay .face {
  position: absolute; height: 12px; width: 20px; background: #E31E24;
  border-radius: 20px 20px 0 0; transform: rotate(-40deg); right: -125px; top: -15px;
}
#page-loader-overlay .face:after {
  content: ""; height: 12px; width: 12px; background: #E31E24;
  right: 4px; top: 7px; position: absolute;
  transform: rotate(40deg); transform-origin: 50% 50%; border-radius: 0 0 0 2px;
}
#page-loader-overlay .loader > span > span:nth-child(1),
#page-loader-overlay .loader > span > span:nth-child(2),
#page-loader-overlay .loader > span > span:nth-child(3),
#page-loader-overlay .loader > span > span:nth-child(4) {
  width: 30px; height: 1px; background: #E31E24;
  position: absolute; animation: fazer1 0.2s linear infinite;
}
#page-loader-overlay .loader > span > span:nth-child(2) { top: 3px; animation: fazer2 0.4s linear infinite; }
#page-loader-overlay .loader > span > span:nth-child(3) { top: 1px; animation: fazer3 0.4s linear infinite; animation-delay: -1s; }
#page-loader-overlay .loader > span > span:nth-child(4) { top: 4px; animation: fazer4 1s linear infinite; animation-delay: -1s; }
@keyframes fazer1 { 0% { left: 0; } 100% { left: -80px; opacity: 0; } }
@keyframes fazer2 { 0% { left: 0; } 100% { left: -100px; opacity: 0; } }
@keyframes fazer3 { 0% { left: 0; } 100% { left: -50px; opacity: 0; } }
@keyframes fazer4 { 0% { left: 0; } 100% { left: -150px; opacity: 0; } }
@keyframes speeder {
  0%   { transform: translate(2px,1px) rotate(0deg); }
  10%  { transform: translate(-1px,-3px) rotate(-1deg); }
  20%  { transform: translate(-2px,0px) rotate(1deg); }
  30%  { transform: translate(1px,2px) rotate(0deg); }
  40%  { transform: translate(1px,-1px) rotate(1deg); }
  50%  { transform: translate(-1px,3px) rotate(-1deg); }
  60%  { transform: translate(-1px,1px) rotate(0deg); }
  70%  { transform: translate(3px,1px) rotate(-1deg); }
  80%  { transform: translate(-2px,-1px) rotate(1deg); }
  90%  { transform: translate(2px,1px) rotate(0deg); }
  100% { transform: translate(1px,-2px) rotate(-1deg); }
}
#page-loader-overlay .longfazers { position: absolute; width: 100%; height: 100%; top:0; left:0; }
#page-loader-overlay .longfazers span { position: absolute; height: 2px; width: 20%; background: rgba(227,30,36,0.35); }
#page-loader-overlay .longfazers span:nth-child(1) { top: 20%; animation: lf  0.6s linear infinite; animation-delay: -5s; }
#page-loader-overlay .longfazers span:nth-child(2) { top: 40%; animation: lf2 0.8s linear infinite; animation-delay: -1s; }
#page-loader-overlay .longfazers span:nth-child(3) { top: 60%; animation: lf3 0.6s linear infinite; }
#page-loader-overlay .longfazers span:nth-child(4) { top: 80%; animation: lf4 0.5s linear infinite; animation-delay: -3s; }
@keyframes lf  { 0% { left: 200%; } 100% { left: -200%; opacity: 0; } }
@keyframes lf2 { 0% { left: 200%; } 100% { left: -200%; opacity: 0; } }
@keyframes lf3 { 0% { left: 200%; } 100% { left: -100%; opacity: 0; } }
@keyframes lf4 { 0% { left: 200%; } 100% { left: -100%; opacity: 0; } }

/* Modern Filter Item Structure */
.filter-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    user-select: none;
}

.filter-item:hover {
    background: var(--tag-bg);
}

.filter-item label {
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    flex: 1;
    margin: 0;
    padding: 0;
}

.filter-item .neon-checkbox {
    margin: 0;
    flex-shrink: 0;
}
