/* =================================================
   1. CSS RESET & BASE STYLES
   ================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    border: none;
}

body {
    font-family: 'Open Sauce One', 'Open Sans', sans-serif;
    font-size: 12pt;
    background-color: #ffffff;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 70px; /* Account for fixed header */
    padding-bottom: 0;
}

/* Remove empty space at top of pages */
.content-wrapper, .main-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Main content area adjustments */
main, .main-content {
    flex: 1;
    min-height: calc(100vh - 70px); /* Account for header only */
}

body.login-page {
    background-color: #bb8515;
}

/* =================================================
   2. CSS VARIABLES
   ================================================= */
:root {
    --primary-color: #bb8515;
    --primary-bg: #fff5df;
    --text-primary: #333;
    --text-secondary: #666;
    --shadow-default: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.15);
    --tile-gap-desktop: 20px;
    --header-height: 70px;
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* =================================================
   1. GLOBAL STYLES AND RESETS
   ================================================= */

/* Global font and size settings */
* {
    box-sizing: border-box;
}

/* Ensure minimum font sizes everywhere - Desktop gets 14px minimum */
body, p, div, span, a, button, input, textarea, select, option, label, li, td, th {
    font-family: 'Open Sauce One', 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 12px !important;
    line-height: 1.4;
}

/* Desktop gets larger minimum font size - 12pt = 16px */
@media (min-width: 769px) {
    body, p, div, span, a, button, input, textarea, select, option, label, li, td, th {
        font-size: 16px !important;
    }
}

/* Headings get appropriate scaling */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Open Sauce One', 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    line-height: 1.3;
}

h1 { font-size: 18px !important; }
h2 { font-size: 16px !important; }
h3 { font-size: 15px !important; }
h4 { font-size: 14px !important; }
h5 { font-size: 13px !important; }
h6 { font-size: 12px !important; }

@media (min-width: 769px) {
    h1 { font-size: 22px !important; }
    h2 { font-size: 20px !important; }
    h3 { font-size: 18px !important; }
    h4 { font-size: 16px !important; }
    h5 { font-size: 15px !important; }
    h6 { font-size: 14px !important; }
}

/* =================================================
   3. HEADER STYLES
   ================================================= */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: var(--header-height);
    padding: 15px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #ffffff;
    z-index: 9999;
    border-bottom: 1px solid #f0f0f0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-logo {
    height: auto;
    width: 60%;
    max-width: 200px;
    cursor: pointer;
}

/* Header with white background */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: var(--header-height);
    padding: 15px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #ffffff !important;
    z-index: 9999;
    border-bottom: 1px solid #f0f0f0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Account button - fixed size and positioning */
.header-account {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    height: 35px !important;
    width: 35px !important;
    max-height: 35px !important;
    max-width: 35px !important;
    cursor: pointer;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-account img {
    height: 35px !important;
    width: 35px !important;
    max-height: 35px !important;
    max-width: 35px !important;
    display: block;
    cursor: pointer;
    object-fit: cover;
    object-position: center;
}

/* Remove any pseudo-elements that might add backgrounds */
.header-account::before,
.header-account::after,
.header-account img::before,
.header-account img::after {
    display: none !important;
}

/* Ensure account button stays small on mobile */
@media (max-width: 768px) {
    .header-account {
        height: 30px !important;
        width: 30px !important;
        max-height: 30px !important;
        max-width: 30px !important;
    }

    .header-account img {
        height: 30px !important;
        width: 30px !important;
        max-height: 30px !important;
        max-width: 30px !important;
    }
}

/* =================================================
   4. MAIN CONTENT AREA
   ================================================= */
.main-content {
    flex: 1;
    padding: 20px 0;
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
    min-height: calc(100vh - var(--header-height) - 200px);
}

/* =================================================
   5. LANDING PAGE TILES
   ================================================= */
.landing-page {
    padding: 0;
    text-align: center;
}

.landing-page h3 {
    font-family: 'Open Sauce One', sans-serif;
    font-size: 14px;
    color: #333;
    margin-bottom: 30px;
    padding: 0 20px;
}

/* Tiles Container */
.tiles-container {
    display: grid;
    width: 100vw;
    background-color: #ffffff;
    box-sizing: border-box;
    margin: 0;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

/* Mobile: Single column */
@media (max-width: 767px) {
    .tiles-container {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 20px;
    }
}

/* Desktop: 2 columns with proper gaps */
@media (min-width: 768px) {
    .tiles-container {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        padding: 0 20px;
    }
    
    /* Ensure tiles fill their grid cells properly */
    .tile {
        width: 100%;
        max-width: none;
    }
}

/* Individual Tiles */
.tile {
    position: relative;
    background: #ffffff;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    padding-bottom: 50%; /* 2:1 aspect ratio */
    height: 0;
    margin: 0;
    display: block;
}

/* Tile Images */
.tile-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #f5f5f5;
}

.tile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}

/* Tile Header */
.tile-header {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    background: white;
    padding: 10px 20px;
    box-shadow: var(--shadow-default);
    text-align: center;
    min-width: 180px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
}

.tile-header h3 {
    font-size: 0.9em;
    text-transform: lowercase;
    margin: 0;
    color: #333;
    line-height: 1;
    white-space: nowrap;
}

/* Mobile tile header adjustments */
@media (max-width: 480px) {
    .tile-header {
        max-width: 80%;
        min-width: 120px;
    }

    .tile-header h3 {
        font-size: 0.85em;
    }
}

/* Tile Hover Content */
.tile-hover {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    padding: 40px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 3;
}

/* Initial state: show images and headers, hide hover content */
.tile .tile-hover {
    opacity: 0;
    visibility: hidden;
}

.tile .tile-header {
    opacity: 1;
    visibility: visible;
}

/* Hover States - only enabled after cursor movement */
body.cursor-moved .tile:hover .tile-hover {
    opacity: 1;
    visibility: visible;
}

body.cursor-moved .tile:hover .tile-header {
    opacity: 0;
    visibility: hidden;
}

/* Ensure survey images are never affected by tile hover states */
.survey-form .tile img,
.survey-container .tile img,
fieldset[data-step] .tile img {
    opacity: 1 !important;
}

/* Mobile active states */
.tile.active .tile-hover,
.tile.show-hover .tile-hover {
    opacity: 1;
    visibility: visible;
}

.tile.active .tile-header,
.tile.show-hover .tile-header {
    opacity: 0;
    visibility: hidden;
}

/* Special case: Tile 10 (video) should keep header stable and never show hover content */
.tile-10 .tile-header {
    opacity: 1 !important;
    visibility: visible !important;
    transition: none !important;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) !important;
}

.tile-10:hover .tile-header {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translate(-50%, -50%) !important;
}

.tile-10 .tile-hover {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

.tile-10:hover .tile-hover {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Clickable tiles */
.tile.clickable .tile-header {
    background: white;
    border: none;
}

/* Mobile Header Adjustments */
@media (max-width: 767px) {
    .tile-header {
        max-width: 85%;
        min-width: 140px;
    }

    .tile-header h3 {
        white-space: normal;
        word-wrap: break-word;
        line-height: 1.2;
    }
}

/* Tile hover content styles */
.tile-hover-content {
    pointer-events: none !important;
}

.tile-hover-content a,
.tile-hover-content button,
.tile-hover-content input,
.tile-hover-content .discount-section,
.tile-hover-content .discount-section * {
    pointer-events: auto !important;
}

/* CTA Links in tiles */
.cta-link {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 20px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

.cta-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(187, 133, 21, 0.3);
}

/* Discount section in tiles */
.discount-section {
    background-color: #ffffff !important;
    border: 1px solid #e0e0e0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    padding: 20px !important;
    border-radius: 8px !important;
    position: relative;
    z-index: 20 !important;
    pointer-events: auto !important;
}

.discount-section input,
.discount-section button {
    cursor: pointer !important;
    pointer-events: auto !important;
    position: relative;
    z-index: 21 !important;
}

#quickCheckoutBtn {
    pointer-events: auto !important;
    cursor: pointer !important;
    z-index: 1000 !important;
    position: relative !important;
}

/* Discount elements MUST be interactive */
#apply-discount-btn {
    pointer-events: auto !important;
    cursor: pointer !important;
    z-index: 1000 !important;
    position: relative !important;
}

#discount-code-input {
    pointer-events: auto !important;
    cursor: text !important;
    z-index: 1000 !important;
    position: relative !important;
}

/* Chrome-specific fix */
@supports (-webkit-appearance: none) {
    .tile-hover-content {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}

/* =================================================
   6. CONSOLIDATED SURVEY STYLES
   ================================================= */

/* Survey container and basic setup */
.survey-container,
.results-container {
    padding: 0 40px;
    margin-bottom: 40px;
    max-width: 60cm;
    margin-left: auto;
    margin-right: auto;
}

/* Increase width of results container */
@media (min-width: 769px) {
    .results-container {
        max-width: 80cm;
    }
}

/* Fieldset and legend styles */
fieldset {
    border: none !important;
    margin-bottom: 2rem;
    padding: 15px;
    border-radius: 5px;
    margin-top: 20px;
    background-color: white;
    position: relative;
    font-family: 'Open Sauce One', 'Open Sans', sans-serif;
}

legend {
    font-size: 1em;
    font-weight: 600;
    color: #333;
    margin-bottom: 25px;
    text-align: center;
    width: 100%;
    padding-top: 0;
    margin-top: 0;
    font-family: 'Open Sauce One', 'Open Sans', sans-serif;
    line-height: 1.4;
}

@media (min-width: 769px) {
    legend {
        font-size: 1.6em;
    }
}

/* Survey styling improvements */
.survey-form legend {
    font-size: calc(1rem + 0.3vw); /* About 1.3x smaller than default */
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Progress bar */
.survey-progress {
    background-color: #f8f8f8;
    height: 8px;
    border-radius: 4px;
    margin-bottom: 30px;
    overflow: hidden;
}

.survey-progress-bar {
    background-color: #333;
    height: 100%;
    width: 0;
    transition: width 0.3s ease;
}

/* Add this CSS to your style.css file */

/* =================================================
   DROPDOWN WRAPPER STYLES
   ================================================= */

/* Main dropdown wrapper with grey background */
.dropdown-wrapper {
    background-color: #f0f0f0 !important;
    border-radius: 12px !important;
    border: 2px solid #d0d0d0 !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
    padding: 20px !important;
    margin: 20px 0 !important;
    width: 100% !important;
    grid-column: 1 / -1 !important;
    clear: both;
}

/* Instruction text */
.dropdown-instruction {
    font-style: italic !important;
    margin: 15px 0 !important;
    color: #666 !important;
    text-align: center !important;
    font-size: 1.1em !important;
}

/* Dropdown content grid */
.dropdown-content {
    display: grid !important;
    gap: 20px !important;
    width: 100% !important;
}

/* Desktop: Up to 3 columns (9cm tiles) */
@media (min-width: 769px) {
    .dropdown-content {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
        max-width: 100% !important;
    }

    /* Limit to 3 columns max */
    .dropdown-content {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
    }

    @supports (width: min(300px, 33%)) {
        .dropdown-content {
            grid-template-columns: repeat(auto-fill, minmax(min(300px, 33%), 1fr)) !important;
        }
    }
}

/* Mobile: Single column */
@media (max-width: 768px) {
    .dropdown-content {
        grid-template-columns: 1fr !important;
    }
}

/* Selected category tile in wrapper */
.dropdown-wrapper > .image-select-option:first-child {
    margin-bottom: 10px !important;
    border-color: #bb8515 !important;
    background-color: #fff5df !important;
}

/* Dropdown tiles styling */
.dropdown-content .image-select-option {
    margin: 0 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.dropdown-content .image-select-option:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.dropdown-content .image-select-option.selected {
    border-color: #bb8515 !important;
    background-color: #fff5df !important;
}

/* Hide original dropdown containers */
#acneOptions,
#babySkinOptions,
.category-dropdown {
    display: none !important;
}

/* Category tile states */
.image-select-option.category-active {
    opacity: 0.7;
}

/* Ensure proper spacing when dropdown is open */
fieldset[data-step] .image-select-container {
    margin-bottom: 20px;
}

/* Fix z-index issues */
.dropdown-wrapper {
    position: relative;
    z-index: 10;
}

/* Ensure dropdown content is visible */
.dropdown-wrapper * {
    visibility: visible !important;
    opacity: 1 !important;
}

/* Keep these - they're for general category styling: */
.category-group {
    margin-bottom: 30px;
}

.category-header-tile {
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
    border: 2px solid #dee2e6;
}

.category-header-tile:hover .image-select-text {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.category-header-tile.active .image-select-text {
    background-color: #fff5df;
    border-color: #bb8515;
}


/* =================================================
   STEP 5 - DOUBLE HEIGHT HEADERS
   ================================================= */

/* Step 5 specific styling - double height headers */
fieldset[data-step="5"] .image-select-text,
fieldset[data-step="5"] .treatment-label {
    min-height: 160px !important; /* Double the normal height (was 80px) */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 25px 15px !important;
    line-height: 1.4;
}

fieldset[data-step="5"] .treatment-option {
    margin-bottom: 25px;
}

/* Ensure step 5 image containers accommodate the taller headers */
fieldset[data-step="5"] .image-select-option {
    min-height: auto;
}

@media (min-width: 769px) {
    fieldset[data-step="5"] .image-select-text,
    fieldset[data-step="5"] .treatment-label {
        min-height: 160px !important;
        padding: 30px 20px !important;
    }
}

/* =================================================
   CATEGORY SECTIONS
   ================================================= */

.category-section {
    margin-bottom: 30px;
}

.category-title {
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
    font-size: 1.1em;
    text-align: center;
}

/* Category section titles styling */
.category-title {
    font-weight: normal !important;
    text-align: center !important;
    font-size: 1.4em !important;
    margin-bottom: 20px !important;
}


/* =================================================
   OPTION STYLES
   ================================================= */

.option-label {
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: #f8f8f8;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.options-container .option-label {
    display: block;
}

.option-label input[type="radio"],
.option-label input[type="checkbox"] {
    margin-right: 15px;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.option-label input[type="radio"]:checked + .option-text,
.option-label input[type="checkbox"]:checked + .option-text {
    font-weight: 600;
    color: #333;
}

.option-text {
    line-height: 1.5;
}


/* Conditional section */
.conditional-section {
    margin-top: 20px;
    padding: 20px;
    background-color: #f8f8f8;
    border-radius: 8px;
}

/* =================================================
   IMAGE SELECT STYLES
   ================================================= */

.image-select-container {
    display: grid;
    gap: 20px;
    justify-content: center;
}

/* Mobile: Single column */
@media (max-width: 768px) {
    .image-select-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Desktop: Auto-fit with minimum width */
@media (min-width: 769px) {
    .image-select-container {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 20px;
    }
}

.image-select-option {
    background-color: #fff;
    border: 1px solid #000 !important;
    border-radius: 0;
    overflow: visible;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.image-select-option:hover {
    border-color: #000 !important;
}

.image-select-option.selected {
    border-color: #bf925a;
    background-color: #fff;
}

/* Standard tick mark for selected image options - applies to ALL steps */
.image-select-option.selected::after {
    content: '✓';
    position: absolute;
    top: 5px;
    left: 5px;
    background-color: #000;
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    z-index: 10;
}

/* Ensure all tiles can contain the tick mark */
.image-select-option {
    position: relative;
}

.image-select-option input[type="checkbox"],
.image-select-option input[type="radio"] {
    display: none;
}

.image-select-text {
    border: 1px solid #000000;
    padding: 12px 15px;
    height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-family: 'Open Sauce One', 'Open Sans', sans-serif;
    font-size: 12pt;
    font-weight: 700;
    line-height: 1.3;
    background-color: #fff;
    transition: all 0.3s ease;
    margin-bottom: -1px;
    z-index: 2;
}

/* Step 6: Country selection with header at top, flag below */
fieldset[data-step="6"] .image-select-option {
    display: flex;
    flex-direction: column;
    border: 1px solid #ddd; /* Light gray border instead of black */
    overflow: hidden;
    background-color: #fff;
}

fieldset[data-step="6"] .image-select-label {
    display: flex;
    flex-direction: column; /* Normal order: text then image */
    width: 100%;
}

/* Country name at TOP of tile */
fieldset[data-step="6"] .image-select-text {
    order: 1; /* Ensure text is first */
    width: 100%;
    height: 60px;
    padding: 10px 15px;
    border: none; /* Remove black border */
    border-bottom: 1px solid #ddd; /* Light separator between text and flag */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 14pt;
    font-weight: 700;
    background-color: #fff;
    margin: 0;
}

/* Flag container - maximum 6cm high when tile is 9cm wide */
fieldset[data-step="6"] .image-select-image {
    order: 2; /* Ensure image is second */
    width: 100%;
    max-height: 6cm; /* Maximum 6cm high */
    height: 6cm; /* Default to 6cm */
    border: none; /* Remove all borders */
    overflow: hidden;
    background-color: #fff;
    display: flex;
    align-items: center; /* Center vertically */
    justify-content: center; /* Center horizontally */
    padding: 10px 0; /* Small vertical padding only */
}

/* Flag images - full width while maintaining aspect ratio */
fieldset[data-step="6"] .image-select-image img {
    width: 100%;
    height: auto; /* Maintain aspect ratio */
    max-height: calc(6cm - 20px); /* Account for padding */
    object-fit: contain; /* Show entire flag without cropping */
    object-position: center center; /* Center the flag */
    display: block;
    border: none; /* Remove all borders */
}

/* Desktop: 9cm width tiles */
@media (min-width: 769px) {
    fieldset[data-step="6"] .image-select-container {
        display: grid;
        grid-template-columns: repeat(auto-fit, 9cm);
        gap: 20px;
        justify-content: center;
        max-width: 100%;
        margin: 0 auto;
    }

    fieldset[data-step="6"] .image-select-option {
        width: 9cm;
        min-width: 9cm;
        max-width: 9cm;
    }

    fieldset[data-step="6"] .image-select-text {
        width: 9cm;
    }

    fieldset[data-step="6"] .image-select-image {
        width: 9cm;
        max-height: 6cm; /* Maximum 6cm */
        height: 6cm; /* But default to 6cm for consistency */
    }
}

/* Mobile: proportionally smaller */
@media (max-width: 768px) {
    fieldset[data-step="6"] .image-select-option {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    fieldset[data-step="6"] .image-select-image {
        width: 100%;
        max-height: 160px; /* Proportionally smaller for mobile */
        height: 160px;
    }

    fieldset[data-step="6"] .image-select-image img {
        max-height: calc(160px - 20px); /* Account for padding on mobile */
    }
}

/* Hover effect with light border */
fieldset[data-step="6"] .image-select-option:hover {
    border-color: #999;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Selected state with gold border (not black) */
fieldset[data-step="6"] .image-select-option.selected {
    border-color: #bb8515;
    background-color: #fff5df;
}

fieldset[data-step="6"] .image-select-option.selected .image-select-text {
    background-color: #fff5df;
}

/* Remove the reverse flex direction if it exists elsewhere */
fieldset[data-step="6"] .image-select-label {
    flex-direction: column !important; /* Force normal order */
}

.image-select-image {
    width: 100%;
    border: 1px solid #000000;
    position: relative;
    background-color: #fff;
}

.image-select-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    min-height: 48px;
    opacity: 1 !important;
    filter: none !important;
    border: 1px solid #000000;
}

/* Steps 8 and 9: Move images to top right inline with content */
fieldset[data-step="8"] .legend,
fieldset[data-step="9"] .legend {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

fieldset[data-step="8"] .question-content,
fieldset[data-step="9"] .question-content {
    flex: 1;
}

fieldset[data-step="8"] .question-image,
fieldset[data-step="9"] .question-image {
    flex: none;
    text-align: center;
    margin-bottom: 20px;
}

fieldset[data-step="8"] .question-image img,
fieldset[data-step="9"] .question-image img {
    max-width: 200px;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}

@media (max-width: 768px) {
    fieldset[data-step="8"] .legend,
    fieldset[data-step="9"] .legend {
        flex-direction: column;
    }

    fieldset[data-step="8"] .question-image,
    fieldset[data-step="9"] .question-image {
        flex: none;
        text-align: center;
        margin-bottom: 20px;
    }
}

/* Make sure images show up for steps 2-9 */
.survey-form .image-select-option img {
    display: block !important;
    max-width: 100%;
    height: auto;
}

/* =================================================
   NAVIGATION BUTTONS
   ================================================= */

.survey-navigation {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-top: 30px !important;
    padding: 20px 0 !important;
    width: 100% !important;
}

.survey-navigation .nav-button {
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    padding: 0 !important;
    opacity: 0.8 !important;
    transition: opacity 0.2s ease !important;
    margin: 0 !important;
}

.survey-navigation .nav-button:hover {
    opacity: 1 !important;
}

.survey-navigation .nav-button img {
    height: 120px !important;
    width: auto !important;
    transform: none !important;
}

/* Navigation buttons - positioned correctly and sized appropriately */
.nav-button, .next-btn, .prev-btn, .submit-btn {
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    padding: 0 !important;
    opacity: 0.8 !important;
    transition: opacity 0.2s ease !important;
    width: auto !important;
    height: auto !important;
    margin: 0 10px !important;
}

.nav-button:hover, .next-btn:hover, .prev-btn:hover, .submit-btn:hover {
    opacity: 1 !important;
}

.nav-button img, .next-btn img, .prev-btn img, .submit-btn img {
    height: 80px !important;
    width: auto !important;
    transform: none !important;
}

/* Back button visibility for all steps */
.nav-buttons .prev-btn {
    visibility: visible !important;
    display: inline-block !important;
}

/* =================================================
   STEP ISOLATION
   ================================================= */

/* Step isolation - ensure only active step content is visible */
fieldset[data-step] {
    display: none !important;
}

fieldset[data-step][style*="display: block"] {
    display: block !important;
}

/* Show only the active step */
fieldset[data-step].active-step {
    display: block !important;
}

/* Hide navigation buttons in inactive steps */
.survey-navigation {
    display: none !important;
}

fieldset[data-step].active-step .survey-navigation,
fieldset[data-step][style*="display: block"] .survey-navigation {
    display: flex !important;
}

/* =================================================
   ACCOUNT DROPDOWN
   ================================================= */
.account-dropdown {
    position: fixed;
    top: var(--header-height);
    right: 20px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    z-index: 10000;
    min-width: 200px;
    max-width: 250px;
    font-family: 'Open Sans', sans-serif;
}

.account-dropdown .user-info {
    padding: 12px 16px;
    color: #666;
    font-size: 0.85em;
    border-bottom: 1px solid #eee;
}

.account-dropdown .user-info strong {
    color: #333;
    font-weight: 600;
}

.account-dropdown a {
    display: block;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #eee;
}

.account-dropdown a:last-child {
    border-bottom: none;
}

.account-dropdown a:hover {
    background-color: #f8f9fa;
}

.account-dropdown a[href*="logout"] {
    color: #dc3545;
}

@media (max-width: 768px) {
    .account-dropdown {
        right: 10px;
        top: 60px;
        min-width: 180px;
    }
}

/* =================================================
   FORMS & INPUTS
   ================================================= */
input[type="text"],
input[type="email"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px;
    margin: 5px 0;
    background-color: var(--primary-bg);
    border: 1px solid var(--primary-color);
    border-radius: 5px;
    font-family: inherit;
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    background-color: #fff;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #333;
}

/* Wash frequency styling */
.wash-frequency-option {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.wash-frequency-option input[type="radio"] {
    margin-right: 8px;
    transform: scale(1.2);
}

.form-check-label {
    margin-left: 5px;
}

/* Country select styling */
.country-select-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    font-family: 'Open Sauce One', 'Open Sans', sans-serif;
}

.country-select {
    width: 100%;
    max-width: 400px;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 12pt;
    background-color: white;
    font-family: 'Open Sauce One', 'Open Sans', sans-serif;
}

@media (min-width: 769px) {
    .country-select {
        font-size: 14pt;
    }
}

.budget-section, .time-section {
    margin-bottom: 25px;
    font-family: 'Open Sauce One', 'Open Sans', sans-serif;
}

.wash-frequency-section {
    margin-top: 40px;
    padding: 20px;
    background-color: #f8f9fa;
    font-family: 'Open Sauce One', 'Open Sans', sans-serif;
}

/* =================================================
   FLASH MESSAGES
   ================================================= */
.flash-messages {
    position: fixed;
    top: calc(var(--header-height) + 10px);
    right: 20px;
    z-index: 1001;
    max-width: 400px;
}

.flash-message {
    background-color: #ffffff;
    border-left: 4px solid #dc3545;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 15px 20px;
    margin-bottom: 10px;
    position: relative;
    animation: slideIn 0.3s ease-out;
}

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

.flash-close {
    position: absolute;
    top: 5px;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
}

/* =================================================
   FOOTER
   ================================================= */
.footer {
    background-color: #ffffff;
    padding: 40px 20px 20px;
    font-size: 10pt;
    font-family: 'Open Sauce One', 'Open Sans', sans-serif;
    position: static;
    bottom: auto;
    left: auto;
    right: auto;
    width: 100%;
    z-index: 1000;
    border-top: 1px solid #f0f0f0;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.footer.visible {
    opacity: 1;
}

.footer-content {
    max-width: 6000px; /* Tripled from 2000px */
    margin: 0 auto;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 15px 90px; /* Tripled gap from 30px to 90px */
    justify-items: center;
    margin-bottom: 10px;
    max-width: 1800px; /* Tripled from 600px */
    margin: 0 auto 10px auto;
}

.footer-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
}

.footer-link {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
    cursor: pointer;
}

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

/* Footer Dropdown Styles */
.footer-dropdown {
    position: relative;
    display: inline-block;
}

.footer-dropdown .footer-link {
    cursor: pointer;
    user-select: none;
}

.footer-dropdown-content {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    z-index: 1000;
    display: none;
    min-width: 400px;
    max-width: 500px;
    max-height: 400px;
    overflow-y: auto;
    padding: 15px;
    font-size: 0.8em;
    color: #444;
    line-height: 1.4;
}

.footer-dropdown-content h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1em;
    color: #333;
    font-weight: 600;
}

.footer-dropdown-content p {
    margin-bottom: 12px;
}

.footer-dropdown-content ul,
.footer-dropdown-content ol {
    margin-bottom: 15px;
    padding-left: 20px;
}

.footer-dropdown-content li {
    margin-bottom: 8px;
}

.footer-dropdown-content strong {
    font-weight: 600;
    color: #333;
}

/* Show dropdown on hover */
.footer-dropdown:hover .footer-dropdown-content {
    display: block;
}

/* Adjust for mobile */
@media (max-width: 768px) {
    .footer-links {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(6, auto);
        gap: 15px;
        max-width: 900px; /* Tripled from 300px */
    }

    .footer-dropdown-content {
        min-width: 300px;
        max-width: 350px;
        left: 0;
        transform: none;
        margin-left: -150px;
    }
}

@media (max-width: 480px) {
    .footer {
        padding: 30px 15px 15px;
    }
    .footer-links {
        gap: 12px;
        max-width: 600px; /* Tripled from 200px */
    }

    .footer-dropdown-content {
        min-width: 250px;
        max-width: 280px;
        margin-left: -125px;
    }
}

.footer-bottom {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

/* =================================================
   VALIDATION AND HELP
   ================================================= */

.validation-error {
    background-color: #fee;
    color: #c33;
    padding: 12px 15px;
    border-radius: 5px;
    margin-top: 15px;
    font-size: 0.9em;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.help-text {
    color: #666;
    font-size: 0.9em;
    margin-top: 15px;
    text-align: center;
    font-style: italic;
}

.required-indicator {
    color: #ff6b6b;
    font-size: 0.9em;
    margin-left: 5px;
}

.question-header {
    margin-bottom: 20px;
}

/* =================================================
   MOBILE RESPONSIVE
   ================================================= */

@media (max-width: 768px) {
    .survey-title {
        font-size: 2em;
    }

    .nav-button img {
        height: 150px;
    }

    .category-section-wrapper {
        padding: 15px;
        margin: 10px 0 20px 0;
    }

    fieldset[data-step="5"] .image-select-text,
    fieldset[data-step="5"] .treatment-label {
        min-height: 70px !important;
        padding: 15px 10px !important;
    }

    /* On mobile, disable hover and use tap instead */
    .tile:hover .tile-hover {
        opacity: 0;
        visibility: hidden;
    }

    .hide-mobile { display: none; }
}

@media (min-width: 769px) {
    .hide-desktop { display: none; }
}

/* Summary boxes responsive layout */
@media (min-width: 768px) {
    .summary-boxes-container {
        display: flex;
        flex-direction: column;
        gap: 20px;
        justify-content: space-between;
    }
}

/* Summary boxes container - ensure normal width like other boxes */
.summary-boxes-container {
  max-width: 100%;
  width: 100%;
}

.summary-box {
  width: 100%;
  max-width: 100%;
}

/* =================================================
   LAZY LOADING AND RESPONSIVE IMAGES
   ================================================= */

/* Lazy loading states - all images fully visible */
img[data-src] {
    opacity: 1;
    transition: opacity 0.2s ease;
}

img.loading {
    opacity: 1;
    filter: none;
    transition: opacity 0.2s ease, filter 0.2s ease;
}

img.loaded {
    opacity: 1;
    filter: none;
}

img.error {
    opacity: 1;
    filter: none;
}

/* Performance optimizations */
img {
    will-change: opacity;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Ensure all images are always fully visible */
img {
    opacity: 1 !important;
    filter: none !important;
}

/* Override lazy loading for survey images - they should always be visible */
.survey-form img,
.image-select-image img,
fieldset[data-step] img {
    opacity: 1 !important;
    filter: none !important;
}

/* Image placeholder for loading states */
.image-placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
    border-radius: 4px;
}

@keyframes loading-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Responsive image containers */
.responsive-image-container {
    position: relative;
    overflow: hidden;
    background-color: #f8f9fa;
}

.responsive-image-container::before {
    content: '';
    display: block;
    padding-bottom: 56.25%; /* 16:9 aspect ratio by default */
}

.responsive-image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Specific aspect ratios for different image types */
.aspect-square::before { padding-bottom: 100%; }
.aspect-4-3::before { padding-bottom: 75%; }
.aspect-3-2::before { padding-bottom: 66.67%; }
.aspect-16-9::before { padding-bottom: 56.25%; }

/* Optimization for critical images (above fold) */
.critical-image {
    opacity: 1 !important;
    filter: none !important;
}

/* =================================================
   UTILITY CLASSES
   ================================================= */

.text-center { text-align: center; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.fw-bold { font-weight: bold; }
.d-block { display: block; }
.fst-italic { font-style: italic; }
.text-muted { color: #666; }
.hidden { display: none; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }

/* Dropdown sections */
.dropdown-section {
    margin-top: 15px;
    margin-bottom: 15px;
}

/* =================================================
   RESULTS PAGE ADJUSTMENTS
   ================================================= */

/* Remove space between content and footer */
.main-content {
    margin-bottom: 0;
}

/* Image Select Container */
.image-select-container {
    display: grid;
    gap: 20px;
    margin-top: 30px;
    padding: 0;
    justify-content: center;
    align-items: start;
}

@media (max-width: 768px) {
    .image-select-container {
        grid-template-columns: 1fr;
        gap: 20px;
        width: 100%;
        max-width: 100%;
        margin: 30px 0 0 0;
        padding: 0 10px;
    }
}

@media (min-width: 769px) {
    .image-select-container {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
        justify-content: center;
        max-width: 100%;
        margin: 30px auto 0;
        padding: 0 20px;
    }
}

/* Hide original dropdown sections - they'll be replaced by the new dropdown wrapper */
#acneOptions,
#babySkinOptions,
#acneSection,
#babySkinSection {
    display: none !important;
}

/* Hide original step 2 & 3 dropdown containers */
[id^="dropdown_"],
[id^="options_"] {
    display: none !important;
}

/* But show them when inside the dropdown wrapper */
.dropdown-wrapper [id^="dropdown_"],
.dropdown-wrapper [id^="options_"],
.dropdown-wrapper #acneOptions,
.dropdown-wrapper #babySkinOptions {
    display: block !important;
}

/* Hide dropdown containers by default */
.category-dropdown,
[id^="dropdown_"] {
    display: none !important;
}

/* Show them when inside the dropdown wrapper */
.dropdown-wrapper .category-dropdown,
.dropdown-wrapper [id^="dropdown_"] {
    display: block !important;
}

/* ADD THIS TO THE END OF YOUR style.css FILE */

/* Emergency fix to ensure survey displays */
fieldset[data-step="1"] {
    display: block !important;
}

/* Ensure active steps are visible */
fieldset[data-step].active-step {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Make sure the form container is visible */
.survey-form,
#survey-form,
form {
    display: block !important;
    visibility: visible !important;
}

/* Ensure survey container is visible */
.survey-container {
    display: block !important;
    visibility: visible !important;
    min-height: 500px;
}

/* Remove debug borders */
fieldset {
    border: none !important;
}

/* If fieldsets exist but are invisible, this will help */
fieldset[data-step] * {
    visibility: visible !important;
    opacity: 1 !important;