/* css/style.css (REVISED COLOR PALETTE, HOVER CAROUSEL) - CORRECTED & CONSOLIDATED */

/* 1. Base Reset & Font Setup */
:root {
    /* YOUR NEW COLOR PALETTE: */
    --color-primary: #1e3a8a;       /* Deep Navy Blue (for buttons/links/accents) */
    --color-secondary: #374151;     /* Charcoal (used as the primary accent color) */
    --color-background: #ffffff;    /* White Background */
    --color-text: #1f2937;          /* Dark Gray/Near Black Text */
    --color-light-text: #4b5563;    /* Lighter Charcoal */
    --color-white: #ffffff;         /* Pure White */
    --color-black: #000000;         /* Pure Black */

    /* --- NEW LUXURY ACCENTS --- */
    --color-luxury-black: #0a0a0a;  /* Deep, Rich Black for high contrast */
    --color-luxury-gold: #D4AF37;   /* Classic Gold/Champagne Accent */
    --color-header-bg: #f9f9f9;     /* Subtle Off-White Background */
    /* -------------------------- */

    --font-primary: 'Georgia', serif; 
    --font-secondary: 'Helvetica Neue', 'Arial', sans-serif; 
}

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

body {
    font-family: var(--font-secondary);
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-background);
    /* Increased padding to accommodate new header height */
    padding-top: 90px; 
}

h1, h2, h3 {
    font-family: var(--font-primary);
    color: var(--color-text);
    margin-bottom: 0.75em;
}

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

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

/* 2. Layout & Structure (UPDATED HEADER) */

.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    /* Increased height for a more substantial, imposing feel */
    height: 90px; 
    /* Subtle off-white background */
    background-color: var(--color-header-bg);
    /* Deeper, more refined shadow */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    z-index: 1000;
}

.logo-text {
    font-family: var(--font-primary);
    /* Larger size for brand authority */
    font-size: 2.2rem; 
    font-weight: 900;
    /* Using the deep black for maximum contrast and luxury */
    color: var(--color-luxury-black) !important; 
    /* Add subtle gold accent on hover */
    transition: color 0.3s ease;
}

.logo-text:hover {
    color: var(--color-luxury-gold) !important;
}

.main-nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    /* Increased gap for visual breathing room */
    gap: 30px; 
}

/* Styling for the Navigation Links */
.main-nav ul li a {
    /* Use a sophisticated, all-caps look */
    text-transform: uppercase;
    /* Use the rich black color */
    color: var(--color-luxury-black); 
    /* Increase font weight slightly */
    font-weight: 500; 
    letter-spacing: 1px;
    padding: 5px 0;
    /* Underline animation prep */
    position: relative;
    transition: color 0.3s;
}

/* Luxury Hover Effect: Subtle underline that appears */
.main-nav ul li a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    /* Use the gold accent color */
    background-color: var(--color-luxury-gold);
    transform: scaleX(0);
    transition: transform 0.3s ease-in-out;
}

.main-nav ul li a:hover {
    /* Subtle gold color change on hover */
    color: var(--color-luxury-gold) !important; 
}

.main-nav ul li a:hover::after {
    /* Expand the underline on hover */
    transform: scaleX(1);
}

.nav-button {
    /* Use the deep black for the button background */
    background-color: var(--color-luxury-black);
    color: var(--color-white);
    padding: 10px 20px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s, transform 0.2s, box-shadow 0.3s;
    /* Apply uppercase to the button text */
    text-transform: uppercase; 
    letter-spacing: 0.5px;
}

.nav-button:hover {
    /* Hover to the luxury gold color */
    background-color: var(--color-luxury-gold); 
    /* Add a clean box shadow lift */
    box-shadow: 0 4px 6px rgba(212, 175, 55, 0.4); 
    transform: translateY(-2px);
}

main {
    padding: 40px 5%;
    max-width: 1200px;
    margin: 0 auto;
    /* CRITICAL AGGRESSIVE FIX: Ensure the main container doesn't clip the card's shadow/lift */
    overflow: visible !important; 
}

/* 3. Homepage Specifics */

.intro-hero {
    text-align: center;
    padding: 50px 0;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 40px;
}

.intro-hero p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 15px auto 0;
    color: var(--color-light-text);
}

.goals-summary .card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.goal-card {
    background-color: #f1f5f9;
    padding: 25px;
    border-left: 5px solid var(--color-primary);
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.goal-card h3 {
    color: var(--color-primary);
    margin-top: 0;
    margin-bottom: 10px;
}

.cta-section {
    text-align: center;
    padding: 50px 0;
    border-top: 1px solid #e5e7eb;
    margin-top: 40px;
}

/* FIX: Add margin below the paragraph in the CTA section to separate it from the buttons */
.cta-section p {
    margin-bottom: 25px;
}

/* 4. Category Pages (Card Grid) */

.category-page-content h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--color-primary);
}

.category-overview {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

/* Base Grid Structure */
.item-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 35px; /* Increased gap slightly */
    margin-top: 20px;
    position: relative; /* CRITICAL FIX: Establish a stacking context for z-index to work against */
}

/* Item Card Container (Base Style) */
.item-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    /* CRITICAL: Set position context for absolute carousel arrows AND z-index fix */
    position: relative; 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    /* The transition property is added here for smooth effects */
    transition: transform 0.5s ease-out, box-shadow 0.5s ease-out; 
    /* Hint to the browser for smoother animation */
    will-change: transform, box-shadow; 
    background-color: var(--color-white);
    /* CRITICAL: Make card a flex container, stacked vertically, to ensure uniform height */
    display: flex;
    flex-direction: column;
}

/* Hide the old, single-image style as it's replaced by the carousel structure */
.card-image {
    display: none !important; 
}


/* NEW: Carousel Structure for Item Cards */
.card-image-carousel {
    position: relative;
    width: 100%;
    height: 250px; /* Match old card-image height */
    overflow: hidden; /* CRITICAL: Hide extra images (click-only scroll) */
    flex-shrink: 0;
}

.carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    /* Ensures we control the scroll with JS/CSS snapping for a clean transition */
    scroll-snap-type: x mandatory; 
    overflow-x: hidden; /* Hide the native scrollbar. Change to 'auto' for free scroll/swiping. */
}

.card-carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    flex-shrink: 0; /* CRITICAL: Prevents image from shrinking */
    scroll-snap-align: start; /* Ensures the snap point is at the start of the image */
}

/* Carousel Arrow Styling */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
    color: var(--color-white);
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    z-index: 10;
    font-size: 1.5rem;
    line-height: 1;
    
    /* MODIFIED: HIDE ARROWS BY DEFAULT */
    opacity: 0; 
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out, background-color 0.2s; 
}

.carousel-arrow:hover {
    opacity: 1;
    background-color: var(--color-primary);
}

.left-arrow {
    left: 0;
    border-radius: 0 4px 4px 0;
}

.right-arrow {
    right: 0;
    border-radius: 4px 0 0 4px;
}

/* Image Count Indicator */
.image-count-indicator {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.6);
    color: var(--color-white);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    z-index: 11;
    
    /* MODIFIED: HIDE INDICATOR BY DEFAULT */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

/* NEW RULE: SHOW ARROWS AND INDICATOR ONLY ON CARD HOVER */
.item-card-link:hover .carousel-arrow,
.item-card-link:hover .image-count-indicator {
    opacity: 1;
    visibility: visible;
}


/* NEW: Tag Filter Bar Styling */
#category-filters-container {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.tag-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.filter-tag-button {
    background-color: #eef2ff; /* Very light blue/indigo */
    color: var(--color-primary);
    padding: 6px 12px;
    border: 1px solid var(--color-primary);
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    font-weight: 500;
}

.filter-tag-button:hover,
.filter-tag-button.active {
    background-color: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

/* NEW: Card Visibility Class */
.item-card.hidden {
    display: none !important;
}

/* --- Item Card Clickable Enhancements --- */

/* 1. Make the anchor tag fill the grid space and reset link styles */
.item-card-link {
    text-decoration: none; /* Remove default underline from the link */
    color: var(--color-text); /* Inherit the main text color */
    display: block; /* Crucial for it to take up full space in the grid */
    /* Increased transition time for a smoother, more 'premium' feel */
    transition: transform 0.5s ease-out, box-shadow 0.5s ease-out; 
    border-radius: 8px; /* Match the card's visual rounding */
}

/* 2. Add a clear, strong hover/focus effect to show the whole card is clickable */
.item-card-link:hover,
.item-card-link:focus {
    outline: none; /* Remove default focus outline if preferred, but usually keep for accessibility */
}

/* Apply the hover/focus effect to the actual card container */
.item-card-link:hover .item-card,
.item-card-link:focus .item-card {
    /* MAX LIFT for the dramatic "pop" - AGGRESSIVE FIX */
    transform: translateY(-10px) !important; 
    /* Force it to layer above adjacent cards (CRITICAL Z-INDEX FIX) - AGGRESSIVE FIX */
    z-index: 99 !important;
    /* MAX PREMIUM 3D EFFECT: Primary color glow + Deep shadow for max depth */
    box-shadow: 
        /* 1st shadow: Strong, primary color glow (acts as a shaded border) */
        0 0 15px 3px rgba(30, 58, 138, 0.5), 
        /* 2nd shadow: Deep, dark shadow for max 3D lift/depth */
        0 30px 60px rgba(0, 0, 0, 0.4); 
    cursor: pointer;
}

/* Card Content Spacing & Alignment */
.card-content {
    padding: 20px;
    /* CRITICAL: Make content section take remaining height and use flex for internal alignment */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* START OF CARD ALIGNMENT CHANGES */

.card-brand {
    font-size: 0.9rem;
    color: var(--color-primary);
    font-weight: 600;
    margin-bottom: 5px;
}

.card-title {
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 5px;
    color: var(--color-secondary);
}

.card-tagline {
    font-size: 0.95rem;
    color: var(--color-light-text);
    margin-bottom: 10px;
}

.card-price {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--color-text);
    margin-bottom: 15px;
    /* CRITICAL: Pushes this and subsequent elements to the bottom of the card content */
    margin-top: auto; 
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
    /* Explicitly reserve vertical space for 1-2 rows of badges */
    min-height: 35px; 
}

/* END OF CARD ALIGNMENT CHANGES */


.tag-badge {
    background-color: #eef2ff; /* Very light blue/indigo */
    color: var(--color-primary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}


/* 5. Item Detail Page */

.item-detail-content {
    padding: 40px 5%;
}

.back-link {
    display: block;
    margin-bottom: 20px;
    font-weight: bold;
    color: var(--color-light-text);
}

.item-hero-section {
    margin-bottom: 30px;
}

.item-hero-section h1 {
    font-size: 3rem;
    color: var(--color-secondary);
}

.tagline {
    font-size: 1.2rem;
    font-style: italic;
    color: var(--color-light-text);
    margin-bottom: 20px;
}

.metadata-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    align-items: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
}

.detail-price-range {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.image-carousel {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding: 15px 0;
    margin-bottom: 20px;
    border-radius: 8px;
    background-color: #f9fafb;
    scroll-snap-type: x mandatory;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05);
}

.carousel-image {
    width: 90%;
    flex-shrink: 0;
    scroll-snap-align: center;
    height: 400px;
    object-fit: cover;
    border-radius: 6px;
}

@media (min-width: 768px) {
    .carousel-image {
        width: 600px;
        height: 500px;
    }
}

.section-separator {
    border: none;
    height: 1px;
    background-color: #e5e7eb;
    margin: 30px 0;
}

.about-brand-section {
    background-color: #fafafc;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    margin-top: 30px;
}

.about-brand-section h3 {
    color: var(--color-primary);
    margin-bottom: 10px;
}

/* CTA Footer Button */
.detail-cta-bar {
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
    border-top: 2px solid var(--color-primary);
    background-color: #fefefe;
}

/* 6. Footer */
.main-footer {
    background-color: var(--color-secondary);
    color: var(--color-white);
    padding: 20px 5%;
    text-align: center;
    font-size: 0.9rem;
}

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

.footer-links a {
    color: #a0a8b4; /* Light text on dark background */
    margin: 0 10px;
}

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

/* * NEW STYLES FOR STRUCTURED DEEP DIVE CONTENT 
 * These rules provide visual separation and hierarchy to the generated sections.
 */

/* Spacing for the introductory paragraph that appears before the first H3 */
#deep-dive-content > p {
    margin-bottom: 30px; 
    font-size: 1.1rem;
    color: var(--color-text);
}

/* The container for each sub-section */
.deep-dive-sub-section {
    /* Space between different sections */
    margin-bottom: 40px; 
    padding: 20px;
    /* Left border and background color provide a strong visual grouping */
    border-left: 4px solid var(--color-secondary); 
    background-color: #f8f8fa; /* A very light background to visually group the content */
    border-radius: 5px;
}

.deep-dive-sub-section h3 {
    /* Ensure header stands out and has ample space below it */
    color: var(--color-primary);
    font-size: 1.6rem;
    margin-top: 0;
    margin-bottom: 15px;
    line-height: 1.3;
}

.deep-dive-sub-section p {
    /* Ensure paragraphs have good line height and no bottom margin on the final one */
    margin-bottom: 0; 
    line-height: 1.7; /* Increased line-height for better readability of long text blocks */
    color: var(--color-text);
}

/* New Styles for Party Facts List */
.party-facts-section ul {
    /* Use 'disc' style for standard bullets */
    list-style-type: disc; 
    /* Increase padding on the left to move the bullets and content to the right */
    padding-left: 25px; 
    margin-top: 15px;
}

.party-facts-section li {
    /* List items should not have background or border on the facts list */
    background-color: transparent; 
    padding: 2px 0; /* Minimal padding for spacing */
    border-left: none;
    margin-bottom: 5px;
    font-style: italic;
    color: var(--color-light-text);
}

/* 7. Modal & Form Styling */

.modal-backdrop {
    /* Critical initial state */
    display: none; /* Starts hidden */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    /* Dark overlay effect */
    background-color: rgba(0, 0, 0, 0.7); 
    padding-top: 50px;
    /* Smooth transition for appearance */
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* CRITICAL FIX: The visibility rule to show the modal when the JS adds the class */
.modal-backdrop.is-visible {
    display: block; /* Make it visible */
    opacity: 1;     /* Fade in */
}

.modal-content {
    background-color: var(--color-white);
    margin: 5% auto; /* Center the modal vertically and horizontally */
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 550px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    /* Add a slight transform for a pop-in effect */
    transform: scale(0.95);
    transition: transform 0.3s ease-in-out;
}

.modal-backdrop.is-visible .modal-content {
    transform: scale(1);
}

.modal-title {
    color: var(--color-primary);
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.modal-message {
    margin-bottom: 20px;
    font-style: italic;
    color: var(--color-light-text);
}

.close-button {
    color: var(--color-secondary);
    float: right;
    font-size: 28px;
    font-weight: bold;
    border: none;
    background: none;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 20px;
}

.close-button:hover,
.close-button:focus {
    color: var(--color-primary);
    text-decoration: none;
}

/* Form Styling */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--color-secondary);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box; /* Ensures padding doesn't affect total width */
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(30, 58, 138, 0.2);
}

.form-submit-button {
    width: 100%;
    padding: 12px;
    font-size: 1.1rem;
}

/* Media Queries for Responsiveness */

@media (max-width: 768px) {
    .main-header {
        height: auto;
        flex-direction: column;
        padding: 15px 5%;
        gap: 10px;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 10px;
        padding-bottom: 10px;
    }
    
    body {
        /* Adjusted padding for new mobile header height */
        padding-top: 150px; 
    }
    
    .logo-text {
        font-size: 2rem; /* Slightly reduced for mobile */
    }
    
    /* Remove hover underline effect for mobile view */
    .main-nav ul li a::after {
        display: none;
    }
    
    .main-nav ul li a {
        padding: 0;
        letter-spacing: normal;
    }

    .goals-summary .card-container {
        grid-template-columns: 1fr;
    }
    
    .item-card-grid {
        grid-template-columns: 1fr;
    }
    
    .item-hero-section h1 {
        font-size: 2rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    .metadata-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .modal-content {
        margin: 10% auto;
    }
    
    .carousel-image {
        width: 100%;
        height: 300px;
    }

}

/* NEW: Filter Group Structuring (Global Styles) */

.filter-group {
    margin-bottom: 15px;
}

.filter-group h3 {
    font-size: 1rem;
    color: var(--color-light-text);
    margin-bottom: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Re-use existing styling for buttons but target them within the new structure */
.tag-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

/* NEW: Filter Control Bar and Collapse Styling */
.filters-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.toggle-filters-button {
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
}

.toggle-icon {
    transition: transform 0.3s ease;
    font-size: 0.8em;
    font-weight: normal;
    line-height: 1; /* Ensures proper alignment */
}

/* Rotate the icon when the container is NOT expanded (i.e., when collapsed) */
.filters-container.collapsed + .toggle-filters-button .toggle-icon,
/* The following selector targets the icon inside the button when the container is collapsed */
.filters-controls > .toggle-filters-button[aria-expanded="false"] > .toggle-icon {
    transform: rotate(-90deg); 
}

/* Clear Button Styling */
.clear-button {
    /* Using a clear-specific color that stands out from regular buttons */
    background-color: #6b9fe4; 
    color: var(--color-text);
    padding: 6px 15px;
    border: 1px solid #3441c8;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.clear-button:hover {
    background-color: #2d78ad; 
    color: var(--color-white);
}

/* Collapsible Content: This controls the actual collapsing effect */
.filters-container {
    /* Use max-height and overflow:hidden for smooth collapse transition */
    transition: max-height 0.4s ease-out, opacity 0.4s ease-out;
    overflow: hidden;
    max-height: 500px; /* Must be larger than the content height */
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.filters-container.collapsed {
    max-height: 0;
    opacity: 0;
    padding-bottom: 0; 
    margin-bottom: 0;
    border-bottom: none;
}