﻿
/* ===================================
   PUNTOMIX - CARRITO Y CHECKOUT
   =================================== */

.aviso-carrito {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    background: #272727;
    color: #FFFFFF;
    padding: 14px 20px;
    border-left: 4px solid #FF6B35;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.18);
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    pointer-events: none;
}

    .aviso-carrito.visible {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

.carrito-section {
    padding: 45px 0 80px;
    background: #FFF9F0;
    min-height: 65vh;
}

    .carrito-section [hidden] {
        display: none !important;
    }

.carrito-encabezado {
    margin-bottom: 30px;
}

    .carrito-encabezado h1 {
        display: flex;
        align-items: center;
        gap: 12px;
        font-size: 30px;
        color: #272727;
    }

        .carrito-encabezado h1 svg {
            color: #FF6B35;
        }

    .carrito-encabezado p {
        color: #777;
        margin-top: 8px;
    }

.carrito-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 25px;
    align-items: start;
}

.carrito-productos,
.carrito-resumen,
.carrito-vacio {
    background: white;
    border: 1px solid #F0E7DD;
    border-radius: 14px;
    padding: 24px;
}

.carrito-productos-titulo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

    .carrito-productos-titulo h2,
    .carrito-resumen h2 {
        font-size: 19px;
        color: #272727;
    }

#carrito-contador {
    font-size: 13px;
    color: #777;
}

.carrito-item {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 20px 0;
    border-bottom: 1px solid #F0E7DD;
}

.carrito-item-imagen {
    width: 90px;
    height: 90px;
    object-fit: contain;
    background: #FFF9F0;
    border-radius: 10px;
    padding: 8px;
}

.carrito-item-info h3 {
    font-size: 16px;
    margin-bottom: 6px;
    color: #272727;
}

.carrito-item-info p {
    font-size: 13px;
    color: #777;
    margin-bottom: 8px;
}

.carrito-item-precio {
    font-size: 14px;
    color: #FF6B35;
    font-weight: 600;
}

.carrito-item-detalle {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.carrito-item-subtotal {
    font-size: 17px;
    color: #272727;
}

.carrito-seguir {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 22px;
    color: #FF6B35;
    font-weight: 600;
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
}

.carrito-resumen h2 {
    margin-bottom: 25px;
}

.carrito-resumen-fila,
.carrito-resumen-total {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.carrito-resumen-fila {
    font-size: 14px;
    color: #666;
}

.carrito-resumen-total {
    border-top: 1px solid #EEE;
    padding-top: 20px;
    font-size: 17px;
    color: #272727;
}

    .carrito-resumen-total strong {
        color: #FF6B35;
    }

.carrito-continuar,
.carrito-enlace {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: #FF6B35;
    color: white;
    border: none;
    border-radius: 9px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

    .carrito-continuar:hover,
    .carrito-enlace:hover {
        background: #E95727;
    }

    .carrito-continuar:active {
        transform: scale(0.98);
    }

    .carrito-continuar:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }

.carrito-resumen-nota {
    margin-top: 15px;
    color: #777;
    font-size: 12px;
    line-height: 1.6;
}

.carrito-vacio {
    text-align: center;
    padding: 65px 25px;
}

    .carrito-vacio > svg {
        width: 60px;
        height: 60px;
        color: #FF6B35;
        margin-bottom: 16px;
    }

    .carrito-vacio h2 {
        margin-bottom: 10px;
    }

    .carrito-vacio p {
        color: #777;
        margin-bottom: 25px;
    }

    .carrito-vacio .carrito-enlace {
        max-width: 220px;
        margin: 0 auto;
    }

/* Controles de cantidad */

.carrito-cantidad-controles {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #E9E2DA;
    border-radius: 8px;
    padding: 4px;
}

    .carrito-cantidad-controles button {
        width: 30px;
        height: 30px;
        border: none;
        border-radius: 5px;
        background: #FFF0E7;
        color: #FF6B35;
        font-size: 19px;
        cursor: pointer;
    }

        .carrito-cantidad-controles button:disabled {
            opacity: 0.4;
            cursor: not-allowed;
        }

    .carrito-cantidad-controles span {
        min-width: 20px;
        text-align: center;
        font-weight: 600;
    }

/* Eliminar y vaciar */

.carrito-eliminar {
    background: none;
    border: none;
    color: #C24136;
    cursor: pointer;
    font-size: 13px;
    text-decoration: underline;
}

.carrito-acciones {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}

.carrito-vaciar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid #E7B8B4;
    color: #B53D35;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
}

    .carrito-vaciar:hover {
        background: #FFF1F0;
    }

/* Aviso con opción deshacer */

.aviso-deshacer {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 18px;
    background: #272727;
    color: #FFFFFF;
    padding: 14px 18px;
    border-radius: 9px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

    .aviso-deshacer[hidden] {
        display: none;
    }

    .aviso-deshacer button {
        border: none;
        background: none;
        color: #FFD166;
        font-weight: 700;
        cursor: pointer;
    }

/* ===================================
   CHECKOUT
   =================================== */

#checkout-contenido {
    width: 100%;
}

#form-checkout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 25px;
    align-items: start;
}

.checkout-formulario {
    background: #FFFFFF;
    border: 1px solid #F0E7DD;
    border-radius: 14px;
    padding: 28px;
}

    .checkout-formulario h2 {
        color: #272727;
        font-size: 20px;
        margin-bottom: 8px;
    }

.checkout-descripcion {
    color: #777;
    font-size: 14px;
    margin-bottom: 25px;
}

.checkout-campos {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.checkout-formulario .form-grupo {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

    .checkout-formulario .form-grupo label {
        color: #272727;
        font-size: 14px;
        font-weight: 600;
    }

    .checkout-formulario .form-grupo input {
        width: 100%;
        min-height: 46px;
        padding: 11px 13px;
        border: 1px solid #E5DDD4;
        border-radius: 8px;
        outline: none;
        background: #FFFFFF;
        color: #272727;
        font-family: inherit;
        font-size: 14px;
        transition: border-color 0.2s, box-shadow 0.2s;
    }

        .checkout-formulario .form-grupo input:focus {
            border-color: #FF6B35;
            box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.12);
        }

        .checkout-formulario .form-grupo input::placeholder {
            color: #AAA;
        }

.checkout-entrega {
    margin-top: 12px;
    padding: 20px;
    border: 1px solid #F0E7DD;
    border-radius: 10px;
    background: #FFF9F0;
}

    .checkout-entrega h3 {
        color: #272727;
        font-size: 16px;
        margin-bottom: 12px;
    }

    .checkout-entrega .carrito-resumen-fila {
        margin-bottom: 10px;
    }

    .checkout-entrega p {
        color: #777;
        font-size: 13px;
        line-height: 1.6;
    }

.checkout-acciones {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 25px;
}

    .checkout-acciones .carrito-continuar {
        width: auto;
        min-width: 190px;
    }

    .checkout-acciones .carrito-seguir {
        margin-top: 0;
        padding: 12px;
    }

.checkout-resumen {
    background: #FFFFFF;
    border: 1px solid #F0E7DD;
    border-radius: 14px;
    padding: 24px;
}

    .checkout-resumen h2 {
        color: #272727;
        font-size: 19px;
        margin-bottom: 20px;
    }

#checkout-productos {
    display: flex;
    flex-direction: column;
}

.checkout-producto {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid #F0E7DD;
    color: #555;
    font-size: 13px;
    line-height: 1.5;
}

    .checkout-producto span {
        overflow-wrap: anywhere;
    }

    .checkout-producto strong {
        color: #272727;
        white-space: nowrap;
    }

.checkout-total-fila {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    color: #666;
    font-size: 14px;
}

.checkout-total-final {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #EDE5DC;
    color: #272727;
    font-size: 17px;
    font-weight: 700;
}

    .checkout-total-final strong {
        color: #FF6B35;
        font-size: 20px;
    }

/* ===================================
   COMPRA COMPLETADA
   =================================== */

.compra-overlay {
    position: fixed;
    inset: 0;
    z-index: 20000;
    background: rgba(25, 25, 25, 0.65);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

    .compra-overlay[hidden] {
        display: none !important;
    }

.compra-modal-abierto {
    overflow: hidden;
}

.compra-modal {
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    background: #FFFFFF;
    border-radius: 18px;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    text-align: center;
}

.compra-icono {
    color: #20A66A;
    margin-bottom: 12px;
}

    .compra-icono svg {
        width: 62px;
        height: 62px;
    }

.compra-modal h2 {
    font-size: 26px;
    color: #272727;
    margin-bottom: 8px;
}

.compra-subtitulo {
    color: #777;
    font-size: 14px;
    margin-bottom: 24px;
}

.compra-datos {
    background: #FFF9F0;
    border-radius: 10px;
    padding: 16px;
    text-align: left;
    margin-bottom: 22px;
}

    .compra-datos p {
        font-size: 13px;
        color: #555;
        margin: 5px 0;
        overflow-wrap: anywhere;
    }

.compra-modal h3 {
    font-size: 16px;
    color: #272727;
    text-align: left;
    margin-bottom: 12px;
}

.compra-producto {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #F0E7DD;
    text-align: left;
    font-size: 14px;
}

    .compra-producto strong {
        white-space: nowrap;
    }

.compra-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 18px;
    padding: 15px 0;
    font-size: 18px;
    font-weight: 700;
}

    .compra-total strong {
        color: #FF6B35;
    }

.compra-botones {
    display: flex;
    gap: 12px;
    margin-top: 15px;
}

    .compra-botones button {
        flex: 1;
        padding: 13px 10px;
        border-radius: 9px;
        font-weight: 600;
        cursor: pointer;
    }

#btn-descargar-pdf {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #FF6B35;
    color: white;
    border: none;
}

#btn-cerrar-compra {
    background: white;
    color: #272727;
    border: 1px solid #DDD;
}

.compra-aviso {
    margin-top: 18px;
    font-size: 11px;
    color: #888;
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 850px) {
    .carrito-grid,
    #form-checkout {
        grid-template-columns: 1fr;
    }

    .checkout-resumen {
        order: -1;
    }
}

@media (max-width: 600px) {
    .aviso-carrito {
        left: 16px;
        right: 16px;
        bottom: 16px;
        text-align: center;
    }
}

@media (max-width: 550px) {
    .carrito-item {
        grid-template-columns: 70px minmax(0, 1fr);
        gap: 12px;
    }

    .carrito-item-imagen {
        width: 70px;
        height: 70px;
    }

    .carrito-item-detalle {
        grid-column: 2;
        align-items: flex-start;
    }

    .carrito-productos,
    .carrito-resumen,
    .checkout-formulario,
    .checkout-resumen {
        padding: 16px;
    }

    .carrito-encabezado h1 {
        font-size: 25px;
    }

    .checkout-campos {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .checkout-acciones {
        flex-direction: column;
        align-items: stretch;
    }

        .checkout-acciones .carrito-continuar {
            width: 100%;
        }

        .checkout-acciones .carrito-seguir {
            justify-content: center;
        }

    .aviso-deshacer {
        left: 16px;
        right: 16px;
        bottom: 16px;
        justify-content: space-between;
    }

    .compra-modal {
        padding: 22px 18px;
    }

    .compra-botones {
        flex-direction: column;
    }
}
