/* ── VIDA Configurator – Frontend Styles ─────────────────────────────────── */

.vida-configurator {
    width: 100%;
    max-width: none;
    margin: 24px 0;
    font-family: inherit;
}

/* Product info header */
.vida-product-info {
    display: grid;
    grid-template-columns: minmax(220px, 320px) 1fr;
    gap: 24px;
    margin-bottom: 28px;
}
.vida-product-main-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #e6e6e6;
    background: #f5f5f5;
}
.vida-product-gallery-thumbs {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}
.vida-gallery-thumb {
    position: relative;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    padding: 0;
    cursor: pointer;
    overflow: hidden;
}
.vida-gallery-thumb.active {
    border-color: #1a1a1a;
    box-shadow: 0 0 0 2px rgba(26, 26, 26, 0.12);
}
.vida-gallery-thumb img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}
.vida-gallery-thumb::after {
    content: attr(data-label);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 6px);
    transform: translateX(-50%);
    background: rgba(20, 20, 20, 0.92);
    color: #fff;
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
    padding: 5px 7px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    opacity: 0;
    pointer-events: none;
    z-index: 3;
    transition: opacity 0.15s ease;
}
.vida-gallery-thumb:hover::after,
.vida-gallery-thumb:focus::after,
.vida-gallery-thumb:focus-visible::after {
    opacity: 1;
}
.vida-product-title {
    margin: 0 0 8px;
    font-size: 32px;
    line-height: 1.15;
}
.vida-product-intro {
    margin: 0 0 12px;
    color: #555;
    font-size: 15px;
    line-height: 1.6;
}
.vida-product-highlights {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 6px;
    color: #333;
    font-size: 14px;
}
.vida-product-switcher {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 10px;
}
.vida-product-switch-card {
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    background: #fff;
    color: #333;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    overflow: hidden;
    text-align: center;
    display: flex;
    flex-direction: column;
    min-height: 122px;
}
.vida-product-switch-card:hover {
    border-color: #9f9f9f;
    transform: translateY(-1px);
}
.vida-product-switch-card.active {
    border-color: #1a1a1a;
    box-shadow: 0 0 0 2px rgba(26,26,26,0.12);
}
.vida-product-switch-card:focus {
    outline: none;
    border-color: #1a1a1a;
}
.vida-product-switch-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}
.vida-product-switch-placeholder {
    width: 100%;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    background: #b8c1b0;
}
.vida-product-switch-label {
    display: block;
    padding: 8px 7px;
    font-size: 11px;
    line-height: 1.25;
    color: #333;
}

.vida-flow-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 28px;
    align-items: start;
}
.vida-flow-main {
    min-width: 0;
}

.vida-sticky-progress {
    --vida-progress-pct: 0;
    position: sticky;
    top: 100px;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border: 1px solid #e4e4e4;
    border-radius: 12px;
    background: #fff;
    padding: 14px 14px 12px;
    min-height: 420px;
}
.vida-sticky-progress-head {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #666;
}
.vida-sticky-progress-track {
    position: relative;
    width: 6px;
    height: 148px;
    border-radius: 999px;
    background: #e9e9e9;
    overflow: hidden;
}
.vida-sticky-progress-fill {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: #1a1a1a;
    transform-origin: center bottom;
    transform: scaleY(calc(var(--vida-progress-pct) / 100));
    transition: transform 0.28s ease;
}
.vida-sticky-steps {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
}
.vida-sticky-step {
    display: grid;
    grid-template-columns: 20px 1fr;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    line-height: 1.25;
    color: #7a7a7a;
    cursor: pointer;
    border-radius: 7px;
    padding: 4px 5px;
    transition: background 0.18s, color 0.18s;
}
.vida-sticky-step:hover {
    background: #f5f5f5;
}
.vida-sticky-step-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    background: #efefef;
    color: #666;
}
.vida-sticky-step.is-done {
    color: #2f6f2f;
}
.vida-sticky-step.is-done .vida-sticky-step-num {
    background: #2f6f2f;
    color: #fff;
}
.vida-sticky-step.is-current {
    color: #1a1a1a;
    font-weight: 600;
    background: #f5f5f5;
}
.vida-sticky-step.is-current .vida-sticky-step-num {
    background: #1a1a1a;
    color: #fff;
}
.vida-sticky-step.is-hidden {
    opacity: 0.5;
}
.vida-sticky-price {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #ececec;
}
.vida-sticky-price-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #777;
}
.vida-sticky-price-amount {
    font-size: 28px;
    line-height: 1.1;
    font-weight: 700;
    color: #1a1a1a;
    margin-top: 2px;
}
.vida-sticky-price-note {
    font-size: 12px;
    color: #888;
}
.vida-sticky-price.vida-sticky-price-error .vida-sticky-price-amount {
    color: #c0392b;
}

@media (max-width: 1080px) {
    .vida-flow-layout {
        grid-template-columns: minmax(0, 1fr) 230px;
        gap: 20px;
    }
}

@media (max-width: 980px) {
    .vida-flow-layout {
        display: flex;
        flex-direction: column;
        gap: 0;
    }
    .vida-sticky-progress {
        order: -1;
        position: sticky;
        top: 12px;
        z-index: 6;
        min-height: 0;
        margin-bottom: 16px;
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 8px 12px;
        padding: 10px 12px;
    }
    .vida-sticky-progress-head {
        display: none;
    }
    .vida-sticky-progress-track {
        width: 100%;
        height: 6px;
        grid-column: 1 / -1;
    }
    .vida-sticky-progress-fill {
        transform-origin: left center;
        transform: scaleX(calc(var(--vida-progress-pct) / 100));
    }
    .vida-sticky-steps {
        grid-column: 1 / -1;
        display: flex;
        gap: 7px;
        overflow-x: auto;
        padding-bottom: 1px;
    }
    .vida-sticky-step {
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 4px 8px;
        white-space: nowrap;
        font-size: 11px;
    }
    .vida-sticky-price {
        margin-top: 0;
        padding-top: 0;
        border-top: none;
        text-align: right;
        min-width: 120px;
    }
    .vida-sticky-price-amount {
        font-size: 22px;
    }
}

/* Progress bar */
.vida-progress {
    height: 4px;
    background: #e8e8e8;
    border-radius: 2px;
    margin-bottom: 32px;
    overflow: hidden;
}
.vida-progress-bar {
    height: 100%;
    background: #1a1a1a;
    border-radius: 2px;
    transition: width 0.4s ease;
    width: 0%;
}

/* Steps */
.vida-step {
    display: none;
    margin-bottom: 36px;
    animation: vidaFadeIn 0.3s ease;
}
.vida-step.vida-step-visible {
    display: block;
}

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

.vida-step-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 16px;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.vida-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #1a1a1a;
    color: #fff;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

/* Text input (window name) */
.vida-text-input {
    width: 100%;
    max-width: 400px;
    padding: 12px 14px;
    border: 1.5px solid #d0d0d0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.vida-text-input:focus {
    outline: none;
    border-color: #1a1a1a;
}

/* Size row — horizontal card layout matching reference */
.vida-size-row {
    display: flex;
    align-items: stretch;
    gap: 0;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}
.vida-size-cell {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 20px;
    flex: 1;
    min-width: 0;
    border-right: 1px solid #e8e8e8;
}
.vida-size-cell:last-child { border-right: none; }

.vida-cell-label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.vida-required { color: #c0392b; }

.vida-input-wrap {
    display: flex;
    align-items: center;
    gap: 0;
}
.vida-number-input {
    width: 100%;
    min-width: 0;
    padding: 8px 10px;
    border: 1.5px solid #d0d0d0;
    border-right: none;
    border-radius: 6px 0 0 6px;
    font-size: 15px;
    transition: border-color 0.2s;
    background: #fff;
}
.vida-number-input:focus {
    outline: none;
    border-color: #1a1a1a;
    z-index: 1;
}
.vida-unit {
    padding: 8px 10px;
    background: #f4f4f4;
    border: 1.5px solid #d0d0d0;
    border-left: none;
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    color: #888;
    white-space: nowrap;
}

/* Area + Price cells (auto-calculated) */
.vida-cell-area, .vida-cell-price {
    background: #fafafa;
}
.vida-cell-value {
    display: flex;
    align-items: baseline;
    gap: 5px;
    flex-wrap: wrap;
}
.vida-area-number {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1;
}
.vida-area-unit {
    font-size: 13px;
    color: #888;
}
.vida-inline-price {
    font-size: 24px;
    font-weight: 700;
    color: #2a7a2a;
    line-height: 1;
}
.vida-price-gst {
    font-size: 12px;
    color: #888;
}

.vida-size-hint {
    margin-top: 8px;
    font-size: 13px;
    min-height: 18px;
}
.vida-hint-ok    { color: #2a7a2a; }
.vida-hint-error { color: #c0392b; }

/* Option grid */
.vida-option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.vida-option-card {
    position: relative;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    background: #fff;
    text-align: center;
    padding-bottom: 10px;
}
.vida-option-card:hover {
    border-color: #aaa;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    transform: translateY(-1px);
}
.vida-option-card.selected {
    border-color: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(26,26,26,0.12);
}
.vida-option-card:focus {
    outline: none;
    border-color: #1a1a1a;
}

.vida-option-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    border-radius: 8px 8px 0 0;
}

.vida-option-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    background: #c8c8c8;
    /* Individual colours set via nth-child to give visual variety */
}
.vida-option-card:nth-child(5n+1) .vida-option-placeholder { background: #b0b8c1; }
.vida-option-card:nth-child(5n+2) .vida-option-placeholder { background: #c1bab0; }
.vida-option-card:nth-child(5n+3) .vida-option-placeholder { background: #b0c1b8; }
.vida-option-card:nth-child(5n+4) .vida-option-placeholder { background: #c1b0bc; }
.vida-option-card:nth-child(5n+5) .vida-option-placeholder { background: #b8c1b0; }

.vida-option-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #333;
    margin-top: 8px;
    padding: 0 6px;
    line-height: 1.3;
}

.vida-option-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0,0,0,0.72);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    pointer-events: none;
}

/* Selected checkmark */
.vida-option-card.selected::after {
    content: '✓';
    position: absolute;
    bottom: 6px;
    right: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #1a1a1a;
}

/* Price box */
.vida-price-box {
    background: #f7f7f7;
    border: 1.5px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px 24px;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    transition: background 0.2s;
}
.vida-price-box.vida-price-error {
    background: #fff5f5;
    border-color: #f5c6cb;
}
.vida-price-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #888;
}
.vida-price-amount {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.1;
}
.vida-price-error .vida-price-amount {
    font-size: 22px;
    color: #c0392b;
}
.vida-price-note {
    font-size: 12px;
    color: #999;
}

/* Responsive */
@media (max-width: 700px) {
    .vida-product-info {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .vida-product-title {
        font-size: 26px;
    }
    .vida-product-switcher {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .vida-option-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }
    .vida-size-row {
        flex-wrap: wrap;
    }
    .vida-size-cell {
        flex: 1 1 140px;
        border-right: none;
        border-bottom: 1px solid #e8e8e8;
    }
    .vida-size-cell:last-child { border-bottom: none; }
    .vida-price-amount { font-size: 26px; }
    .vida-area-number, .vida-inline-price { font-size: 20px; }
    .vida-sticky-step-label {
        display: none;
    }
    .vida-sticky-price {
        min-width: 92px;
    }
}

/* ── Standalone Add to Cart form ─────────────────────────────────────────── */
.vida-atc-form {
    margin-top: 24px;
    border: none;
    padding: 0;
}
.vida-atc-btn {
    display: inline-block;
    padding: 16px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
    border: none;
    width: 100%;
    max-width: 400px;
}
.vida-atc-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}
.vida-atc-btn:not(:disabled):hover {
    transform: translateY(-1px);
    opacity: 0.92;
}

/* ── Configurator full-width layout below product ────────────────────────── */
.vida-configurator {
    width: 100%;
    clear: both;
    padding-top: 40px;
    border-top: 1px solid #e8e8e8;
    margin-top: 20px;
}
