/* /assets/css/cart-panel.css */

/* --- Estilos base (Contador, Backdrop, Panel) --- */
.cart-fab {
    position: relative;
}
.cart-counter {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: #dc3545;
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.75rem;
    font-weight: bold;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    border: none;
    transform: scale(0);
    transition: transform 0.2s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}
.cart-counter.visible {
    transform: scale(1);
}
.cart-panel-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.cart-panel-backdrop.visible {
    opacity: 1;
    visibility: visible;
}
.cart-panel {
    position: fixed;
    top: 82px;
    right: -100%;
    width: 520px;
    max-width: 95%;
    height: calc(100vh - 82px);
    z-index: 2001;
    transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    perspective: 1000px;
}
.cart-panel.open {
    right: 0;
}

@media (max-width: 768px) {
    .cart-panel {
        top: 30px; /* Ajustado a la nueva altura del header móvil */
        height: calc(100vh - 120px);
    }
}


/* --- Estilos para la Animación de Volteo --- */
.cart-panel-flipper {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}
.cart-panel-flipper.flipped {
    transform: rotateY(180deg);
}
.cart-page {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    background-color: var(--color-cart-panel-bg, rgba(0, 0, 0, 0.709));
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    color: #f0f0f0;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}
.cart-page-1 {
    transform: rotateY(0deg);
}
.cart-page-2 {
    transform: rotateY(180deg);
}

/* --- Estilos Comunes (Header, Footer, Body) --- */
.cart-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}
.cart-panel-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #fff;
}
.cart-panel-close-btn, .cart-panel-back-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #ffffff;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}
.cart-panel-back-btn {
    font-size: 1rem;
    font-weight: bold;
}
.cart-panel-close-btn:hover, .cart-panel-back-btn:hover {
    color: #fff;
}
.cart-panel-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
}
.cart-panel-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}
.whatsapp-checkout-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    background-color: #0aa543;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.whatsapp-checkout-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* --- Estilos para la Cara 1 (Carrito) --- */
.empty-cart-message {
    text-align: center;
    color: #a0a0a0;
    padding: 4rem 1rem;
}
.empty-cart-message p {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0 0 0.5rem;
    color: #fff;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}
.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border: 2px solid transparent;
    border-radius: 12px;
    margin-bottom: 1rem;
    background-color: rgba(255, 255, 255, 0.05);
    transition: border-color 0.3s, box-shadow 0.3s;
    animation: fadeInUp 0.4s ease forwards;
}

.cart-item.flash-sale-item {
    border-color: #FFD700;
    box-shadow: 0 0 8px #FFD700, 0 0 12px #FFFACD; /* Brillo estático */
    animation: fadeInUp 0.4s ease forwards; /* Mantenemos la animación de entrada */
}

.cart-item-image {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
}
.cart-item-info {
    flex-grow: 1;
}
.cart-item-info .name {
    font-weight: 600;
    color: #fff;
}
.cart-item-info .price {
    color: #ffffff;
}
.cart-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
}
.quantity-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.quantity-control button {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
}
.remove-item-btn {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    font-size: 1.2rem;
}
.cart-item-timer {
    font-size: 0.8rem;
    font-weight: bold;
    color: #FFD700;
    margin-top: 0.5rem;
    background-color: rgba(255, 215, 0, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}
.cart-summary .summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
.summary-line.total {
    font-size: 1.3rem;
    font-weight: bold;
    color: #fff;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.2);
}
.coupon-area {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
#coupon-code-input {
    flex-grow: 1;
    padding: 0.75rem;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff;
}
#coupon-code-input:disabled {
    background-color: rgba(50, 50, 50, 0.5);
    cursor: not-allowed;
}
#validate-coupon-btn {
    padding: 0 1rem;
    border: none;
    background: #343a40;
    color: white;
    border-radius: 4px;
    cursor: pointer;
}
#validate-coupon-btn:disabled {
    background: #555;
    cursor: not-allowed;
}
#coupon-message {
    font-size: 0.85rem;
    height: 1.2em;
}
#coupon-message.success {
    color: #00e676;
}
#coupon-message.error {
    color: #ff6b6b;
}
#applied-coupons-container {
    margin: 0.75rem 0;
}
.applied-coupon {
    display: inline-flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(0, 230, 118, 0.1);
    color: #00e676;
    padding: 0.5rem 0.8rem;
    border-radius: 20px;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    border: 1px solid rgba(0, 230, 118, 0.4);
}
.remove-coupon-btn {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    font-size: 1.2rem;
    margin-left: 8px;
}
.applied-coupon.neon-effect {
    /* Simplemente le añadimos un brillo estático en lugar de la animación */
    box-shadow: 0 0 5px #00e676, 0 0 8px #69f0ae;
}

/* --- Estilos para la Cara 2 (Formulario) --- */
#checkout-form .form-group {
    margin-bottom: 1.25rem;
}
#checkout-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: #ccc;
}
#checkout-form input, #checkout-form select, #checkout-form textarea {
    width: 100%;
    padding: 0.8rem;
    box-sizing: border-box;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff;
    font-size: 1rem;
}
.shipping-select-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.5rem;
}
#delivery-fields {
    border-left: 3px solid #25d366;
    padding-left: 1rem;
    margin-top: 1.25rem;
}