/* Design tool (js/app.js). Uses the tokens and buttons from site.css. */

.design {
    padding-top: 32px;
}

.design-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 24px;
    margin-bottom: 24px;
}

.price-label {
    margin: 0;
    color: var(--stone);
    font-size: 14px;
}

.price-value {
    margin: 0;
    color: var(--garnet);
    font: 600 32px/1.1 var(--text);
}

/* Progress */
.progress-container {
    margin-bottom: 24px;
    padding: 20px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.progress-bar {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.progress-step {
    display: flex;
    flex: 1;
    align-items: center;
}

.progress-step:last-child {
    flex: none;
}

.progress-circle {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1.5px solid var(--stone);
    border-radius: 50%;
    color: var(--stone);
    font-weight: 600;
    font-size: 15px;
}

.progress-circle.active {
    border-color: var(--garnet);
    background: var(--garnet);
    color: var(--ivory);
}

.progress-line {
    flex: 1;
    height: 1.5px;
    margin: 0 8px;
    background: var(--line);
}

.progress-line.completed {
    background: var(--garnet);
}

.progress-title {
    margin: 0;
    font-size: 26px;
}

/* Option cards shared by the steps */
.product-grid,
.material-grid,
.extras-grid,
.size-list {
    display: grid;
    gap: 12px;
}

.product-card,
.material-card,
.size-option,
.color-option,
.extra-option {
    border: 1px solid var(--stone);
    border-radius: 6px;
    background: var(--white);
    color: var(--graphite);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.product-card,
.material-card,
.size-option {
    padding: 18px 20px;
}

.product-card:hover,
.material-card:hover,
.size-option:hover,
.color-option:hover,
.extra-option:hover {
    border-color: var(--graphite);
}

.product-card.selected,
.material-card.selected,
.size-option.selected,
.color-option.selected,
.extra-option.selected {
    border-color: var(--garnet);
    background: var(--blush);
    box-shadow: inset 0 0 0 1px var(--garnet);
}

.product-name,
.material-name {
    margin: 0 0 4px;
    font-size: 22px;
}

.product-desc,
.material-desc {
    margin: 0 0 12px;
    color: var(--stone);
    font-size: 15px;
}

.product-price,
.material-price,
.extra-price {
    margin: 0;
    color: var(--garnet);
    font-weight: 600;
}

.size-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 16px;
}

.size-name {
    font-weight: 600;
}

.size-multiplier {
    color: var(--stone);
    font-size: 14px;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.color-option {
    padding: 10px;
}

.color-swatch {
    height: 56px;
    margin-bottom: 8px;
    border: 1px solid var(--line);
    border-radius: 4px;
}

.color-name {
    margin: 0;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
}

.extras-grid {
    margin-bottom: 24px;
}

.extra-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 56px;
    padding: 12px 16px;
}

.extra-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.extra-checkbox {
    width: 20px;
    height: 20px;
    accent-color: var(--garnet);
}

.extra-name {
    font-weight: 600;
}

/* Summary */
.summary-card {
    margin-bottom: 16px;
    padding: 8px 20px;
    background: var(--blush);
}

.summary-item {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--rose);
}

.summary-item:last-child {
    border-bottom: 0;
}

.summary-label {
    font-weight: 600;
}

.summary-item > :last-child {
    text-align: right;
}

.summary-value {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-indicator {
    width: 20px;
    height: 20px;
    border: 1px solid var(--stone);
    border-radius: 50%;
}

.extras-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.total-section {
    margin-bottom: 16px;
    padding: 20px;
    background: var(--garnet);
    color: var(--ivory);
}

.total-content {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 16px;
}

.total-label {
    font-weight: 600;
    font-size: 18px;
}

.total-price {
    font: 600 34px/1.1 var(--text);
}

.total-note {
    margin: 8px 0 0;
    font-size: 14px;
}

.info-box,
.payment-panel,
.success {
    margin-bottom: 24px;
    padding: 20px;
    border: 1px solid var(--line);
    background: var(--white);
}

.info-title {
    margin: 0 0 8px;
    font-weight: 600;
}

.info-list {
    margin: 0;
    padding-left: 20px;
    color: var(--stone);
    font-size: 15px;
}

.payment-panel h3,
.success h3 {
    margin-bottom: 8px;
}

.payment-panel > p {
    color: var(--stone);
    font-size: 15px;
}

.success {
    border-color: var(--graphite);
}

.success-details {
    padding-top: 12px;
    border-top: 1px solid var(--line);
    font-size: 15px;
}

.success-details p {
    margin: 0 0 4px;
}

.loading {
    padding: 24px 0;
    color: var(--stone);
    text-align: center;
}

.spinner {
    width: 28px;
    height: 28px;
    margin: 0 auto 12px;
    border: 2px solid var(--line);
    border-top-color: var(--garnet);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Buttons inside the tool */
.btn--full {
    width: 100%;
}

.btn--gap {
    margin-top: 12px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.navigation {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.navigation .btn {
    flex: 1;
}

/* ---------- Tablet, 768 ---------- */
@media (min-width: 768px) {
    .design {
        padding-top: 48px;
    }

    .price-section {
        text-align: right;
    }

    .price-value {
        font-size: 38px;
    }

    .progress-title {
        font-size: 32px;
    }

    .product-grid,
    .material-grid,
    .extras-grid {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .color-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }

    .color-swatch {
        height: 72px;
    }
}

/* ---------- Laptop, 1024 ---------- */
@media (min-width: 1024px) {
    .product-grid,
    .material-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .color-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* ---------- Desktop, 1440: the tool keeps a readable column instead of stretching ---------- */
@media (min-width: 1440px) {
    .design {
        width: 984px;
        margin: 0 auto;
    }
}
