:root {
    --app-height: 750px;
    --door-ratio: 491 / 1000;
    --primary: #2c2d31;
    --accent: #f9d282;
    --text: #26272b;
    --bg-light: #f4f4f4;
    --bg-white: #ffffff;
    --border-color: #ddd;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
    font-family: 'Segoe UI', sans-serif;
    background-color: var(--bg-white);
    color: var(--text);
    display: flex;
    flex-direction: column; 
    justify-content: center;
    align-items: center;
    min-height: auto;
    padding: 40px 20px; 
}

/* --- NOWY HEADER --- */
.main-header {
    width: 100%;
    max-width: 1200px; 
    text-align: left;
    margin-bottom: 30px;
}

.page-title {
    font-size: 32px; 
    margin-bottom: 15px;
    color: var(--primary);
    /*border-bottom: 3px solid var(--accent);*/
    display: inline-block;
    padding-bottom: 5px;
}

.lead-text {
    font-size: 18px;
    color: #555;
    line-height: 1.5;
    max-width: 800px;
}

/* --- KONFIGURATOR (WRAPPER) --- */
.configurator-wrapper {
    display: flex;
    flex-direction: row;
    background: transparent;
    /* box-shadow: 0 10px 30px rgba(0,0,0,0.05); */
    /* border: 1px solid var(--border-color);
    border-width: 1px 0 0 1px; */
    padding: 20px;
    max-width: 1200px;
    width: 100%;
    gap: 40px;
    border-radius: 0px;
}

/* --- WIZUALIZACJA --- */
.visualizer-container {
    position: relative;
    height: var(--app-height);
    width: calc(var(--app-height) * var(--door-ratio));
    flex-shrink: 0;
    margin: 0 auto;
}

.layer {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.loader {
    position: absolute;
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-size: 14px; color: #888;
}

/* --- KONTROLKI (Prawa strona) --- */
.controls-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: var(--app-height);
    max-width: 600px;
}

.section-title {
    margin-bottom: 10px;
    font-size: 24px;
    color: var(--primary);
    display: inline-block;
    padding-bottom: 5px;
}

.selected-info {
    font-size: 16px; margin-bottom: 15px; font-weight: bold; color: var(--text);
}

/* --- SWIPER / KOLORY --- */
.swiper-viewport {
    flex-grow: 0; 
    height: 400px; 
    overflow: hidden; 
    position: relative;
    touch-action: pan-y;
	transition: height 0.3s ease;
}

.swiper-viewport.expanded {
    height: 650px;
}

.swiper-track {
    display: flex; height: 100%; transition: transform 0.3s ease-out;
}

.swiper-slide {
    min-width: 100%; height: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 10px; padding: 2px; align-content: stretch; 
}

.color-option {
    position: relative; cursor: pointer;
    border: 1px solid #eee; border-radius: 4px;
    overflow: hidden; background-color: #fff;
    width: 100%; height: 100%;
    transition: transform 0.2s, border-color 0.2s;
}

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

.color-option.active {
    border: 3px solid var(--accent);
}

/* Styl nakładki */
.color-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(44, 45, 49, 0.7);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5px;
    pointer-events: none;
}

.color-overlay span {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
    font-family: 'Segoe UI', sans-serif;
    text-transform: none;
    letter-spacing: 0.5px;
}

.color-option:hover .color-overlay {
    opacity: 1;
}

.pagination {
    display: flex; justify-content: center; gap: 8px; margin: 15px 0 25px 0; height: 20px; flex-shrink: 0;
}

.dot {
    width: 10px; height: 10px; background-color: #ccc;
    border-radius: 50%; cursor: pointer; transition: background-color 0.3s;
}
.dot.active { background-color: var(--primary); }

/* --- SEKCJA FORMULARZY --- */
.configuration-section {
    flex-grow: 1;
    border-top: 1px solid #eee;
    padding-top: 20px;
    overflow-y: auto; 
}

.options-title {
    font-size: 18px; margin-bottom: 15px; color: var(--primary);
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.option-group {
    display: flex; flex-direction: column; gap: 5px;
}

.option-group label {
    font-size: 13px; font-weight: 600; color: #666; background: transparent;
}

.option-group select {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: #fff;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    outline: none;
}

.option-group select:focus {
    border-color: var(--accent);
}

.checkbox-group {
    justify-content: flex-end; 
}

.toggle-label {
    display: flex; align-items: center; gap: 10px; 
    cursor: pointer; font-size: 14px; user-select: none;
    padding: 10px; background: #f9f9f9; border-radius: 4px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.toggle-label:hover { background: #f0f0f0; }
.toggle-label input { accent-color: var(--accent); width: 18px; height: 18px; }


@media (max-width: 900px) {
    .configurator-wrapper { flex-direction: column; height: auto; align-items: center; padding: 10px; }
    :root { --app-height: 500px; }
    .controls-container { width: 100%; height: auto; }
    .swiper-viewport { height: 350px; } 
    .swiper-viewport.expanded { height: 500px; } 
    .options-grid { grid-template-columns: 1fr; } 
    .main-header { text-align: center; } 
    .lead-text { margin: 0 auto; }
}

/* Ukrywanie tekstu alternatywnego dla ładowanych/uszkodzonych obrazków */
.layer {
    color: transparent; /* Ukrywa tekst 'alt' */
}

/* Usuwa ikonkę 'złamany obrazek' w niektórych przeglądarkach */
.layer:-moz-broken {
    opacity: 0;
}
.layer:not([src]) {
    visibility: hidden;
}