/* Variable Definitions - Premium Dark Theme */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #121212;
    --bg-card: #1c1c1e;

    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-accent: #3b82f6;
    /* Modern Blue */

    --accent-primary: #e61c24;
    /* Casadio Red */
    --accent-secondary: #b01118;
    /* Dark Red */
    --accent-glow: rgba(230, 28, 36, 0.5);

    --border-color: #27272a;

    --font-main: 'Outfit', 'Glacial Indifference', system-ui, -apple-system, sans-serif;

    --transition-speed: 0.3s;
}

/* Light Theme Variables */
[data-theme="light"] {
    --bg-primary: #f4f4f8;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;

    --text-primary: #0f0f0f;
    --text-secondary: #555566;

    --border-color: #d1d5db;
}

/* ---- Header & Nav ---- */
[data-theme="light"] .bottom-nav {
    background-color: #f4f4f8;
    border-color: #d1d5db;
}

[data-theme="light"] .nav-links a {
    color: var(--text-primary);
}

[data-theme="light"] .icon-btn {
    color: #111111;
}

[data-theme="light"] .top-bar .brand-text {
    color: #ffffff; /* Header sempre nero -> brand resta bianco */
}

/* Header sempre nero -> tutto dentro è sempre bianco */
header.site-header .icon-btn,
header.site-header .brand-text,
header.site-header .user-actions * {
    color: #ffffff !important;
}



/* ---- Accordion panels / Porsche cards ---- */
[data-theme="light"] .accordion-panel,
[data-theme="light"] .porsche-card {
    background: #ffffff;
    border-color: #d1d5db;
}

[data-theme="light"] .accordion-trigger {
    color: #0f0f0f;
}

[data-theme="light"] .accordion-content {
    background: #ffffff;
}

/* ---- Sidebar header ---- */
[data-theme="light"] .sidebar-header h1 {
    color: #0f0f0f;
}

[data-theme="light"] .porsche-badge {
    background: #e2e8f0;
    color: #334155;
}

/* ---- Model picker buttons ---- */
[data-theme="light"] .model-picker-btn {
    background: #f1f5f9;
    border-color: #d1d5db;
    color: #0f0f0f;
}

[data-theme="light"] .model-picker-btn:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

[data-theme="light"] .model-picker-btn.active {
    background: #fff;
    border-color: var(--accent-primary);
    color: #0f0f0f;
}

/* ---- Toggle buttons (Chassis / Version) ---- */
[data-theme="light"] .toggle-btn {
    background: #f1f5f9;
    border-color: #d1d5db;
    color: #0f0f0f;
}

[data-theme="light"] .toggle-btn.active {
    background: #0f0f0f;
    color: #ffffff;
    border-color: #0f0f0f;
}

/* ---- Labels ---- */
[data-theme="light"] .porsche-label {
    color: #555566;
}

/* ---- Frame tools buttons ---- */
[data-theme="light"] .tool-icon {
    background: rgba(255,255,255,0.85);
    color: #0f0f0f;
    border-color: #d1d5db;
}

/* ---- Section titles / tag badge ---- */
[data-theme="light"] .section-sub-label,
[data-theme="light"] .bc-item {
    color: #555566;
}

/* ---- Wheel select ---- */
[data-theme="light"] #wheel-select {
    background: #f1f5f9;
    color: #0f0f0f;
    border-color: #d1d5db;
}

/* ---- Checkout / Sommario button stays red ---- */

/* Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;

    /* Font Smoothing for consistency */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Enable Native View Transitions (Magic Move) */
@view-transition {
    navigation: auto;
}

/* Keyframe Animations */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-60px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(60px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(60px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Apply Animations */
h1 {
    animation: slideInLeft 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

p.subtitle,
.section-title p {
    animation: slideInRight 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    animation-delay: 0.1s;
    opacity: 0;
    /* Start hidden for delay */
}

/* Staggered Model Cards */
.model-card {
    opacity: 0;
    animation: slideInUp 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.model-card:nth-child(1) {
    animation-delay: 0.1s;
}

.model-card:nth-child(2) {
    animation-delay: 0.2s;
}

.model-card:nth-child(3) {
    animation-delay: 0.3s;
}

.model-card:nth-child(4) {
    animation-delay: 0.4s;
}

.model-card:nth-child(5) {
    animation-delay: 0.5s;
}

.model-card:nth-child(6) {
    animation-delay: 0.6s;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--accent-primary);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 3.5rem;
}

h2 {
    font-size: 2.5rem;
}

h3 {
    font-size: 1.75rem;
}

p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

/* Layout Utilities */
.container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.visible-hidden {
    display: none;
}

/* Navigation Redesign */
header.site-header {
    background-color: #000000;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.brand-area {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
}

.brand-logo {
    height: 75px;
    width: auto;
    flex-shrink: 0;
    /* Prevent shrinking in different contexts */
    object-fit: contain;
}

.brand-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 2.2rem;
    line-height: 1;
    color: #ffffff;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
}

.search-box {
    position: absolute;
    right: 100%;
    /* Position to the left of the button */
    top: 50%;
    transform: translateY(-50%);
    margin-right: 10px;
    width: 0;
    /* Start hidden */
    overflow: hidden;
    transition: width 0.3s ease;
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.search-box.active {
    width: 200px;
    /* Expanded width */
    padding: 0.25rem;
    /* Add padding when active */
}

#search-input {
    width: 100%;
    background: transparent;
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    font-family: var(--font-main);
    outline: none;
}

.icon-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.icon-btn svg {
    width: 24px;
    height: 24px;
    stroke: white;
    stroke-width: 1.5;
}

.icon-label {
    font-size: 0.7rem;
    font-weight: 300;
    text-transform: lowercase;
}

/* Secondary Navigation (Bottom Row) */
.bottom-nav {
    display: flex;
    justify-content: center;
    /* Centered links as per sketch suggestion (or left) */
    padding: 0.75rem 0;
    overflow-x: auto;
}

.nav-links {
    display: flex;
    gap: 3rem;
}

.nav-links a {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    padding-bottom: 0.2rem;
    white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
    border-bottom-color: var(--accent-primary);
    color: var(--text-primary);
}


/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
    border: none;
    font-size: 1rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    margin-right: 0.75rem;
    border-radius: 4px;
    /* Optional: adds subtle rounding if the image is square */
    object-fit: contain;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
}

.btn-primary:hover {
    background: var(--accent-secondary);
    transform: translateY(-2px);
    color: white;
}

.btn-secondary {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

.btn-cults {
    background-color: #822EF5;
    /* Extracted exact logo color */
    color: white;
    box-shadow: 0 4px 15px rgba(130, 46, 245, 0.4);
    border: none;
}

.btn-cults:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(130, 46, 245, 0.5);
    background-color: #7124d6;
    /* Slightly darker on hover */
}

.btn-youmagine {
    background-color: #124BB2;
    /* Extracted exact logo color */
    color: white;
    box-shadow: 0 4px 15px rgba(18, 75, 178, 0.4);
    border: none;
}

.btn-youmagine:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(18, 75, 178, 0.5);
    background-color: #0e3a8f;
    /* Slightly darker on hover */
}

/* Hero Section */
.hero {
    padding: 8rem 1.5rem 6rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    /* Ensure content sits above slideshow */
    z-index: 1;
}

/* Slideshow/* Hero Slideshow */
.hero-slideshow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    z-index: 0;
}

.slide.active {
    opacity: 1;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.7));
    z-index: -1;
}

/* Slider Buttons - Minimal */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    /* No background */
    border: none;
    color: rgba(255, 255, 255, 0.7);
    /* Slightly transparent white */
    font-size: 2rem;
    /* Moderate size, not huge */
    cursor: pointer;
    z-index: 20;
    padding: 1rem;
    /* Hit area */
    transition: color 0.3s, transform 0.2s;
    user-select: none;
}

.slider-btn:hover {
    color: white;
    /* Full white on hover */
    transform: translateY(-50%) scale(1.2);
    /* Slight grow */
}

.slider-btn.prev {
    left: 20px;
}

.slider-btn.next {
    right: 20px;
}

/* Remove the old blob effect as the slideshow replaces it */
/* .hero::before { deleted } */

.hero h1 {
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    /* Better readability */
}

.hero p.subtitle {
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto 2.5rem;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

/* Sections */
section {
    padding: 4rem 1.5rem;
}

.section-title {
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
}

.section-title h1 {
    margin-bottom: 0.75rem;
}

.section-title p {
    font-size: 1.1rem;
    margin-bottom: 0;
    color: var(--text-secondary);
}

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: transform var(--transition-speed);
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
}

/* Workflow / Philosophy Section - Apple/Porsche Premium Style */
.philosophy-section {
    padding: 6rem 1.5rem;
    background: radial-gradient(circle at 50% 0%, #1a1a1f 0%, var(--bg-primary) 70%);
    position: relative;
    overflow: hidden;
}

.workflow-container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    padding: 2rem 0;
}

.workflow-line {
    position: absolute;
    left: 40px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, transparent, var(--accent-primary) 20%, var(--accent-secondary) 80%, transparent);
    z-index: 0;
    opacity: 0.5;
}

.workflow-step {
    display: flex;
    align-items: flex-start;
    gap: 3rem;
    margin-bottom: 4rem;
    position: relative;
    z-index: 1;
}

.workflow-step:last-child {
    margin-bottom: 0;
}

.step-number {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    background: var(--bg-primary);
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 900;
    color: var(--accent-primary);
    box-shadow: 0 0 20px rgba(230, 28, 36, 0.3);
    font-family: 'Outfit', sans-serif;
    position: relative;
    transition: all 0.4s ease;
}

.workflow-step:hover .step-number {
    transform: scale(1.1);
    background: var(--accent-primary);
    color: white;
    box-shadow: 0 0 30px rgba(230, 28, 36, 0.6);
}

.step-content {
    background: rgba(28, 28, 30, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 2.5rem;
    border-radius: 20px;
    flex-grow: 1;
    transition: all 0.4s ease;
}

.workflow-step:hover .step-content {
    border-color: rgba(230, 28, 36, 0.3);
    transform: translateX(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.step-content h3 {
    font-size: 1.8rem;
    color: white;
    margin-bottom: 1rem;
    letter-spacing: 0.02em;
}

.step-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

@media (max-width: 768px) {
    .workflow-line {
        left: 25px;
    }
    
    .workflow-step {
        gap: 1.5rem;
    }
    
    .step-number {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .step-content {
        padding: 1.5rem;
    }
}

/* Footer */
footer {
    border-top: 1px solid var(--border-color);
    padding: 3rem 1.5rem;
    margin-top: 4rem;
    text-align: center;
    color: var(--text-secondary);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}


/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    .nav-links {
        display: none;
    }

    /* Ideal: Add hamburger menu */
}

/* --- Model Showcase Styles --- */
.models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
}

.model-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: all var(--transition-speed);
    display: flex;
    flex-direction: column;
}

.model-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.model-image-placeholder {
    width: 100%;
    height: 250px;
    background: linear-gradient(45deg, #2a2a2e, #18181b);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-weight: 500;
}

.model-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: rgba(230, 28, 36, 0.1);
    color: var(--accent-primary);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    align-self: flex-start;
}

.model-content h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.model-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 1.5rem;
}

.model-actions .btn {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: left;
    /* Aligns the "Buy on" and "Store" text to the left relative to the icon */
    margin: 0;
    padding: 0.5rem 1rem;
    /* Added padding for better spacing */
    line-height: 1.2;
    /* Tighter line height for the two lines */
}

.model-actions .btn span {
    display: block;
}

.model-actions .btn strong {
    font-size: 1.1em;
    /* Make the store name slightly larger */
    text-transform: uppercase;
    font-weight: 800;
}

/* Shopping List / Details Accordion */
.model-details {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    animation: fadeIn 0.3s ease-out;
}

.model-details.hidden {
    display: none;
}

.model-details h4 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.shopping-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.shopping-list li:last-child {
    border-bottom: none;
}

.shop-link {
    color: var(--accent-primary);
    font-size: 0.9rem;
    font-weight: 600;
}


/* --- Configurator Styles --- */
.configurator-wrapper {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .configurator-wrapper {
        flex-direction: column;
    }
}

/* --- Immersive Configurator Styles --- */
.immersive-configurator {
    display: flex;
    flex-direction: column;
    height: 90vh;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at center, #2a2a2e 0%, #000000 100%);
    /* Added Background */
}

.config-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #2a2a2e 0%, #000000 100%);
    position: relative;
    padding: 2rem;
    /* Normal padding */
    min-height: 0;
    /* Important for flex */
}

/* Adjust Preview Container for Stage */
.config-stage .preview-container {
    width: 100%;
    height: 100%;
    max-width: 1200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.config-stage img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.5));
}

.config-bottom-panel {
    position: relative;
    /* No longer absolute */
    width: 100%;
    background: #111;
    /* Solid dark background */
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex-shrink: 0;
    /* Don't shrink */
}

.step-nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

.step-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    position: relative;
    padding-bottom: 0.25rem;
    transition: color 0.3s ease;
}

.step-btn.active {
    color: var(--accent-primary);
    font-weight: 700;
}

.step-btn.active::after {
    content: '';
    position: absolute;
    bottom: -0.6rem;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-primary);
}

.controls-container {
    min-height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.config-step {
    display: none;
    /* Hidden by default */
    width: 100%;
    text-align: center;
    animation: slideInUp 0.4s ease-out;
}

.config-step.active {
    display: block;
}

.option-grid {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.option-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 120px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.option-card img {
    width: 100%;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.option-card span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.option-card:hover,
.option-card.active {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
}

.option-card.active span {
    color: white;
}

.nav-actions {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 0.5rem;
}

/* Version Grid (Step 2) - Same as Model Grid */
.version-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    max-width: 900px;
    margin: 0 auto;
}

/* Version Button - Styling to match Model Select Btn */
.version-select-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.version-select-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.version-select-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.version-select-btn .version-name {
    font-size: 1.2rem;
    font-weight: 700;
}

/* Performance Details - Below Grid */
.performance-details-panel {
    grid-column: 1 / -1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
    animation: fadeIn 0.3s ease-out;
}

/* Ensure model-list uses grid too */
.model-list-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    max-width: 900px;
    margin: 0 auto;
}

/* Animation for Performance Options */
.performance-options {
    animation: slideDown 0.3s ease-out forwards;
    padding-left: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0 0 8px 8px;
    margin-top: -5px !important;
    border-left: 2px solid var(--accent-primary);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.model-select-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.model-select-btn:hover {
    background-color: rgba(99, 102, 241, 0.1);
    border-color: var(--accent-primary);
    transform: translateX(5px);
}

.model-name {
    font-size: 1.2rem;
    font-weight: 700;
}

.model-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Scrollable Options Container */
.scrollable-options {
    max-height: 400px;
    /* Constrain height to keep preview visible */
    overflow-y: auto;
    padding-right: 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) transparent;
}

.sub-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

.separator {
    border: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 2rem 0;
}

/* Summary Table Styles */
.summary-table th {
    text-align: left;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-table td {
    padding: 1rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
}

.summary-table td a:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* Color Options in Horizontal Row */
.color-options {
    justify-content: center !important;
    display: flex;
    gap: 0.5rem;
}

.btn-group {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

/* Toggle Switch */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.toggle-switch input {
    display: none;
}

.slider {
    width: 40px;
    height: 20px;
    background-color: #333;
    border-radius: 20px;
    position: relative;
    transition: 0.3s;
}

.slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: white;
    top: 2px;
    left: 2px;
    transition: 0.3s;
}

.toggle-switch input:checked+.slider {
    background-color: var(--accent-primary);
}

.toggle-switch input:checked+.slider::before {
    transform: translateX(20px);
}

.config-preview {
    flex: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.preview-container {
    width: 100%;
    max-width: 600px;
    aspect-ratio: 16/9;
    background-color: #1a1a1a;
    /* Darker background for canvas */
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
}

.layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    transition: all 0.5s ease;
}


/* --- Story Page "Zigzag" Layout --- */
.story-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 0;
}

.story-row {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    margin-bottom: 6rem;
    align-items: center;
}

.story-content {
    flex: 1;
    font-size: 1.15rem;
    line-height: 1.7;
    color: var(--text-primary);
}

.story-image {
    flex: 1;
    width: 100%;
}

.story-image img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.story-image img:hover {
    transform: scale(1.02);
}

/* Tablet/Desktop: Side-by-side */
@media (min-width: 768px) {
    .story-row {
        flex-direction: row;
    }

    /* Alternate direction for even rows */
    .story-row:nth-child(even) {
        flex-direction: row-reverse;
    }

    .story-content {
        padding: 0 1rem;
    }
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 4rem;
}

.gallery-grid img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    transition: opacity 0.3s;
}

.gallery-grid img:hover {
    opacity: 0.9;
    cursor: pointer;
    transform: scale(1.02);
    transition: transform 0.2s;
}

/* Lightbox Styles */
.lightbox {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s;
}

.lightbox.hidden {
    display: none;
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90vh;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s;
}

.close-lightbox {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    z-index: 1001;
}

.close-lightbox:hover,
.close-lightbox:focus {
    color: var(--accent-primary);
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0
    }

    to {
        transform: scale(1);
        opacity: 1
    }
}

/* --- Voting System Styles --- */
.voting-layout {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

@media (max-width: 768px) {
    .voting-layout {
        flex-direction: column;
    }
}

.suggestion-form-container {
    flex: 1;
    min-width: 300px;
}

.voting-list-container {
    flex: 2;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-main);
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Ideas Grid */
.ideas-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.idea-card {
    display: flex;
    align-items: center;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 12px;
    gap: 1.5rem;
    transition: transform 0.2s;
}

.idea-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.vote-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    padding: 0.5rem;
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.vote-count {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-primary);
    line-height: 1;
}

.vote-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.idea-content {
    flex: 1;
}

.idea-content h4 {
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
}

.idea-content p {
    margin-bottom: 0;
    font-size: 0.9rem;
}

/* Option Buttons */
.option-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.option-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
    border-color: var(--accent-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.option-btn:active {
    transform: scale(0.95);
}

.option-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    box-shadow: 0 0 15px var(--accent-glow);
}

/* Color Buttons */
.color-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s;
}

.color-btn:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.color-btn:active {
    transform: scale(0.9);
}

.color-btn.active {
    border-color: white;
    transform: scale(1.1);
    box-shadow: 0 0 15px var(--accent-glow);
}

.btn-vote {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-vote:hover {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.btn-vote.voted {
    background-color: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* --- Rebuild V2 Styles --- */
.config-content {
    width: 100%;
    max-width: 900px;
    z-index: 10;
    margin: 0 auto;
    /* Center Content */
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Center Children */
}

/* Simple Grid for Models/Versions */
.simple-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
    width: 100%;
    justify-content: center;
    /* Center Grid Items */
}

/* Simple Option Button (Model/Version) */
.simple-option-btn {
    background: rgba(255, 255, 255, 0.05);
    /* Proper glass buttons */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

.simple-option-btn:hover {
    background: rgba(var(--accent-primary-rgb), 0.2);
    /* Fallback or use accent */
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--accent-primary);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

.simple-option-btn:active {
    transform: scale(0.98);
}

/* Nav Arrow Button */
.nav-arrow-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.7);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-arrow-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* CONFIGURATOR V1 (RECREATION) Styles */
.configurator-v1-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

@media (min-width: 900px) {
    .configurator-v1-container {
        flex-direction: row;
        align-items: flex-start;
    }

    .config-sidebar {
        flex: 1;
        max-width: 350px;
        position: sticky;
        top: 100px;
        /* if header is sticky */
    }

    .config-preview {
        flex: 2;
    }
}

/* SIDEBAR CARD */
.config-sidebar {
    background: #121212;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 1.5rem;
}

.control-block {
    margin-bottom: 1.5rem;
}

.control-label {
    display: block;
    color: #fff;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

/* DROPDOWN */
.custom-select {
    width: 100%;
    background: #222;
    border: 1px solid #444;
    color: #fff;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
}

.custom-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* TOGGLE BUTTONS (Versions) */
.toggle-group {
    display: flex;
    gap: 0.5rem;
    background: #000;
    padding: 0.25rem;
    border-radius: 8px;
}

.toggle-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: #888;
    padding: 0.5rem;
    font-size: 0.9rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.toggle-btn.active {
    background: #6366f1;
    /* Purple/Indigo from screenshot */
    color: #fff;
    font-weight: 500;
}

.toggle-btn:hover:not(.active) {
    color: #fff;
}

/* COLOR CIRCLES */
.color-circles {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.color-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #444;
    transition: transform 0.2s, border-color 0.2s;
}

.color-circle:hover {
    transform: scale(1.1);
}

.color-circle.active {
    border-color: #fff;
    transform: scale(1.2);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

/* PREVIEW */
/* PREVIEW */
.preview-frame {
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    width: 55%;
    /* Reduced from 65% */
    max-width: 600px;
    margin: 0 auto;
    /* Center it */
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #333;
}

.preview-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.disclaimer {
    margin-top: 1rem;
    color: #666;
    font-size: 0.8rem;
    text-align: right;
}


/* CONFIGURATOR V1 (RECREATION) Styles */
.configurator-v1-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

@media (min-width: 900px) {
    .configurator-v1-container {
        flex-direction: row;
        align-items: flex-start;
    }

    .config-sidebar {
        flex: 1;
        max-width: 350px;
        position: sticky;
        top: 100px;
    }

    .config-preview {
        flex: 2;
        /* Ensure no background here */
        background: transparent;
        box-shadow: none;
        border: none;
    }
}

/* SIDEBAR CARD */
.config-sidebar {
    background: #121212;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 1.5rem;
}

.control-block {
    margin-bottom: 1.5rem;
}

.control-label {
    display: block;
    color: #fff;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

/* DROPDOWN */
.custom-select {
    width: 100%;
    background: #222;
    border: 1px solid #444;
    color: #fff;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
}

.custom-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* TOGGLE BUTTONS (Versions) */
.toggle-group {
    display: flex;
    gap: 0.5rem;
    background: #000;
    padding: 0.25rem;
    border-radius: 8px;
}

.toggle-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: #888;
    padding: 0.5rem;
    font-size: 0.9rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.toggle-btn.active {
    background: #6366f1;
    /* Purple/Indigo from screenshot */
    color: #fff;
    font-weight: 500;
}

.toggle-btn:hover:not(.active) {
    color: #fff;
}

/* COLOR CIRCLES */
.color-circles {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.color-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #444;
    transition: transform 0.2s, border-color 0.2s;
}

.color-circle:hover {
    transform: scale(1.1);
}

.color-circle.active {
    border-color: #fff;
    transform: scale(1.2);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.disclaimer {
    margin-top: 1rem;
    color: #666;
    font-size: 0.8rem;
    text-align: right;
}

/* GARAGE DOOR ANIMATION */
.garage-door {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #111;
    z-index: 10;
    transform: translateY(-100%);
    transition: transform 1s cubic-bezier(0.5, 0, 0.2, 1);
    /* Heavy feel */
    display: flex;
    flex-direction: column;
    pointer-events: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
}

.garage-door.closed {
    transform: translateY(0);
    pointer-events: auto;
}

/* The Main Rolling Surface */
.shutter-roll {
    flex: 1;
    width: 100%;
    /* Complex gradient to simulate curved metallic slats */
    background: repeating-linear-gradient(180deg,
            #2c2c2c 0%,
            #3d3d3d 10%,
            /* Highlight top of curve */
            #2a2a2a 40%,
            /* Mid-tone */
            #1a1a1a 48%,
            /* Shadow bottom of curve */
            #000 50%
            /* Gap line */
        );
    background-size: 100% 30px;
    /* Size of each slat */
    box-shadow: inset 0 0 150px rgba(0, 0, 0, 0.7);
    /* Deep vignette for depth */
}

/* Bottom Heavy Bar */
.shutter-bottom-bar {
    width: 100%;
    height: 25px;
    background: linear-gradient(to bottom, #444, #222);
    border-top: 1px solid #555;
    border-bottom: 4px solid #000;
    /* Rubber seal */
}

/* Handle removed */

.preview-frame {
    position: relative;
    background: transparent;
    /* Remove any fixed height or bg that creates black bars */
    height: auto;
    min-height: 300px;
    /* Just enough space */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Wheel Detail Zone (Separate Box) */
.wheel-detail-zone {
    margin-top: 1rem;
    background: #111;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    max-width: 300px;
    /* Or match preview frame width */
    margin-left: auto;
    margin-right: auto;
}

.wheel-detail-zone h3 {
    font-size: 1rem;
    color: #fff;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-weight: 500;
}

.wheel-display-box {
    width: 100%;
    aspect-ratio: 1 / 1;
    /* Square */
    border-radius: 6px;
    overflow: hidden;
    background: #000;
}

.wheel-display-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wheel-detail-zone.hidden {
    display: none;
}

/* WIZARD STEPS */
.config-step {
    animation: fadeIn 0.3s ease-out;
}

.config-step.hidden {
    display: none;
}

.step-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #fff;
    border-bottom: 1px solid #333;
    padding-bottom: 0.5rem;
}

.step-desc {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 1.5rem;
}

/* NAVIGATION */
.step-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #333;
}

.nav-btn {
    padding: 0.75rem 1.5rem;
    border: 1px solid #444;
    background: transparent;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: #333;
}

.nav-btn.primary {
    background: #6366f1;
    border-color: #6366f1;
}

.nav-btn.primary:hover {
    background: #4f46e5;
}

.nav-btn.hidden {
    visibility: hidden;
    /* Keep space layout */
}

/* SUMMARY BOX */
.summary-box {
    background: #222;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    color: #ccc;
    font-size: 0.95rem;
    line-height: 1.6;
}

.summary-box strong {
    color: #fff;
}

.full-width {
    width: 100%;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* BREADCRUMBS */
.config-breadcrumb {
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.bc-item {
    color: #555;
    transition: color 0.3s;
}

.bc-item.active {
    color: #fff;
}

.bc-separator {
    color: #333;
}

/* --- Porsche-Style Configurator --- */
.configurator-porsche-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    padding: 0 4rem;
    max-width: 1600px;
    margin: 2rem auto 0 auto;
    height: calc(100vh - 130px);
    align-items: stretch;
    /* overflow rimosso: bloccava il dropdown della select */
}

@media (max-width: 1024px) {
    .configurator-porsche-container {
        grid-template-columns: 1fr;
        padding: 0 2rem;
    }
}

/* LEFT: Preview Area */
.porsche-preview-area {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
    overflow: hidden;
    position: sticky;
    top: 0;
}

.porsche-main-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16/10;
    background: #111; /* Sfondo scuro per far risaltare l'auto */
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.porsche-main-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.6s ease-in-out;
}

/* ---- Garage Door Animation ---- */
.garage-door {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    overflow: hidden;
    /* Nascosta di default (già aperta, fuori dallo schermo verso l'alto) */
    transform: translateY(-100%);
    transition: transform 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}

.garage-door.closing {
    transform: translateY(0%); /* scende: copre il frame */
}

.garage-door.opening {
    transform: translateY(-100%); /* risale: scopre il frame */
}

.garage-slats-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.garage-slat {
    flex: 1;
    background: linear-gradient(
        to bottom,
        #888 0%,
        #aaa 30%,
        #999 50%,
        #777 80%,
        #666 100%
    );
    border-top: 1px solid #555;
    border-bottom: 1px solid #bbb;
    position: relative;
}

.garage-slat::after {
    content: '';
    position: absolute;
    top: 30%;
    left: 0; right: 0;
    height: 20%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.08) 0%, transparent 100%);
}

/* Tools Overlays su Immagine */
.porsche-frame-tools {
    position: absolute;
    bottom: 1.5rem;
    left: 1.5rem;
    display: flex;
    gap: 0.75rem;
}

.tool-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tool-icon:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.05);
}

.tool-icon.active {
    background: white;
    color: black;
}

/* Thumbnail Gallery */
.porsche-thumbnail-gallery {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.thumb-btn {
    width: 120px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    background: #222;
    flex-shrink: 0;
    transition: all 0.2s;
}

.thumb-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-btn:hover {
    opacity: 0.8;
}

.thumb-btn.active {
    border-color: var(--accent-primary);
    opacity: 1;
}

/* RIGHT: Sidebar */
.porsche-sidebar {
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-top: 0;
    height: 100%;
    overflow-y: auto; /* Scorrevole solo la sidebar */
    scrollbar-width: none; /* Firefox - nasconde scrollbar */
    -ms-overflow-style: none; /* IE */
}

.porsche-sidebar::-webkit-scrollbar { display: none; }

.sidebar-header {
    margin-bottom: 1.5rem;
}

.sidebar-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    line-height: 1.1;
    font-weight: 500;
    animation: none !important;
}

.badges {
    display: flex;
    gap: 0.75rem;
}

.badge {
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    background: #333;
    border-radius: 4px;
    color: #ccc;
    font-weight: 600;
}

.badge.light-badge {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 500;
}

.technical-link {
    display: inline-block;
    color: var(--text-secondary);
    text-decoration: underline;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.technical-link:hover {
    color: var(--text-primary);
}

/* Porsche Search & Toggles */
.search-box-porsche {
    position: relative;
    background: #1a1a1f;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.porsche-select-naked {
    background: transparent;
    border: none;
    color: var(--text-primary);
    width: 100%;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    outline: none;
    appearance: none;
}

.toggle-switch-porsche {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toggle-switch-porsche .switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch-porsche .switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch-porsche .slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #333;
    transition: .4s;
    border-radius: 34px;
}

.toggle-switch-porsche .slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.toggle-switch-porsche input:checked + .slider {
    background-color: var(--accent-primary);
}

.toggle-switch-porsche input:checked + .slider:before {
    transform: translateX(20px);
}

.toggle-switch-porsche .switch-label {
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* Accordion Logic (Porsche Cards) */
.porsche-card {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.accordion-panel {
    /* Removed border-bottom, moved to card styles */
}

.accordion-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    padding: 1.5rem 0;
    font-family: 'Outfit', sans-serif;
}

.accordion-trigger .chevron.left-chevron {
    transition: transform 0.3s ease;
    transform: rotate(0deg); /* Default giù o chiuso */
}

.accordion-panel.active .chevron.left-chevron {
    transform: rotate(180deg); /* Quando aperto, freccia su */
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, margin 0.4s ease, opacity 0.3s ease;
    opacity: 0;
}

.accordion-panel.active .accordion-content {
    max-height: 1000px;
    opacity: 1;
    margin-bottom: 1.5rem;
}

/* Stili Interni Accordion */
.porsche-label {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.porsche-pill-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Premium Swatches */
.porsche-color-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.color-type { font-weight: 600; }
.color-price { color: var(--text-secondary); }

.porsche-swatch-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.porsche-swatch-grid.small {
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
}

.porsche-swatch {
    width: 100%;
    aspect-ratio: 4/3; /* Rettangolare in stile Porsche */
    border-radius: 12px;
    border: 2px solid transparent;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
    box-shadow: inset 0 2px 10px rgba(255,255,255,0.1), 0 4px 10px rgba(0,0,0,0.3);
}

/* Effetto metallizzato/lucido */
.porsche-swatch::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, transparent 50%, rgba(0,0,0,0.2) 100%);
    pointer-events: none;
}

.porsche-swatch:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.5);
}

.porsche-swatch.active {
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

.porsche-checkout {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}
/* Model Picker Custom (sostituisce select nativa) */
.model-picker-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.model-picker-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.75rem 1rem;
    background: #222;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.model-picker-btn:hover {
    background: #2a2a2a;
    border-color: rgba(230,28,36,0.5);
}

.model-picker-btn.active {
    background: #1a1a1a;
    border-color: var(--accent-primary);
    color: white;
    font-weight: 600;
}
