/* ============================================== */
/* --- 1. DEFAULT / EXTRA SMALL (MOBILE-FIRST) --- */
/* ============================================== */

/* Basic reset/styling */
body {
    /* Vintage Library Color Palette */
    font-family: Arial, sans-serif;
    background-color: #F6F2EA; /* Parchment Background */
    margin: 0;
    color: #343A40; /* Charcoal Text */
}

a {
    text-decoration: none;
    color: inherit; /* Inherit body color by default */
}

/* CONTAINER DEFAULTS (Mobile) */
.container {
    width: 100%; 
    padding: 0 15px; 
    box-sizing: border-box;
    margin: 0 auto;
    background-color: #EDE8E1; /* Slightly Darkened Background for distinction */
}


/* =========================== */
/* --- 2. HEADER COMPONENT --- */
/* =========================== */

.header-row {
    display: flex;
    align-items: center; 
    justify-content: space-between; 
    padding: 10px 0;
    flex-wrap: wrap; /* IMPORTANT: Allows elements to wrap onto the next line */
    background-color: #E4DED4; /* Medium Darkened color for header background */
}

/* Ensure the logo area doesn't shrink */
.header-row > a {
    flex-shrink: 0; 
    transition: opacity 0.2s;
    /* FIX: Added display: block to ensure margin auto works on desktop */
    display: block; 
}

.header-logo {
    height: 30px;
    margin-left: 10px;
    margin-right: 5px;
}

/* --- Search Input & Button Group --- */

.header-search {
    flex-grow: 1; 
    display: flex;
    align-items: center;
    padding: 0 15px;
    max-width: 400px; /* Constrains the search bar width on large screens */
    margin-left: 5px;
    margin-right: 5px;
}

.header-search input {
    flex-grow: 1; 
    padding: 8px 10px;
    border: 1px solid #C2B280;
    border-radius: 4px 0 0 4px;
    background-color: #F6F2EA;
    color: #1E423F;
    border-right: none; 
}

.search-button {
    background-color: #C2B280; /* Muted Gold */
    border: 1px solid #C2B280;
    border-left: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    height: 34px;
    outline: none;
    appearance: none;
    line-height: 0; 
}

.search-button svg {
    width: 20px;
    height: 20px;
    fill: #532C2E; /* Aged Leather */
}

.search-button:hover {
    background-color: #532C2E;
}

.search-button:hover svg {
    fill: #F6F2EA;
}

/* --- Cart Icon --- */

.header-nav {
    display: flex; 
    align-items: center;
    gap: 15px;
    flex-shrink: 0; 
    margin-right: 10px;
    margin-left: 5px;
}

.cart-icon-link svg {
    width: 24px; 
    height: 24px;
    fill: #532C2E; 
    transition: fill 0.2s;
}

.cart-icon-link:hover svg {
    fill: #C2B280; 
}

/* =========================== */
/* --- 3. HERO COMPONENT --- */
/* =========================== */

.hero-container {
    position: relative;
    width: 100%;
    max-width: 1200px; 
    margin: 0 auto;
}

.hero-image {
    width: 100%;
    height: 200px; /* ADDED: Defines a fixed height for the image area */
    display: block;
    /* FIX: Set opacity to 100% or adjust your image source. */
    /* An opacity of 25% makes the image almost transparent and text hard to read. */
    opacity: 1; 
    border-radius: 5px;

    object-fit: cover; /* ADDED: Ensures the image covers the area, cropping content */
    object-position: center; /* ADDED: Centers the image content when cropping */

    /* Optional: If image is too bright, apply a darker overlay in HTML/CSS */
    /* filter: brightness(70%); */
}

.hero-content-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    display: flex;
    flex-direction: column;
    align-items: center; 
    justify-content: space-between; 
    
    padding: 20px; 
    box-sizing: border-box;
}

.hero-text {
    /* FIX: Change text color for better contrast if image opacity is 1 */
    color: #343A40; 
    background-color: rgba(246, 242, 234, 0.8); /* Parchment color with transparency */
    padding: 10px 20px;
    font-size: 1.5rem; 
    text-align: center;
    max-width: 90%; 
    border-radius: 5px;
    font-weight: bold;
}

.hero-button {
    /* Adjust button size for mobile touch targets */
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    border: none;
    border-radius: 8px;
    background-color: #C2B280; /* Muted Gold */
    color: #532C2E; /* Aged Leather Text */
    margin-bottom: 20px; 
    white-space: nowrap; 
    display: inline-block;
}


/* ================================== */
/* --- 4. BREAKPOINTS AND LAYOUTS --- */
/* ================================== */

/* --- A. Tablet/Desktop Breakpoint: Min-width 610px --- */
@media (min-width: 610px) {
    /* Center the main content container */
    .container {
        max-width: 960px; 
        padding: 0; 
    }
}


/* --- B. Mobile Stacking Fix: Max-width 609px --- */
@media (max-width: 609px) {
    
    /* 1. Logo takes up full width and centers itself */
    .header-row > a {
        width: 100%; 
        text-align: center; 
        margin-bottom: 10px; 
        margin-left: 0;
        margin-right: 0;
    }

    /* 2. Search and Cart share the second line */
    .header-search {
        max-width: none; 
        flex-grow: 1;
        /* Padding fix: removed right padding on search, added left padding on cart */
        padding: 0 0 0 15px; 
        margin-right: 0;
        margin-left: 0;
    }
    
    /* 3. Cart container alignment */
    .header-nav {
        /* FIX: Use margin-left: auto to push to the right edge */
        margin-left: 5px; 
        margin-right: 15px; /* Add margin back to the right edge */
    }

    /* Ensure the logo image itself is centered */
    .header-row > a .header-logo {
        margin: 0 auto;
        display: block;
    }
    
    /* Hero element adjustments for smaller screens (already in your original code) */
    .hero-text {
        font-size: 1.1rem; 
        padding: 8px 15px;
    }
    .hero-button {
        padding: 12px 24px;
        font-size: 0.9rem;
    }
}


/* ======================= */
/* --- 5. FOOTER STYLE --- */
/* ======================= */

.footer {
    text-align: center;
    padding: 20px 0;
    background-color: #E4DED4;
    font-size: 0.9rem;
}

/* =========================== */
/* --- 6. CAROUSEL COMPONENT --- */
/* =========================== */

.carousel-section {
    padding-top: 30px;
    padding-bottom: 30px;
}

.carousel-section h2 {
    color: #532C2E; /* Aged Leather */
    margin-bottom: 20px;
    text-align: center;
    font-size: 2rem;
}

.carousel-wrapper {
    position: relative;
    display: flex; /* Centers the navigation buttons vertically */
    align-items: center;
    padding: 0 40px;
}

/* The actual scrollable track */
.carousel-track {
    display: flex;
    overflow-x: scroll; /* Key: Enables horizontal scrolling */
    scroll-behavior: smooth; /* Key: Makes JavaScript scrolling smooth */
    -webkit-overflow-scrolling: touch; /* Improves scrolling on iOS */
    
    /* Hides the scrollbar, but still allows scrolling */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
    
    padding: 10px 0; /* Breathing room for shadows/focus */
    margin: 0 10px; /* Offset for navigation buttons */
    
    /* Remove padding set by .container on mobile */
    /* This line is mainly for the full container width handling, 
       but keeping items tight is important */
}

/* Hide scrollbar for Chrome/Safari/Opera */
.carousel-track::-webkit-scrollbar {
    display: none;
}

/* --- Book Card Styling --- */

.book-card {
    flex-shrink: 0; /* Prevents cards from shrinking when space is tight */
    width: 150px; /* Fixed width for the card (adjust as needed) */
    margin-right: 20px;
    text-align: center;
    
    transition: transform 0.2s;
}

.book-card a:hover {
    opacity: 0.8;
}

.book-cover {
    width: 100%;
    height: 225px; /* Fixed height for consistent display (150x225 is 2:3 ratio) */
    object-fit: cover; /* Ensures the image fills the space without distortion */
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.book-title {
    font-weight: bold;
    font-size: 0.95rem;
    margin: 5px 0 2px 0;
    color: #343A40;
    white-space: normal; /* Allow title text to wrap */
}

.book-author {
    font-size: 0.85rem;
    color: #7A7A7A; /* Lighter text for author */
    margin: 0;
    white-space: normal; /* Allow author text to wrap */
}

/* --- Navigation Button Styling --- */

.carousel-nav {
    background-color: rgba(194, 178, 128, 0.9); /* Muted Gold with slight transparency */
    color: #532C2E; /* Aged Leather */
    border: none;
    cursor: pointer;
    padding: 10px 5px;
    font-size: 1.5rem;
    line-height: 0;
    position: absolute;
    top: 42%;
    transform: translateY(-50%);
    z-index: 10;
    border-radius: 4px;
    transition: background-color 0.2s;
    height: 60px; /* Make the hit area taller */
    
    /* Hide on screens too small for effective carousel display (optional) */
    display: none; 
}

.carousel-nav:hover {
    background-color: #C2B280;
}

.prev-btn {
    left: 0;
}

.next-btn {
    right: 0;
}


/* ================================== */
/* --- 4. BREAKPOINTS AND LAYOUTS (Adjustment for Carousel) --- */
/* ================================== */

/* --- A. Tablet/Desktop Breakpoint: Min-width 610px --- */
@media (min-width: 610px) {
    /* ... (rest of the container and hero styles) ... */
    
    /* Show navigation buttons on wider screens */
    .carousel-nav {
        display: block; 
    }
    
    /* Adjust button positions to be outside the container padding */
    .prev-btn {
        left: 5px; 
    }

    .next-btn {
        right: 5px;
    }
}

/* ================================== */
/* --- 7. CATEGORIES/FILTER SECTION --- */
/* ================================== */

.filter-categories-section {
    padding-top: 30px;
    padding-bottom: 40px;
    text-align: center; /* Center the main title */
}

.section-title {
    color: #532C2E; /* Aged Leather */
    margin-bottom: 30px;
    font-size: 2rem;
    width: 100%;
}

/* Container for all filter groups */
.filter-categories-section {
    display: flex;
    flex-wrap: wrap; /* Allows groups to wrap on smaller screens */
    justify-content: center; /* Centers groups when there isn't a full row */
    gap: 30px; /* Space between the filter boxes */
}

/* Individual filter group box */
.filter-group {
    /* Set a base width, but allow shrinking/growing */
    width: 100%; /* Default to full width on mobile */
    max-width: 300px;
    
    background-color: #E4DED4; /* Medium Darkened background */
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.filter-title {
    color: #1E423F; /* Dark Teal Accent */
    font-size: 1.25rem;
    margin-top: 0;
    margin-bottom: 10px;
    border-bottom: 2px solid #C2B280; /* Muted Gold separator */
    padding-bottom: 5px;
}

.filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.filter-list li {
    margin: 5px 0;
}

.filter-list a {
    display: block;
    padding: 5px 10px;
    color: #343A40; /* Charcoal Text */
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
    font-size: 1rem;
}

.filter-list a:hover {
    background-color: #C2B280; /* Muted Gold highlight */
    color: #532C2E; /* Aged Leather text on hover */
}


/* ================================== */
/* --- 4. BREAKPOINTS AND LAYOUTS (Adjustment for Categories) --- */
/* ================================== */

/* --- A. Tablet/Desktop Breakpoint: Min-width 610px --- */
@media (min-width: 610px) {
    /* ... (rest of the media query styles) ... */
    
    /* Allow two groups per row on tablets/small desktops */
    .filter-group {
        width: calc(50% - 15px); /* Two columns minus half the gap */
    }
}

/* --- C. Large Desktop Breakpoint: Min-width 960px (Optional for full-width layout) --- */
@media (min-width: 960px) {
    /* Allow three groups per row on larger screens */
    .filter-group {
        width: calc(33.333% - 20px); /* Three columns minus a portion of the gap */
    }
}

/* ================================== */
/* --- 8. BROWSE PAGE LAYOUT & STYLES --- */
/* ================================== */

/* --- Layout Container (Flexbox for Sidebar + Main) --- */
.browse-page-layout {
    display: flex;
    flex-direction: column; /* Stacks sidebar and main content on mobile */
    gap: 30px;
    padding-top: 30px;
    padding-bottom: 50px;
}

/* --- Filter Sidebar --- */
.filter-sidebar {
    width: 100%; /* Full width on mobile */
    background-color: #E4DED4; /* Medium Darkened background */
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    position: relative;
    left: -20px
}

.filter-sidebar h2 {
    color: #532C2E;
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
}

.filter-group-panel {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #C2B280;
}

.filter-group-panel:last-of-type {
    border-bottom: none;
}

.panel-title {
    color: #1E423F;
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 8px;
    font-weight: bold;
}

/* Checkbox Styling */
.checkbox-list label {
    display: block;
    font-size: 0.95rem;
    color: #343A40;
    padding: 3px 0;
    cursor: pointer;
}

.checkbox-list input[type="checkbox"] {
    margin-right: 8px;
    accent-color: #C2B280; /* Changes the color of the checked box */
}

/* Apply and Clear Buttons */
.apply-filters-btn, .clear-filters-btn {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.apply-filters-btn {
    background-color: #C2B280; /* Muted Gold */
    color: #532C2E; 
}

.apply-filters-btn:hover {
    background-color: #532C2E; 
    color: #F6F2EA;
}

.clear-filters-btn {
    background-color: #EDE8E1; /* Light background */
    color: #343A40; 
    border: 1px solid #C2B280;
}

.clear-filters-btn:hover {
    background-color: #E4DED4; 
}

/* --- ACCORDION STYLES FOR SIDEBAR FILTERS (New Section) --- */

/* Make panel titles clickable and give them a pointer and display control */
.filter-group-panel .accordion-toggle {
    cursor: pointer;
    display: flex; /* Enable flex for title and icon alignment */
    justify-content: space-between;
    align-items: center;
    
    /* The border-bottom on the panel-title needs to be removed if it was here */
    border-bottom: none;
}

/* Style for the icon */
.accordion-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    margin-left: 10px;
    color: #C2B280; /* Muted Gold color for the icon */
}

/* Rotate icon when the panel is active/open */
.filter-group-panel.active .accordion-icon {
    transform: rotate(180deg);
}

/* Styles for the accordion content */
.accordion-content {
    /* Start closed by default */
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding-top: 0;
    padding-bottom: 5px;
}

/* Style for when the panel is active/open */
.filter-group-panel.active .accordion-content {
    max-height: 500px; /* Large value to accommodate content */
    padding-top: 10px;
}

/* --- Main Content Area (Book Grid) --- */
.book-grid-main {
    width: 100%;
}

.search-results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.sort-dropdown {
    padding: 8px;
    border: 1px solid #C2B280;
    border-radius: 4px;
    background-color: #F6F2EA;
    color: #343A40;
    margin-right: 10px;
    width: 300px;
}

/* Book Grid (Displaying 4 columns on desktop, 2-3 on tablet) */
.book-grid {
    display: grid;
    /* Default: 2 columns on small screens */
    grid-template-columns: repeat(2, 1fr); 
    gap: 20px;
    margin-bottom: 30px;
}

.book-card-grid {
    text-align: center;
    /* Reusing carousel styles for book cover/title look */
}

.book-cover-grid {
    height: auto; /* Let height adjust to maintain aspect ratio */
    min-height: 150px;
    max-height: 150px;
    min-width: 100px;
    max-width: 100px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.book-title-grid {
    font-weight: bold;
    font-size: 0.9rem;
    margin: 5px 0 2px 0;
    color: #343A40;
}

.book-author-grid {
    font-size: 0.8rem;
    color: #7A7A7A;
    margin: 0;
}


/* --- Pagination --- */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 30px;
}

.page-link {
    display: block;
    padding: 8px 12px;
    border: 1px solid #E4DED4;
    border-radius: 4px;
    color: #532C2E;
    transition: background-color 0.2s;
    font-size: 0.9rem;
}

.page-link:hover:not(.active):not(.disabled) {
    background-color: #E4DED4;
}

.page-link.active {
    background-color: #C2B280;
    color: #532C2E;
    border-color: #C2B280;
    font-weight: bold;
}

.page-link.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.ellipsis {
    padding: 8px 0;
    color: #7A7A7A;
}


/* ================================== */
/* --- 4. BREAKPOINTS AND LAYOUTS (Adjustment for Browse Page) --- */
/* ================================== */

/* --- A. Tablet/Desktop Breakpoint: Min-width 610px --- */
@media (min-width: 610px) {
    /* 1. Switch to two-column grid for the whole page */
    .browse-page-layout {
        flex-direction: row; /* Sidebar next to main content */
    }
    
    /* 2. Define sidebar width and main content width */
    .filter-sidebar {
        width: 250px; /* Fixed width for sidebar */
        flex-shrink: 0; 
        left: 0px
    }
    
    .book-grid-main {
        flex-grow: 1; /* Main content takes up the rest of the space */
    }
    
    /* 3. Increase book grid columns */
    .book-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 columns on tablet */
    }
}


/* --- C. Large Desktop Breakpoint: Min-width 960px --- */
@media (min-width: 960px) {
    /* Increase book grid columns further */
    .book-grid {
        grid-template-columns: repeat(4, 1fr); /* 4 columns on large desktop */
    }
}

/* ================================== */
/* --- 9. PRINT GUIDE SECTION --- */
/* ================================== */

.print-guide-section {
    padding: 30px 15px; /* Use container padding on mobile */
    text-align: center;
    background-color: #E4DED4; /* Medium Darkened background to make it stand out */
    border-top: 2px solid #C2B280; /* Muted Gold separation line */
}

/* Reusing .section-title style for consistency */
.print-guide-section .section-title {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.75rem;
}

.print-guide-section p {
    max-width: 600px;
    margin: 0 auto 20px auto;
    font-size: 1.1rem;
    color: #343A40;
}

/* Reusing .hero-button style for the link */
.print-guide-section .hero-button {
    margin-bottom: 0;
}

/* ================================== */
/* --- 10. BOOK DETAIL PAGE STYLES --- */
/* ================================== */

/* --- 1. Detail Grid Layout (Cover + Info) --- */

.book-detail-grid {
    display: flex;
    flex-direction: column; /* Stack on mobile */
    gap: 30px;
    margin-bottom: 30px;
}

/* --- A. Cover Preview & Customization Panel --- */
.book-cover-container {
    text-align: center;
    max-width: 300px;
    margin: 0 auto; /* Center on mobile */
}

.book-cover-preview {
    height: auto;
    max-height: 400px;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
}

/* ❌ MODIFIED: COVER OPTIONS PANEL (Now inside .config-panel) */
.cover-options-panel {
    /* REMOVED: background-color, padding, border-radius, box-shadow */
    background-color: transparent; /* Remove the background */
    padding: 0; /* Remove internal padding */
    border-radius: 0; /* Remove rounded corners */
    text-align: left;
    margin-top: 30px; /* Keep separation from other config groups */
}

/* ❌ MODIFIED: Make the title match the panel-title style */
.cover-options-panel .filter-title {
    color: #1E423F; 
    font-size: 1rem; /* Smaller font size to match panel-title */
    font-weight: bold; /* Added bolding to match panel-title */
    margin-top: 0;
    margin-bottom: 5px; /* Reduced margin */
    border-bottom: none; /* Remove the bottom border */
    padding-bottom: 0; /* Remove padding */
}

.cover-style-select label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.95rem;
}

/* --- B. Book Info --- */

.book-title-detail {
    color: #532C2E;
    font-size: 2.5rem;
    margin-bottom: 5px;
}

.book-author-detail {
    color: #1E423F;
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 20px;
}

.book-description {
    line-height: 1.6;
    margin-bottom: 25px;
}

.book-metadata {
    font-size: 0.95rem;
    padding: 15px;
    border: 1px dashed #C2B280;
    border-radius: 4px;
    background-color: #EDE8E1;
}

.metadata-tag {
    color: #532C2E;
    font-weight: bold;
}

/* --- 2. Config & Actions --- */

.book-config-actions {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 40px;
    /* NEW: Set max-width and center for full-size views */
    max-width: 300px; 
    margin-left: auto;
    margin-right: auto;
}

.config-panel {
    /* NEW: Ensure text/elements are left-aligned within the panel */
    text-align: left;
}

.config-group {
    margin-bottom: 20px;
}

/* Note: The panel-title style is applied to h4, which includes:
.panel-title {
    font-size: 1rem;
    font-weight: bold;
    color: #1E423F; 
}
This is what .cover-options-panel .filter-title is now mimicking.
*/


.action-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center; /* Center buttons on mobile */
}

/* Action Button Styles (Matching the screenshot's button order and look) */

/* The Download PDF button */
.download-pdf-btn {
    /* The screenshot shows a dark button */
    background-color: #1E423F; /* Dark Teal for download CTA */
    color: #F6F2EA;
    min-width: 300px; /* Ensure width matches Order button */
}

.download-pdf-btn:hover {
    background-color: #532C2E;
}

/* The Order Print button */
.order-btn {
    /* The screenshot shows a light gold/tan button */
    background-color: #C2B280; 
    color: #532C2E; 
    min-width: 300px;
    /* Uses existing hero-button and general button styles */
}

/* --- 3. Order Options Panel --- */

.order-options-panel {
    padding: 20px;
    background-color: #F6F2EA;
    border: 1px solid #C2B280;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.order-config-row {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 20px;
    margin-bottom: 30px;
}

.price-summary {
    border-top: 2px solid #C2B280;
    padding-top: 15px;
}

/* --- Desktop Layout (Min-width 610px) --- */
@media (min-width: 610px) {
    .book-detail-grid {
        flex-direction: row; /* Side-by-side (Cover and Info) */
        text-align: left;
    }
    
    .book-cover-container {
        flex-shrink: 0; /* Cover column won't shrink */
        width: 300px;
        margin: 0; /* Remove auto margin */
    }

    .book-info-block {
        flex-grow: 1;
    }
    
    /* MODIFIED: .book-config-actions is now centered with max-width (see general styles) */
    .book-config-actions {
        flex-direction: column; 
        align-items: center; /* Center the panels within the max-width container */
        max-width: 600px;
    }
    
    .config-panel {
        width: 100%; /* Take full width of the max-width container */
        max-width: 300px;
    }
    
    .action-panel {
        width: 100%; /* Take full width of the max-width container */
        align-items: center; /* Center the button group */
        /* Use default stacking: Download on top of Order Print */
        flex-direction: column; 
    }

    /* ADDITIONAL FIX: Ensure the Order Options panel is also centered */
    .order-options-panel {
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }

    .order-config-row {
        justify-content: center; /* Center options inside the order panel */
    }
}

/* --- Cart Panel Mobile (Inline) --- */
.cart-panel {
    display: none; 
    width: 100%;
    background-color: #EDE8E1;
    border-top: 1px solid #C2B280;
    padding: 20px;
    box-sizing: border-box;
    order: 4; /* Ensures it wraps below search/logo on mobile */
}

.cart-panel.active {
    display: block;
}

.close-cart-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: #532C2E;
    cursor: pointer;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #C2B280;
    margin-bottom: 15px;
}

.empty-cart-msg {
    text-align: center;
    padding: 20px 0;
    color: #7A7A7A;
}

.checkout-btn {
    display: block;
    text-align: center;
    margin-top: 10px;
}

/* --- Desktop Switch (Side Drawer) --- */
@media (min-width: 610px) {
    .cart-panel {
        position: fixed;
        top: 0;
        right: -400px; /* Hidden off-screen */
        width: 380px;
        height: 100vh;
        background-color: #F6F2EA;
        z-index: 2000;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        transition: right 0.3s ease-in-out;
        display: flex; /* Always flex but hidden by 'right' */
        flex-direction: column;
        order: unset;
        border-top: none;
    }

    .cart-panel.active {
        right: 0;
    }

    .cart-overlay.active {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1999;
    }
}

/* --- Desktop Fix --- */
@media (min-width: 610px) {
    .header-nav {
        /* This ensures the cart icon always stays at the end */
        margin-left: auto; 
    }

    #cart-panel {
        /* 'fixed' or 'absolute' removes the element from the flex flow 
           so justify-content ignores it */
        position: fixed; 
        display: flex; /* or block */
        
        /* Ensure it doesn't stay in the header row visually */
        top: 0;
        right: -400px; 
    }
}

@media (min-width: 610px) {
    .cart-panel {
        position: fixed;
        top: 0;
        right: -400px; /* Hidden state */
        width: 380px;
        height: 100vh;
        background-color: #F6F2EA;
        z-index: 2000;
        transition: right 0.3s ease-in-out; /* Smooth sliding */
        display: flex; 
        flex-direction: column;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    }

    /* This must come AFTER the .cart-panel definition */
    .cart-panel.active {
        right: 0 !important; /* Forces the panel to slide in */
    }
}

/* Red Dot Notification Style */
.cart-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background-color: #00afff; /* Your requested color */
    border-radius: 50%;
    display: none; /* Hidden by default */
}

.cart-item-info h4 {
    color: #333;
    font-family: inherit;
}

.empty-cart-msg {
    text-align: center;
    color: #888;
    margin-top: 40px;
}

.cart-item button:hover {
    color: #ff0000 !important;
    transform: scale(1.1);
}

/* --- ACCORDION & CART LOCKING --- */
#cart-items-wrapper {
    overflow: hidden;
    transition: max-height 0.4s ease-out, opacity 0.3s ease;
}

/* --- VINTAGE ADDRESS INPUTS --- */
.address-field {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #C2B280; /* Muted Gold */
    border-radius: 4px;
    background-color: #F6F2EA; /* Parchment Background */
    color: #343A40; /* Charcoal Text */
    font-family: Arial, sans-serif;
    box-sizing: border-box;
}

.address-field:focus {
    outline: none;
    border-color: #532C2E; /* Aged Leather focus */
    box-shadow: 0 0 4px rgba(83, 44, 46, 0.2);
}

/* The box containing the address form */
.estimation-box {
    background-color: #E4DED4; /* Medium Darkened Parchment */
    padding: 20px;
    border-radius: 8px;
    border: 1px dashed #C2B280;
    margin-top: 10px;
}

/* Label for the address section */
.estimation-label {
    color: #1E423F; /* Dark Teal Accent */
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 12px;
    display: block;
    letter-spacing: 0.5px;
}

/* --- DESKTOP ALIGNMENT FIX --- */
@media (min-width: 610px) {
    #cart-panel {
        display: block !important; 
        overflow-y: auto;
    }
    /* Prevents the footer from pinning to bottom of viewport on desktop */
    .cart-footer-container {
        margin-top: 20px !important;
        position: static !important;
        background: transparent !important;
    }
}