/* ===================================
   GENESIS CAMPUS MARKET - GLOBAL STYLES
   Premium Black-First UI
   =================================== */

/* CSS Variables */
:root {
    /* Organic Tech Palette (Default Light) */
    --bg-primary: #F8F9FA;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #F1F3F5;
    --bg-card: #FFFFFF;
    --bg-elevated: #FFFFFF;
    --bg-hover: #F1F3F5;

    /* Refined Indigo Accent */
    --accent: #4338CA;
    --accent-light: #6366F1;
    --accent-dark: #3730A3;
    --accent-glow: rgba(67, 56, 202, 0.1);
    --accent-subtle: rgba(67, 56, 202, 0.05);

    /* Text Colors (Soft Blacks) */
    --text-primary: #1A1A1A;
    --text-secondary: #4A4A4A;
    --text-muted: #717171;
    --text-subtle: #A3A3A3;

    /* Borders */
    --border-subtle: rgba(0, 0, 0, 0.04);
    --border-default: rgba(0, 0, 0, 0.08);
    --border-accent: rgba(67, 56, 202, 0.2);

    /* Status Colors */
    --success: #10B981;
    --success-subtle: rgba(16, 185, 129, 0.1);
    --warning: #F59E0B;
    --warning-subtle: rgba(245, 158, 11, 0.1);
    --error: #EF4444;
    --error-subtle: rgba(239, 68, 68, 0.1);

    /* Typography */
    --font-primary: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Inter', system-ui, -apple-system, sans-serif;

    /* Spacing (Refined for tighter layout) */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1.25rem;
    --spacing-lg: 1.75rem;
    --spacing-xl: 2.5rem;
    --spacing-2xl: 3.5rem;
    --spacing-3xl: 5rem;
    --spacing-4xl: 7rem;

    /* Border Radius (Standardized to 12px) */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    --radius-full: 9999px;

    /* Layered Shadows (Deep & Premium) */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 40px rgba(67, 56, 202, 0.1);
    --shadow-glow-sm: 0 0 20px rgba(67, 56, 202, 0.05);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
    --transition-smooth: 500ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Navbar/Glassmorphism */
    --nav-bg: rgba(248, 249, 250, 0.8);
    --nav-bg-scrolled: rgba(248, 249, 250, 0.95);
}

[data-theme="dark"] {
    /* Premium Midnight Palette */
    --bg-primary: #000000;
    --bg-secondary: #0A0A0A;
    --bg-tertiary: #111111;
    --bg-card: #0D0D0D;
    --bg-elevated: #161616;
    --bg-hover: #1A1A1A;

    --text-primary: #FFFFFF;
    --text-secondary: #A3A3A3;
    --text-muted: #737373;
    --text-subtle: #404040;

    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-default: rgba(255, 255, 255, 0.1);
    --border-accent: rgba(99, 102, 241, 0.3);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.8);
    --shadow-glow: 0 0 60px rgba(99, 102, 241, 0.15);
    --shadow-glow-sm: 0 0 30px rgba(99, 102, 241, 0.1);

    --nav-bg: rgba(0, 0, 0, 0.8);
    --nav-bg-scrolled: rgba(0, 0, 0, 0.95);

    --accent-glow: rgba(99, 102, 241, 0.15);
    --accent-subtle: rgba(99, 102, 241, 0.08);
}

/* Reset & Base Styles */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    scroll-padding-top: 100px;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition-base), color var(--transition-base);
}

/* Selection */
::selection {
    background: var(--accent);
    color: white;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

h2 {
    font-size: clamp(1.875rem, 4vw, 2.5rem);
    font-weight: 700;
}

h3 {
    font-size: clamp(1.5rem, 3vw, 1.75rem);
    font-weight: 600;
}

h4 {
    font-size: clamp(1.125rem, 2vw, 1.25rem);
}

p {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent);
}

/* Container */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

@media (max-width: 768px) {
    .container {
        padding: 0 var(--spacing-md);
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    font-family: var(--font-primary);
    line-height: 1;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.01em;
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 12px var(--accent-subtle);
}

.btn-primary:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--accent-glow);
    color: white !important;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1rem;
    border-radius: var(--radius-lg);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-smooth);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-default);
}

/* Forms */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.form-label.required::after {
    content: " *";
    color: var(--error);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-family: var(--font-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
    border-color: var(--border-default);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

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

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-error {
    color: var(--error);
    font-size: 0.875rem;
    margin-top: var(--spacing-xs);
    display: none;
}

.form-group.error .form-input,
.form-group.error .form-select,
.form-group.error .form-textarea {
    border-color: var(--error);
}

.form-group.error .form-error {
    display: block;
}

.form-helper {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: var(--spacing-xs);
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    font-size: 0.9375rem;
}

.alert-success {
    background: var(--success-subtle);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.alert-error {
    background: var(--error-subtle);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.alert-warning {
    background: var(--warning-subtle);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.alert-info {
    background: var(--accent-subtle);
    border: 1px solid var(--border-accent);
    color: var(--accent-light);
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

@keyframes skeletonPulse {
    0% {
        background-color: var(--bg-tertiary);
        opacity: 0.5;
    }

    50% {
        background-color: var(--bg-secondary);
        opacity: 0.8;
    }

    100% {
        background-color: var(--bg-tertiary);
        opacity: 0.5;
    }
}

.skeleton {
    animation: skeletonPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(8px);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-elevated);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-subtle);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.98);
    }

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.modal-close {
    background: var(--bg-hover);
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--error-subtle);
    color: var(--error);
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    letter-spacing: 0.02em;
}

.badge-primary {
    background: var(--accent-subtle);
    color: var(--accent);
    border: 1px solid var(--border-accent);
}

.badge-success {
    background: var(--success-subtle);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-subtle);
    color: var(--warning);
}

.badge-error {
    background: var(--error-subtle);
    color: var(--error);
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-accent {
    color: var(--accent);
}

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

.mt-1 {
    margin-top: var(--spacing-xs);
}

.mt-2 {
    margin-top: var(--spacing-sm);
}

.mt-3 {
    margin-top: var(--spacing-md);
}

.mt-4 {
    margin-top: var(--spacing-lg);
}

.mb-1 {
    margin-bottom: var(--spacing-xs);
}

.mb-2 {
    margin-bottom: var(--spacing-sm);
}

.mb-3 {
    margin-bottom: var(--spacing-md);
}

.mb-4 {
    margin-bottom: var(--spacing-lg);
}

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

/* Responsive utilities */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

@keyframes heartBeat {
    0% {
        transform: scale(1);
    }

    14% {
        transform: scale(1.3);
    }

    28% {
        transform: scale(1);
    }

    42% {
        transform: scale(1.3);
    }

    70% {
        transform: scale(1);
    }
}

@keyframes skeletonPulse {
    0% {
        background-color: var(--bg-tertiary);
        opacity: 0.5;
    }

    50% {
        background-color: var(--bg-hover);
        opacity: 0.8;
    }

    100% {
        background-color: var(--bg-tertiary);
        opacity: 0.5;
    }
}

.skeleton {
    animation: skeletonPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    background: var(--bg-tertiary);
}

.skeleton-product-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.skeleton-product-image {
    width: 100%;
    aspect-ratio: 1/1;
}

.skeleton-product-content {
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-product-title {
    height: 14px;
    width: 85%;
    border-radius: 4px;
}

.skeleton-product-price {
    height: 20px;
    width: 35%;
    border-radius: 4px;
}

.heart-pulse {
    animation: heartBeat 0.8s ease-in-out;
}

.fade-in {
    animation: fadeIn var(--transition-slow) ease-out forwards;
}

.fade-in-up {
    animation: fadeInUp var(--transition-smooth) forwards;
    opacity: 0;
}

/* Staggered entrance classes */
.stagger-1 {
    animation-delay: 50ms;
}

.stagger-2 {
    animation-delay: 100ms;
}

.stagger-3 {
    animation-delay: 150ms;
}

.stagger-4 {
    animation-delay: 200ms;
}

.stagger-5 {
    animation-delay: 250ms;
}

.stagger-6 {
    animation-delay: 300ms;
}

.stagger-7 {
    animation-delay: 350ms;
}

.stagger-8 {
    animation-delay: 400ms;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
}

.theme-toggle:hover {
    transform: scale(1.1);
    background: var(--bg-hover);
    border-color: var(--accent);
    color: var(--accent);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-slow);
}

[data-theme="light"] .theme-toggle .sun-icon {
    display: block;
}

[data-theme="light"] .theme-toggle .moon-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: block;
}

/* Default state (pre-logic) */
.theme-toggle .moon-icon {
    display: block;
}

.theme-toggle .sun-icon {
    display: none;
}

@media (max-width: 768px) {
    .theme-toggle {
        bottom: var(--spacing-md);
        right: var(--spacing-md);
        width: 42px;
        height: 42px;
    }
}

/* ===================================
   E-COMMERCE SHARED COMPONENTS
   =================================== */

/* Product Card */
.product-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-smooth);
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

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

.product-card-image {
    display: block;
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    background: var(--bg-tertiary);
}

.product-card-content {
    padding: var(--spacing-md);
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-card-category {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.product-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    height: auto;
}

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

.product-card-price {
    font-size: 1.0625rem;
    font-weight: 800;
    color: #108954;
    /* Forest Green to match product page */
    letter-spacing: -0.02em;
}

[data-theme="dark"] .product-card-price {
    color: #34D399;
}

@media (max-width: 768px) {
    .product-card-title {
        font-size: 0.9375rem;
    }

    .product-card-price {
        font-size: 1rem;
    }
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.7);
    /* Translucent */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    transition: all var(--transition-base);
}

[data-theme="dark"] .navbar {
    background: rgba(0, 0, 0, 0.6);
}

.navbar.scrolled {
    background: var(--nav-bg-scrolled);
    border-bottom-color: var(--border-default);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.nav-brand h1 {
    font-size: 1.375rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.beta-badge {
    background: var(--accent-subtle);
    color: var(--accent);
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    border: 1px solid var(--border-accent);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links a:not(.btn) {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 450;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.nav-links a:not(.btn):hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-links .btn {
    margin-left: 0.5rem;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.mobile-menu-toggle:hover {
    background: var(--bg-hover);
}

.mobile-menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition-base);
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: var(--spacing-md);
        gap: 0.25rem;
        transform: translateY(-100%);
        opacity: 0;
        transition: all var(--transition-base);
        border-bottom: 1px solid var(--border-subtle);
        pointer-events: none;
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-links a:not(.btn) {
        width: 100%;
        padding: 0.875rem 1rem;
    }

    .nav-links .btn {
        width: 100%;
        margin-left: 0;
        margin-top: var(--spacing-sm);
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
}

/* Lightbox Modal */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.lightbox.active {
    display: flex;
    animation: fadeIn var(--transition-base) forwards;
}

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

.lightbox-content {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    transform: scale(0.95);
    transition: transform var(--transition-smooth);
}

.lightbox.active .lightbox-content {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 10px;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    width: 110%;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    transform: translateY(-50%);
}

.lightbox-nav button {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.lightbox-counter {
    color: white;
    margin-top: 15px;
    font-size: 0.9rem;
}

/* --- Refined Loading State (Skeleton) --- */
.skeleton-product-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.skeleton-product-image {
    width: 100%;
    aspect-ratio: 1/1;
}

.skeleton-product-content {
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-product-title {
    height: 14px;
    width: 85%;
    border-radius: 4px;
}

.skeleton-product-price {
    height: 20px;
    width: 35%;
    border-radius: 4px;
}

/* --- Lightbox Counter & Better Layout --- */
.lightbox-container {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-content {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    transform: scale(0.95);
    transition: transform var(--transition-smooth);
}

.lightbox.active .lightbox-content {
    transform: scale(1);
}

.lightbox-counter {
    color: white;
    margin-top: 15px;
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 12px;
    border-radius: 20px;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    width: 115%;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    transform: translateY(-50%);
}

.lightbox-nav button {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
}
/* --- Minimal Footer --- */
.minimal-footer {
    padding: var(--spacing-2xl) 0;
    border-top: 1px solid var(--border-subtle);
    margin-top: var(--spacing-4xl);
    background: var(--bg-primary);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
}

.footer-logo img {
    height: 24px;
}

.footer-links {
    display: flex;
    gap: var(--spacing-lg);
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

.footer-copy {
    color: var(--text-muted);
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    text-align: right;
}

.developer-link {
    color: var(--accent);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all var(--transition-fast);
}

.developer-link:hover {
    color: var(--accent-light);
    text-decoration: underline;
}

@media (max-width: 768px) {
    .footer-copy {
        align-items: center;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-lg);
    }
    
    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--spacing-md);
    }
}

/* ===================================
   SEARCH FUNCTIONALITY
   =================================== */
.search-container {
    margin-bottom: var(--spacing-xl);
    width: 100%;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 1rem 1.25rem 1rem 3.25rem;
    font-size: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow), var(--shadow-md);
    background: var(--bg-card);
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    color: var(--text-muted);
    pointer-events: none;
    transition: color var(--transition-fast);
}

.search-input:focus + .search-icon {
    color: var(--accent);
}

.search-clear {
    position: absolute;
    right: 1.25rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
}

.search-clear:hover {
    color: var(--error);
    background: var(--error-subtle);
}

.search-input:not(:placeholder-shown) ~ .search-clear {
    display: flex;
}

/* Empty search state */
.search-empty {
    text-align: center;
    padding: var(--spacing-3xl) var(--spacing-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px dashed var(--border-default);
    margin-top: var(--spacing-lg);
}

.search-empty h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.search-empty p {
    color: var(--text-secondary);
}

.discovery-hint {
    margin-top: -1rem;
    margin-bottom: var(--spacing-xl);
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    display: inline-block;
    border: 1px solid var(--border-default);
}

.discovery-hint p {
    font-size: 0.9375rem;
    margin: 0;
}

.underline {
    text-decoration: underline !important;
}

/* Category Chips */
.category-chips-container {
    margin-bottom: var(--spacing-xl);
    overflow: hidden;
    position: relative;
}

.category-chips {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.category-chips::-webkit-scrollbar {
    display: none;
}

.chip {
    padding: 0.625rem 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--transition-base);
}

.chip:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.chip.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 4px 12px var(--accent-subtle);
}
/* Spinner Small */
.spinner-small {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
    animation: spin 0.8s linear infinite;
}

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

/* Discovery Hero Section */
.discovery-hero {
    margin: var(--spacing-xxl) 0;
}

.discovery-card {
    background: linear-gradient(135deg, var(--bg-card), var(--bg-secondary));
    border: 1px solid var(--border-default);
    border-radius: var(--radius-2xl);
    padding: var(--spacing-xl) var(--spacing-xxl);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.discovery-content {
    max-width: 500px;
    position: relative;
    z-index: 2;
}

.discovery-content h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.discovery-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    font-size: 1rem;
}

.discovery-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.75rem;
    font-weight: 600;
}

.discovery-btn svg {
    transition: transform var(--transition-base);
}

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

.discovery-visual {
    position: absolute;
    right: -100px;
    top: -50px;
    width: 300px;
    height: 300px;
    z-index: 1;
}

.blob-glow {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    opacity: 0.15;
    filter: blur(40px);
    animation: pulseGlow 4s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(1); opacity: 0.15; }
    50% { transform: scale(1.2); opacity: 0.25; }
}

@media (max-width: 768px) {
    .discovery-card {
        padding: var(--spacing-xl);
        flex-direction: column;
        text-align: center;
    }
    
    .discovery-content h3 {
        font-size: 1.5rem;
    }
    
    .discovery-visual {
        display: none;
    }
}
