/* ── Checkout & Cart — shared ─────────────────────────────────────────────── */

.ck-hero {
    background: #f5f6f8;
    padding: 2rem 0 1.75rem;
    border-bottom: 1px solid #e8eaed;
}
.ck-hero__title {
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 800;
    color: #0a0a0a;
    margin: .5rem 0 .25rem;
}
.ck-hero__sub {
    font-size: .9rem;
    color: #666;
    margin: 0;
}

/* ── CART PAGE ─────────────────────────────────────────────────────────────── */

.cart-page { padding: 2.5rem 0 4.5rem; }

.cart-empty-state {
    text-align: center;
    padding: 4rem 0 5rem;
}
.cart-empty-state svg { color: #d1d5db; margin-bottom: .75rem; }
.cart-empty-state p {
    color: #666;
    font-size: 1rem;
    margin: 0 0 1.5rem;
}

.cart-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2.5rem;
    align-items: start;
}

/* Items */
.cart-items__header {
    display: grid;
    grid-template-columns: 1fr 120px 110px 36px;
    gap: .75rem;
    padding: 0 0 .65rem;
    border-bottom: 2px solid #e8eaed;
    font-size: .75rem;
    font-weight: 700;
    color: #767676;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.cart-items__list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.cart-item {
    display: grid;
    grid-template-columns: 1fr 120px 110px 36px;
    gap: .75rem;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
}
.cart-item__product {
    display: flex;
    align-items: center;
    gap: .85rem;
    min-width: 0;
}
.cart-item__img {
    width: 72px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    background: #f5f5f5;
    flex-shrink: 0;
}
.cart-item__name {
    font-size: .88rem;
    font-weight: 600;
    color: #0a0a0a;
    margin: 0 0 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cart-item__size {
    font-size: .76rem;
    color: #767676;
    font-family: var(--ff-mono, 'Courier New', monospace);
    margin: 0;
}
.cart-item__qty {
    display: flex;
    align-items: center;
    gap: .3rem;
}
.cart-item__qty-btn {
    width: 26px;
    height: 26px;
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cart-item__qty-btn:hover { border-color: #c0392b; color: #c0392b; }
.cart-item__qty-input {
    width: 36px;
    text-align: center;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 3px 4px;
    font-size: .85rem;
    color: #1a1a1a;
    -moz-appearance: textfield;
}
.cart-item__qty-input::-webkit-inner-spin-button,
.cart-item__qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.cart-item__price {
    font-size: .9rem;
    font-weight: 700;
    color: #1a1a1a;
    white-space: nowrap;
}
.cart-item__remove {
    background: none;
    border: none;
    cursor: pointer;
    color: #ccc;
    font-size: 1.35rem;
    line-height: 1;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .15s;
}
.cart-item__remove:hover { color: #c0392b; }

/* Cart summary */
.cart-summary-card {
    background: #f8f9fa;
    border: 1px solid #e8eaed;
    border-radius: 10px;
    padding: 1.5rem;
    position: sticky;
    top: 1.5rem;
}
.cart-summary-card__title {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #767676;
    margin: 0 0 1rem;
}
.cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .88rem;
    color: #444;
    margin-bottom: .45rem;
}
.cart-summary-row--total {
    border-top: 1px solid #e8eaed;
    margin-top: .65rem;
    padding-top: .75rem;
    font-size: 1rem;
    font-weight: 700;
    color: #0a0a0a;
}
.cart-summary-card .btn { width: 100%; margin-top: 1.25rem; }
.cart-note {
    font-size: .75rem;
    color: #767676;
    text-align: center;
    margin-top: .65rem;
}

/* ── CHECKOUT FORM PAGE ───────────────────────────────────────────────────── */

.ck-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 2.5rem;
    align-items: start;
    padding: 2.5rem 0 4.5rem;
}
.ck-form-card {
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 1.25rem;
}
.ck-section-title {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #767676;
    margin: 0 0 1.25rem;
    padding-bottom: .6rem;
    border-bottom: 1px solid #f0f0f0;
}
.ck-section-title + .ck-section-title,
.ck-spacer + .ck-section-title { margin-top: 1.75rem; }
.ck-spacer { display: block; height: .25rem; }

.ck-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}
.ck-row--3 { grid-template-columns: 1fr 1fr 1fr; }
.ck-field {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    margin-bottom: 1rem;
}
.ck-field--full { grid-column: 1 / -1; }
.ck-label {
    font-size: .82rem;
    font-weight: 600;
    color: #374151;
}
.ck-label .req { color: #c0392b; margin-left: 1px; }
.ck-input,
.ck-select,
.ck-textarea {
    padding: .55rem .75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: .9rem;
    color: #1a1a1a;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
    width: 100%;
    font-family: inherit;
}
.ck-input:focus,
.ck-select:focus,
.ck-textarea:focus {
    outline: none;
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(192,57,43,.08);
}
.ck-textarea { resize: vertical; min-height: 80px; }

/* Document type row */
.ck-doc-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Invoice type */
.ck-radio-group {
    display: flex;
    gap: 1.5rem;
    margin-top: .1rem;
}
.ck-radio-label {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .88rem;
    cursor: pointer;
    user-select: none;
}
.ck-radio-label input { accent-color: #c0392b; }

/* Error */
.ck-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    color: #991b1b;
    font-size: .85rem;
    padding: .65rem .9rem;
    margin-top: 1rem;
    display: none;
}
.ck-error.is-visible { display: block; }

/* Submit */
.ck-submit-area {
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e8eaed;
}
.ck-submit-area .btn {
    width: 100%;
    padding: .9rem 1.5rem;
    font-size: 1rem;
}
.ck-submit-note {
    text-align: center;
    font-size: .76rem;
    color: #767676;
    margin: .5rem 0 0;
}
.ck-secure-note {
    text-align: center;
    font-size: .76rem;
    color: #767676;
    margin-top: .6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;
}

/* Checkout summary sidebar */
.ck-summary-card {
    background: #f8f9fa;
    border: 1px solid #e8eaed;
    border-radius: 10px;
    padding: 1.5rem;
    position: sticky;
    top: 1.5rem;
}
.ck-summary-card__title {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #767676;
    margin: 0 0 1rem;
}
.ck-summary-items {
    list-style: none;
    padding: 0;
    margin: 0 0 .75rem;
    display: flex;
    flex-direction: column;
    gap: .65rem;
    max-height: 280px;
    overflow-y: auto;
}
.ck-summary-item {
    display: flex;
    gap: .65rem;
    align-items: flex-start;
}
.ck-summary-item__img {
    width: 52px;
    height: 40px;
    object-fit: cover;
    border-radius: 5px;
    background: #eee;
    flex-shrink: 0;
}
.ck-summary-item__info { flex: 1; min-width: 0; }
.ck-summary-item__name {
    font-size: .82rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ck-summary-item__sub {
    font-size: .76rem;
    color: #767676;
    margin: 1px 0 0;
}
.ck-summary-item__price {
    font-size: .82rem;
    font-weight: 700;
    color: #1a1a1a;
    white-space: nowrap;
    flex-shrink: 0;
}
.ck-summary-divider {
    border: none;
    border-top: 1px solid #e8eaed;
    margin: .65rem 0;
}
.ck-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: .87rem;
    color: #555;
    margin-bottom: .35rem;
}
.ck-summary-row--total {
    font-size: 1rem;
    font-weight: 700;
    color: #0a0a0a;
    border-top: 1px solid #e8eaed;
    margin-top: .5rem;
    padding-top: .65rem;
    margin-bottom: 0;
}
.ck-back-link {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-size: .8rem;
    color: #767676;
    text-decoration: none;
    margin-top: .9rem;
}
.ck-back-link:hover { color: #c0392b; }

/* ── CONFIRMATION PAGE ────────────────────────────────────────────────────── */

.confirm-page { padding: 3rem 0 5rem; }

.confirm-card {
    max-width: 680px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,.06);
}

.confirm-card__header {
    padding: 2rem 2rem 1.75rem;
    text-align: center;
    border-bottom: 1px solid #e8eaed;
}
.confirm-card__header--pending { background: #fffbeb; }
.confirm-card__header--paid    { background: #f0fdf4; }

.confirm-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto .75rem;
    color: #fff;
}
.confirm-icon--pending { background: #d97706; }
.confirm-icon--paid    { background: #16a34a; }

.confirm-card__title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #0a0a0a;
    margin: 0 0 .3rem;
}
.confirm-card__number {
    font-size: .9rem;
    color: #666;
    margin: 0;
}
.confirm-card__number strong {
    color: #0a0a0a;
    font-family: var(--ff-mono, 'Courier New', monospace);
    font-size: .95rem;
}

.confirm-card__body { padding: 2rem; }

.confirm-section { margin-bottom: 1.75rem; }
.confirm-section:last-child { margin-bottom: 0; }
.confirm-section__title {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #767676;
    margin: 0 0 .9rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid #f0f0f0;
}

.confirm-items {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .65rem;
}
.confirm-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .75rem;
}
.confirm-item__info { flex: 1; min-width: 0; }
.confirm-item__name {
    font-size: .88rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 1px;
}
.confirm-item__sub {
    font-size: .78rem;
    color: #767676;
    margin: 0;
}
.confirm-item__price {
    font-size: .88rem;
    font-weight: 700;
    color: #1a1a1a;
    white-space: nowrap;
}
.confirm-total-row {
    display: flex;
    justify-content: space-between;
    padding: .75rem 0 0;
    border-top: 2px solid #e8eaed;
    margin-top: .65rem;
    font-size: 1rem;
    font-weight: 700;
    color: #0a0a0a;
}

.confirm-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .8rem 1.25rem;
}
.confirm-detail-full {
    grid-column: 1 / -1;
}
.confirm-detail-label {
    font-size: .73rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #767676;
    margin: 0 0 2px;
}
.confirm-detail-value {
    font-size: .88rem;
    color: #1a1a1a;
    margin: 0;
}

.confirm-pending-notice {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    font-size: .85rem;
    color: #92400e;
    text-align: center;
    line-height: 1.55;
}

.confirm-card__footer {
    padding: 1.25rem 2rem;
    background: #f8f9fa;
    border-top: 1px solid #e8eaed;
    display: flex;
    gap: .75rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 860px) {
    .cart-layout,
    .ck-layout { grid-template-columns: 1fr; }
    .cart-items__header { display: none; }
    .cart-item { grid-template-columns: 1fr auto auto auto; }
    .ck-summary-card { position: static; }
    .cart-summary-card { position: static; }
    .confirm-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 580px) {
    .ck-row,
    .ck-row--3 { grid-template-columns: 1fr; }
    .ck-doc-row { grid-template-columns: 1fr; }
    .ck-form-card { padding: 1.25rem; }
    .confirm-card__body { padding: 1.25rem; }
    .confirm-card__footer { padding: 1rem 1.25rem; }
    /* C1: prevent iOS auto-zoom on input focus (requires font-size >= 16px) */
    .ck-input,
    .ck-select,
    .ck-textarea { font-size: 1rem; }
}

/* ── Payment trust elements ───────────────────────────────────────────────── */

.ck-payment-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    margin: .7rem 0 .25rem;
    flex-wrap: wrap;
}
.ck-lock-icon {
    width: 14px;
    height: 14px;
    color: #16a34a;
    flex-shrink: 0;
}
.ck-pay-badge {
    font-size: .6rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 3px;
    letter-spacing: .04em;
    white-space: nowrap;
    line-height: 1.5;
}
.ck-pay-badge--visa   { background: #1a1f71; color: #fff; }
.ck-pay-badge--mc     { background: #eb001b; color: #fff; }
.ck-pay-badge--diners { background: #004a97; color: #fff; }
.ck-pay-badge--yape   { background: #6e2cf0; color: #fff; }

.ck-terms-note {
    text-align: center;
    font-size: .72rem;
    color: #767676;
    margin: .35rem 0 0;
    line-height: 1.45;
}
.ck-terms-link {
    color: #767676;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.ck-terms-link:hover { color: #c0392b; }
