/* Base Styles */
:root {
    --primary-color: #000000;
    --secondary-color: #fafafa;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --bg-light: #f3f4f6;
    --border-color: #e5e7eb;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --badge-bg: #e0e0e0;
    --badge-text: #333333;
}

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

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--text-primary);
    background-color: var(--secondary-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    position: relative;
}

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

ul {
    list-style: none;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header */
#main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

#main-header.scrolled {
    background-color: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

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

.header-left {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.mobile-only {
    display: none;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.logo-icon:hover {
    transform: scale(1.05);
}

.main-nav {
    display: flex;
    gap: 1.5rem;
}

.main-nav a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
}

.main-nav a:hover, .main-nav a.active {
    color: var(--primary-color);
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.main-nav a:hover::after, .main-nav a.active::after {
    width: 100%;
}

.header-right {
    display: flex;
    gap: 1.25rem;
}

.icon-btn {
    font-size: 1.1rem;
    color: var(--text-primary);
    transition: var(--transition);
}

.icon-btn:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

/* Account Dropdown */
.account-dropdown-container {
    position: relative;
    display: inline-block;
}

.account-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    min-width: 320px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-radius: 12px;
    padding: 1.5rem;
    z-index: 1000;
    margin-top: 10px;
    border: 1px solid var(--border-color);
}

.account-dropdown.show {
    display: block;
}

.account-dropdown h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 500;
}

.dropdown-links {
    display: flex;
    gap: 1rem;
}

.dropdown-links a {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: var(--transition);
}

.dropdown-links a:hover {
    border-color: var(--primary-color);
}

.btn-primary {
    background-color: #5A31F4; /* Shop Purple */
    color: white;
}

.btn-primary:hover {
    background-color: #4a28cc;
    color: white;
}

/* Hero Section */
.hero-section {
    position: relative;
    height: 70vh;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-top: 76px; /* Header height offset */
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform: scale(1.05);
    transition: transform 10s ease-out;
}

.hero-section:hover .hero-background {
    transform: scale(1);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.5));
}

.hero-content {
    position: relative;
    z-index: 10;
    color: var(--secondary-color);
    padding: 0 1rem;
    animation: fadeInUp 1s ease-out;
}

.hero-content h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 2rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.btn {
    display: inline-block;
    padding: 0.8rem 2.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 0;
    cursor: pointer;
    transition: var(--transition);
}

.btn-outline {
    background: transparent;
    color: var(--secondary-color);
    border: 1px solid var(--secondary-color);
    backdrop-filter: blur(5px);
}

.btn-outline:hover {
    background: var(--secondary-color);
    color: var(--primary-color);
}

.btn-dark {
    background: var(--primary-color);
    color: var(--secondary-color);
    border: 1px solid var(--primary-color);
}

.btn-dark:hover {
    background: var(--text-secondary);
    border-color: var(--text-secondary);
}

/* New Picks Section */
.new-picks-section {
    padding: 5rem 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 1.75rem;
    font-weight: 600;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2.5rem 1.5rem;
}

@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem 0.5rem;
    }
    
    .product-title {
        font-size: 0.85rem;
    }
    
    .product-price {
        font-size: 0.85rem;
    }
}

.product-card {
    group: product;
    cursor: pointer;
    min-width: 0;
}

.product-image-container {
    position: relative;
    aspect-ratio: 4/5;
    background-color: var(--bg-light);
    overflow: hidden;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.product-card:hover .product-image {
    transform: scale(1.08);
}

.badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: var(--badge-bg);
    color: var(--badge-text);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

.badge-sale {
    background-color: var(--primary-color);
    color: var(--secondary-color);
}

.badge-sold-out {
    background-color: #f3f4f6;
    color: #4b5563;
}

.quick-add-btn {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--secondary-color);
    color: var(--primary-color);
    border: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 2;
}

.product-card:hover .quick-add-btn {
    opacity: 1;
    transform: translateY(0);
}

.quick-add-btn:hover {
    background-color: var(--primary-color);
    color: var(--secondary-color);
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

.product-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-price {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Newsletter */
.newsletter-section {
    border-top: 1px solid var(--border-color);
    padding: 4rem 0;
}

.newsletter-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .newsletter-container {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

.newsletter-text p {
    font-size: 1rem;
    color: var(--text-secondary);
}

.newsletter-form form {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    overflow: hidden;
    width: 100%;
    max-width: 400px;
    background-color: var(--secondary-color);
}

.newsletter-form input {
    flex-grow: 1;
    border: none;
    padding: 0.8rem 1.5rem;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    background: transparent;
}

.newsletter-form button {
    background: transparent;
    border: none;
    padding: 0 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.newsletter-form button:hover {
    color: var(--text-secondary);
    transform: translateX(3px);
}

/* Footer */
footer {
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
}

.footer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

@media (min-width: 768px) {
    .footer-container {
        flex-direction: row;
        justify-content: space-between;
    }
}

.footer-center a {
    color: var(--text-secondary);
}

.footer-center a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.social-link {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.social-link:hover {
    color: var(--primary-color);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .desktop-only {
        display: none !important;
    }
    
    .header-container {
        padding: 1rem;
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
    }
    
    .header-left {
        gap: 1rem;
        justify-content: flex-start;
    }
    
    .logo-icon {
        position: static;
        transform: none;
        display: flex;
        justify-content: center;
    }
    
    .header-right {
        justify-content: flex-end;
    }
    
    .main-nav {
        display: none;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem 1rem;
    }
    
    .product-title {
        font-size: 0.85rem;
    }
    .product-price {
        font-size: 0.8rem;
    }
    
    .mobile-only {
        display: block !important;
    }
}

/* Product Details Page */
.product-page-main {
    margin-top: 100px;
    padding-bottom: 5rem;
}

.product-page-container {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

@media (min-width: 900px) {
    .product-page-container {
        flex-direction: row;
        align-items: flex-start;
    }
}

/* Gallery */
.product-gallery {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 900px) {
    .product-gallery {
        grid-template-columns: repeat(2, 1fr);
        flex: 1.5; /* take more space */
    }
    
    /* Make first image take full width occasionally to match masonry */
    .product-gallery img:first-child {
        grid-column: 1 / -1;
    }
}

.product-gallery img {
    width: 100%;
    height: auto;
    object-fit: cover;
    background-color: var(--bg-light);
}

/* Sidebar Details */
.product-details-sidebar {
    flex: 1;
}

@media (min-width: 900px) {
    .product-details-sidebar {
        position: sticky;
        top: 100px; /* header offset */
    }
}

.p-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.p-price {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.p-form {
    margin-bottom: 3rem;
}

.p-form label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.p-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    background-color: transparent;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    outline: none;
}

.p-select:focus {
    border-color: var(--primary-color);
}

.p-actions {
    display: flex;
    gap: 1rem;
}

.qty-selector {
    display: flex;
    border: 1px solid var(--border-color);
    width: fit-content;
}

.qty-selector button {
    background: transparent;
    border: none;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 1.1rem;
}

.qty-selector input {
    width: 40px;
    text-align: center;
    border: none;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    font-size: 0.95rem;
    outline: none;
}

.btn-full {
    flex: 1;
}

.p-description-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.p-description-section p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

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

.related-title {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    font-weight: 600;
}

/* ─── Collections Dropdown ──────────────────────────────── */
.collections-dropdown-container {
    position: relative;
}
.collections-nav-link {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}
.collections-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    padding-top: 8px;
    background: white;
    min-width: 200px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    z-index: 2000;
    overflow: hidden;
}
.collections-dropdown.show { display: block; }
.collections-dropdown a {
    display: block;
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}
.collections-dropdown a:last-child { border-bottom: none; }
.collections-dropdown a:hover { background: var(--bg-light); }

/* ─── Search Modal ──────────────────────────────────────── */
.search-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    background: white;
    z-index: 3000;
    padding: 1.5rem 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    max-height: 80vh;
    overflow-y: auto;
}
.search-modal.open { display: block; }
.search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 2500;
}
.search-overlay.open { display: block; }
.search-input-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 2px solid var(--text-primary);
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
}
.search-input-row input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.2rem;
    font-family: inherit;
}
.search-input-row button {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text-secondary);
}
.search-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-weight: 600;
}
.search-result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-primary);
}
.search-result-item:hover { background: var(--bg-light); }
.search-result-item img { width: 60px; height: 60px; object-fit: cover; border-radius: 4px; }
.search-result-item p:first-child { font-weight: 500; font-size: 0.95rem; }
.search-result-item p:last-child { font-size: 0.85rem; color: var(--text-secondary); }

/* ─── Cart Sidebar ──────────────────────────────────────── */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -420px;
    width: 420px;
    max-width: 100vw;
    height: 100vh;
    background: white;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 30px rgba(0,0,0,0.1);
}
.cart-sidebar.open { right: 0; }
.cart-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2900;
}
.cart-overlay.open { display: block; }
.cart-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}
.cart-sidebar-header h3 { font-size: 1.1rem; font-weight: 600; }
.cart-sidebar-header button { background: none; border: none; font-size: 1.4rem; cursor: pointer; }
.cart-items-list { flex: 1; overflow-y: auto; padding: 1rem 1.5rem; }
.cart-empty { text-align: center; padding: 3rem 1rem; color: var(--text-secondary); }
.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}
.cart-item img { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; }
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 500; font-size: 0.95rem; margin-bottom: 0.3rem; }
.cart-item-price { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 0.5rem; }
.cart-item-qty { display: flex; align-items: center; gap: 0.75rem; font-size: 0.85rem; }
.cart-item-qty button { background: none; border: none; cursor: pointer; color: var(--text-secondary); }
.cart-item-qty button:hover { color: red; }
.cart-sidebar-footer { padding: 1.5rem; border-top: 1px solid var(--border-color); }
.cart-total-row { display: flex; justify-content: space-between; font-weight: 600; font-size: 1rem; margin-bottom: 1rem; }

/* ─── Account Pages ─────────────────────────────────────── */
.auth-page {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
}
.auth-box {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.07);
    width: 100%;
    max-width: 420px;
}
.auth-box .auth-logo {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}
.auth-box h1 { font-size: 1.5rem; font-weight: 600; margin-bottom: 0.5rem; }
.auth-box p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 2rem; }
.auth-box .form-group { margin-bottom: 1.2rem; }
.auth-box label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 0.4rem; }
.auth-box input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
    outline: none;
}
.auth-box input:focus { border-color: var(--text-primary); }
.auth-box .btn-submit {
    width: 100%;
    padding: 0.9rem;
    background: var(--text-primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
    margin-top: 0.5rem;
}
.auth-box .btn-submit:hover { opacity: 0.85; }
.auth-alt-link { text-align: center; margin-top: 1.5rem; font-size: 0.9rem; color: var(--text-secondary); }
.auth-alt-link a { color: var(--text-primary); font-weight: 600; text-decoration: underline; }
.auth-error { 
    background-color: #fef2f2;
    border-left: 4px solid #ef4444;
    color: #b91c1c;
    padding: 1rem;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    display: none;
    text-align: left;
    border-radius: 4px;
    align-items: center;
    gap: 0.75rem;
}
.auth-success { color: #38a169; font-size: 0.85rem; margin-bottom: 1rem; display: none; text-align: center; }

/* ─── Collection Page ────────────────────────────────────── */
.collection-page { padding: 8rem 0 4rem; }
.collection-page h1 { font-size: 2.2rem; font-weight: 500; margin-bottom: 2rem; color: #121212; }

/* Filter Toolbar */
.filter-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    font-size: 0.95rem;
    color: #121212;
}

.filter-left, .filter-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.item-count {
    color: #777;
    font-size: 0.9rem;
}

/* Dropdowns */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    background: none;
    border: none;
    font-size: 0.95rem;
    color: #121212;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0;
}

.dropdown-toggle:hover {
    text-decoration: underline;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.75rem;
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    padding: 1.5rem;
    min-width: 250px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: none;
    z-index: 100;
}

.dropdown.open .dropdown-menu {
    display: block;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    cursor: pointer;
}

.checkbox-label:last-child {
    margin-bottom: 0;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #121212;
}

/* Price Filter */
.price-menu {
    min-width: 320px;
}
.price-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.input-group {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 0.5rem;
    flex: 1;
}
.input-group .currency-symbol {
    color: #777;
    margin-right: 0.5rem;
    font-size: 0.9rem;
}
.input-group input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 0.95rem;
}
.price-highest-label {
    font-size: 0.85rem;
    color: #777;
}

/* Sort & Grid */
.sort-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.sort-container label {
    color: #777;
    font-size: 0.95rem;
}
.sort-container select {
    border: none;
    background: none;
    font-size: 0.95rem;
    font-weight: 500;
    color: #121212;
    cursor: pointer;
    outline: none;
}

.grid-toggles {
    display: flex;
    gap: 0.25rem;
}
.grid-toggles button {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #ccc;
    cursor: pointer;
    padding: 0.2rem;
    transition: color 0.2s;
}
.grid-toggles button.active, .grid-toggles button:hover {
    color: #121212;
}

/* Product Grid Layouts */
.product-grid.small-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem 1rem;
}

@media (max-width: 900px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .product-grid.small-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .filter-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .filter-left, .filter-right {
        width: 100%;
        justify-content: space-between;
    }
}

/* ─── Search Modal (Popup) ─────────────────────────── */
.search-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 90%;
    max-width: 800px;
    height: auto;
    max-height: 85vh;
    background-color: white;
    z-index: 2000;
    transform: translate(-50%, -50%) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.search-modal.open {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
}

.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

.search-overlay.open {
    opacity: 1;
    visibility: visible;
}

.search-modal-inner {
    padding: 1rem 2rem;
}

.search-input-row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e2e2e2;
    padding: 1rem 0;
    margin-bottom: 1.5rem;
}

.search-input-row i.fa-magnifying-glass {
    font-size: 1.2rem;
    color: #777;
    margin-right: 1rem;
}

.search-input-row input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.2rem;
    color: #121212;
    background: transparent;
}

.search-input-row input::placeholder {
    color: #999;
}

#search-close-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #121212;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: 1rem;
}

.search-results {
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
}

@media (max-width: 768px) {
    .search-modal {
        width: 100%;
        max-width: none;
        height: 100vh;
        max-height: none;
        top: 0;
        left: 0;
        bottom: 0;
        transform: translateY(-100%);
        border-radius: 0;
    }
    
    .search-modal.open {
        transform: translateY(0);
    }
    
    .search-modal-inner {
        padding: 0 1rem;
    }
    .search-input-row input {
        font-size: 1.1rem;
    }
    .search-results-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
}


/* Markdown Content Styles */
.markdown-content h1, .markdown-content h2, .markdown-content h3 {
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 700;
}
.markdown-content h1 { font-size: 1.5rem; }
.markdown-content h2 { font-size: 1.25rem; }
.markdown-content h3 { font-size: 1.1rem; }
.markdown-content p {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}
.markdown-content ul, .markdown-content ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}
.markdown-content li {
    margin-bottom: 0.25rem;
}
.markdown-content strong, .markdown-content b {
    font-weight: 700;
    color: #111;
}
.markdown-content em, .markdown-content i {
    font-style: italic;
}
.markdown-content a {
    color: #000;
    text-decoration: underline;
}


/* Admin Layout Responsive */
.admin-layout {
  display: flex;
  min-height: 100vh;
  background: #f9fafb;
}

.admin-mobile-header {
  display: none;
}

.admin-sidebar {
  width: 250px;
  min-width: 250px;
  background: #f4f6f8;
  color: #111827;
  padding: 0;
  border-right: 1px solid #e5e7eb;
  transition: transform 0.3s ease;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
}

.admin-main {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  min-height: 100vh;
}

.admin-main-content {
  max-width: 1200px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .admin-layout {
    flex-direction: column;
  }
  
  .admin-mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #000639;
    color: white;
    z-index: 1001;
  }

  .hamburger-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
  }

  .admin-sidebar {
    position: fixed;
    top: 60px; /* Below mobile header */
    left: 0;
    width: 250px;
    height: calc(100vh - 60px);
    transform: translateX(-100%);
    z-index: 1000;
  }

  .admin-sidebar.open {
    transform: translateX(0);
  }

  .admin-sidebar-header {
    display: none !important;
  }

  .admin-main {
    padding: 1rem;
    height: auto;
    overflow-y: visible;
  }

  /* Fix tables overflowing on mobile */
  .admin-main table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  /* Fix admin product lists on mobile */
  .admin-main li {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 1rem;
  }
  
  .admin-main li > div:nth-child(2) {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }
}


/* Enhanced Button Styling */
button, .btn {
  border-radius: 6px !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease !important;
}

button:hover:not(:disabled), .btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

input, select, textarea {
  border-radius: 6px !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: #111 !important;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.1) !important;
}
