/* SteelChief Shed Designer — layout + chrome (loaded after index structure) */

/* Desktop: controls left, 3D viewer right. Narrow screens: stack (controls scroll, viewer gets rest). */
body {
    margin: 0; padding: 0; background: #a0d8ef; font-family: 'Segoe UI', sans-serif;
    display: flex; flex-direction: row; width: 100%; box-sizing: border-box;
    min-height: 100vh; min-height: 100dvh; max-height: 100vh; max-height: 100dvh;
    overflow: hidden;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}
a.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 10001;
    padding: 10px 14px;
    background: #1a252f;
    color: #fff;
    font-weight: bold;
    font-size: 13px;
    text-decoration: none;
    border-radius: 0 0 6px 0;
}
a.skip-link:focus {
    left: 8px;
    top: 8px;
    outline: 3px solid #3498db;
    outline-offset: 2px;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid #3498db;
    outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
    button { transition: none !important; }
}
#sidebar {
    width: 380px; max-width: 100%; height: 100vh; background: #fff; padding: 20px; box-sizing: border-box;
    overflow-y: auto; overflow-x: hidden; border-right: 2px solid #ccc; flex-shrink: 0; z-index: 10;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y pinch-zoom;
}
#viewer {
    flex: 1 1 auto; min-width: 0; height: 100vh; position: relative; overflow: hidden; cursor: grab;
    touch-action: none;
}
@media (max-width: 960px) {
    body { flex-direction: column; }
    #sidebar {
        width: 100%; height: auto; max-height: min(48vh, 400px);
        flex: 0 1 auto; border-right: none; border-bottom: 2px solid #ccc;
        padding: 12px 14px 14px;
        -webkit-overflow-scrolling: touch;
    }
    #viewer {
        flex: 1 1 0; height: auto; min-height: 220px; width: 100%;
    }
    button { padding: 10px 8px; font-size: 12px; min-height: 40px; }
    #wallTransBtn { bottom: max(16px, env(safe-area-inset-bottom, 0px)) !important; right: max(16px, env(safe-area-inset-right, 0px)) !important; }
    #dimToggleBtn { bottom: max(52px, calc(28px + env(safe-area-inset-bottom, 0px))) !important; right: max(16px, env(safe-area-inset-right, 0px)) !important; }
}
h2  { margin: 0 0 15px 0; color: #2c3e50; border-bottom: 2px solid #3498db; padding-bottom: 8px; font-size: 1.1em; }
h3  { margin: 0 0 8px 0; font-size: 13px; }
.box         { background: #f8f9fa; padding: 12px; margin-bottom: 12px; border-radius: 5px; border: 1px solid #dee2e6; }
.flow-heading {
    margin: 16px 0 10px;
    font-size: 12px;
    font-weight: 700;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
}
.flow-heading-btn {
    width: 100%;
    text-align: left;
    border: 1px solid #d7e3ee;
    border-radius: 6px;
    background: #eef4fa;
    color: #2c3e50;
    cursor: pointer;
    margin: 14px 0 8px;
    padding: 8px 10px;
}
.flow-heading-btn .flow-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    flex: 1;
}
.flow-meta {
    font-size: 10px;
    font-weight: 700;
    color: #3c5f7c;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.flow-heading-btn.is-locked {
    opacity: 0.7;
    background: #f5f7fa;
    cursor: not-allowed;
}
.flow-heading-btn.is-active {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.15);
}
.flow-section {
    display: none;
}
.flow-section.is-open {
    display: block;
}
.flow-step {
    background: #1f6fb2;
    color: #fff;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 10px;
    letter-spacing: 0.04em;
}
.flow-heading-btn.is-locked .flow-step {
    background: #8aa3ba;
}
.flow-progress {
    margin: 10px 0 8px;
    padding: 8px 10px;
    border: 1px solid #d9e6f2;
    border-radius: 6px;
    background: #f4f9ff;
    color: #2f5878;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.flow-next-btn {
    margin-top: 4px;
    background: #2f84c9;
    border: 1px solid #236ca6;
    font-size: 11px;
}
.flow-next-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.summary-box { background: #2c3e50; color: white; border: none; }
.summary-box h3  { border-bottom: 1px solid #576574; padding-bottom: 5px; }
.summary-row     { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; padding-bottom: 4px; border-bottom: 1px dashed #576574; }
.summary-total   { font-weight: bold; font-size: 14px; color: #2ecc71; margin-top: 10px; border-bottom: none; }
.alert           { color: #f1c40f; font-weight: bold; font-size: 11px; margin-top: 5px; }
label            { display: block; font-size: 11px; font-weight: bold; margin-bottom: 5px; color: #495057; text-transform: uppercase; }
.grid-2          { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
input[type="range"], input[type="number"], input[type="text"], input[type="tel"], input[type="email"], select, textarea { width: 100%; margin: 4px 0; box-sizing: border-box; font-size: 12px; }
button           { width: 100%; padding: 8px; background: #3498db; color: white; border: none; border-radius: 4px; cursor: pointer; font-weight: bold; margin-top: 5px; font-size: 11px; transition: 0.2s; }
.op-card         { background: #fff; border: 1px solid #ddd; padding: 10px; margin-top: 10px; border-radius: 4px; position: relative; font-size: 11px; border-left: 5px solid #3498db; }
.btn-del         { position: absolute; top: 5px; right: 5px; background: #ff4757; color: white; border: none; border-radius: 3px; cursor: pointer; padding: 2px 6px; font-size: 10px; width: auto; }
.tool-active     { background: #e74c3c !important; box-shadow: 0 0 8px rgba(231,76,60,0.5); }
.tool-active-wall { background: #2980b9 !important; box-shadow: 0 0 8px rgba(41,128,185,0.45); }
.badge           { padding: 4px 8px; border-radius: 3px; font-size: 10px; font-weight: bold; display: inline-block; margin-top: 4px; width: 100%; text-align: center; box-sizing: border-box; }
.badge.std       { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.badge.pref      { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.badge.must      { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.check-label     { font-weight: normal; display: flex; align-items: center; gap: 5px; margin-bottom: 5px; text-transform: none; }

/* Touch-first ergonomics (iPad/tablet/phone) */
@media (hover: none), (pointer: coarse) {
    body { overscroll-behavior: none; }
    #viewer { cursor: default; }

    button,
    input[type="button"],
    input[type="submit"],
    select,
    input[type="number"],
    input[type="text"],
    input[type="tel"],
    input[type="email"],
    textarea {
        min-height: 44px;
        font-size: 16px;
        border-radius: 8px;
    }

    input[type="checkbox"],
    input[type="radio"] {
        transform: scale(1.25);
        margin-right: 6px;
    }

    .btn-del {
        min-width: 36px;
        min-height: 36px;
        padding: 6px 8px;
        font-size: 14px;
        border-radius: 8px;
    }

    input[type="range"] {
        height: 34px;
        margin: 8px 0;
    }
    input[type="range"]::-webkit-slider-thumb {
        -webkit-appearance: none;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background: #2f7dd1;
        border: 2px solid #fff;
        box-shadow: 0 1px 4px rgba(0,0,0,0.25);
    }
    input[type="range"]::-moz-range-thumb {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background: #2f7dd1;
        border: 2px solid #fff;
        box-shadow: 0 1px 4px rgba(0,0,0,0.25);
    }
    input[type="range"]::-webkit-slider-runnable-track {
        height: 8px;
        border-radius: 6px;
    }
    input[type="range"]::-moz-range-track {
        height: 8px;
        border-radius: 6px;
    }
}

/* iPad/tablet landscape optimization: keep pricing visible and free more 3D space */
@media (hover: none) and (pointer: coarse) and (orientation: landscape) and (min-width: 900px) {
    #sidebar {
        width: 340px;
        padding: 12px 12px 16px;
    }
    #viewer {
        min-width: 0;
    }
    #priceSummaryLive {
        position: sticky;
        top: 8px;
        z-index: 12;
    }
    #primaryActionsStrip {
        position: sticky;
        top: 240px;
        z-index: 11;
        background: rgba(248, 249, 250, 0.96);
        border: 1px solid #d9e1e6;
        border-radius: 8px;
        padding: 8px;
        margin-top: 8px;
        box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
    }
    #primaryActionsStrip p {
        margin-bottom: 0 !important;
    }
    .box {
        padding: 10px;
        margin-bottom: 10px;
    }
    h2 {
        font-size: 1.0em;
        margin-bottom: 10px;
    }
}
