:root {
    /* Brand Colors */
    --color-primary: #000099;
    /* Deep Blue from original site */
    --color-primary-light: #1a1aeb;
    /* Brighter Blue for hover */
    --color-secondary: #e60000;
    /* Red for specials */
    --color-text: #333333;
    --color-bg: #f4f4f4;
    --color-white: #ffffff;
    --color-border: #dddddd;

    /* Spacing */
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;

    /* Layout */
    --sidebar-width: 396px;
    --header-height: 60px;

    /* Animation */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease-out;

    /* Touch Targets (WCAG 2.5.5) */
    --touch-target-min: 44px;

    /* Drawer */
    --drawer-width: 85vw;
    --drawer-max-width: 320px;

    /* Z-Index Scale */
    --z-header: 100;
    --z-drawer: 200;
    --z-backdrop: 199;
}

/* Accessibility: Skip Link */
.skip-link {
    position: absolute;
    top: -100px;
    /* Moved further up to prevent visual leak */
    left: 0;
    background: var(--color-primary);
    color: white;
    padding: 8px;
    z-index: 10000;
    transition: top 0.3s, opacity 0.3s;
    opacity: 0;
    /* Hidden visually */
}

.skip-link:focus {
    top: 0;
    opacity: 1;
    /* Visible on focus */
}

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

body {
    font-family: 'Roboto', sans-serif;
    /* consistently use Roboto */
    color: var(--color-text);
    line-height: 1.6;
    font-weight: 400;
    /* Roboto Roman (Regular) */
}

/* Typography Standards */
h1,
h2,
h3,
h4,
h5,
h6,
b,
strong,
.product-name {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    /* Roboto Bold */
}

p,
td,
li,
.product-details {
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    /* Roboto Roman */
}

/* --- Layout Grid --- */
.app-container {
    display: grid;
    min-height: 100vh;
    /* Mobile First: Stacked layout */
    grid-template-areas:
        "header"
        "content"
        "footer";
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
}

/* --- Desktop Layout (>1024px) --- */
@media (min-width: 1024px) {
    .app-container {
        grid-template-areas:
            "header header header"
            "nav center logos"
            "footer footer footer";
        grid-template-columns: var(--sidebar-width) 1fr var(--sidebar-width);
        grid-template-rows: auto 1fr auto;
        max-width: 1440px;
        margin: 0 auto;
        background-color: var(--color-white);
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);

        /* Fixed Viewport Height for Desktop */
        height: 100vh;
        overflow: hidden;
    }

    /* Scrollable Areas */
    #main-nav {
        overflow-y: auto;
    }

    #center-column {
        overflow-y: auto;
        /* Ensure content doesn't get hidden behind headers if Sticky headers are used implicitly, though here grid handles it */
        height: 100%;
    }

    #brand-logos {
        overflow-y: auto;
    }
}

/* --- Areas --- */
/* app-logo removed */

#main-nav {
    grid-area: nav;
    background-color: #f8f9fa;
    border-right: 1px solid var(--color-border);
    padding: var(--spacing-md);
    display: none;
    /* Hidden on mobile by default, toggled via JS */
}

#center-column {
    grid-area: center;
    /* Or 'content' on mobile */
    display: flex;
    flex-direction: column;
    padding: var(--spacing-md);
    overflow-x: hidden;
    /* Prevent horizontal scroll */
}

#global-header {
    grid-area: header;
    background-color: #fff;
    /* border-bottom removed per user request */
    padding: 10px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;

    /* Sticky Positioning */
    position: sticky;
    top: 0;
    z-index: 1000;
}

#main-content {
    flex: 1;
    background-color: var(--color-white);
    /* CSS Isolation for legacy content */
    contain: content;
    width: 100%;
}

#brand-logos {
    grid-area: logos;
    border-left: 1px solid var(--color-border);
    padding: var(--spacing-md);
    display: none;
    /* Hidden on mobile, moved to footer */
}

#global-footer {
    grid-area: footer;
    background-color: var(--color-primary);
    color: var(--color-white);
    padding: var(--spacing-lg);
    text-align: center;
}

/* --- Mobile Visibility Overrides --- */
@media (min-width: 1024px) {
    #main-nav {
        display: block;
    }

    #brand-logos {
        display: block;
    }

    #mobile-header {
        display: none;
    }
}

@media (max-width: 1023px) {
    .app-container {
        grid-template-areas:
            "mobile-header"
            "center"
            "footer";
    }

    #center-column {
        grid-area: center;
    }

    #mobile-header {
        grid-area: mobile-header;
        background: var(--color-primary);
        color: white;
        padding: var(--spacing-md);
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* Hide desktop elements on mobile */
    #global-header {
        display: none !important;
    }

    /* Responsive overrides for legacy content */
    #legacy-container table {
        width: 100% !important;
        display: block;
    }

    #legacy-container tbody,
    #legacy-container tr,
    #legacy-container td {
        display: block;
        width: 100% !important;
        text-align: center !important;
        /* Center align for better mobile view */
        height: auto !important;
        /* Override fixed heights */
    }

    #legacy-container td {
        padding: 10px;
        border-bottom: 1px solid #eee;
    }

    #legacy-container img {
        max-width: 100% !important;
        height: auto !important;
        display: inline-block;
    }
}

/* --- Global Utilities --- */
/* PDF Icon Badge Removed per user request */

/* Fix for Product Page Legacy Wrappers */
#forrelli {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    height: auto !important;
    overflow-y: visible !important;
    max-width: 100%;
}

/* =====================================================
   Product Modern Styles (for modernized product pages)
   ===================================================== */

/* Category Header - Blue background bar */
.category-header {
    background: #000099;
    color: white;
    padding: 12px 15px;
    text-align: center;
    font-size: 1.25rem;
    font-weight: bold;
    font-style: italic;
    margin-bottom: 0;
    font-family: 'Times New Roman', Times, serif;
}

/* Product Container */
.product-container {
    max-width: 100%;
    margin: 0;
    padding: 0 15px;
}

/* Product List */
.product-list {
    display: flex;
    flex-direction: column;
}

/* Product Item */
.product-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #ddd;
    align-items: flex-start;
}

.product-item:last-child {
    border-bottom: none;
}

/* Product Media (Image + PDF Link) */
.product-media {
    text-align: center;
    min-width: 120px;
    flex-shrink: 0;
}

.product-media img {
    max-height: 180px;
    width: auto;
    display: block;
    margin: 0 auto;
}

.product-media .spec-link,
.product-media .spec-link:link,
.product-media .spec-link:visited,
.spec-link,
.spec-link:link,
.spec-link:visited,
a.spec-link,
a.spec-link:link,
a.spec-link:visited {
    display: block;
    margin-top: 8px;
    font-size: 0.85rem;
    color: #000099 !important;
    text-decoration: none;
}

.product-media .spec-link:hover,
.spec-link:hover,
a.spec-link:hover {
    text-decoration: underline;
    color: #000099 !important;
}

/* Product Info */
.product-info {
    flex: 1;
    text-align: left;
    font-weight: bold;
    font-style: italic;
    font-family: 'Times New Roman', Times, serif;
    color: #330033;
}

.product-info .upc {
    font-size: 0.875rem;
    color: #666;
    display: block;
    margin-bottom: 5px;
}

.product-info h2 {
    font-size: 1rem;
    margin: 0 0 8px 0;
    font-weight: bold;
    font-style: italic;
    font-family: 'Times New Roman', Times, serif;
    color: #330033;
}

.product-info .specs {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
}

.product-info .specs li {
    margin-bottom: 3px;
}

/* Responsive Product Layout */
@media (max-width: 600px) {
    .product-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .product-info {
        text-align: center;
    }

    .product-media {
        min-width: auto;
    }
}

/* =====================================================
   Mobile Navigation System (Woodmart-inspired)
   ===================================================== */

/* --- Drawer Backdrop --- */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-backdrop);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-fast), visibility var(--transition-fast);
}

.drawer-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* --- Mobile Drawer --- */
.mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--drawer-width);
    max-width: var(--drawer-max-width);
    height: 100%;
    background: var(--color-white);
    z-index: var(--z-drawer);
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    will-change: transform;
}

.mobile-drawer.open {
    transform: translateX(0);
}

/* Drawer Header */
.drawer-header {
    display: flex;
    justify-content: flex-end;
    /* Keep close button on right */
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
}

.drawer-close {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.drawer-close:hover {
    background: var(--color-border);
}

.drawer-close svg {
    width: 24px;
    height: 24px;
}

/* --- Search in Drawer --- */
.drawer-search {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
}

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

.search-input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition-fast);
}

.search-input:focus {
    border-color: var(--color-primary);
}

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

.search-clear {
    position: absolute;
    right: 8px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.search-clear.visible {
    display: flex;
}

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

.search-icon {
    position: absolute;
    left: 12px;
    width: 20px;
    height: 20px;
    color: #999;
    pointer-events: none;
}

/* Search Results */
.search-results {
    max-height: 200px;
    overflow-y: auto;
    margin-top: var(--spacing-sm);
    display: none;
}

.search-results.visible {
    display: block;
}

.search-result-item {
    padding: 10px;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.search-result-item:hover {
    background: var(--color-bg);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-name {
    font-weight: 600;
    color: var(--color-text);
}

.search-result-upc {
    font-size: 0.85rem;
    color: #666;
}

.search-no-results {
    padding: 15px;
    text-align: center;
    color: #666;
    display: none;
}

.search-no-results.visible {
    display: block;
}

.search-loading {
    padding: 15px;
    text-align: center;
    color: #666;
    display: none;
}

.search-loading.visible {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* --- Drawer Tabs --- */
.drawer-tabs {
    display: flex;
    border-bottom: 2px solid var(--color-border);
}

.drawer-tab {
    flex: 1;
    padding: 14px 16px;
    border: none;
    background: transparent;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    cursor: pointer;
    position: relative;
    transition: color var(--transition-fast);
}

.drawer-tab.active {
    color: var(--color-primary);
}

.drawer-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-primary);
}

.drawer-tab:hover:not(.active) {
    color: var(--color-text);
}

/* Drawer Tab Content */
.drawer-tab-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md);
}

.drawer-tab-panel {
    display: none;
}

.drawer-tab-panel.active {
    display: block;
}



/* --- Hamburger Button --- */
#menu-toggle {
    width: var(--touch-target-min);
    height: var(--touch-target-min);
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border-radius: 4px;
    transition: background var(--transition-fast);
}

#menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

#menu-toggle:active {
    background: rgba(255, 255, 255, 0.2);
}

#menu-toggle svg {
    width: 28px;
    height: 28px;
}

/* Body scroll lock when drawer is open */
body.drawer-open {
    overflow: hidden;
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {

    .mobile-drawer,
    .drawer-backdrop,
    .drawer-tab,
    .search-input {
        transition: none;
    }
}

/* --- Desktop Search in Header --- */
@media (min-width: 1024px) {
    .header-search {
        display: flex;
        align-items: center;
        max-width: 300px;
        margin-left: auto;
        margin-right: var(--spacing-md);
    }

    .header-search .search-input-wrapper {
        width: 100%;
    }

    .header-search .search-input {
        padding: 8px 36px 8px 12px;
        font-size: 0.9rem;
    }

    .mobile-drawer,
    .drawer-backdrop {
        display: none !important;
    }

    /* Enforce Blue Search Button on Desktop */
    .header-search .search-submit {
        background-color: var(--color-primary) !important;
        color: white !important;
        border: none !important;
    }
}

/* --- Drawer Menu List --- */
/* --- Drawer Menu List --- */
.drawer-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.drawer-menu-list li {
    margin-bottom: 8px;
    border-bottom: none;
    /* Removed border */
}

/* Updated to match Admin Button Styling */
.drawer-menu-list a {
    display: block;
    padding: 12px 24px;
    background-color: var(--color-primary);
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 8px;
    /* Softer corners */
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 153, 0.3);
    border: none;
}

.drawer-menu-list a:hover {
    background-color: var(--color-primary-light);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 153, 0.4);
}



.drawer-menu-list .highlight-link {
    background-color: #ffe200;
    /* User requested Yellow */
    color: #000;
    font-weight: bold;
}

.drawer-menu-list .highlight-link:hover,
.drawer-menu-list .highlight-link.active {
    background-color: #ffe200 !important;
    /* Stay Yellow */
    color: #000 !important;
}

/* Special Order Links & Specials - Always Red (override all states) */
.drawer-menu-list .special-order,
.drawer-menu-list .special-order:link,
.drawer-menu-list .special-order:visited,
.drawer-menu-list .special-order:active,
.drawer-menu-list .special-order:focus,
.drawer-menu-list .special-link,
.drawer-menu-list a.special-order,
.drawer-menu-list li a.special-order,
.drawer-menu-list a[href*="special-order"],
.drawer-menu-list li a[href*="special-order"] {
    background-color: #CC0000 !important;
    background: #CC0000 !important;
    color: white !important;
}

.drawer-menu-list .special-order:hover,
.drawer-menu-list a.special-order:hover,
.drawer-menu-list a[href*="special-order"]:hover {
    background-color: #AA0000 !important;
    background: #AA0000 !important;
    color: white !important;
    box-shadow: 0 4px 8px rgba(204, 0, 0, 0.4) !important;
}

/* Active/Current Page - Red with yellow glow */
.drawer-menu-list .special-order.active,
.drawer-menu-list a.special-order.active,
.drawer-menu-list a[href*="special-order"].active,
.drawer-menu-list a[href*="special-order"][style*="box-shadow"] {
    background-color: #CC0000 !important;
    background: #CC0000 !important;
    color: white !important;
}


/* --- Drawer Logo --- */
.drawer-logo {
    display: none;
    /* User requested removal */
}

/* --- Mobile Search Button in Header --- */
.mobile-search-btn {
    width: var(--touch-target-min);
    height: var(--touch-target-min);
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border-radius: 4px;
}

.mobile-search-btn svg {
    width: 24px;
    height: 24px;
}

@media (min-width: 1024px) {
    .mobile-search-btn {
        display: none;
    }

    .bottom-search-bar {
        display: none;
    }
}

/* --- Mobile Logo --- */
.mobile-logo {
    height: 38px;
    /* Reduced from 48px (20% smaller) */
    /* Increased size slightly for visibility */
    width: auto;
    display: block;
    /* Filter removed - using pre-colored image */
}

#mobile-header {
    justify-content: space-between;
    /* Ensure logo flows to right, toggle to left */
}

/* --- Bottom Search Bar --- */
/* --- Bottom Search Bar (Modern Redesign) --- */
.bottom-search-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    /* Changed from primary color to white */
    padding: 12px 16px;
    /* Increased side padding */
    z-index: 900;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    /* Softer shadow */
    transform: translateY(0);
    transition: transform var(--transition-normal);
    border-top: 1px solid #eee;
}

.bottom-search-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.bottom-search-input {
    width: 100%;
    padding: 0 50px 0 20px;
    /* Space for integrated button */
    border: 1px solid #e2e8f0;
    /* Thin subtle border */
    border-radius: 8px;
    /* Modern Rounded Rectangle */
    font-size: 16px;
    height: 46px;
    /* Comfortable height */
    outline: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    font-family: 'Roboto', sans-serif;
    color: #333;
    background-color: #ffffff;
    transition: all 0.2s ease;
}

.bottom-search-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 153, 0.1);
}

/* Integrated Mobile Search Button (New) */
.bottom-search-submit {
    position: absolute;
    right: 4px;
    top: 4px;
    bottom: 4px;
    width: 40px;
    background-color: var(--color-primary);
    border: none;
    cursor: pointer;
    color: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bottom-search-submit svg {
    width: 20px;
    height: 20px;
}

.bottom-search-clear {
    position: absolute;
    right: 50px;
    /* Adjusted to be left of submit button */
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #64748b;
    /* Darker gray for better visibility */
    padding: 4px;
    cursor: pointer;
    display: none;
    z-index: 10;
    /* Ensure above input */
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.bottom-search-clear.visible {
    display: flex !important;
    /* Force flex display */
}

.bottom-search-clear:hover {
    background-color: #f1f5f9;
    color: #ef4444;
    /* Red on hover */
}

/* Add padding to body/footer to prevent content hiding */
@media (max-width: 1023px) {
    body {
        padding-bottom: 70px;
    }
}

/* --- Modern Content Styles (About, Contact, etc) --- */
.modern-content {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    padding: 20px;
    background: #fff;
    max-width: 1000px;
    margin: 0 auto;
}

.modern-content h1 {
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 2rem;
}

.modern-content h2 {
    color: var(--color-primary);
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.modern-content p {
    margin-bottom: 15px;
    font-size: 1rem;
}

.modern-content ul {
    margin-bottom: 15px;
    padding-left: 20px;
}

.modern-content li {
    margin-bottom: 5px;
}

#holiday-list li strong {
    color: var(--color-primary);
}

.modern-content a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

.modern-content a:hover {
    text-decoration: underline;
}

.modern-content strong,
.modern-content b {
    color: #000;
}

.modern-content .float-img {
    float: right;
    margin: 0 0 20px 20px;
    max-width: 300px;
    height: auto;
    border-radius: 4px;
}