/*
    W. W. Doak Combo Builder

    This stylesheet keeps the legacy builder workflow but presents each choice
    as responsive product cards instead of nested tables.
*/

.combo-builder-page {
    max-width: 2000px;
    margin: 0 auto 40px;
    padding: 18px;
    background: #FFFFFF;
    border: 1px solid #c9c9c9;
    box-sizing: border-box;
}

.combo-builder-header {
    text-align: center;
    margin-bottom: 18px;
}

.combo-builder-header h1 {
    margin: 0 0 10px;
    color: var(--wwd-colour-dark-blue, #213663);
}

.combo-builder-header p {
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.45;
}

.combo-builder-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 18px;
    align-items: start;
}

.combo-builder-main,
.combo-builder-summary {
    border: 1px solid #d8d8d8;
    background: #FFFFFF;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.combo-builder-main {
    padding: 16px;
}

.combo-builder-summary {
    position: sticky;
    top: 12px;
    padding: 14px;
}

.combo-builder-summary h2,
.combo-builder-panel h2 {
    margin: 0 0 10px;
    color: var(--wwd-colour-dark-blue, #213663);
}

.combo-builder-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.combo-builder-step {
    display: inline-block;
    padding: 6px 9px;
    border: 1px solid #c9c9c9;
    border-radius: 999px;
    background: #e1e4e6;
    color: #213663;
    font-size: 0.9rem;
}

.combo-builder-step.is-active {
    background: #213663;
    color: #FFFFFF;
}

.combo-builder-panel > p {
    margin: 0 0 16px;
}

.combo-builder-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}

.combo-builder-choice-card {
    /*
        These are real <button> elements for keyboard accessibility, but they
        must not inherit the site-wide raised blue purchase-button treatment.
        Keep this reset local to the combo cards so normal Add to Cart buttons
        elsewhere continue to use the legacy style.
    */
    -webkit-appearance: none;
    appearance: none;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    width: 100%;
    height: auto;
    padding: 12px;
    border: 1px solid #c9c9c9;
    border-radius: 10px;
    background: #FFFFFF;
    color: #1f1f1f;
    font: inherit;
    line-height: 1.35;
    text-align: left;
    text-shadow: none;
    text-transform: none;
    letter-spacing: normal;
    cursor: pointer;
    -webkit-box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    -moz-box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    transform: none;
}

.combo-builder-choice-card:hover,
.combo-builder-choice-card:focus,
.combo-builder-choice-card:active {
    border-color: #213663;
    background: #FFFFFF;
    color: #1f1f1f;
    text-align: left;
    text-shadow: none;
    -webkit-box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    -moz-box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    transform: none;
    outline: 2px solid rgba(33, 54, 99, 0.2);
}

.combo-builder-choice-card:hover .combo-builder-card-body,
.combo-builder-choice-card:focus .combo-builder-card-body,
.combo-builder-choice-card:active .combo-builder-card-body,
.combo-builder-choice-card:hover .combo-builder-card-title,
.combo-builder-choice-card:focus .combo-builder-card-title,
.combo-builder-choice-card:active .combo-builder-card-title,
.combo-builder-choice-card:hover .combo-builder-card-subtitle,
.combo-builder-choice-card:focus .combo-builder-card-subtitle,
.combo-builder-choice-card:active .combo-builder-card-subtitle,
.combo-builder-choice-card:hover .combo-builder-card-summary,
.combo-builder-choice-card:focus .combo-builder-card-summary,
.combo-builder-choice-card:active .combo-builder-card-summary,
.combo-builder-choice-card:hover .combo-builder-card-specs,
.combo-builder-choice-card:focus .combo-builder-card-specs,
.combo-builder-choice-card:active .combo-builder-card-specs,
.combo-builder-choice-card:hover .combo-builder-card-price,
.combo-builder-choice-card:focus .combo-builder-card-price,
.combo-builder-choice-card:active .combo-builder-card-price {
    color: inherit;
    text-shadow: none;
}

.combo-builder-card-delivery {
    /*
        This is important fulfilment information, so keep it visually distinct
        from the normal specifications without using the red price treatment.
        No Activity Log belongs here because this is display-only styling.
    */
    display: block;
    margin-top: 4px;
    color: var(--wwd-colour-dark-blue, #213663);
    font-weight: bold;
    line-height: 1.3;
}

.combo-builder-choice-card:hover .combo-builder-card-delivery,
.combo-builder-choice-card:focus .combo-builder-card-delivery,
.combo-builder-choice-card:active .combo-builder-card-delivery {
    color: var(--wwd-colour-dark-blue, #213663);
    text-shadow: none;
}

.combo-builder-card-price {
    text-align: left;
}

.combo-builder-weight-card,
.combo-builder-direction-card {
    text-align: center;
    justify-content: center;
    min-height: 130px;
}

.combo-builder-weight-card:hover,
.combo-builder-weight-card:focus,
.combo-builder-weight-card:active,
.combo-builder-direction-card:hover,
.combo-builder-direction-card:focus,
.combo-builder-direction-card:active,
.combo-builder-weight-card:hover .combo-builder-card-body,
.combo-builder-weight-card:focus .combo-builder-card-body,
.combo-builder-weight-card:active .combo-builder-card-body,
.combo-builder-direction-card:hover .combo-builder-card-body,
.combo-builder-direction-card:focus .combo-builder-card-body,
.combo-builder-direction-card:active .combo-builder-card-body,
.combo-builder-weight-card:hover .combo-builder-card-title,
.combo-builder-weight-card:focus .combo-builder-card-title,
.combo-builder-weight-card:active .combo-builder-card-title,
.combo-builder-direction-card:hover .combo-builder-card-title,
.combo-builder-direction-card:focus .combo-builder-card-title,
.combo-builder-direction-card:active .combo-builder-card-title,
.combo-builder-weight-card:hover .combo-builder-card-subtitle,
.combo-builder-weight-card:focus .combo-builder-card-subtitle,
.combo-builder-weight-card:active .combo-builder-card-subtitle,
.combo-builder-direction-card:hover .combo-builder-card-subtitle,
.combo-builder-direction-card:focus .combo-builder-card-subtitle,
.combo-builder-direction-card:active .combo-builder-card-subtitle,
.combo-builder-weight-card:hover .combo-builder-card-summary,
.combo-builder-weight-card:focus .combo-builder-card-summary,
.combo-builder-weight-card:active .combo-builder-card-summary,
.combo-builder-direction-card:hover .combo-builder-card-summary,
.combo-builder-direction-card:focus .combo-builder-card-summary,
.combo-builder-direction-card:active .combo-builder-card-summary {
    text-align: center;
}

.combo-builder-card-image {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 135px;
    margin-bottom: 10px;
}

.combo-builder-card-image img {
    max-width: 100%;
    max-height: 150px;
    object-fit: contain;
}

.combo-builder-card-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.combo-builder-card-title {
    color: #213663;
    line-height: 1.25;
}

.combo-builder-card-subtitle,
.combo-builder-card-summary,
.combo-builder-card-specs {
    font-size: 0.92rem;
    line-height: 1.3;
}

.combo-builder-card-specs {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.combo-builder-card-price {
    margin-top: 4px;
    color: #9b111e;
    font-weight: bold;
    font-size: 1.05rem;
}

.combo-builder-summary-list {
    margin: 0 0 14px;
}

.combo-builder-summary-list div {
    margin-bottom: 9px;
}

.combo-builder-summary-list dt {
    font-weight: bold;
    color: #213663;
}

.combo-builder-summary-list dd {
    margin: 2px 0 0;
}

.combo-builder-total-table {
    width: 100%;
    margin: 12px 0;
    border-collapse: collapse;
}

.combo-builder-total-table td,
.combo-builder-total-table th {
    padding: 6px 0;
    border-top: 1px solid #e1e4e6;
}

.combo-builder-total-table tfoot th,
.combo-builder-total-table tfoot td {
    font-size: 1.08rem;
    font-weight: bold;
    color: #213663;
}

.combo-builder-breakdown-price,
.combo-builder-total-table td:last-child {
    text-align: right;
    white-space: nowrap;
}

.combo-builder-submit,
.combo-builder-reset {
    width: 100%;
    margin-top: 8px;
}

.combo-builder-back {
    /*
        Keep the previous-step control as a compact full-row button above the
        option cards. Without the full-row placement, CSS grid stretching can
        make this button as tall as the product card beside it.
    */
    grid-column: 1 / -1;
    justify-self: start;
    align-self: start;
    width: auto;
    min-width: 240px;
    max-width: 320px;
    min-height: 0;
    margin: 0 0 4px;
    padding: 5px 18px;
    line-height: 1.2;
}

.combo-builder-review-note,
.combo-builder-empty {
    grid-column: 1 / -1;
    padding: 14px;
    background: #e1e4e6;
    border: 1px solid #c9c9c9;
    border-radius: 8px;
    text-align: center;
}

@media (max-width: 850px) {
    .combo-builder-layout {
        grid-template-columns: 1fr;
    }

    .combo-builder-summary {
        position: static;
    }
}

@media (max-width: 520px) {
    .combo-builder-page {
        padding: 10px;
    }

    .combo-builder-card-grid {
        grid-template-columns: 1fr;
    }
}
