/* ========== MAIN CHECKOUT (variables locales + estilos) ========== */
.checkout {
    --color-border-light: #ffb1cc;
}

/* contenedor grid (mobile por defecto = 1 columna) */
.checkout__grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 5rem;
}

.checkout__left {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* ========== BLOQUE: DETALLE DEL PEDIDO (tabla responsive) ========== */
.cart-table {
    background: var(--white);
    border: 1px solid var(--secondary-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all 0.3s;
}

.cart-table__title {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1.5rem;
    letter-spacing: -0.2px;
}

/* tabla semántica */
.cart-table__table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

/* ocultar visualmente el thead en mobile (pero accesible) */
@media (max-width: 1023px) {
    .cart-table__table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border-width: 0;
    }
}

.cart-table__table th {
    text-align: left;
    padding: 0.75rem 0.5rem;
    font-weight: 600;
    color: var(--gray-600);
    border-bottom: 2px solid var(--gray-200);
}

/* alinear precios a la derecha en escritorio */
.cart-table__table th:nth-child(3),
.cart-table__table th:nth-child(4),
.cart-table__table td:nth-child(3),
.cart-table__table td:nth-child(4) {
    text-align: right;
}

.cart-table__table td {
    padding: 1rem 0.5rem;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: middle;
}

/* producto: imagen + nombre */
.product-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.product-cell__img {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    overflow: hidden;
}

.product-cell__name {
    font-weight: 500;
    color: var(--gray-800);
}

/* 📱 MÓVIL: convertir filas en CARDS usando data-label */
@media (max-width: 1023px) {
    .cart-table__table,
    .cart-table__table tbody,
    .cart-table__table tr,
    .cart-table__table td {
        display: block;
    }

    .cart-table__table tr {
        display: block;
        background: var(--white);
        border-radius: var(--radius-md);
        margin-bottom: 1rem;
        padding: 1rem;
        border: 1px solid var(--gray-300);
    }

    .cart-table__table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 0;
        border-bottom: 1px dashed #eef2f6;
        text-align: right;
    }

    .cart-table__table td:last-of-type {
        border-bottom: none;
    }

    /* pseudo-elemento con data-label */
    .cart-table__table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--gray-600);
        text-align: left;
        flex: 1;
    }

    /* Ajuste para celda producto: mantener flex dentro */
    .cart-table__table td:first-child {
        flex-wrap: wrap;
    }
    .product-cell {
        width: 100%;
        justify-content: space-between;
    }
    .cart-table__table td:first-child::before {
        content: attr(data-label);
        font-weight: 600;
        align-self: center;
    }
    /* Precio unitario y subtotal alineados */
    .cart-table__table td:nth-child(3),
    .cart-table__table td:nth-child(4) {
        text-align: right;
    }
}

/* ========== RESUMEN PEDIDO (card) ========== */
.order-summary {
    background: var(--secondary-light);
    border: 1px solid var(--secondary-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.order-summary__title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--gray-800);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border-light);
    font-size: var(--font-size-sm);
}

.summary-row--envio {
    border: none;
}

.summary-row--total {
    border-top: 2px solid var(--color-border-light);
    border-bottom: none;
    margin-top: 0.5rem;
    padding-top: 1rem;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--secondary-dark);
}

.summary-total-value {
    color: var(--secondary-dark);
    font-weight: 800;
}

/* ========== FORMULARIO CLIENTE ========== */
.customer-form {
    background: var(--white);
    border: 1px solid var(--secondary-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.customer-form__title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--gray-800);
}

.form-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-field label {
    font-weight: 500;
    font-size: var(--font-size-base);
    color: var(--gray-700);
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: var(--font-size-base);
    border: 1.5px solid var(--gray-300);
    border-radius: 1rem;
    background: var(--white);
    transition: all 0.3s;
    font-family: inherit;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--gray-400);
}

.form-field textarea {
    resize: vertical;
    min-height: 80px;
}

/* agrupación visual */
.form-section {
    margin-top: 0.5rem;
}

.form-field .form-select {
    cursor: pointer;
    appearance: none;
    background-image: url(../images/icons/caret-down.svg);
    background-size: 16px;
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* detalles transferencia */

/* Oculto por defecto */
.details-transfer {
    display: none;
    padding: 1rem;
    border-radius: 12px;
    background: var(--secondary-light);
    border: 1px solid #eee;
    animation: fadeIn 0.3s ease;
    margin-top: 1rem;
}

/* Estado visible */
.details-transfer.is-active {
    display: block;
}

/* Contenedores */
.transfer-box {
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}

/* Diferenciación visual */
.transfer-box--bank,
.transfer-box--tigo {
    display: flex;
    gap: 0.5rem;
    flex-direction: column;
    background: var(--white);
}

.transfer-box--bank p {
    font-size: 0.95rem;
    margin-bottom: 0;
    line-height: 1.2;
}

/* Títulos */
.transfer-title {
    font-size: 1.05rem;
    margin-bottom: 0;
    font-weight: 600;
    line-height: 1.2;
}

/* Número destacado */
.transfer-highlight {
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary-color);
    line-height: 1.2;
    margin-bottom: 0;
}

/* Comprobante */
.transfer-proof {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed #ccc;
    text-align: center;
}

.transfer-link {
    color: var(--secondary-dark);
    font-weight: bold;
    text-decoration: none;
}

.transfer-link:hover {
    text-decoration: underline;
}

/* copiar numero */
.transfer-copy {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 0.875rem;
    min-height: var(--touch-comfortable);
    font-size: 0.875rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    background: var(--secondary-color);
    color: var(--gray-900);
    touch-action: manipulation;
    transition: all 0.2s ease;
}
.copy-btn:active {
    transform: scale(0.95);
    opacity: 0.9;
}

.copy-btn:hover {
    background: var(--secondary-dark);
    color: var(--white);
}

.copy-btn.copied {
    background: #2ecc71; /* verde éxito */
}

.copy-icon {
    font-size: 0.9rem;
}

.copy-icon svg {
    height: 18px;
    width: 18px;
}

/* Animación suave */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== LAYOUT DESKTOP (2 COLUMNAS) ========== */
@media (min-width: 1024px) {
    .checkout__grid {
        display: grid;
        grid-template-columns: 1.35fr 1fr;
        gap: 2rem;
        align-items: start;
    }

    /* columna izquierda: detalle + resumen */

    .product-cell {
        max-width: 220px;
        margin-top: 0;
    }

    /* columna derecha: formulario */
    .checkout__right {
        display: flex;
        flex-direction: column;
    }

    .cart-table__table th,
    .cart-table__table td {
        padding: 0.75rem 0.5rem;
    }

    .cart-table__table th:first-child,
    .cart-table__table td:first-child {
        padding-left: 0;
    }

    .cart-table__table th:last-child,
    .cart-table__table td:last-child {
        padding-right: 0;
    }

    /* HOVER solo en desktop (opcional) */
    .cart-table__table tr:hover {
        background-color: #fffdfe;
        transition: 0.1s;
    }

    .form-field input:hover,
    .form-field select:hover,
    .form-field textarea:hover {
        border-color: var(--gray-400);
    }
}

/* micro-espaciado y utilidades */
.badge-mock {
    font-size: 0.7rem;
    background: #eef2ff;
    border-radius: 20px;
    padding: 0.2rem 0.5rem;
    color: var(--secondary-color);
}

/* garantizar que imágenes mock tengan consistencia */
.emoji-icon {
    font-size: 1.6rem;
}
