/*
 * control_standard / NVMe configuration layout v3.0.0
 * Visual changes only. No prices, promotion codes, PHP, or JavaScript here.
 * Scoped to configureproduct.tpl; does not restyle the final cart or admin area.
 */

/* Keep the content column shrinkable beside the existing vertical steps. */
#order-verticalsteps.cld-config-page > #main-content {
    flex: 1 1 auto;
    min-width: 0;
}

/* NVMe service name: compact row at the left, without the 25% label column. */
#order-verticalsteps.cld-nvme-layout .cld-product-header {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin: 0 0 20px;
}

#order-verticalsteps.cld-nvme-layout .cld-product-header::before,
#order-verticalsteps.cld-nvme-layout .cld-product-header::after {
    display: none;
}

#order-verticalsteps.cld-nvme-layout .cld-product-header > .control-label {
    float: none;
    flex: 0 0 auto;
    width: auto;
    margin: 0;
    padding: 0;
    text-align: left;
    line-height: 1.5;
}

#order-verticalsteps.cld-nvme-layout .cld-product-meta {
    float: none;
    flex: 1 1 220px;
    width: auto;
    min-width: 0;
    padding: 0;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

/* Billing choices fill the panel, rather than starting after a grid offset. */
#order-verticalsteps.cld-nvme-layout .cld-cycle-holder {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
    gap: 12px;
    float: none;
    width: 100%;
    max-width: 100%;
    margin: 0 !important;
    padding: 0;
}

#order-verticalsteps.cld-nvme-layout .cld-cycle-holder::before,
#order-verticalsteps.cld-nvme-layout .cld-cycle-holder::after {
    display: none;
}

#order-verticalsteps.cld-nvme-layout .cld-cycle-holder > .btn-custom-billing {
    float: none;
    width: auto;
    min-width: 0;
    max-width: none;
    min-height: 86px;
    margin: 0 !important;
    padding: 18px 16px 14px;
    border-radius: 6px !important;
    white-space: normal;
    text-align: center;
    line-height: 1.5;
    box-shadow: none;
}

#order-verticalsteps.cld-nvme-layout .cld-cycle-holder > .btn-custom-billing > strong {
    font-size: 16px;
}

#order-verticalsteps.cld-nvme-layout .cld-cycle-holder .cld-cycle-renewal {
    display: block;
    font-size: 13px;
    line-height: 1.5;
    white-space: normal;
}

#order-verticalsteps.cld-nvme-layout .cld-cycle-holder > .btn-custom-billing:focus-within {
    outline: 2px solid #297fb9;
    outline-offset: 2px;
}

#order-verticalsteps.cld-nvme-layout .cld-cycle-spacer {
    display: none;
}

#order-verticalsteps.cld-nvme-layout .cld-discount-note {
    clear: both;
    width: 100%;
    margin: 14px 0 0 !important;
    padding: 0;
    line-height: 1.6;
}

/*
 * The original style.css sets td:first-child to 180px.
 * Let the description use the available width; keep the amount column compact.
 * These selectors also cover a native summary returned by an AJAX refresh.
 */
#order-verticalsteps.cld-config-page #producttotal table.order-summary {
    width: 100%;
    max-width: 100%;
    margin-bottom: 0;
    table-layout: auto;
}

#order-verticalsteps.cld-config-page #producttotal table.order-summary > tbody > tr > td {
    padding: 12px 10px;
    vertical-align: top;
    font-size: 14px;
    line-height: 1.5;
}

#order-verticalsteps.cld-config-page #producttotal table.order-summary > tbody > tr > td:first-child {
    width: auto;
    min-width: 0;
    max-width: none;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
}

#order-verticalsteps.cld-config-page #producttotal table.order-summary > tbody > tr > td:last-child {
    width: 1%;
    min-width: 112px;
    padding-left: 20px;
    text-align: right;
    white-space: nowrap;
    overflow-wrap: normal;
    font-variant-numeric: tabular-nums;
}

#order-verticalsteps.cld-config-page #producttotal .cld-summary-title {
    display: block;
    width: auto;
    max-width: none;
    margin-bottom: 4px;
    line-height: 1.5;
}

#order-verticalsteps.cld-config-page #producttotal .cld-summary-note {
    display: block;
    width: auto;
    max-width: none;
    font-size: 13px;
    line-height: 1.6;
}

#order-verticalsteps.cld-config-page #producttotal .cld-renewal-label {
    display: block;
    line-height: 1.5;
}

/* Keep the original submit button and all its existing handlers. */
#order-verticalsteps.cld-config-page #orderSummary .cld-config-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    clear: both;
    text-align: right;
}

#order-verticalsteps.cld-config-page #orderSummary .cld-config-actions > #btnCompleteProductConfig {
    float: none;
    display: inline-block;
    width: auto;
    max-width: 100%;
    margin: 0 0 0 auto;
}

/* Mobile: choices stack; prices remain aligned right and readable. */
@media (max-width: 767px) {
    #order-verticalsteps.cld-nvme-layout .cld-cycle-holder {
        grid-template-columns: minmax(0, 1fr);
    }

    #order-verticalsteps.cld-config-page #producttotal table.order-summary > tbody > tr > td {
        padding: 10px 6px;
        font-size: 13px;
    }

    #order-verticalsteps.cld-config-page #producttotal table.order-summary > tbody > tr > td:last-child {
        min-width: 100px;
        padding-left: 10px;
    }
}
