/* ===== CSS Variables & Theme ===== */
:root {
    --bg-primary: #F8F6F3;
    --bg-secondary: #FFFFFF;
    --bg-elevated: #FFFFFF;
    --bg-card: rgba(255, 255, 255, 0.8);
    
    --text-primary: #1A1A1A;
    --text-secondary: #5C5C5C;
    --text-muted: #9A9A9A;
    
    /* Brand colors from favicon */
    --brand-gold: #D4952D;
    --brand-blue: #3D5A98;
    --brand-black: #1A1A1A;
    
    --accent: var(--brand-gold);
    --accent-dim: rgba(212, 149, 45, 0.1);
    --accent-glow: rgba(212, 149, 45, 0.3);
    
    --border: rgba(0, 0, 0, 0.08);
    --border-active: var(--brand-blue);
    
    --success: #22C55E;
    --error: #EF4444;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 40px var(--accent-glow);
    
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== Responsive Utility Classes ===== */
.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .desktop-only {
        display: none;
    }
    .mobile-only {
        display: inline;
    }
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    overflow-y: scroll; /* Prevent layout shift from scrollbar appearing/disappearing */
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== App Container ===== */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* ===== Ambient Background ===== */
.ambient-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.5;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #E8DCC8 0%, transparent 70%);
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #D4E5ED 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    animation-delay: -7s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, #E2EBE5 0%, transparent 70%);
    top: 50%;
    left: 50%;
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* ===== Hero Section ===== */
.hero {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-top: -2rem; /* Counteract app-container padding */
    min-height: 45vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    margin-bottom: 3rem;
}

.hero-image {
    position: absolute;
    inset: 0;
    z-index: 0;
}

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

.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        135deg,
        rgba(26, 26, 26, 0.85) 0%,
        rgba(26, 26, 26, 0.6) 50%,
        rgba(26, 26, 26, 0.3) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    min-height: 45vh;
}

.hero-header {
    padding: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hero-logo {
    height: 56px;
    filter: brightness(0) invert(1);
    margin: 0;
}

/* Hero Navigation */
.hero-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.hero-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: all var(--transition-fast);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.hero-nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
}

.hero-nav-link svg {
    opacity: 0.8;
}

.hero-nav-link:hover svg {
    opacity: 1;
}

/* Account link - logged in state */
.hero-nav-link.account-link.logged-in {
    background: rgba(212, 149, 45, 0.25);
    border-color: rgba(212, 149, 45, 0.4);
}

.hero-nav-link.account-link.logged-in:hover {
    background: rgba(212, 149, 45, 0.35);
}

.nav-link-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.3;
}

/* Mobile Menu Button - hidden on desktop */
.mobile-menu-btn {
    display: none;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    color: white;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.mobile-menu-btn svg {
    width: 22px;
    height: 22px;
}

.mobile-menu-btn .close-icon {
    display: none;
}

.mobile-menu-btn.active .menu-icon {
    display: none;
}

.mobile-menu-btn.active .close-icon {
    display: block;
}

/* Mobile Nav Dropdown - hidden by default */
.mobile-nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: 1rem;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
}

.mobile-nav.active {
    display: flex;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: white;
    text-decoration: none;
    transition: all var(--transition-base);
}

.mobile-nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.mobile-nav-link svg {
    width: 24px;
    height: 24px;
    opacity: 0.8;
    flex-shrink: 0;
}

.mobile-nav-link span {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.mobile-nav-link strong {
    font-size: 0.95rem;
    font-weight: 600;
}

.mobile-nav-link small {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Mobile nav row for side-by-side links (Visualizer + Order Generator) */
.mobile-nav-row {
    display: flex;
    gap: 0.5rem;
}

.mobile-nav-half {
    flex: 1;
    min-width: 0;
}

.mobile-nav-half span strong {
    font-size: 0.85rem;
}

.mobile-nav-half span small {
    font-size: 0.7rem;
}

.nav-link-title {
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    color: #fff;
}

.nav-link-subtitle {
    font-weight: 400;
    font-size: 0.75rem;
    opacity: 0.8;
}

.hero-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 600px;
    padding: 2rem 0;
}

.hero-title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 600;
    color: #FFFFFF;
    line-height: 1.2;
    margin-bottom: 1.25rem;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    margin-bottom: 2rem;
    font-weight: 300;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--brand-gold);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 100px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(212, 149, 45, 0.4);
    width: fit-content;
}

.hero-cta svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.hero-cta:hover {
    background: #E5A63A;
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(212, 149, 45, 0.5);
}

.hero-cta:hover svg {
    transform: translateY(3px);
}

/* ===== Header (legacy, kept for compatibility) ===== */
.header {
    text-align: center;
    margin-bottom: 2rem;
    animation: fadeInDown 0.6s ease;
    display: none; /* Hidden when hero is present */
}

.logo-img {
    height: 48px;
    width: auto;
    display: block;
    margin: 0 auto;
}

.header-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 0.5rem;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Horizontal Stepper ===== */
.stepper {
    margin-bottom: 3rem;
    padding: 0 1rem;
}

.stepper-track {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

/* Individual step button */
.stepper-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: none;
    padding: 0.75rem 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

/* Step badge (number or checkmark) */
.step-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border: 2px solid var(--border);
    transition: all 0.3s ease;
    flex-shrink: 0;
    position: relative;
}

.step-badge .step-num {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.step-badge .step-check {
    position: absolute;
    width: 14px;
    height: 14px;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Step text label */
.step-text {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.01em;
    white-space: nowrap;
    transition: all 0.3s ease;
    opacity: 0.6;
}

/* Connector line between steps */
.stepper-connector {
    width: 3rem;
    height: 2px;
    background: var(--border);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.connector-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: var(--brand-gold);
    transition: width 0.4s ease;
}

/* ===== Step States ===== */

/* Upcoming (default) - muted, disabled feel */
.stepper-step {
    opacity: 1;
}

/* Active step - prominent, highlighted */
.stepper-step.active .step-badge {
    background: var(--brand-gold);
    border-color: var(--brand-gold);
    color: white;
    box-shadow: 0 0 0 4px var(--accent-glow);
    transform: scale(1.05);
}

.stepper-step.active .step-text {
    color: var(--text-primary);
    font-weight: 600;
    opacity: 1;
}

/* Completed step - checkmark, muted but done */
.stepper-step.completed .step-badge {
    background: var(--bg-primary);
    border-color: var(--brand-gold);
    color: var(--brand-gold);
}

.stepper-step.completed .step-badge .step-num {
    opacity: 0;
    transform: scale(0.5);
}

.stepper-step.completed .step-badge .step-check {
    opacity: 1;
    transform: scale(1);
    color: var(--brand-gold);
}

.stepper-step.completed .step-text {
    color: var(--text-secondary);
    opacity: 0.8;
}

/* Completed connector fills */
.stepper-step.completed + .stepper-connector .connector-fill {
    width: 100%;
}

/* Hover states */
.stepper-step:hover:not(.active) .step-badge {
    border-color: var(--text-muted);
    transform: scale(1.02);
}

.stepper-step:hover:not(.active) .step-text {
    opacity: 0.9;
}

/* Legacy selectors for JS compatibility */
.progress-nav { display: none; }
.step-indicator { display: none; }
.step-dot { display: none; }

/* Hide old step numbers */
.step-number {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    position: relative;
}

.step-panel {
    display: none;
    padding-bottom: 2rem;
}

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

.step-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.step-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.step-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Auth Prompt - Sign in nudge (blue style) */
.auth-prompt {
    display: none; /* Hidden by default, shown via JS for guests */
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(61, 90, 152, 0.12) 0%, rgba(61, 90, 152, 0.06) 100%);
    border: 1px solid rgba(61, 90, 152, 0.3);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.auth-prompt.visible {
    display: flex;
}

.auth-prompt-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: var(--brand-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-prompt-icon svg {
    width: 20px;
    height: 20px;
    stroke: white;
}

.auth-prompt-content {
    flex: 1;
}

.auth-prompt-content p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.auth-prompt-content strong {
    color: var(--brand-blue);
    font-weight: 600;
}

.auth-prompt-link {
    flex-shrink: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    text-decoration: none;
    padding: 0.6rem 1.25rem;
    background: var(--brand-blue);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    box-shadow: 0 2px 8px rgba(61, 90, 152, 0.25);
}

.auth-prompt-link:hover {
    background: #324a7d;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(61, 90, 152, 0.35);
}

.auth-prompt.hidden {
    display: none !important;
}

@media (max-width: 600px) {
    .auth-prompt {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .auth-prompt-link {
        width: 100%;
        text-align: center;
    }
}

/* Quick Select Buttons Container - Compact inline style */
.quick-select-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.25rem;
}

/* Compact pill buttons */
.surprise-me-btn,
.use-last-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.surprise-me-btn:hover,
.use-last-btn:hover:not(:disabled) {
    background: var(--accent-dim);
    border-color: var(--brand-gold);
    color: var(--text-primary);
}

.surprise-icon {
    font-size: 0.9rem;
}

.surprise-text,
.use-last-text {
    display: inline;
}

.surprise-main,
.use-last-main {
    font-size: inherit;
    font-weight: inherit;
}

/* Hide sub text in compact buttons */
.surprise-sub,
.use-last-sub {
    display: none;
}

/* Use Last Selection Button */
.use-last-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.use-last-icon {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.use-last-main {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
}

.use-last-sub {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-muted);
    line-height: 1.2;
}

/* ===== Selection Sections ===== */
.selection-section {
    margin-bottom: 2.5rem;
}

/* Collapsible Optional Sections */
.collapsible-section .section-content {
    display: block;
    animation: slideDown 0.25s ease;
}

.collapsible-section .add-section-btn {
    display: none;
}

.collapsible-section.collapsed .section-content {
    display: none;
}

.collapsible-section.collapsed .add-section-btn {
    display: inline-flex;
}

.add-section-btn {
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-secondary);
    border: 1px dashed var(--border);
    border-radius: 100px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
}

.add-section-btn:hover {
    border-color: var(--text-muted);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.add-section-btn .add-icon {
    font-size: 1rem;
    font-weight: 300;
    color: var(--text-muted);
}

.add-section-btn:hover .add-icon {
    color: var(--accent);
}

.collapse-btn {
    margin-left: auto;
    padding: 0.25rem 0.75rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
}

.collapse-btn:hover {
    border-color: var(--error);
    color: var(--error);
    background: rgba(239, 68, 68, 0.05);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    width: 100%;
}

.optional-badge {
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    margin-left: 0.25rem;
}

.title-accent {
    width: 20px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
}

/* ===== Custom Door Display (separate box above gallery) ===== */
.custom-door-display {
    margin-bottom: 1rem;
}

/* Saved doors from Door Designer */
.saved-doors-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, rgba(100, 149, 212, 0.06) 0%, rgba(100, 149, 212, 0.02) 100%);
    border: 1px solid rgba(100, 149, 212, 0.2);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
}

.saved-doors-grid {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.saved-door-tile {
    width: 100px;
    flex-shrink: 0;
    cursor: pointer;
}

.saved-door-tile:hover {
    transform: translateY(-2px);
}

.saved-door-tile .door-preview-square {
    aspect-ratio: 3/4; /* Match generated door aspect ratio from door designer */
    border: 2px solid transparent;
    transition: var(--transition-base);
}

.saved-door-tile:hover .door-preview-square {
    border-color: var(--accent);
}

/* Selected state for saved door tiles */
.saved-door-tile.selected .door-preview-square {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.saved-door-tile .no-preview {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* View all button in saved doors grid - match saved door tile size */
.saved-doors-view-more {
    width: 100px;
    flex-shrink: 0;
}

.saved-doors-view-more .door-preview-square {
    aspect-ratio: 3/4; /* Match saved door tile aspect ratio */
}

/* Door Designer Prompt - Encouraging users to try the door designer */
.door-designer-prompt {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(61, 90, 152, 0.12) 0%, rgba(61, 90, 152, 0.06) 100%);
    border: 1px solid rgba(61, 90, 152, 0.3);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.door-designer-prompt-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: var(--brand-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.door-designer-prompt-icon svg {
    width: 20px;
    height: 20px;
    stroke: white;
}

.door-designer-prompt-content {
    flex: 1;
}

.door-designer-prompt-content p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.door-designer-prompt-content strong {
    color: var(--brand-blue);
    font-weight: 600;
}

.door-designer-prompt-link {
    flex-shrink: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    text-decoration: none;
    padding: 0.6rem 1.25rem;
    background: var(--brand-blue);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    box-shadow: 0 2px 8px rgba(61, 90, 152, 0.25);
}

.door-designer-prompt-link:hover {
    background: #324a7d;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(61, 90, 152, 0.35);
}

@media (max-width: 600px) {
    .door-designer-prompt {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .door-designer-prompt-link {
        width: 100%;
        text-align: center;
    }
}

.custom-door-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, rgba(212, 149, 45, 0.06) 0%, rgba(212, 149, 45, 0.02) 100%);
    border: 1px solid rgba(212, 149, 45, 0.2);
    border-radius: var(--radius-md);
}

.custom-row-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(180, 130, 50, 0.6);
}

.custom-door-square {
    width: 120px;
    flex-shrink: 0;
}

.door-preview-square {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
}

.door-preview-square img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== Door Gallery ===== */
.door-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.door-option {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-sm);
}

.door-option:hover {
    border-color: var(--text-muted);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.door-option.selected {
    border-color: var(--accent);
    background: var(--accent-dim);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.door-preview {
    position: relative; /* Enable positioning for color overlay */
    width: 100%;
    aspect-ratio: 2/3; /* Taller to allow horizontal crop without vertical loss */
    border-radius: 2px; /* Tiny rounding */
    overflow: hidden;
    background: #F0F0F0;
}

/* Color tint overlay for door thumbnails (exclude view-more tile) */
.door-preview:not(.view-more-tile)::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #b3ac9e;
    mix-blend-mode: multiply;
    pointer-events: none; /* Allows hover/click to pass through */
}

.door-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-base);
    filter: grayscale(1); /* Remove original colors for consistent tinting */
}

.door-option:hover .door-preview img {
    /* No zoom effect on hover */
}

.door-option span {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
}

/* View More Tile - Premium inline expansion */
.door-option.view-more-btn {
    border: 1px solid var(--border);
    background: #FAFAF8;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.03);
    cursor: pointer;
}

.door-option.view-more-btn:hover {
    border-color: rgba(0, 0, 0, 0.18);
    background: #F5F5F2;
    transform: translateY(-3px);
    box-shadow: 
        inset 0 1px 4px rgba(0, 0, 0, 0.02),
        0 6px 16px rgba(0, 0, 0, 0.08);
}

.door-option.view-more-btn .view-more-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    background: transparent;
}

.door-option.view-more-btn .view-more-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
    transition: color var(--transition-base);
}

.door-option.view-more-btn .view-more-meta {
    font-size: 0.65rem;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.35);
    letter-spacing: 0.01em;
}

.door-option.view-more-btn:hover .view-more-label {
    color: var(--text-primary);
}

/* Custom Door Upload Button in Header */
.custom-door-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: auto;
    padding: 0.3rem 0.6rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
}

.custom-door-upload-btn:hover {
    border-color: var(--text-muted);
    color: var(--text-secondary);
    background: var(--bg-secondary);
}

.custom-door-upload-btn svg {
    width: 12px;
    height: 12px;
}


/* Custom Door Tile in Gallery */
.custom-door-option .door-preview {
    background: var(--bg-tertiary);
}

.custom-door-option .door-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Custom Door Modal */
.custom-door-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.custom-door-modal.open {
    opacity: 1;
    visibility: visible;
}

.custom-door-modal-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 480px;
    width: 90%;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.custom-door-modal.open .custom-door-modal-content {
    transform: translateY(0);
}

.modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition-base);
}

.modal-close-btn:hover {
    color: var(--text-primary);
}

.custom-door-modal h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.modal-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.custom-door-dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center; /* Center text inside dropzone content */
    cursor: pointer;
    transition: all var(--transition-base);
    min-height: 200px;
}

.custom-door-dropzone:hover,
.custom-door-dropzone.dragover {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.custom-door-dropzone .dropzone-icon svg {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.custom-door-dropzone p {
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.custom-door-dropzone .file-types {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.custom-door-preview {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    max-height: 300px;
}

.custom-door-preview img {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: contain;
    display: block;
}

.remove-preview-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    transition: background var(--transition-base);
}

.remove-preview-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    justify-content: flex-end;
}

.modal-cancel-btn {
    padding: 0.75rem 1.25rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
}

.modal-cancel-btn:hover {
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.modal-confirm-btn {
    padding: 0.75rem 1.5rem;
    background: var(--brand-gold);
    border: none;
    border-radius: 100px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
}

.modal-confirm-btn:hover:not(:disabled) {
    background: #E5A63A;
}

.modal-confirm-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== Sample Photo Picker Modal ===== */
.sample-photo-modal-content {
    max-width: 640px;
    max-height: 80vh;
    overflow-y: auto;
}

.sample-photo-gallery {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sample-photo-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sample-photo-group-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.sample-photo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.sample-photo-option {
    aspect-ratio: 4/3;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    background: var(--bg-tertiary);
    transition: all var(--transition-base);
}

.sample-photo-option:hover {
    border-color: var(--accent);
    transform: scale(1.03);
    box-shadow: var(--shadow-md);
}

.sample-photo-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Responsive adjustments for sample photo modal */
@media (max-width: 600px) {
    .sample-photo-modal-content {
        padding: 1.5rem;
    }
    
    .sample-photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
}

/* Hide the empty span below */
.door-option.view-more-btn > span:last-child,
.backsplash-option.view-more-btn > span:last-child,
.countertop-option.view-more-btn > span:last-child,
.finish-option.view-more-btn > span:last-child {
    display: none;
}

/* View More Tile - Shared styles for other galleries */
.backsplash-option.view-more-btn,
.countertop-option.view-more-btn,
.finish-option.view-more-btn {
    border: 1px solid var(--border);
    background: #FAFAF8;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.03);
    cursor: pointer;
    justify-content: center;
}

.backsplash-option.view-more-btn:hover,
.countertop-option.view-more-btn:hover,
.finish-option.view-more-btn:hover {
    border-color: rgba(0, 0, 0, 0.18);
    background: #F5F5F2;
    transform: translateY(-2px);
    box-shadow: 
        inset 0 1px 4px rgba(0, 0, 0, 0.02),
        0 4px 12px rgba(0, 0, 0, 0.08);
}

.backsplash-option.view-more-btn .view-more-tile,
.countertop-option.view-more-btn .view-more-tile,
.finish-option.view-more-btn .view-more-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    width: 100%;
    aspect-ratio: 1;
}

.backsplash-option.view-more-btn .view-more-label,
.countertop-option.view-more-btn .view-more-label,
.finish-option.view-more-btn .view-more-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: color var(--transition-base);
}

.backsplash-option.view-more-btn .view-more-meta,
.countertop-option.view-more-btn .view-more-meta,
.finish-option.view-more-btn .view-more-meta {
    font-size: 0.6rem;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.35);
}

.backsplash-option.view-more-btn:hover .view-more-label,
.countertop-option.view-more-btn:hover .view-more-label,
.finish-option.view-more-btn:hover .view-more-label {
    color: var(--text-primary);
}

.door-option.selected span {
    color: var(--text-primary);
}

/* ===== Handle Gallery ===== */
.handle-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); /* Match backsplash/countertop */
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.handle-option {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.handle-option:hover {
    border-color: var(--text-muted);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.handle-option.selected {
    border-color: var(--accent);
    background: var(--accent-dim);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.handle-preview {
    width: 100%;
    aspect-ratio: 1; /* Square to match lighting icons */
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

/* Handle styles */
.bar-handle::before {
    content: '';
    width: 40px;
    height: 6px;
    background: var(--text-secondary);
    border-radius: 3px;
}

.knob-handle::before {
    content: '';
    width: 16px;
    height: 16px;
    background: var(--text-secondary);
    border-radius: 50%;
}

.edge-handle::before {
    content: '';
    width: 6px;
    height: 24px;
    background: var(--text-secondary);
    border-radius: 3px;
}

.no-handle::before {
    content: '—';
    color: var(--text-muted);
    font-size: 1.5rem;
}

.handle-option span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
}

.handle-option.selected span {
    color: var(--text-primary);
}

/* ===== Handle Sub-Options (Color & Finish) ===== */
.handle-sub-options {
    display: none;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin-top: 0.5rem;
}

.handle-sub-options.visible {
    display: flex;
}

.handle-sub-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sub-option-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 50px;
}

.handle-color-options,
.handle-finish-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.handle-color-option,
.handle-finish-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: all var(--transition-base);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.handle-color-option:hover,
.handle-finish-option:hover {
    border-color: var(--text-muted);
    background: var(--bg-elevated);
}

.handle-color-option.selected,
.handle-finish-option.selected {
    border-color: var(--accent);
    background: var(--accent-dim);
    color: var(--text-primary);
}

/* Color swatches */
.color-swatch {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid var(--border);
}

.black-swatch {
    background: #1A1A1A;
}

.gold-swatch {
    background: linear-gradient(135deg, #D4AF37, #FFD700, #B8860B);
}

.silver-swatch {
    background: linear-gradient(135deg, #E8E8E8, #C0C0C0, #A8A8A8);
}

/* ===== Finish Gallery ===== */
.finish-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
    padding: 0.25rem 0.5rem 0.25rem 0.25rem;
}

.finish-gallery::-webkit-scrollbar {
    width: 6px;
}

.finish-gallery::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.finish-gallery::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.finish-gallery::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Custom Door Finish Toggle */
.custom-finish-toggle {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, rgba(212, 149, 45, 0.08) 0%, rgba(212, 149, 45, 0.04) 100%);
    border: 1px solid rgba(212, 149, 45, 0.2);
    border-radius: var(--radius-md);
}

.custom-finish-toggle .toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.custom-finish-toggle .toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.custom-finish-toggle .toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: 0.3s;
    border-radius: 24px;
}

.custom-finish-toggle .toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.custom-finish-toggle input:checked + .toggle-slider {
    background-color: var(--accent);
}

.custom-finish-toggle input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.custom-finish-toggle .toggle-label {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.custom-finish-toggle .toggle-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.custom-finish-toggle .toggle-description {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Finish Gallery Disabled State */
.finish-gallery.disabled {
    max-height: none;
    overflow: visible;
}

.finish-disabled-message {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2.5rem 1.5rem;
    background: linear-gradient(135deg, rgba(212, 149, 45, 0.06) 0%, rgba(212, 149, 45, 0.02) 100%);
    border: 1px dashed rgba(212, 149, 45, 0.3);
    border-radius: var(--radius-md);
    text-align: center;
}

.finish-disabled-message .disabled-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(212, 149, 45, 0.1);
    border-radius: 50%;
    color: var(--accent);
}

.finish-disabled-message .disabled-icon svg {
    width: 24px;
    height: 24px;
}

.finish-disabled-message span {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Custom swatch display (outside accordions) */
.custom-swatch-display {
    margin-bottom: 0.75rem;
}

.custom-swatch-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, rgba(212, 149, 45, 0.06) 0%, rgba(212, 149, 45, 0.02) 100%);
    border: 1px solid rgba(212, 149, 45, 0.2);
    border-radius: var(--radius-md);
}

.custom-swatch-row .finish-option {
    max-width: 120px;
}

.finish-option {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.finish-option:hover {
    border-color: var(--text-muted);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.finish-option.selected {
    border-color: var(--accent);
    background: var(--accent-dim);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.finish-option img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.finish-option span {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-align: center;
    font-weight: 500;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.finish-option.selected span {
    color: var(--text-primary);
}

/* ===== Backsplash Gallery ===== */
.backsplash-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.backsplash-option {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.backsplash-option:hover {
    border-color: var(--text-muted);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.backsplash-option.selected {
    border-color: var(--accent);
    background: var(--accent-dim);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.backsplash-option img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.backsplash-option span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    font-weight: 500;
}

.backsplash-option.selected span {
    color: var(--text-primary);
}

.no-backsplash-icon {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 2rem;
    color: var(--text-muted);
}

.no-backsplash-icon.summary-size {
    width: 70px;
    height: 70px;
    font-size: 1.5rem;
}

/* ===== Countertop Gallery ===== */
.countertop-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.countertop-option {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.countertop-option:hover {
    border-color: var(--text-muted);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.countertop-option.selected {
    border-color: var(--accent);
    background: var(--accent-dim);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.countertop-option img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.countertop-option span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    font-weight: 500;
}

.countertop-option.selected span {
    color: var(--text-primary);
}

/* ===== Flooring Gallery ===== */
.flooring-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.flooring-option {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.flooring-option:hover {
    border-color: var(--text-muted);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.flooring-option.selected {
    border-color: var(--accent);
    background: var(--accent-dim);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.flooring-option img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.flooring-option span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    font-weight: 500;
}

.flooring-option.selected span {
    color: var(--text-primary);
}

/* ===== Lighting Gallery ===== */
.lighting-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); /* Match backsplash/countertop */
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.lighting-option {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.lighting-option:hover {
    border-color: var(--text-muted);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.lighting-option.selected {
    border-color: var(--accent);
    background: var(--accent-dim);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.lighting-icon {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.lighting-icon.warm {
    color: #F5A623;
}

.lighting-icon.cool {
    color: #7EC8E3;
}

.lighting-option.selected .lighting-icon {
    color: var(--accent);
}

.lighting-option.selected .lighting-icon.warm {
    color: #F5A623;
}

.lighting-option.selected .lighting-icon.cool {
    color: #7EC8E3;
}

.lighting-option span:last-child {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-align: center;
}

.lighting-option.selected span:last-child {
    color: var(--text-primary);
}

/* Lighting icon preview - square to match other previews */
.summary-lighting-icon {
    width: 80px;
    height: 80px;
    font-size: 2rem;
    color: var(--text-muted);
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.summary-lighting-icon.warm {
    color: #F5A623;
}

.summary-lighting-icon.cool {
    color: #7EC8E3;
}

/* ===== Camera Section (Generate Page) ===== */
.camera-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: opacity var(--transition-base);
}

.camera-section.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.camera-section-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.75rem;
}

.camera-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.camera-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.camera-option {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 100px;
    flex: 1;
    box-shadow: var(--shadow-sm);
}

.camera-option:hover {
    border-color: var(--text-muted);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.camera-option.selected {
    border-color: var(--accent);
    background: var(--accent-dim);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.camera-icon {
    font-size: 1.75rem;
    color: var(--text-muted);
}

.camera-option.selected .camera-icon {
    color: var(--accent);
}

.camera-option span:last-child {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-align: center;
}

.camera-option.selected span:last-child {
    color: var(--text-primary);
}

/* ===== Appliance Section (for real photos) ===== */
.appliance-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.appliance-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.appliance-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.appliance-option {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 100px;
    flex: 1;
    box-shadow: var(--shadow-sm);
}

.appliance-option:hover {
    border-color: var(--text-muted);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.appliance-option.selected {
    border-color: var(--accent);
    background: var(--accent-dim);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.appliance-icon {
    font-size: 1.75rem;
}

.appliance-option.selected .appliance-icon {
    color: var(--accent);
}

.appliance-option span:last-child {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-align: center;
}

.appliance-option.selected span:last-child {
    color: var(--text-primary);
}

.appliance-section-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.75rem;
}

/* ===== Additional Notes Section (Collapsible) ===== */
.additional-notes-section {
    margin-bottom: 2rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
}

.additional-notes-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background var(--transition-base);
    text-align: left;
}

.additional-notes-toggle:hover {
    background: rgba(0, 0, 0, 0.02);
}

.toggle-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: transform var(--transition-base), color var(--transition-base);
}

.toggle-icon svg {
    width: 16px;
    height: 16px;
}

.additional-notes-section.expanded .toggle-icon {
    transform: rotate(45deg);
    color: var(--accent);
}

.toggle-text {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.additional-notes-toggle .optional-badge {
    margin-left: auto;
}

.additional-notes-content {
    display: none;
    padding: 0 1.25rem 1.25rem;
    animation: slideDown 0.25s ease;
}

.additional-notes-section.expanded .additional-notes-content {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.additional-notes-textarea {
    width: 100%;
    min-height: 80px;
    padding: 0.875rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-primary);
    resize: vertical;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.additional-notes-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.additional-notes-textarea::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.additional-notes-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* ===== Flooring Accordion ===== */
.flooring-accordion {
    margin-bottom: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
}

.flooring-accordion-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background var(--transition-base);
    text-align: left;
}

.flooring-accordion-toggle:hover {
    background: rgba(0, 0, 0, 0.02);
}

.flooring-accordion .toggle-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: transform var(--transition-base), color var(--transition-base);
}

.flooring-accordion .toggle-icon svg {
    width: 16px;
    height: 16px;
}

.flooring-accordion.expanded .toggle-icon {
    transform: rotate(45deg);
    color: var(--accent);
}

.flooring-accordion .toggle-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.flooring-accordion-content {
    display: none;
    padding: 0 1rem 1rem;
    animation: slideDown 0.25s ease;
}

.flooring-accordion.expanded .flooring-accordion-content {
    display: block;
}

/* Flooring gallery inside accordion - match countertop sizing */
.flooring-accordion .flooring-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0; /* Remove extra margin inside accordion */
}

.selected-finish-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.finish-preview {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    background-size: cover;
    background-position: center;
    border: 1px solid var(--border);
    transition: background var(--transition-base);
}

.finish-name {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Summary item centered layout */
.summary-item-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

/* Wrapper for preview + clear button (X positions relative to preview, not text) */
.summary-preview-wrapper {
    position: relative;
    display: inline-block;
    overflow: hidden; /* Clip scaled door images for crop effect */
}

/* Clear button on summary items */
.summary-clear-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    z-index: 1;
}

.summary-clear-btn:hover {
    background: var(--error);
    border-color: var(--error);
    color: white;
}

/* Select missing button in summary */
.select-missing-btn {
    background: none;
    border: 1px dashed var(--brand-blue);
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    color: var(--brand-blue);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
}

.select-missing-btn:hover {
    background: rgba(61, 90, 152, 0.08);
    border-style: solid;
}

.select-missing-btn.required {
    border-color: var(--brand-gold);
    color: var(--brand-gold);
}

.select-missing-btn.required:hover {
    background: var(--accent-dim);
    border-style: solid;
}

/* IKEA image in summary */
.summary-ikea-img {
    width: 100%;
    max-height: 80px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

/* Highlight pulse animation for sections */
.selection-section {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    border-radius: var(--radius-md);
    padding: 1rem;
    margin: -1rem;
    margin-bottom: 1.5rem;
}

.selection-section.highlight-pulse {
    animation: highlightPulse 2s ease-out;
}

@keyframes highlightPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(61, 90, 152, 0.4);
        background: rgba(61, 90, 152, 0.1);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(61, 90, 152, 0);
        background: rgba(61, 90, 152, 0.05);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(61, 90, 152, 0);
        background: transparent;
    }
}

.summary-item-centered span {
    font-size: 0.85rem;
    color: var(--text-primary);
}

/* Summary door image - square to match other previews */
.summary-door-img {
    width: 80px;
    height: 80px;
    object-fit: contain; /* Show full door without cropping */
    border-radius: 0;
    border: 1px solid var(--border);
    background: #FFFFFF;
}

/* Summary finish swatch - bigger square */
.summary-finish-swatch {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid var(--border);
}

/* Handle preview in summary - square to match other previews */
.summary-handle-preview {
    width: 80px;
    height: 80px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.summary-handle-preview.bar-handle::before {
    content: '';
    width: 50px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 4px;
}

.summary-handle-preview.knob-handle::before {
    content: '';
    width: 20px;
    height: 20px;
    background: var(--text-secondary);
    border-radius: 50%;
}

.summary-handle-preview.edge-handle::before {
    content: '';
    width: 8px;
    height: 32px;
    background: var(--text-secondary);
    border-radius: 4px;
}

.summary-handle-preview.none-handle::before {
    content: '—';
    color: var(--text-muted);
    font-size: 1.5rem;
}

/* ===== Upload Grid ===== */
.upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.upload-section {
    display: flex;
    flex-direction: column;
}

.upload-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.upload-section-title svg {
    color: var(--accent);
}

/* .optional-badge is defined earlier in the file (line ~573) */

.required-badge {
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    margin-left: 0.25rem;
}

.sample-options {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.use-sample-btn {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 0.4rem 0.85rem;
    border-radius: 100px;
    cursor: pointer;
    transition: all var(--transition-base);
}

.use-sample-btn:hover {
    background: var(--accent-dim);
    border-color: var(--brand-gold);
    color: var(--text-primary);
}

.coming-soon-badge {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.05);
    border: 1px dashed var(--text-muted);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    margin-left: auto;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.dropzone-disabled {
    cursor: not-allowed;
    border-style: dotted;
    background: rgba(0, 0, 0, 0.02);
}

.dropzone-disabled:hover {
    border-color: var(--border);
    background: rgba(0, 0, 0, 0.02);
}

/* ===== Dropzone ===== */
.dropzone-container {
    position: relative;
    width: 100%;
}

.dropzone {
    border: 2px dashed rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    background: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
    height: 100%;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropzone:hover {
    border-color: var(--accent);
    background: var(--accent-dim);
    box-shadow: var(--shadow-md);
}

.dropzone.dragover {
    border-color: var(--accent);
    background: var(--accent-dim);
    transform: scale(1.01);
    box-shadow: var(--shadow-md);
}

.dropzone-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    color: var(--text-muted);
    transition: color var(--transition-base);
}

.dropzone:hover .dropzone-icon {
    color: var(--accent);
}

.dropzone-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.dropzone-content p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.file-types {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.05);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
}

.upload-preview {
    display: none;
    position: relative;
    border-radius: var(--radius-lg);
    background: #F0F0F0;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    text-align: center; /* Center the image horizontally */
}

.upload-preview.active {
    display: block;
}

.upload-preview img {
    display: block;
    max-width: 100%;
    max-height: 400px;
    margin: 0 auto; /* Center horizontally */
    border-radius: calc(var(--radius-lg) - 2px);
}

.remove-upload {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
}

.remove-upload:hover {
    background: var(--error);
    border-color: var(--error);
    color: white;
}

.remove-upload svg {
    width: 16px;
    height: 16px;
}

/* ===== Upload Hint & Image Type Badge ===== */
/* Spacious upload section layout */
.upload-section-spacious {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    overflow: visible;
}

.upload-section-header {
    margin-bottom: 1.25rem;
    overflow: visible;
}

.upload-section-header .upload-section-title {
    margin-bottom: 0.5rem;
}


.sample-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.upload-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.image-type-badge {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    background: #FFFFFF;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    z-index: 10;
    margin-top: 0.75rem;
    line-height: 1.4;
}

.image-type-badge .badge-title {
    font-weight: 600;
    display: block;
}

.image-type-badge .badge-desc {
    font-size: 0.7rem;
    color: var(--text-secondary);
    display: block;
    margin-top: 0.2rem;
}

.image-type-badge:empty {
    display: none;
}

.image-type-badge.detecting,
.image-type-badge.analyzing {
    background: #F5F5F5;
    color: var(--text-secondary);
}

/* Spinner inside badge during analysis */
.badge-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-top-color: var(--text-secondary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}

/* Analyzing overlay on image */
.upload-preview.analyzing::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    border-radius: var(--radius-lg);
    z-index: 5;
}

.upload-preview.analyzing::before {
    content: 'Analyzing image...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 6;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
}

.image-type-badge.render {
    background: #E8EDF5;
    color: var(--brand-blue);
    border-color: var(--brand-blue);
}

.image-type-badge.photo {
    background: #FDF6E9;
    color: #8B6914;
    border-color: var(--brand-gold);
}

.image-type-badge.not-kitchen {
    background: #FDECEC;
    color: #DC2626;
    border-color: var(--error);
}

/* Summary type label */
.summary-type-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.summary-type-label.warning-label {
    color: var(--error);
    font-weight: 600;
}

/* ===== Tips Card ===== */
.tips-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.tips-card h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.tips-card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tips-card li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding-left: 1.25rem;
    position: relative;
}

.tips-card li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* ===== Summary Grid ===== */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    min-height: 160px;
    display: flex;
    flex-direction: column;
}

.summary-card h4 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}

.summary-content {
    font-size: 0.95rem;
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
}

.summary-content .placeholder {
    color: var(--text-muted);
    font-style: italic;
}

/* For IKEA/Kitchen preview images */
.summary-content > img {
    width: 100%;
    max-height: 80px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.summary-color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--border);
}

/* ===== API Section ===== */
.api-section {
    margin-bottom: 2rem;
}

.api-section label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

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

.api-input-wrapper input {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem 3rem 1rem 1rem;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-family: inherit;
    transition: border-color var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.api-input-wrapper input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.api-input-wrapper input::placeholder {
    color: var(--text-muted);
}

.toggle-visibility {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    transition: color var(--transition-base);
}

.toggle-visibility:hover {
    color: var(--text-secondary);
}

.toggle-visibility svg {
    width: 20px;
    height: 20px;
}

.api-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--accent);
    text-decoration: none;
    transition: opacity var(--transition-base);
}

.api-link:hover {
    opacity: 0.8;
}

/* ===== Generate Button ===== */
.generate-btn {
    width: 100%;
    background: linear-gradient(135deg, #8B6914 0%, #A67C00 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 1.25rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.generate-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.2) 50%, transparent 100%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.generate-btn:hover::before {
    transform: translateX(100%);
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(139, 105, 20, 0.35);
}

.generate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.generate-btn:disabled::before {
    display: none;
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

/* ===== Loading State ===== */
.loading-state {
    display: none;
    text-align: center;
    padding: 3rem;
}

.loading-state.active {
    display: block;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-state p {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.loading-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===== Collapsible Step 3 Settings ===== */
.step3-settings {
    transition: all 0.3s ease;
}

.step3-settings.collapsed {
    display: none;
}

.expand-settings-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    margin: 0 auto 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    width: fit-content;
}

.expand-settings-btn:hover {
    background: var(--bg-primary);
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.expand-settings-btn svg {
    transition: transform 0.2s ease;
}

.expand-settings-btn.expanded svg {
    transform: rotate(180deg);
}

/* ===== Result Container ===== */
.result-tabs-container {
    margin-top: 1.5rem;
}

/* Result Tabs Container */
.result-tabs-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

/* Result Tabs - styled like appliance toggle */
.result-tabs {
    display: inline-flex;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 4px;
    gap: 4px;
}

.result-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-radius: calc(var(--radius-md) - 4px);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
}

.result-tab:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.03);
}

.result-tab.active {
    background: white;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.result-tab svg {
    opacity: 0.6;
}

.result-tab.active svg {
    opacity: 1;
}

.result-tab.disabled,
.result-tab:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Video Disabled Message */
.video-disabled-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    min-height: 280px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border);
}

.video-disabled-message h4 {
    margin: 1rem 0 0.5rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Tab Content */
.result-tab-content {
    display: none;
}

.result-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Generate Prompts (Image and Video) */
.image-generate-prompt,
.video-generate-prompt {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border);
    max-width: 800px;
    margin: 0 auto;
}

.generate-prompt-icon {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.image-generate-prompt h4,
.video-generate-prompt h4 {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.image-generate-prompt p,
.video-generate-prompt p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* Generate buttons inside prompts */
.image-generate-prompt .generate-btn,
.generate-video-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--text-primary);
    color: white;
    border: none;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    width: auto;
}

.image-generate-prompt .generate-btn:hover,
.generate-video-btn:hover {
    background: var(--accent);
    transform: translateY(-1px);
}

.image-generate-prompt .generate-btn:disabled,
.generate-video-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Generate button loading state */
.generate-btn .btn-spinner,
.generate-video-btn .btn-spinner {
    display: none;
}

.generate-btn.loading .btn-text,
.generate-btn.loading .btn-icon,
.generate-video-btn.loading .btn-text,
.generate-video-btn.loading .btn-icon {
    display: none;
}

.generate-btn.loading .btn-spinner,
.generate-video-btn.loading .btn-spinner {
    display: inline-flex;
}

.generate-btn .spinner-icon,
.generate-video-btn .spinner-icon {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Loading hint text for video generation */
.video-loading-hint {
    display: block;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Hide prompt content when video result is shown */
.video-generate-prompt.has-result .generate-prompt-content {
    display: none;
}

.video-generate-prompt.has-result {
    border-style: solid;
    border-color: var(--border);
    padding: 1.5rem;
}

/* Video result inside generate prompt container */
.video-generate-prompt .video-result-wrapper {
    margin: 0;
    max-width: 100%;
    box-shadow: none;
}

/* Hide prompt content when result is shown */
.image-generate-prompt.has-result .generate-prompt-content {
    display: none;
}

/* Adjust container style when showing result */
.image-generate-prompt.has-result {
    border-style: solid;
    border-color: var(--border);
    padding: 1.5rem;
}

/* Result image inside generate prompt container */
.image-generate-prompt .result-image-wrapper {
    margin: 0;
    max-width: 100%;
    box-shadow: none;
}

.video-disabled-hint {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ===== Video Generation Container (matches Image tab) ===== */
.video-generate-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.video-generation-preview {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-tertiary);
    aspect-ratio: 16/9;
}

.video-generation-preview img,
.video-generation-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Hide image when video is shown */
.video-generation-preview.has-video img {
    display: none;
}

.video-generation-preview.has-video video {
    display: block !important;
}

/* Grayscale effect when generating */
.video-generation-preview.generating img {
    filter: grayscale(0.6) brightness(0.7);
}

/* Video loading overlay */
.video-loading-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.video-generation-preview.generating .video-loading-overlay {
    opacity: 1;
    visibility: visible;
}

/* Video actions overlay */
.video-generation-preview .video-actions-overlay {
    position: absolute;
    bottom: 16px;
    right: 16px;
    opacity: 0;
    transition: opacity var(--transition-base);
    z-index: 2;
}

.video-generation-preview.has-video:hover .video-actions-overlay {
    opacity: 1;
}

/* Placeholder when no image */
.video-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.video-placeholder .generate-prompt-icon {
    opacity: 0.5;
}

/* Hide placeholder when generated image exists */
.video-generation-preview.has-generated .video-placeholder {
    display: none;
}

/* Show placeholder overlay on reference image (before generation) */
.video-generation-preview.has-image:not(.has-generated) .video-placeholder {
    display: flex;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2;
}

/* Dim reference image when showing placeholder */
.video-generation-preview.has-image:not(.has-generated) img {
    filter: brightness(0.5);
}

/* Hide image when no image at all (show placeholder instead) */
.video-generation-preview:not(.has-image) img {
    display: none;
}

/* Hide button while generating */
.video-generate-container.generating .generate-btn {
    display: none;
}

/* ===== Video Options Overlay ===== */
.video-options-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    z-index: 1;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

/* Show overlay only when generated image exists (not just reference image) */
.video-generation-preview.has-generated:not(.has-video):not(.generating) .video-options-overlay {
    opacity: 1;
    visibility: visible;
}

/* Dim the generated image when options overlay is shown */
.video-generation-preview.has-generated:not(.has-video):not(.generating) img {
    filter: brightness(0.6);
}

/* Hide overlay while generating or when video is ready */
.video-generation-preview.generating .video-options-overlay,
.video-generation-preview.has-video .video-options-overlay {
    opacity: 0;
    visibility: hidden;
}

/* Video option toggles - uses result-tabs styling with enhanced visibility */
.video-options-overlay .result-tabs {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* ===== Generation Preview Container ===== */
.image-generate-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Gold generate button style for both Image and Video tabs - matches nav accent */
.image-generate-container .generate-btn,
.video-generate-container .generate-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 2px 8px rgba(212, 149, 45, 0.3);
}

.image-generate-container .generate-btn:hover,
.video-generate-container .generate-btn:hover {
    filter: brightness(1.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 149, 45, 0.4);
}

.image-generate-container .generate-btn:disabled,
.video-generate-container .generate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.generation-preview {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-tertiary);
    aspect-ratio: 16/9;
}

.generation-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: filter 0.3s ease;
}

/* Grayscale effect when loading */
.generation-preview.generating img {
    filter: grayscale(0.6) brightness(0.7);
}

/* Loading overlay on reference image */
.generation-loading-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.generation-preview.generating .generation-loading-overlay {
    opacity: 1;
    visibility: visible;
}

.generation-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: white;
    text-align: center;
    padding: 1rem;
}

.generation-spinner {
    width: 48px;
    height: 48px;
}

.generation-spinner svg {
    width: 100%;
    height: 100%;
    animation: spin 1s linear infinite;
    color: white;
}

.generation-loading-text {
    font-size: 1rem;
    font-weight: 500;
}

.generation-loading-sub {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Hide button while generating */
.image-generate-container.generating .generate-btn {
    display: none;
}

/* AI Disclaimer - shown only after generation */
.ai-disclaimer {
    display: none;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.75rem;
    font-style: italic;
}

.generation-preview.has-result ~ .generate-btn ~ .ai-disclaimer {
    display: block;
}

/* Download button overlay - bottom right */
.generation-preview .result-actions-overlay {
    position: absolute;
    bottom: 16px;
    right: 16px;
    opacity: 0;
    transition: opacity var(--transition-base);
    z-index: 2;
}

.generation-preview.has-result:hover .result-actions-overlay {
    opacity: 1;
}

/* Always show action buttons on mobile/touch devices */
@media (max-width: 768px) {
    .generation-preview.has-result .result-actions-overlay {
        opacity: 1;
    }
}

/* Also show on devices that don't support hover */
@media (hover: none) {
    .generation-preview.has-result .result-actions-overlay {
        opacity: 1;
    }
}

/* Expand indicator - centered on image */
.generation-preview .expand-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-base);
    cursor: pointer;
    backdrop-filter: blur(4px);
}

.generation-preview .expand-indicator svg {
    width: 24px;
    height: 24px;
    color: white;
}

.generation-preview.has-result:hover .expand-indicator {
    opacity: 1;
}

/* Placeholder when no reference image */
.generation-preview:not(.has-image) {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--border);
    background: var(--bg-secondary);
}

.generation-preview:not(.has-image)::before {
    content: 'Upload a reference image first';
    color: var(--text-muted);
    font-size: 0.9rem;
}

.generation-preview:not(.has-image) img,
.generation-preview:not(.has-image) .expand-indicator,
.generation-preview:not(.has-image) .result-actions-overlay {
    display: none;
}

.result-image-wrapper {
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #F0F0F0;
    margin: 0 auto 1.5rem;
    box-shadow: var(--shadow-md);
    max-width: 800px;
}

.result-image-wrapper img {
    width: 100%;
    display: block;
}

/* Hover download overlay for result image */
.result-actions-overlay {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.result-image-wrapper {
    position: relative;
}

.result-image-wrapper img {
    cursor: zoom-in;
}

.result-image-wrapper:hover .result-actions-overlay {
    opacity: 1;
}

/* Expand indicator overlay for clickable images */
.expand-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-base);
    pointer-events: none;
}

.expand-indicator svg {
    width: 24px;
    height: 24px;
    stroke: white;
}

.result-image-wrapper:hover .expand-indicator {
    opacity: 1;
}

/* ===== Video Result Section ===== */
.video-result-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.video-result-section h4 {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.video-loading-state {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border);
}

.video-loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.video-loading-state p {
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.video-loading-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.video-result-wrapper {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #000;
    box-shadow: var(--shadow-md);
    max-width: 800px;
    margin: 0 auto;
}

.video-result-wrapper video {
    width: 100%;
    display: block;
    border-radius: var(--radius-lg);
}

.video-actions-overlay {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.video-result-wrapper:hover .video-actions-overlay {
    opacity: 1;
}

.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
}

.action-btn svg {
    width: 18px;
    height: 18px;
}

.download-btn {
    background: var(--accent);
    color: white;
    border: none;
    box-shadow: var(--shadow-sm);
}

.download-btn:hover {
    background: #A67C00;
}

/* ===== Generated Images Gallery ===== */
.generated-gallery {
    margin-top: 3rem;
    margin-bottom: 6rem; /* Space for footer navigation */
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.generated-gallery-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.generated-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.generated-gallery-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #F0F0F0;
    aspect-ratio: 16/9;
    cursor: pointer;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.generated-gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.generated-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
}

/* Expand indicator for gallery items */
.generated-gallery-item .expand-indicator {
    width: 40px;
    height: 40px;
}

.generated-gallery-item .expand-indicator svg {
    width: 18px;
    height: 18px;
}

.generated-gallery-item:hover .expand-indicator {
    opacity: 1;
}

.gallery-actions {
    position: absolute;
    bottom: 8px;
    right: 8px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.generated-gallery-item:hover .gallery-actions {
    opacity: 1;
}

.gallery-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-base), background var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.gallery-action-btn:hover {
    transform: scale(1.1);
    background: white;
}

.gallery-action-btn svg {
    width: 16px;
    height: 16px;
    stroke: var(--text-primary);
}

.gallery-delete-btn:hover {
    background: #fee2e2;
}

.gallery-delete-btn:hover svg {
    stroke: #dc2626;
}

/* ===== Lightbox ===== */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-base);
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-image {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Mobile: 2 columns */
@media (max-width: 768px) {
    .generated-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-actions {
        opacity: 1;
    }
    
    .lightbox-overlay {
        padding: 1rem;
    }
    
    .lightbox-close {
        top: 0.5rem;
        right: 0.5rem;
    }
}


/* ===== Sticky Navigation Footer ===== */
.nav-footer {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    
    /* Glassmorphism effect */
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    
    padding: 0.625rem 0.75rem;
    border-radius: 100px; /* Pill shape */
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.15),
        0 4px 12px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    
    /* Smooth entrance animation */
    animation: navFooterSlideUp 0.4s ease-out;
}

@keyframes navFooterSlideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.nav-footer > .nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-btn > svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Spinner for Generate button */
.nav-btn .btn-spinner {
    display: none;
    align-items: center;
    justify-content: center;
}

.nav-btn .btn-spinner .spinner-icon {
    width: 18px;
    height: 18px;
    animation: navSpinnerRotate 0.8s linear infinite;
    stroke: currentColor;
    stroke-width: 2.5;
}

@keyframes navSpinnerRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.nav-btn.generating .btn-label {
    display: none !important;
}

.nav-btn.generating > svg.btn-arrow {
    display: none !important;
}

.nav-btn.generating .btn-spinner {
    display: inline-flex !important;
}

/* Add text for generating state */
.nav-btn.generating::after {
    content: 'Generating...';
    margin-left: 0.5rem;
}

.prev-btn {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-secondary);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.prev-btn:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-primary);
    border-color: rgba(0, 0, 0, 0.12);
}

.prev-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.next-btn {
    background: var(--brand-gold);
    color: white;
    border: none;
    box-shadow: 0 2px 8px var(--accent-glow);
}

.next-btn:hover:not(:disabled) {
    background: var(--brand-gold);
    filter: brightness(1.1);
    box-shadow: 0 4px 12px var(--accent-glow);
    transform: translateY(-1px);
}

.next-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

/* Step indicator pill between buttons */
.nav-footer .step-pill {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.nav-footer .step-pill .current-step {
    color: var(--accent);
}

/* Spacer to prevent content from being hidden behind sticky nav */
.nav-footer-spacer {
    height: 100px;
}

/* ===== Custom Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.25s ease;
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
}

.modal-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    color: var(--brand-blue);
}

.modal-icon.error {
    color: var(--error);
}

.modal-icon.success {
    color: var(--success);
}

.modal-icon.warning {
    color: var(--brand-gold);
}

.modal-icon.info {
    color: var(--brand-blue);
}

.modal-icon svg {
    width: 100%;
    height: 100%;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.modal-message {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

/* Door Design Summary Table - styled confirmation table */
.design-summary-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 12px;
    overflow: hidden;
    background: var(--glass-bg);
    border: 1px solid var(--border-subtle);
    margin: 0.5rem 0;
}

.design-summary-table tr:not(:last-child) {
    border-bottom: 1px solid var(--border-subtle);
}

.design-summary-table td {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

.design-summary-label {
    color: var(--text-muted);
    font-weight: 500;
    width: 40%;
    text-align: left;
    background: rgba(255, 255, 255, 0.02);
}

.design-summary-value {
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
}

/* Alternate row subtle highlight */
.design-summary-table tr:nth-child(even) .design-summary-label {
    background: rgba(255, 255, 255, 0.04);
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.modal-actions.horizontal {
    flex-direction: row;
    justify-content: center;
}

.modal-btn {
    background: var(--brand-blue);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.75rem 2rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    flex: 1;
}

.modal-btn:hover {
    filter: brightness(1.1);
}

.modal-btn.gold {
    background: var(--brand-gold);
}

.modal-btn.secondary,
.modal-btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.modal-btn.secondary:hover,
.modal-btn-secondary:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: var(--text-muted);
}

.modal-btn.danger,
.modal-btn-danger {
    background: #dc3545;
    color: white;
}

.modal-btn.danger:hover,
.modal-btn-danger:hover {
    background: #c82333;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .app-container {
        padding: 1rem;
    }
    
    /* Hero responsive */
    .hero {
        min-height: 50vh;
        margin-top: -1rem; /* Counteract mobile app-container padding */
    }
    
    .hero-content {
        padding: 1.5rem;
    }
    
    .hero-logo {
        height: 44px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
    }
    
    .hero-cta {
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
    }
    
    /* Hero nav - hide desktop nav, show mobile menu */
    .hero-header {
        position: relative;
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }
    
    .desktop-nav {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    /* Add section buttons full width on mobile with buffer */
    .add-section-btn {
        width: calc(100% - 2rem);
        margin-left: 1rem;
        margin-right: 1rem;
        justify-content: center;
    }
    
    /* Result tabs full width on mobile */
    .result-tabs {
        display: flex;
        width: 100%;
    }
    
    .result-tab {
        flex: 1;
        justify-content: center;
    }
    
    /* Stepper mobile styles */
    .stepper {
        margin-bottom: 2rem;
        padding: 0 0.5rem;
    }
    
    .stepper-track {
        gap: 0;
    }
    
    .stepper-step {
        padding: 0.5rem 0.25rem;
        gap: 0.35rem;
    }
    
    .step-badge {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }
    
    .step-badge .step-check {
        width: 12px;
        height: 12px;
    }
    
    .step-text {
        font-size: 0.7rem;
    }
    
    .stepper-connector {
        width: 1.5rem;
    }
    
    .stepper-step.active .step-badge {
        box-shadow: 0 0 0 3px var(--accent-glow);
    }
    
    .quick-select-buttons {
        flex-direction: row;
        justify-content: center;
    }
    
    .surprise-me-btn,
    .use-last-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .step-header {
        overflow: visible;
        padding: 0 0.5rem;
    }
    
    .step-header h1 {
        font-size: 1.75rem;
    }
    
    .door-gallery {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    /* Flooring galleries (wood/tile) match door gallery 3-column layout on mobile */
    .flooring-accordion .flooring-gallery {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .action-btn {
        justify-content: center;
    }
    
    /* Sticky nav adjustments for mobile */
    .nav-footer {
        bottom: 1rem;
        padding: 0.5rem 0.625rem;
        gap: 0.5rem;
        transition: opacity 0.3s ease, transform 0.3s ease;
    }
    
    /* Hide nav footer on mobile until scrolled (step 1 only) */
    .nav-footer.nav-hidden {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
        pointer-events: none;
    }
    
    .nav-footer > .nav-btn {
        padding: 0.625rem 1rem;
        font-size: 0.8rem;
    }
    
    .nav-footer .step-pill {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .nav-footer-spacer {
        height: 80px;
    }
}

@media (max-width: 480px) {
    /* Sticky nav on small screens - centered without transform */
    .nav-footer {
        bottom: 0.75rem;
        left: 0.75rem;
        right: 0.75rem;
        transform: none;
        width: auto;
        animation: navFooterSlideUpMobile 0.4s ease-out;
    }
    
    /* Hidden state for 480px uses different transform */
    .nav-footer.nav-hidden {
        transform: translateY(20px);
    }
    
    @keyframes navFooterSlideUpMobile {
        from {
            opacity: 0;
            bottom: -20px;
        }
        to {
            opacity: 1;
            bottom: 0.75rem;
        }
    }
    
    .nav-footer > .nav-btn {
        flex: 1;
        justify-content: center;
        padding: 0.625rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .nav-footer .step-pill {
        padding: 0.25rem 0.625rem;
    }
    /* Stepper smaller mobile */
    .stepper-step {
        padding: 0.4rem 0.15rem;
        gap: 0.25rem;
    }
    
    .step-badge {
        width: 22px;
        height: 22px;
        font-size: 0.65rem;
    }
    
    .step-text {
        font-size: 0.6rem;
    }
    
    .stepper-connector {
        width: 1rem;
    }
}
