/* ================= CARRITO ================= */

.cart {
    max-width: 1100px;
    margin: auto;
}

.cart h1 {
    font-size: 36px;
    color: var(--dorado);
    margin-bottom: 40px;
}

/* ---------- Carrito vacío ---------- */
.cart-empty {
    font-size: 18px;
    opacity: 0.8;
    margin-bottom: 30px;
}

/* ---------- Lista ---------- */
.cart-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ---------- Item ---------- */
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #111;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    transition: 0.3s;
}

.cart-item:hover {
    border-color: var(--dorado);
    transform: translateY(-2px);
}

/* Info producto */
.cart-item-info h3 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 600;
}

.cart-item-info p {
    margin: 4px 0;
    font-size: 14px;
    opacity: 0.75;
}

/* Precio */
.cart-item-price {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cart-item-price span {
    font-size: 14px;
    opacity: 0.8;
}

.cart-item-price strong {
    font-size: 18px;
    color: var(--dorado);
}

/* ---------- Total ---------- */
.cart-total {
    margin-top: 40px;
    padding: 25px;
    background: #0f0f0f;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    text-align: right;
}

.cart-total h2 {
    margin: 0;
    font-size: 28px;
    color: var(--dorado);
}

/* ---------- Acciones ---------- */
.cart-actions {
    margin-top: 30px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

/* Botones */
.btn {
    padding: 14px 30px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: 0.3s;
    display: inline-block;
    text-align: center;
    box-sizing: border-box; /* 👈 Agregá esta línea */
}

.btn.primary {
    background: var(--dorado);
    color: var(--negro);
}

.btn.primary:hover {
    background: #b8942f;
}

.btn.secondary {
    border: 1px solid var(--dorado);
    color: var(--dorado);
    background: transparent;
}

.btn.secondary:hover {
    background: var(--dorado);
    color: var(--negro);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {

    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .cart-item-price {
        width: 100%;
        align-items: flex-end;
    }

    .cart-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

.cart-item-left img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: #000;
}

.cart-item {
    gap: 20px;
}


/* ===== BARRA INFERIOR DEL CARRITO ===== */
.cart-bar {
    margin-top: 50px;
    padding: 25px 30px;
    background: #0f0f0f;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;

    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
}

/* ===== IZQUIERDA: MÉTODO DE PAGO ===== */
.cart-bar-left h3 {
    margin: 0 0 12px;
    color: var(--dorado);
    font-size: 18px;
    font-weight: 600;
}

.cart-bar-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Radios custom */
.payment-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
}

.payment-option input {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid var(--blanco);
    border-radius: 50%;
    position: relative;
}

.payment-option input:checked {
    border-color: var(--dorado);
}

.payment-option input:checked::after {
    content: "";
    width: 8px;
    height: 8px;
    background: var(--dorado);
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
}

.payment-option span {
    transition: 0.3s;
}

.payment-option:hover span {
    color: var(--dorado);
}

/* ===== CENTRO: TOTAL ===== */
.cart-bar-center h2 {
    margin: 0;
    color: var(--dorado);
    font-size: 26px;
    font-weight: 700;
    white-space: nowrap;
}

/* ===== DERECHA: BOTONES ===== */
.cart-bar-right {
    display: flex;
    flex-direction: column;   /* ⬅️ clave */
    text-align: right;
}

.cart-bar-right p {
    margin: 0;
    font-size: 14px;
    opacity: 0.85;
    margin-top: 10px;
}

.cart-bar-right h2 {
    margin-top: 12px;
    font-size: 26px;
    color: var(--dorado);
}

/* ===== MOBILE ===== */
@media (max-width: 900px) {
    .cart-bar {
        flex-direction: column;
        text-align: center;
    }

    .cart-bar-right {
        flex-direction: column;
        width: 100%;
    }

    .cart-bar-right .btn {
        width: 100%;
    }
}


/* ===== PAYMENT SELECT ===== */
.cart-bar-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.payment-label {
    color: var(--dorado);
    font-size: 16px;
    font-weight: 600;
}

/* Caja principal */
.payment-select {
    display: flex;
    justify-content: space-between;
    align-items: center;

    min-width: 200px;
    padding: 12px 15px;

    background: #0f0f0f;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;

    cursor: pointer;
    transition: 0.3s;
}

.payment-select:hover {
    border-color: var(--dorado);
}

.payment-arrow {
    color: var(--dorado);
    font-size: 14px;
}

/* Dropdown */
.payment-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;

    margin-top: 6px;
    background: #0f0f0f;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;

    overflow: hidden;

    max-height: 0;
    opacity: 0;
    transform: translateY(-8px);

    transition:
        max-height 0.35s ease,
        opacity 0.25s ease,
        transform 0.25s ease;
}

.payment-dropdown.active {
    max-height: 120px;
    opacity: 1;
    transform: translateY(0);
}

.payment-dropdown .payment-option {
    padding: 12px 15px;
    cursor: pointer;
    transition: 0.3s;
}

.payment-dropdown .payment-option:hover {
    background: rgba(212,175,55,0.1);
    color: var(--dorado);
}

/* ===== SHIPPING SELECT (CLON PAYMENT) ===== */

.shipping-select {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-width: 200px;
    padding: 12px 15px;
    background: #0f0f0f;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;

    position: relative; /* ⬅️ CLAVE */
    z-index: 20;
}

.shipping-select:hover {
    border-color: var(--dorado);
}

.shipping-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 30; /* ⬅️ por encima del input */
    margin-top: 6px;
    background: #0f0f0f;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;

    overflow: hidden;

    max-height: 0;
    opacity: 0;
    transform: translateY(-8px);

    transition:
        max-height 0.35s ease,
        opacity 0.25s ease,
        transform 0.25s ease;
}

.shipping-dropdown.active {
    max-height: 180px;
    opacity: 1;
    transform: translateY(0);
}

.shipping-option {
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.shipping-option small {
    opacity: 0.7;
}

.shipping-option:hover {
    background: rgba(212,175,55,0.1);
    color: var(--dorado);
}

.cart-bar-center {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

/* ===== POSTAL CODE ===== */

.postal-box {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    z-index: 1;
}

.postal-box label {
    font-size: 14px;
    font-weight: 500;
    color: var(--dorado);
}

/* Input estilo SELECT */
.postal-box input {
    width: 100%;
    padding: 12px 15px;

    background: #0f0f0f;
    color: white;

    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;

    font-size: 14px;
    transition: 0.3s;
}

/* Hover igual a shipping/payment */
.postal-box input:hover {
    border-color: var(--dorado);
}

/* Focus elegante */
.postal-box input:focus {
    border-color: var(--dorado);
    box-shadow: 0 0 0 2px rgba(212,175,55,0.15);
}

/* Placeholder */
.postal-box input::placeholder {
    color: rgba(255,255,255,0.4);
}

/* ===== POSTAL ANIMATION ===== */

.postal-box {
    overflow: visible;
    max-width: 87%;
    max-height: 0;
    opacity: 0;
    transform: translateY(-6px);

    transition:
        max-height 0.35s ease,
        opacity 0.25s ease,
        transform 0.25s ease;

    pointer-events: none;
}

/* Visible */
.postal-box.active {
    max-height: 180px; /* o 200px */
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}


.shipping-wrapper {
    position: relative;
    width: 100%;
}

/* SELECT */
.shipping-select {
    position: relative;
    z-index: 2;
}

/* DROPDOWN */
.shipping-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    z-index: 50;
}

/* ===== WRAPPER ENVÍO ===== */
.shipping-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* CONTEXTO FIJO PARA EL DROPDOWN */
.shipping-select-wrapper {
    position: relative;
    width: 100%;
}

/* SELECT */
.shipping-select {
    position: relative;
    z-index: 3;
}

/* DROPDOWN: SIEMPRE BAJO EL SELECT */
.shipping-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    z-index: 20;
}

/* POSTAL: YA NO AFECTA AL DROPDOWN */
.postal-box {
    position: relative;
    z-index: 1;
}


.qty-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.qty-controls button {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.15);
    background: transparent;
    color: var(--blanco);
    font-size: 16px;
    cursor: pointer;
    transition: 0.25s;
}

.qty-controls button:hover {
    border-color: var(--dorado);
    color: var(--dorado);
}

.qty-input {
    width: 36px;
    background: transparent;
    border: none;
    color: var(--blanco);
    font-weight: 500;
    text-align: center;
    pointer-events: none;
}

.remove-item {
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 18px;
    cursor: pointer;
    margin-left: 10px;
    transition: 0.25s;
}

.remove-item:hover {
    color: var(--dorado);
    transform: scale(1.15);
}


