/* CONFIGURATOR MODAL STYLES (UPDATED FOR MOBILE) */
.config-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100dvh; /* 100dvh prevents bottom bar clipping on mobile */
    background: #050505;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}
.config-modal.active { opacity: 1; visibility: visible; }

.config-modal-close {
    position: absolute;
    top: 1rem; right: 1rem;
    font-size: 3rem;
    color: #666;
    cursor: pointer;
    z-index: 100;
    line-height: 0.5;
    transition: color 0.2s;
    padding: 10px; /* larger touch target */
}
.config-modal-close:hover { color: #fff; }

.config-layout {
    display: flex;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Lock body scrolling */
}

.config-visual {
    flex: 6;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-right: 1px solid #333;
    overflow: hidden;
}

.config-visual img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: opacity 0.3s ease;
    position: absolute; /* Stop jumping */
    top: 50%; left: 50%; transform: translate(-50%, -50%);
}

.launch-placeholder {
    width: 80%;
    max-width: 600px;
    height: auto;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-weight: 800;
    color: #FFD700;
    border: 2px dashed #444;
    background: rgba(10, 10, 10, 0.8);
    padding: 2rem;
    line-height: 1.5;
    box-sizing: border-box;
    z-index: 5;
    font-size: 1.5rem;
    position: absolute; /* Stop jumping */
    top: 50%; left: 50%; transform: translate(-50%, -50%);
}

.config-panel {
    flex: 4;
    background: #0a0a0a;
    display: flex;
    flex-direction: column;
    padding: 4rem;
    color: #fff;
    height: 100%;
    box-sizing: border-box;
}

.config-header {
    border-bottom: 2px solid #333;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-shrink: 0; /* Keep header visible */
}
.config-header h2 { font-size: 2rem; text-transform: uppercase; font-weight: 900; letter-spacing: -1px; margin: 0; }
.config-running-price { font-family: 'Courier New', monospace; font-size: 1.8rem; font-weight: 700; color: #FFD700; }

.config-steps-container {
    flex-grow: 1;
    position: relative;
    overflow-y: auto; /* Fix next button falling off */
    overflow-x: hidden;
    padding-right: 1rem;
}

/* Scrollbar styling for options */
.config-steps-container::-webkit-scrollbar { width: 6px; }
.config-steps-container::-webkit-scrollbar-track { background: #111; }
.config-steps-container::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
.config-steps-container::-webkit-scrollbar-thumb:hover { background: #555; }

.config-step {
    position: absolute;
    top: 0; left: 0; width: 100%;
    opacity: 0;
    visibility: hidden;
    transform: translateX(20px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.config-step.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    position: relative;
}

.config-step h3 { font-size: 1.2rem; text-transform: uppercase; color: #888; margin-bottom: 1.5rem; letter-spacing: 1px; }
.config-note { font-size: 0.8rem; color: #555; margin-bottom: 1.5rem; text-transform: uppercase; font-weight: 700; }

.config-options { display: flex; flex-direction: column; gap: 1rem; padding-bottom: 1rem; }

.config-option {
    border: 1px solid #333; background: #111; padding: 1.5rem; cursor: pointer;
    display: flex; justify-content: space-between; align-items: center; transition: all 0.2s; user-select: none;
    touch-action: manipulation; /* Mobile touch fix */
}
.config-option:hover { border-color: #666; background: #1a1a1a; }
.config-option.selected { border-color: #FFD700; background: #1a1a1a; }
.config-option h4 { font-size: 1rem; text-transform: uppercase; font-weight: 800; margin: 0; }
.config-option span { font-family: 'Courier New', monospace; font-size: 0.9rem; color: #888; font-weight: 700; }
.config-option.selected span { color: #FFD700; }

.config-summary-list { list-style: none; padding: 0; margin: 0 0 2rem 0; }
.config-summary-list li {
    padding: 1rem 0; border-bottom: 1px solid #222; font-size: 1rem; text-transform: uppercase;
    color: #ccc; font-weight: 700; display: flex; justify-content: space-between;
}
.config-summary-list li span { color: #fff; font-family: 'Courier New', monospace; }

.config-submit-btn {
    width: 100%; padding: 1.5rem; background: #fff; color: #000; border: none; font-weight: 900;
    text-transform: uppercase; letter-spacing: 2px; font-size: 1.2rem; cursor: pointer; transition: background 0.2s;
    touch-action: manipulation;
}
.config-submit-btn:hover { background: #FFD700; }

.config-nav {
    display: flex; justify-content: space-between; margin-top: 1rem; padding-top: 1.5rem;
    border-top: 1px solid #333; flex-shrink: 0; /* Keep nav visible */
}
.nav-btn {
    background: transparent; border: none; color: #888; font-weight: 800; text-transform: uppercase;
    letter-spacing: 2px; font-size: 0.9rem; cursor: pointer; transition: color 0.2s; padding: 10px;
    touch-action: manipulation;
}
.nav-btn:hover { color: #fff; }

/* Fix for "Start Config" button touch issues */
.purchase-interface .card-btn {
    position: relative;
    z-index: 50;
    touch-action: manipulation;
}

@media (max-width: 1024px) {
    .config-layout { flex-direction: column; }
    .config-visual { flex: 0 0 35%; border-right: none; border-bottom: 1px solid #333; }
    .config-panel { flex: 1; padding: 1.5rem; overflow: hidden; }
    .config-header { padding-bottom: 1rem; margin-bottom: 1rem; }
    .config-header h2 { font-size: 1.5rem; }
    .config-running-price { font-size: 1.2rem; }
    .launch-placeholder { font-size: 1rem; padding: 1rem; min-height: 100px; width: 90%; }
    .config-option { padding: 1rem; }
    .config-option h4 { font-size: 0.85rem; }
    .config-submit-btn { padding: 1rem; font-size: 1rem; }
}