/* ============================================================
   FlushFit Z71 Aluminium Window Configurator Stylesheet
   FastFold UK - Brand Aesthetics & Layout
   ============================================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.flushfit-window-page {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #0b110c;
    color: #f1f5f1;
    min-height: 100vh;
    padding-bottom: 120px; /* Space for fixed navigation bar */
    overflow-x: hidden;
}

/* Header */
.ffw-header {
    background: #000000;
    border-bottom: 2px solid #2e7d32;
    padding: 16px 24px;
    width: 100%;
}

.ffw-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ffw-logo {
    max-height: 48px;
    width: auto;
    display: block;
}

.ffw-trust-img {
    max-height: 44px;
    width: auto;
    display: block;
}

/* Trust Bar */
.ffw-trust-bar {
    background: #111d13;
    border-bottom: 1px solid #1c331f;
    padding: 10px 20px;
}

.ffw-trust-items {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    font-size: 13px;
    font-weight: 600;
    color: #a8d5aa;
    letter-spacing: 0.5px;
}

/* Main Shell */
.ffw-shell {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Visual Preview Section */
.ffw-preview-section {
    width: 100%;
}

.ffw-preview-card {
    background: #132415;
    border: 1px solid #224225;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    position: relative;
    overflow: hidden;
}

.ffw-preview-badge {
    position: absolute;
    top: 16px;
    left: 20px;
    background: #2e7d32;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 4px 10px;
    border-radius: 4px;
}

.ffw-preview-viewport {
    width: 100%;
    max-width: 520px;
    height: 300px;
    margin: 20px 0 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#ffw-window-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 12px 24px rgba(0,0,0,0.6));
    transition: all 0.3s ease;
}

.ffw-preview-meta {
    font-size: 14px;
    color: #a2cfa4;
    font-weight: 500;
    text-align: center;
    background: rgba(0,0,0,0.3);
    padding: 8px 18px;
    border-radius: 20px;
    border: 1px solid #1c351f;
}

/* Wizard Form */
.ffw-form {
    background: #112013;
    border: 1px solid #1e3a21;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    position: relative;
}

.ffw-wizard-step {
    display: none;
    animation: ffwFadeIn 0.3s ease;
}

.ffw-wizard-step.active {
    display: block;
}

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

.ffw-step-header {
    margin-bottom: 30px;
    border-bottom: 1px solid #1e3a21;
    padding-bottom: 20px;
}

.ffw-step-num {
    display: inline-block;
    color: #4caf50;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 6px;
}

.ffw-step-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.ffw-step-header p {
    font-size: 15px;
    color: #a6c0a7;
    line-height: 1.5;
}

/* Card Grids */
.ffw-card-grid {
    display: grid;
    gap: 20px;
    width: 100%;
}

.ffw-grid-5 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.ffw-grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.ffw-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.ffw-colour-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

/* Individual Card */
.ffw-card {
    background: #172a1a;
    border: 2px solid #234327;
    border-radius: 8px;
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: all 0.25s ease;
    user-select: none;
}

.ffw-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ffw-card:hover {
    border-color: #388e3c;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.4);
}

.ffw-card:has(input[type="radio"]:checked) {
    background: #1e3d23;
    border-color: #4caf50;
    box-shadow: 0 0 0 2px #4caf50, 0 8px 20px rgba(76,175,80,0.25);
}

.ffw-card:has(input[type="radio"]:checked)::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    background: #4caf50;
    color: #ffffff;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ffw-card b {
    font-size: 16px;
    color: #ffffff;
    margin: 12px 0 6px;
    font-weight: 600;
}

.ffw-card small {
    font-size: 12px;
    color: #9ebf9f;
    line-height: 1.4;
}

.ffw-card-art {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ffw-card-art svg {
    width: 100%;
    height: 100%;
}

.ffw-card-img-wrap {
    width: 100%;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 6px;
    background: #0f1c11;
    padding: 8px;
}

.ffw-card-img-wrap img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

/* Handle Visual Tiles */
.handle-tile .ffw-handle-img-wrap {
    width: 100%;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    overflow: hidden;
    background: #0f1c11;
}

.handle-tile .ffw-handle-img-wrap img {
    max-height: 100%;
    max-width: 100%;
    object-fit: cover;
    border-radius: 4px;
}

/* Colour Swatches */
.ffw-swatch {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid #335938;
    margin-bottom: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    display: block;
}

.swatch-anthracite { background-color: #383e42; }
.swatch-black { background-color: #111111; }
.swatch-white { background-color: #ffffff; }
.swatch-dual {
    background: linear-gradient(135deg, #383e42 50%, #ffffff 50%);
}
.swatch-ral {
    background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red);
}

.ffw-ral-input-container {
    margin-top: 25px;
    background: #172a1a;
    border: 1px solid #2e7d32;
    border-radius: 8px;
    padding: 20px;
}

.ffw-ral-input-container label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #c4e4c5;
    margin-bottom: 10px;
}

.ffw-ral-input-container input {
    width: 100%;
    padding: 14px 16px;
    background: #0a130b;
    border: 2px solid #2e7d32;
    border-radius: 6px;
    color: #ffffff;
    font-size: 15px;
    outline: none;
}

.ffw-ral-input-container input:focus {
    border-color: #4caf50;
    box-shadow: 0 0 0 3px rgba(76,175,80,0.25);
}

/* Dimension Step */
.ffw-dimension-box {
    background: #172a1a;
    border: 1px solid #234327;
    border-radius: 8px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.ffw-size-range-info {
    background: #0f1c11;
    border-left: 4px solid #2e7d32;
    padding: 14px 18px;
    border-radius: 4px;
    font-size: 14px;
    color: #c4e4c5;
}

.ffw-input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.ffw-field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ffw-field-group label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #ffffff;
}

.ffw-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.ffw-input-wrap input {
    width: 100%;
    padding: 16px 50px 16px 18px;
    background: #0b140c;
    border: 2px solid #234327;
    border-radius: 6px;
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    outline: none;
    transition: all 0.2s ease;
}

.ffw-input-wrap input:focus {
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46,125,50,0.25);
}

.ffw-input-wrap.invalid input {
    border-color: #d32f2f !important;
    background: #1a0f0f !important;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.25) !important;
}

.validation-error {
    color: #ff4d4d;
    font-size: 13px;
    font-weight: 600;
    margin-top: 6px;
    display: none;
}

.ffw-unit {
    position: absolute;
    right: 18px;
    color: #79a67a;
    font-weight: 700;
    font-size: 14px;
    pointer-events: none;
}

.ffw-hint {
    font-size: 12px;
    color: #8dae8e;
}

.ffw-calc-summary {
    display: flex;
    justify-content: space-between;
    background: #0f1c11;
    border: 1px solid #1c331f;
    border-radius: 6px;
    padding: 16px 20px;
    font-size: 15px;
    color: #b0d8b2;
}

.ffw-calc-summary strong {
    color: #4caf50;
}

.ffw-error-msg {
    color: #ff6b6b;
    font-size: 14px;
    font-weight: 600;
    display: none;
}

/* Delivery Section */
.ffw-delivery-box {
    margin-top: 25px;
    background: #172a1a;
    border: 1px solid #234327;
    border-radius: 8px;
    padding: 24px;
}

.ffw-delivery-box h3 {
    font-size: 18px;
    color: #ffffff;
    margin-bottom: 6px;
}

.ffw-delivery-box p {
    font-size: 13px;
    color: #9ebf9f;
    margin-bottom: 16px;
}

.ffw-delivery-inputs {
    display: flex;
    gap: 12px;
    max-width: 500px;
}

.ffw-delivery-inputs input {
    flex: 1;
    padding: 14px 16px;
    background: #0b140c;
    border: 2px solid #234327;
    border-radius: 6px;
    color: #ffffff;
    font-size: 15px;
    outline: none;
}

.ffw-delivery-inputs input:focus {
    border-color: #2e7d32;
}

.ffw-btn-calc {
    padding: 14px 22px;
    background: #2e7d32;
    border: none;
    border-radius: 6px;
    color: #ffffff;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.2s;
}

.ffw-btn-calc:hover {
    background: #1b5e20;
}

.ffw-delivery-feedback {
    margin-top: 14px;
    font-size: 14px;
    font-weight: 600;
    color: #a8d5aa;
}

/* Step 10: Review & Summary */
.ffw-summary-container {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 28px;
    align-items: start;
}

.ffw-summary-specs {
    background: #172a1a;
    border: 1px solid #234327;
    border-radius: 8px;
    padding: 24px;
}

.ffw-summary-specs h3 {
    font-size: 18px;
    color: #ffffff;
    margin-bottom: 18px;
    border-bottom: 1px solid #234327;
    padding-bottom: 12px;
}

.ffw-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 14px;
}

.ffw-summary-row:last-child {
    border-bottom: none;
}

.ffw-summary-row span {
    color: #9ebf9f;
}

.ffw-summary-row b {
    color: #ffffff;
    text-align: right;
}

.ffw-summary-price-box {
    background: #132415;
    border: 2px solid #2e7d32;
    border-radius: 8px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: center;
}

.ffw-summary-total-label {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #a8d5aa;
    margin-bottom: 8px;
}

.ffw-summary-total-value {
    font-size: 38px;
    font-weight: 800;
    color: #4caf50;
    margin-bottom: 12px;
}

.ffw-tax-note {
    font-size: 12px;
    color: #8dae8e;
    margin-bottom: 24px;
}

.ffw-summary-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.ffw-btn-submit {
    width: 100%;
    padding: 16px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    border: none;
    transition: all 0.25s ease;
}

.ffw-btn-cart {
    background: #2e7d32;
    color: #ffffff;
}

.ffw-btn-cart:hover {
    background: #1b5e20;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(46,125,50,0.4);
}

.ffw-btn-buy {
    background: #1a1a1a;
    color: #ffffff;
    border: 2px solid #2e7d32;
}

.ffw-btn-buy:hover {
    background: #2e7d32;
    transform: translateY(-2px);
}

.ffw-form-feedback {
    margin-top: 14px;
    font-size: 13px;
    font-weight: 600;
    color: #ff6b6b;
}

/* Bottom Navigation Bar */
.ffw-nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #000000;
    border-top: 2px solid #2e7d32;
    padding: 16px 24px;
    z-index: 99990;
}

.ffw-nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ffw-nav-btn {
    padding: 14px 32px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.ffw-prev {
    background: #3e5040;
    color: #ffffff;
}

.ffw-prev:hover:not(:disabled) {
    background: #4e6350;
}

.ffw-prev:disabled {
    background: #28362a;
    color: #6d8470;
    cursor: not-allowed;
    opacity: 0.5;
}

.ffw-next {
    background: #2e7d32;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(46,125,50,0.3);
}

.ffw-next:hover {
    background: #1b5e20;
    box-shadow: 0 6px 16px rgba(46,125,50,0.5);
}

.ffw-progress-indicator {
    font-size: 14px;
    font-weight: 600;
    color: #c4d2c3;
    letter-spacing: 1px;
}

/* Slide-out Configuration Drawer */
.ffw-drawer-tab {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 99992;
    width: 54px;
    padding: 16px 8px;
    background: #2e7d32 !important;
    border: none !important;
    border-radius: 16px 0 0 16px;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    box-shadow: -4px 0 16px rgba(0,0,0,0.5);
    transition: all 0.25s ease;
}

.ffw-drawer-tab:hover {
    background: #1b5e20 !important;
    width: 58px;
}

.ffw-tab-icon {
    font-size: 18px;
}

.ffw-tab-price-info {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.ffw-tab-price-info small {
    font-size: 9px;
    letter-spacing: 1px;
    color: #c8e6c9;
}

.ffw-tab-price-info b {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
}

.ffw-tab-price-info b em {
    font-size: 9px;
    font-style: normal;
    opacity: 0.8;
}

.ffw-tab-arrow {
    font-size: 16px;
    font-style: normal;
}

.ffw-drawer-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 99994;
}

.ffw-drawer-backdrop.open {
    display: block;
}

.ffw-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    max-width: 90vw;
    background: #0f1c11;
    border-left: 2px solid #2e7d32;
    z-index: 99995;
    padding: 30px 24px;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -10px 0 30px rgba(0,0,0,0.7);
}

.ffw-drawer.open {
    transform: translateX(0);
}

.ffw-drawer-close {
    position: absolute;
    top: 18px;
    right: 20px;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
}

.ffw-drawer h2 {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 20px;
    border-bottom: 1px solid #234327;
    padding-bottom: 14px;
}

.ffw-drawer-items {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 6px;
}

.ffw-drawer-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #172a1a;
    border: 1px solid #234327;
    border-radius: 6px;
    padding: 12px;
}

.ffw-drawer-row i {
    width: 22px;
    height: 22px;
    background: #2e7d32;
    color: #ffffff;
    font-style: normal;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ffw-drawer-row span {
    flex: 1;
    font-size: 13px;
    color: #ffffff;
    font-weight: 600;
    line-height: 1.3;
}

.ffw-drawer-row span em {
    display: block;
    font-style: normal;
    font-size: 12px;
    color: #9ebf9f;
    font-weight: 400;
    margin-top: 2px;
}

.ffw-drawer-row b {
    font-size: 13px;
    color: #4caf50;
    font-weight: 700;
}

.ffw-drawer-footer {
    border-top: 2px solid #234327;
    padding-top: 18px;
    margin-top: 15px;
}

.ffw-drawer-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 16px;
    color: #ffffff;
}

.ffw-drawer-total-row strong {
    font-size: 26px;
    color: #4caf50;
}

.ffw-drawer-actions {
    display: flex;
    gap: 10px;
}

.ffw-drawer-btn {
    flex: 1;
    padding: 14px 8px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ffw-drawer-add {
    background: #2e7d32;
    color: #ffffff;
}

.ffw-drawer-add:hover {
    background: #1b5e20;
}

.ffw-drawer-buy {
    background: #111111;
    color: #ffffff;
    border: 1px solid #2e7d32;
}

.ffw-drawer-buy:hover {
    background: #2e7d32;
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .ffw-summary-container {
        grid-template-columns: 1fr;
    }

    .ffw-input-row {
        grid-template-columns: 1fr;
    }

    .ffw-form {
        padding: 24px 16px;
    }

    .ffw-nav-inner {
        padding: 0 10px;
    }

    .ffw-nav-btn {
        padding: 12px 20px;
    }

    .ffw-drawer {
        width: 100%;
        max-width: 100vw;
    }
}
