/* Checkout — Royaal */

.checkout-page {
    padding-top: 14px;
    padding-bottom: 40px;
}

.checkout-hero {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.checkout-hero h1 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: .2px;
    color: #222;
}

.checkout-hero p {
    margin: 0;
    color: #888;
    font-size: .85rem;
}

.checkout-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.checkout-form {
    flex: 1;
    min-width: 0;
    background: #fff;
    border-radius: 14px;
    border: 1px solid #eee;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .05);
    padding: 24px 26px;
}

.checkout-alert {
    display: none;
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #eee;
    font-size: .9rem;
}

.checkout-section {
    margin-bottom: 16px;
}

.checkout-section:last-of-type {
    margin-bottom: 0;
}

.checkout-section__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    color: #222;
    font-size: 1rem;
    margin-bottom: 12px;
}

.checkout-section__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    font-size: .8rem;
    font-weight: 800;
    flex: 0 0 24px;
}

.checkout-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.checkout-ubigeo-grid {
    grid-template-columns: repeat(3, 1fr);
}

.checkout-field {
    display: grid;
    gap: 6px;
}

.checkout-field--full {
    grid-column: 1 / -1;
}

.checkout-field label {
    font-weight: 700;
    color: #444;
    font-size: .85rem;
}

.checkout-field input,
.checkout-field select {
    width: 100%;
    height: 42px;
    border-radius: 10px;
    border: 1.5px solid #e2e2e2;
    padding: 0 13px;
    outline: none;
    font-size: .92rem;
    color: #222;
    font-family: inherit;
    transition: border-color .15s ease, box-shadow .15s ease;
    background: #fff;
}

.checkout-field input:focus,
.checkout-field select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(220, 31, 39, .1);
}

.checkout-field small {
    color: #999;
    font-size: .78rem;
}

.checkout-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.checkout-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    color: #333;
    border: 1.5px solid #e6e6e6;
    border-radius: 12px;
    padding: 11px 14px;
    flex: 1 1 220px;
    flex-wrap: nowrap;
    transition: border-color .15s ease, background .15s ease;
}

.checkout-option:hover {
    border-color: #ccc;
}

.checkout-option:has(input:checked) {
    border-color: var(--primary-color);
    background: rgba(220, 31, 39, .04);
}

.checkout-option input[type="radio"] {
    accent-color: var(--primary-color);
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.checkout-option__label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .92rem;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.checkout-option__meta {
    flex: 0 0 auto;
    white-space: nowrap;
    font-weight: 800;
    color: #333;
    font-size: .9rem;
}

.checkout-option__meta--muted {
    font-weight: 500;
    color: #999;
    font-size: .8rem;
}

.checkout-option__cards {
    display: flex;
    gap: 7px;
    align-items: center;
    font-size: 1.5rem;
    flex: 0 0 auto;
}
.checkout-option__cards .fa-cc-visa { color: #1a1f71; }
.checkout-option__cards .fa-cc-mastercard { color: #eb001b; }
.checkout-option__cards .fa-cc-amex { color: #2e77bc; }
.checkout-option__cards .fa-cc-diners-club { color: #0079be; }

.checkout-zone {
    margin-top: 4px;
}

.checkout-geo-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1.5px solid var(--primary-color);
    color: var(--primary-color);
    font-weight: 700;
    font-size: .85rem;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.checkout-geo-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: #fff;
}
.checkout-geo-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.checkout-geo-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.checkout-geo-overlay__box {
    background: #fff;
    padding: 20px 26px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: .92rem;
    color: #222;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .2);
    max-width: 320px;
    text-align: left;
}

.checkout-geo-overlay__box i {
    color: var(--primary-color);
    font-size: 1.3rem;
    flex: 0 0 auto;
}

.checkout-geo-status {
    margin-top: 8px;
    font-size: .82rem;
    color: #666;
    min-height: 1.2em;
}
.checkout-geo-status.is-success { color: #1e8449; }
.checkout-geo-status.is-error { color: #b31920; }

.checkout-envio-info {
    margin-top: 10px;
    font-size: .85rem;
    font-weight: 700;
    color: #333;
    min-height: 1.2em;
}
.checkout-envio-info.is-muted { color: #999; font-weight: 500; }

.checkout-notice {
    color: #a15c00;
    background: #fff8e6;
    border: 1px solid #ffe6a8;
    padding: 10px 13px;
    border-radius: 10px;
    font-size: .82rem;
    margin-top: 10px;
    line-height: 1.5;
}

.checkout-actions {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-checkout-submit {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 12px;
    background: var(--primary-color);
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: .3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 6px 16px rgba(220, 31, 39, .25);
    transition: background .18s ease, transform .12s ease;
}
.btn-checkout-submit:hover:not(:disabled) {
    background: #b51920;
    transform: translateY(-1px);
}
.btn-checkout-submit:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.btn-checkout-back {
    width: 100%;
    height: 46px;
    border-radius: 12px;
    background: transparent;
    border: 1.5px solid #e2e2e2;
    color: #555;
    font-weight: 700;
    font-size: .9rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.btn-checkout-back:hover {
    border-color: #bbb;
    background: #fafafa;
    color: #333;
}

.checkout-trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #999;
    font-size: .78rem;
    margin-top: 14px;
}
.checkout-trust i { color: #2fa84f; }

/* ── Resumen ───────────────────────────────────────────── */
.checkout-summary {
    width: 380px;
    flex: 0 0 380px;
    background: #fff;
    border-radius: 14px;
    border: 1px solid #eee;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .05);
    padding: 22px;
    position: sticky;
    top: 20px;
}

.checkout-summary__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.checkout-summary__header h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 900;
    color: #222;
}

.checkout-summary__header a {
    color: var(--primary-color);
    font-weight: 700;
    font-size: .85rem;
}

.checkout-summary-items {
    display: grid;
    gap: 10px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 2px;
}

.summary-item {
    display: flex;
    gap: 12px;
    align-items: center;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 9px;
}

.summary-item__img {
    width: 50px;
    height: 50px;
    border: 1px solid #eee;
    border-radius: 10px;
    overflow: hidden;
    flex: 0 0 50px;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
}
.summary-item__img img { width: 100%; height: 100%; object-fit: contain; }

.summary-item__info {
    flex: 1;
    min-width: 0;
}
.summary-item__name {
    font-weight: 800;
    color: #333;
    font-size: .86rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.summary-item__qty {
    color: #999;
    font-size: .78rem;
    margin-top: 2px;
}
.summary-item__price {
    font-weight: 800;
    color: var(--primary-color);
    font-size: .88rem;
    white-space: nowrap;
}

.checkout-summary-totals {
    border-top: 1px solid #eee;
    margin-top: 16px;
    padding-top: 16px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #666;
    font-size: .9rem;
}
.summary-row + .summary-row { margin-top: 8px; }
.summary-row span:last-child { font-weight: 700; color: #333; }

.summary-row--total {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #ddd;
}
.summary-row--total span:first-child {
    font-weight: 900;
    color: #222;
    font-size: 1rem;
}
.summary-row--total span:last-child {
    font-weight: 900;
    color: var(--primary-color);
    font-size: 1.35rem;
}

.checkout-summary-note {
    margin-top: 12px;
    color: #999;
    font-size: .78rem;
    line-height: 1.5;
}

.checkout-summary-empty {
    color: #999;
    font-size: .9rem;
    text-align: center;
    padding: 20px 0;
}

@media (max-width: 980px) {
    .checkout-layout { flex-direction: column; }
    .checkout-summary { width: 100%; flex-basis: auto; position: static; }
    .checkout-form { padding: 18px 16px; }
    .checkout-form-grid { grid-template-columns: 1fr; }
    .checkout-ubigeo-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
}

@media (max-width: 560px) {
    .checkout-hero h1 { font-size: 1.15rem; }
    .checkout-option { padding: 10px 12px; gap: 8px; }
    .checkout-option__label { font-size: .82rem; gap: 7px; }
    .checkout-option__meta { font-size: .8rem; }
    .checkout-option__meta--muted { font-size: .72rem; }
}

@media (max-width: 560px) {
    .checkout-ubigeo-grid { gap: 6px; }
    .checkout-ubigeo-grid .checkout-field label { font-size: .72rem; }
    .checkout-ubigeo-grid .checkout-field select { padding: 0 6px; font-size: .78rem; }
}
