:root {
    /* Default Classic Blue Palette */
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-secondary: #28a745;
    --color-secondary-dark: #20c997;
    --color-accent: #1a1a1a;
    --color-text: #1a1a1a;
    --color-text-light: #6b7280;
    --color-border: #e5e5e5;
}

/* Color Palette: Classic Blue (Default) */
html[data-color-palette="classic-blue"] {
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-secondary: #28a745;
    --color-secondary-dark: #20c997;
    --color-accent: #1a1a1a;
}

/* Color Palette: Tactical Red */
html[data-color-palette="tactical-red"] {
    --color-primary: #dc2626;
    --color-primary-dark: #b91c1c;
    --color-secondary: #1f2937;
    --color-secondary-dark: #4b5563;
    --color-accent: #1a1a1a;
}

/* Color Palette: Forest Green */
html[data-color-palette="forest-green"] {
    --color-primary: #166534;
    --color-primary-dark: #14532d;
    --color-secondary: #365314;
    --color-secondary-dark: #15803d;
    --color-accent: #1a1a1a;
}

/* Color Palette: Desert Tan */
html[data-color-palette="desert-tan"] {
    --color-primary: #d97706;
    --color-primary-dark: #b45309;
    --color-secondary: #92400e;
    --color-secondary-dark: #78350f;
    --color-accent: #451a03;
}

/* Color Palette: Navy Blue */
html[data-color-palette="navy-blue"] {
    --color-primary: #1e3a8a;
    --color-primary-dark: #1e40af;
    --color-secondary: #0f172a;
    --color-secondary-dark: #1e293b;
    --color-accent: #0f172a;
}

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

/* Responsive base: works on browser and mobile, nothing special */
html {
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #ffffff;
    color: var(--color-text);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}
img, iframe, video {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}
@media (max-width: 600px) {
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }
}

.section-title {
    font-size: 2.75rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
    letter-spacing: -1px;
}

.section-title::after {
    content: '';
    display: block;
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, var(--color-secondary), var(--color-secondary-dark));
    margin: 1.5rem auto 0;
    border-radius: 2px;
}

/* Navigation */
.navbar {
    background: #ffffff;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #e5e5e5;
    overflow: visible;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    flex-wrap: wrap;
    position: relative;
    overflow: visible;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    gap: 4px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: #1a1a1a;
    border-radius: 2px;
    transition: all 0.3s ease;
}

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

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

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

.nav-brand h1 {
    color: #1a1a1a;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.3px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-brand h1 .header-logo {
    height: 1.75em;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    vertical-align: middle;
}

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

.nav-links a {
    text-decoration: none;
    color: #1a1a1a;
    font-weight: 400;
    font-size: 0.9375rem;
    transition: color 0.2s ease;
    padding: 0.5rem 0.75rem;
}

.nav-links a:hover {
    color: #666;
}

/* User Menu */
#user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#user-name {
    padding: 0.5rem 1.25rem;
    margin-right: 0.5rem;
    font-weight: 500;
    color: #1a1a1a;
    white-space: nowrap;
}

.badge {
    background: #1a1a1a;
    color: white;
    border-radius: 10px;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

/* Buttons */
.btn-primary {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: background 0.2s;
}

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

.btn-secondary {
    background: #e5e7eb;
    color: #374151;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #d1d5db;
}

.btn-primary:hover {
    background: #333;
}

.btn-secondary {
    background: #ffffff;
    color: #1a1a1a;
    border: 1px solid #d1d1d1;
    border-radius: 4px;
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 500;
}

.btn-secondary:hover {
    background: #f5f5f5;
    border-color: #1a1a1a;
}

.btn-large {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    width: 100%;
}

.btn-back {
    background: none;
    border: none;
    color: var(--color-secondary);
    cursor: pointer;
    font-size: 1rem;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
    font-weight: 600;
    transition: color 0.3s ease;
}

.btn-back:hover {
    color: #218838;
}

/* Pages */
.page {
    display: none;
    animation: fadeIn 0.3s;
    min-height: 60vh;
    padding: 2rem 0;
}

.page.active {
    display: block !important;
}

/* Checkout page specific styles */
#checkout-page {
    min-height: 60vh;
    padding: 2rem 0;
    width: 100%;
}

#checkout-page.active {
    display: block !important;
}

#checkout-page .container {
    display: block;
    width: 100%;
    padding: 2rem;
}

#checkout-page .checkout-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    width: 100%;
}

#checkout-page .checkout-form,
#checkout-page .checkout-summary {
    display: block;
}

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

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

.product-description {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-actions {
    display: flex;
    gap: 0.5rem;
}

/* Filters */
.filters {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
}

.filters input, .filters select {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
}

.filters input {
    flex: 1;
}

.filters select {
    min-width: 200px;
}

/* Product Detail Page */
#product-detail-page {
    display: none;
    min-height: 60vh;
    padding: 2rem 0;
    width: 100%;
}

#product-detail-page.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#product-detail-page .container {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#product-detail-content {
    min-height: 400px;
    width: 100%;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Product Detail */
.product-detail {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 300px;
}

.product-detail-image {
    width: 100%;
    border-radius: 8px;
    background: #f3f4f6;
}

.product-detail-info h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.product-detail-price {
    font-size: 2rem;
    color: var(--color-secondary);
    font-weight: 700;
    margin-bottom: 1rem;
}

.product-detail-description {
    color: #6b7280;
    margin-bottom: 2rem;
    line-height: 1.8;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.quantity-selector input {
    width: 80px;
    padding: 0.5rem;
    text-align: center;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

/* Cart */
.cart-item {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    gap: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cart-item-image-wrap {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    border-radius: 6px;
    background: #f3f4f6;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.cart-item-description {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0 0 0.5rem 0;
    line-height: 1.35;
}

.cart-item-total {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2563eb;
    align-self: flex-start;
}

.cart-item-price {
    color: var(--color-secondary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

/* Checkout order summary items */
.checkout-item-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e5e7eb;
    gap: 1rem;
}
.checkout-item-detail {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}
.checkout-item-name {
    font-weight: 600;
    color: #1f2937;
}
.checkout-item-desc {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.35;
}
.checkout-item-qty {
    font-size: 0.8125rem;
    color: #9ca3af;
}
.checkout-item-total {
    font-weight: 600;
    color: #2563eb;
    flex-shrink: 0;
}

/* Cart page: single summary on the side (no full-width breakdown) */
.cart-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    width: 100%;
    margin-top: 1rem;
}
.cart-main {
    min-width: 0;
}
.cart-summary-side {
    align-self: start;
}
.cart-summary-side .cart-summary {
    margin-top: 0;
    position: sticky;
    top: 1rem;
}
@media (max-width: 768px) {
    .cart-container {
        grid-template-columns: 1fr;
    }
    .cart-summary-side {
        order: -1; /* Summary first on small screens, still only one summary */
    }
}

.cart-summary {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-top: 2rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.summary-row.total {
    font-size: 1.25rem;
    font-weight: 700;
    border-bottom: none;
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 2px solid #e5e7eb;
}

/* Checkout */
.checkout-container {
    display: grid !important;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
}

.checkout-form, .checkout-summary {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.payment-method-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.payment-method-option {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.2s, background 0.2s;
}
.payment-method-option:hover {
    border-color: #2563eb;
    background: #f8fafc;
}
.payment-method-option input[type="radio"] {
    margin: 0;
    cursor: pointer;
}
.payment-method-option input[type="radio"]:checked + .payment-method-label {
    font-weight: 600;
}
.payment-method-option:has(input:checked) {
    border-color: #2563eb;
    background: #eff6ff;
}

.checkout-form h3, .checkout-summary h3 {
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Mobile-friendly form inputs */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
textarea,
select {
    font-size: 16px; /* Prevents zoom on iOS */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}


.form-row.three {
    grid-template-columns: 1fr 1fr 1fr;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 16px; /* Prevents zoom on iOS */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    margin-bottom: 1rem;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Auth */
.auth-container {
    max-width: 400px;
    margin: 3rem auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    width: 100%;
}

.auth-container h2 {
    margin-bottom: 1.5rem;
    text-align: center;
}

.auth-container form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-container p {
    text-align: center;
    margin-top: 1rem;
    color: #6b7280;
}

.auth-container a {
    color: var(--color-secondary);
    text-decoration: none;
    font-weight: 600;
}

.auth-container a:hover {
    color: #218838;
    text-decoration: underline;
}

/* Account - tabs visible whenever account page is shown (.active or body class) */
body.on-account-page #account-page,
#account-page.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}
body.on-account-page #account-tabs-row,
#account-page.active #account-tabs-row,
#account-page #account-tabs-row {
    display: flex !important;
    visibility: visible !important;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e5e7eb;
}
body.on-account-page #account-tabs-row .tab-btn,
#account-page.active #account-tabs-row .tab-btn,
#account-page #account-tabs-row .tab-btn {
    display: inline-block !important;
    visibility: visible !important;
}
#account-page {
    pointer-events: auto;
    position: relative;
    z-index: 50;
}

#account-page .container {
    display: block;
    width: 100%;
    pointer-events: auto;
}

#account-page .account-tabs {
    display: flex !important;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 0.5rem 0 0 0;
    border-bottom: 2px solid #e5e7eb;
    visibility: visible;
    pointer-events: auto;
    background: #f9fafb;
    border-radius: 8px 8px 0 0;
}

#account-page .tab-btn {
    display: inline-block !important;
    padding: 1rem 2rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    color: #6b7280;
    transition: all 0.3s;
    flex-shrink: 0;
    visibility: visible;
    pointer-events: auto;
}

#account-page .tab-btn.active {
    color: var(--color-secondary);
    border-bottom-color: var(--color-secondary);
}

#account-page .account-tab {
    display: none;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#account-page .account-tab.active {
    display: block !important;
}

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--color-secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #1f2937;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: none;
    z-index: 1001;
    animation: slideIn 0.3s;
}

.toast.show {
    display: block;
}

.toast.success {
    background: #10b981;
}

/* Policy Modal */
.policy-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 99999 !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px;
    box-sizing: border-box;
}

.policy-modal[style*="display: flex"],
.policy-modal.show {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.policy-modal-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(2px);
    z-index: 100000;
}

.policy-modal-content {
    position: relative !important;
    background: white !important;
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    z-index: 100001 !important;
    margin: 0 !important;
    transform: none !important;
}

.policy-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
}

.policy-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #1f2937;
}

.policy-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.policy-modal-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.policy-modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.policy-modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
}

/* Scrollbar styling for modal content */
.policy-modal-body::-webkit-scrollbar {
    width: 8px;
}

.policy-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.policy-modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.policy-modal-body::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.toast.error {
    background: #ef4444;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}


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

/* Banners */
#banners-container {
    width: 100%;
}

.banners-section {
    width: 100%;
    margin-bottom: 2rem;
}

.banner-item {
    width: 100%;
    max-width: 900px;
    margin: 0 auto 1.5rem;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.banner-item:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.banner-link {
    display: block;
    text-decoration: none;
    cursor: pointer;
}

.banner-image {
    width: 100%;
    height: auto;
    max-height: 200px;
    display: block;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.banner-item:hover .banner-image {
    transform: scale(1.03);
}

.banner-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.75), transparent);
    color: white;
    padding: 1rem 1.25rem 0.75rem;
    font-size: 1.1rem;
    font-weight: 700;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.6);
}

.banners-homepage-top {
    margin-bottom: 0;
}

.banners-homepage-middle {
    margin: 3rem 0;
}

.banners-homepage-bottom {
    margin-top: 3rem;
}

.banners-all-top {
    margin-bottom: 2rem;
}

.banners-all-bottom {
    margin-top: 2rem;
}

/* Enhanced Product Cards */
.product-card {
    background: #ffffff;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid #e5e5e5;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-color: #1a1a1a;
}

.product-card-image-wrap {
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
}

.product-card-image-wrap .product-image {
    display: block;
}

.warehouse-fulfillment-banner {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.7));
    color: #fff;
    text-align: center;
    padding: 0.5rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.lipsey-detail-image-wrap {
    margin-bottom: 1rem;
    border-radius: 6px;
    overflow: hidden;
}

.lipsey-detail-image-wrap .warehouse-fulfillment-banner {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #f5f5f5;
    transition: transform 0.3s ease;
}

/* Home page feed: show full image (fit, don't crop) */
.home-search-form .form-group { margin-bottom: 0; }
.home-search-main {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}
.home-search-main input { min-width: 200px; }
.home-search-advanced {
    margin-top: 1rem;
    padding: 1.25rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}
.home-search-advanced-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}
.home-search-advanced-grid .form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #374151;
}
.home-search-advanced-grid input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
}

.lipsey-feed-section .product-image {
    object-fit: contain;
    height: 220px;
    background: #f9fafb;
}

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

.product-info {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 0.9375rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.75rem;
    margin-top: auto;
}

.product-description {
    color: #666;
    font-size: 0.8125rem;
    margin-bottom: 0.75rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.product-card-specs,
.product-card-meta {
    color: #6b7280;
    font-size: 0.75rem;
    margin: 0 0 0.35rem 0;
    line-height: 1.4;
}

.product-card-badges {
    margin-bottom: 0.35rem;
}

.product-card-ffl {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #92400e;
    background: #fef3c7;
    border-radius: 4px;
}

/* MAP: "See price in cart" sales tag when price is below Minimum Advertised Price */
.product-card-map-tag {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    background: #dc2626;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.product-card-badges-image {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 2;
}

.product-card-msrp {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 400;
    text-decoration: line-through;
    margin-left: 0.35rem;
}

.lipsey-detail-specs {
    border-collapse: collapse;
}
.lipsey-detail-specs td {
    vertical-align: top;
}
.lipsey-detail-specs tr:not(:last-child) td {
    border-bottom: 1px solid #f3f4f6;
}

.product-actions {
    display: flex;
    gap: 0.5rem;
}

.product-actions .btn-primary {
    flex: 1;
    text-align: center;
}

/* Featured Categories */
/* Hero Banner Section */
.hero-banner-section {
    background: #f5f5f5;
    padding: 0;
    margin-bottom: 2rem;
}

#banners-container {
    width: 100%;
}

/* Categories Section - Dropdown Menu Style (Ruby Love eCommerce style) */
.categories-section {
    background: #ffffff;
    padding: 0;
    border-bottom: 1px solid #e5e5e5;
    display: block !important;
}

.category-dropdown-nav {
    display: flex !important;
    justify-content: center;
    align-items: center;
    min-height: 48px;
    padding: 0.75rem 1rem;
    max-width: 100%;
    background: #ffffff;
    list-style: none;
    margin: 0;
    flex-wrap: wrap !important;
    gap: 0.5rem;
}

/* Category Dropdown Wrapper */
.category-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

/* Category Menu Link (Main Navigation Item) */
.category-menu-link {
    display: flex;
    align-items: center;
    padding: 0.625rem 1.25rem;
    color: #1a1a1a;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.category-menu-link:hover {
    color: var(--color-primary);
    background: #f8f9fa;
    border-color: var(--color-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.dropdown-arrow {
    margin-left: 0.25rem;
    font-size: 0.65rem;
    color: #666;
    transition: transform 0.2s ease;
}

.category-dropdown-wrapper:hover .dropdown-arrow {
    transform: rotate(180deg);
}

/* Category Dropdown Menu */
.category-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    min-width: 220px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e5e5;
    border-top: none;
    z-index: 1000;
    padding: 0.75rem 0;
    margin-top: 0;
}

.category-dropdown-wrapper:hover .category-dropdown {
    display: block;
}

/* Dropdown Items */
.dropdown-item {
    display: block;
    padding: 0.875rem 1.5rem;
    color: #1a1a1a;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 400;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.dropdown-item:hover {
    background: #f8f9fa;
    color: #1a1a1a;
    border-left-color: #1a1a1a;
    padding-left: 1.75rem;
}

/* Featured Products Section */
/* Products Section */
.products-section {
    background: #f8f9fa;
    padding: 4rem 0;
}

.btn-view-all {
    background: var(--color-secondary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-view-all:hover {
    background: #218838;
    transform: translateX(4px);
}

.search-section {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.search-wrapper {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-wrapper input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-wrapper input:focus {
    border-color: var(--color-secondary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.search-wrapper .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 1.1rem;
}

.category-select-modern {
    padding: 0.875rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    min-width: 200px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-select-modern:focus {
    border-color: var(--color-secondary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.filters-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    align-items: center;
}

.search-box {
    flex: 1;
    position: relative;
    max-width: 500px;
}

.search-box input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid #e9ecef;
    border-radius: 50px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #ffffff;
}

.search-box input:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    pointer-events: none;
}

.category-select {
    padding: 1rem 1.5rem;
    border: 2px solid #e9ecef;
    border-radius: 50px;
    font-size: 1rem;
    background: #ffffff;
    cursor: pointer;
    min-width: 200px;
    transition: all 0.3s ease;
    color: #2c3e50;
}

.category-select:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

/* Enhanced Product Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2.5rem;
    margin-top: 2rem;
}

/* Responsive Design */

/* Tablet and below (768px and below) */
@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    
    .container {
        padding: 0 16px;
    }
    
    .navbar .container {
        padding: 0 16px;
    }
    
    .nav-brand h1 {
        font-size: 1.25rem;
    }
    
    /* Mobile Menu Toggle */
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #ffffff;
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        border-top: 1px solid #e5e5e5;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        display: none !important;
        gap: 0.5rem;
        z-index: 1001;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }
    
    .nav-links.active {
        display: flex !important;
    }
    
    .nav-links a {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #f0f0f0;
        width: 100%;
        text-align: left;
    }
    
    #auth-buttons {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
        margin-top: 0.5rem;
    }
    
    #auth-buttons button {
        width: 100%;
    }
    
    #user-menu {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
        margin-top: 0.5rem;
    }
    
    #user-name {
        padding: 0.75rem;
        text-align: center;
        border-bottom: 1px solid #f0f0f0;
        width: 100%;
    }
    
    #user-menu button {
        width: 100%;
    }
    
    .filters-bar {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-box {
        max-width: 100%;
        width: 100%;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .product-card {
        padding: 1rem;
    }
    
    .product-card img {
        height: 150px;
    }
    
    .product-card h3 {
        font-size: 0.9375rem;
    }
    
    .category-dropdown-nav {
        flex-wrap: nowrap !important;
        padding: 0.75rem 0.5rem;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        scrollbar-width: thin;
        scrollbar-color: #cbd5e1 transparent;
        gap: 0.5rem;
    }
    
    .category-dropdown-nav::-webkit-scrollbar {
        height: 4px;
    }
    
    .category-dropdown-nav::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .category-dropdown-nav::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 2px;
    }
    
    .category-menu-link {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .category-dropdown {
        min-width: 200px;
        position: absolute;
        left: 0;
        right: auto;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        border: 1px solid #e5e5e5;
        margin-top: 0;
        z-index: 1000;
    }
    
    .category-dropdown-wrapper {
        position: relative;
        display: inline-block;
    }
    
    .dropdown-item {
        padding: 0.75rem 1.25rem;
        font-size: 0.8125rem;
    }
    
    .banner-image {
        max-height: 200px;
    }
    
    .banner-title {
        font-size: 1.2rem;
        padding: 1.5rem 1rem 0.75rem;
    }
    
    .checkout-container {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }
    
    .checkout-form, .checkout-summary {
        padding: 1.5rem;
        width: 100%;
    }
    
    .checkout-form h3, .checkout-summary h3 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .checkout-form input,
    .checkout-form textarea,
    .checkout-form select {
        font-size: 16px !important; /* Prevents zoom on iOS */
        padding: 0.875rem !important;
        min-height: 44px; /* Touch-friendly size */
    }
    
    .checkout-form .form-row {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    
    .checkout-summary {
        order: -1; /* Show summary first on mobile */
    }
    
    #coupon-code-input {
        font-size: 16px !important;
        padding: 0.875rem !important;
        min-height: 44px;
    }
    
    #apply-coupon-btn,
    #remove-coupon-btn {
        padding: 0.875rem 1rem !important;
        min-height: 44px;
        font-size: 0.875rem;
    }
    
    .checkout-form button.btn-primary.btn-large {
        width: 100%;
        padding: 1rem !important;
        font-size: 1rem;
        min-height: 48px;
    }
    
    .product-detail {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .auth-container {
        margin: 2rem auto;
        padding: 1.5rem;
        max-width: 100%;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .btn-secondary,
    .btn-primary {
        padding: 0.75rem 1.25rem;
        font-size: 0.9375rem;
    }
    
    .btn-large {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
}

/* Tablet Styles */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 0 20px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1.5rem;
    }
    
    .section-title {
        font-size: 2.25rem;
    }
    
    .category-dropdown-nav {
        flex-wrap: wrap !important;
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }
    
    .category-menu-link {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
    
    .product-detail {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Mobile Styles (Small) */
@media (max-width: 480px) {
    .navbar {
        padding: 0.75rem 0;
    }
    
    .navbar .container {
        padding: 0 12px;
    }
    
    .nav-brand h1 {
        font-size: 1.125rem;
    }
    
    .nav-links {
        gap: 0.25rem;
    }
    
    .nav-links a {
        font-size: 0.8125rem;
        padding: 0.375rem 0.5rem;
    }
    
    .section-title {
        font-size: 1.75rem;
        margin-bottom: 2rem;
    }
    
    .container {
        padding: 0 12px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .product-card {
        padding: 0.75rem;
    }
    
    .product-card img {
        height: 120px;
    }
    
    .product-card h3 {
        font-size: 0.875rem;
    }
    
    .product-card .price {
        font-size: 1rem;
    }
    
    .category-dropdown-nav {
        padding: 0.75rem 0.5rem;
        gap: 0.5rem;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }
    
    .category-menu-link {
        padding: 0.5rem 0.875rem;
        font-size: 0.75rem;
        flex-shrink: 0;
    }
    
    .auth-container {
        margin: 1rem auto;
        padding: 1.25rem;
        max-width: 100%;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .btn-large {
        padding: 0.875rem 1.5rem;
        font-size: 0.9375rem;
    }
    
    .checkout-container {
        grid-template-columns: 1fr !important;
        gap: 1.25rem;
    }
    
    .checkout-form, .checkout-summary {
        padding: 1.25rem;
    }
    
    .checkout-form input,
    .checkout-form textarea,
    .checkout-form select {
        font-size: 16px !important;
        padding: 0.875rem !important;
        min-height: 44px;
    }
    
    .checkout-form .form-row {
        grid-template-columns: 1fr !important;
    }
    
    #coupon-code-input {
        font-size: 16px !important;
        padding: 0.875rem !important;
        min-height: 44px;
    }
    
    #apply-coupon-btn,
    #remove-coupon-btn {
        padding: 0.875rem 0.75rem !important;
        min-height: 44px;
        font-size: 0.8125rem;
    }
    
    .checkout-form button.btn-primary.btn-large {
        width: 100%;
        padding: 1rem !important;
        font-size: 0.9375rem;
        min-height: 48px;
    }
    
    .product-detail {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .product-detail img {
        width: 100%;
        height: auto;
    }
    
    #user-menu {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }
    
    #user-name {
        text-align: center;
        padding: 0.5rem;
    }
    
    #auth-buttons {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }
    
    #auth-buttons button {
        width: 100%;
    }
    
    .banner-image {
        max-height: 150px;
    }
    
    .banner-title {
        font-size: 1rem;
        padding: 1rem 0.75rem 0.5rem;
    }
    
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .cart-item-image {
        width: 100%;
        max-width: 200px;
        height: auto;
        margin: 0 auto;
    }
    
    .cart-item-info {
        width: 100%;
    }
    
    .cart-item-actions {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    #account-page .account-tabs {
        flex-wrap: wrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    #account-page .tab-btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        white-space: nowrap;
    }
    
    .product-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .product-actions .btn-primary {
        width: 100%;
    }
    
    .product-detail {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 1.5rem;
    }
    
    .product-detail-image {
        max-height: 400px;
        object-fit: contain;
    }
    
    .product-detail-info h2 {
        font-size: 1.5rem;
    }
    
    .product-detail-price {
        font-size: 1.5rem;
    }
    
    .toast {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
    }
}

/* Large Desktop */
/* Desktop Styles - Ensure category menu stays on one line */
@media (min-width: 1025px) {
    .category-dropdown-nav {
        flex-wrap: wrap !important;
        padding: 0.75rem 1rem !important;
        gap: 0.5rem !important;
    }
    
    .category-menu-link {
        padding: 0.625rem 1.25rem !important;
        font-size: 0.875rem !important;
        white-space: nowrap !important;
    }
    
    .dropdown-arrow {
        margin-left: 0.25rem !important;
        font-size: 0.65rem !important;
    }
}

@media (min-width: 1400px) {
    .container {
        max-width: 1600px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

/* ----- 404 Not Found (branded) ----- */
.page-404 {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
}
.not-found-wrap {
    text-align: center;
    max-width: 480px;
    margin: 0 auto;
}
.not-found-code {
    font-size: clamp(4rem, 15vw, 8rem);
    font-weight: 800;
    line-height: 1;
    color: var(--color-primary);
    letter-spacing: -0.04em;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.06);
}
.not-found-tagline {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}
.not-found-sub {
    color: var(--color-text-light);
    margin-bottom: 2rem;
    font-size: 1rem;
}
.not-found-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}
.not-found-actions .btn {
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
}
.not-found-footer {
    font-size: 0.8rem;
    color: var(--color-text-light);
    font-style: italic;
}

