/* ============================================================
   ESTILOS DEL CARRITO DE COMPRAS - VERSIÓN 2.18
   ============================================================
   Este archivo contiene TODOS los estilos del carrito:
   - Badge del carrito
   - Dropdown del carrito
   - Items del carrito
   - Toast notifications
   - Botones de añadir al carrito
   - Quick modal de productos
   ============================================================ */

/* ============================================================
   BADGE DEL CARRITO (botón principal)
   ============================================================ */
.bag-badge {
    position: relative;
    background: none;
    border: none;
    color: var(--color-blue, #0000ff);
    font-size: 1.4rem;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.bag-badge:hover {
    background: rgba(255, 255, 255, 0.1);
}

.bag-badge .bag-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--color-red, #FE0201);
    color: var(--color-white, #FEFEFE);
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    font-family: 'Helvetica World', Helvetica, Arial, sans-serif;
    box-shadow: 0 2px 8px rgba(254, 2, 1, 0.4);
    transition: transform 0.2s ease;
}

.bag-badge .bag-count:not(:empty) {
    display: flex;
}

/* ============================================================
   DROPDOWN DEL CARRITO
   ============================================================ */
.bag-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 380px;
    max-width: 90vw;
    max-height: 480px;
    background: var(--color-white, #FEFEFE);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 20px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px) scale(0.96);
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.bag-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Scrollbar personalizada para el dropdown */
.bag-dropdown::-webkit-scrollbar {
    width: 6px;
}

.bag-dropdown::-webkit-scrollbar-track {
    background: #f1f3f5;
    border-radius: 10px;
}

.bag-dropdown::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.bag-dropdown::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* ============================================================
   ITEMS DEL CARRITO EN EL DROPDOWN
   ============================================================ */
#bagItems {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 12px;
}

.bag-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: background 0.2s ease;
}

.bag-item:last-child {
    border-bottom: none;
}

.bag-item-image {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    object-fit: cover;
    background: #f1f3f5;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.bag-item-info {
    flex: 1;
    min-width: 0;
}

.bag-item-name {
    font-family: 'Helvetica World', Helvetica, Arial, sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-black, #000000);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bag-item-price {
    font-family: 'Impact', 'Helvetica World', sans-serif;
    font-size: 1rem;
    color: var(--color-blue, #0000FF);
    margin-top: 2px;
}

.bag-item-quantity {
    font-size: 0.75rem;
    color: #888;
    margin-top: 2px;
}

.bag-item-remove {
    background: none;
    border: none;
    color: #ccc;
    font-size: 1rem;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.bag-item-remove:hover {
    background: rgba(254, 2, 1, 0.08);
    color: var(--color-red, #FE0201);
}

/* ============================================================
   ESTADO VACÍO DEL CARRITO
   ============================================================ */
.bag-empty {
    text-align: center;
    padding: 32px 16px;
    color: #888;
}

.bag-empty i {
    font-size: 2.8rem;
    color: #ddd;
    margin-bottom: 12px;
    display: block;
}

.bag-empty p {
    font-size: 0.95rem;
    margin: 0;
}

/* ============================================================
   FOOTER DEL DROPDOWN (Total + Checkout)
   ============================================================ */
.bag-footer {
    display: none;
    flex-direction: column;
    gap: 12px;
    padding-top: 16px;
    border-top: 2px solid rgba(0, 0, 0, 0.06);
    margin-top: 4px;
}

.bag-footer .bag-total-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bag-footer .bag-total-amount {
    font-family: 'Impact', 'Helvetica World', sans-serif;
    font-size: 1.6rem;
    color: var(--color-blue, #0000FF);
    float: right;
}

.bag-footer .btn-checkout {
    display: block;
    width: 100%;
    padding: 14px;
    background: var(--color-blue, #0000FF);
    color: var(--color-white, #FEFEFE);
    text-align: center;
    border-radius: 10px;
    text-decoration: none;
    font-family: 'Impact', 'Helvetica World', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.bag-footer .btn-checkout:hover {
    background: #0000DD;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 255, 0.3);
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--color-black, #000000);
    color: var(--color-white, #FEFEFE);
    padding: 14px 28px;
    border-radius: 14px;
    font-family: 'Helvetica World', Helvetica, Arial, sans-serif;
    font-size: 0.95rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: 90vw;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.toast-notification.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.toast-notification .toast-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.toast-notification .toast-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.toast-notification .toast-close:hover {
    color: var(--color-white, #FEFEFE);
}

/* ============================================================
   BOTÓN "AÑADIR AL CARRITO" EN TARJETAS DE PRODUCTO
   ============================================================ */
.btn-add-to-bag {
    background: var(--color-blue, #0000FF);
    color: var(--color-white, #FEFEFE);
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-family: 'Impact', 'Helvetica World', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-add-to-bag:hover {
    background: #0000DD;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 255, 0.25);
}

.btn-add-to-bag.added {
    background: #00A86B;
    transform: scale(0.95);
}

.btn-add-to-bag .bag-icon {
    font-size: 0.9rem;
}

.btn-add-to-bag .btn-text {
    font-size: 0.8rem;
}

/* ============================================================
   ESTILOS DEL PRODUCT QUICK MODAL (VERSIÓN 2.16)
   ============================================================ */
.quick-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: quickModalFadeIn 0.3s ease;
}

.quick-modal-overlay.active {
    display: flex;
}

.quick-modal {
    background: var(--color-white, #FEFEFE);
    border-radius: 24px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: quickModalSlideUp 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
}

.dark .quick-modal {
    background: #1a1a1a;
}

.quick-modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #888;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-modal-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #000;
}

.dark .quick-modal-close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.quick-modal-body {
    display: flex;
    flex-direction: row;
    padding: 32px;
    gap: 32px;
}

@media (max-width: 768px) {
    .quick-modal-body {
        flex-direction: column;
        padding: 20px;
        gap: 20px;
    }
}

.quick-modal-image {
    flex: 0 0 40%;
    border-radius: 16px;
    overflow: hidden;
    background: #f1f3f5;
    position: relative;
    min-height: 300px;
}

.quick-modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.quick-modal-image .placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: #ccc;
}

.quick-modal-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.quick-modal-info .event-title {
    font-family: 'Helvetica World', Helvetica, Arial, sans-serif;
    font-size: 0.85rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.quick-modal-info .product-name {
    font-family: 'Impact', 'Helvetica World', sans-serif;
    font-size: 2rem;
    color: var(--color-black, #000000);
    margin: 0;
    line-height: 1.2;
}

.dark .quick-modal-info .product-name {
    color: var(--color-white, #FEFEFE);
}

.quick-modal-info .product-price {
    font-family: 'Impact', 'Helvetica World', sans-serif;
    font-size: 2.4rem;
    color: var(--color-blue, #0000FF);
}

.quick-modal-info .product-price .currency {
    font-size: 1.2rem;
    font-weight: 400;
    color: #888;
}

.quick-modal-info .product-stock {
    font-size: 0.9rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-modal-info .product-stock .in-stock {
    color: #00A86B;
    font-weight: 600;
}

.quick-modal-info .product-stock .out-of-stock {
    color: #FE0201;
    font-weight: 600;
}

.quick-modal-features {
    margin: 12px 0;
    padding: 0;
    list-style: none;
}

.quick-modal-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    font-family: 'Helvetica World', Helvetica, Arial, sans-serif;
    font-size: 0.95rem;
    color: var(--color-black, #000000);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.dark .quick-modal-features li {
    color: var(--color-white, #FEFEFE);
    border-bottom-color: rgba(255, 255, 255, 0.04);
}

.quick-modal-features li:last-child {
    border-bottom: none;
}

.quick-modal-features li .feature-icon {
    font-size: 1.2rem;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.quick-modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.quick-modal-actions .btn-add-to-bag-modal {
    flex: 1;
    min-width: 160px;
    padding: 14px 28px;
    background: var(--color-blue, #0000FF);
    color: var(--color-white, #FEFEFE);
    border: none;
    border-radius: 12px;
    font-family: 'Impact', 'Helvetica World', sans-serif;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.quick-modal-actions .btn-add-to-bag-modal:hover {
    background: #0000DD;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 255, 0.3);
}

.quick-modal-actions .btn-add-to-bag-modal.added {
    background: #00A86B;
}

.quick-modal-actions .btn-view-event {
    padding: 14px 24px;
    background: transparent;
    color: var(--color-blue, #0000FF);
    border: 2px solid var(--color-blue, #0000FF);
    border-radius: 12px;
    font-family: 'Impact', 'Helvetica World', sans-serif;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.quick-modal-actions .btn-view-event:hover {
    background: var(--color-blue, #0000FF);
    color: var(--color-white, #FEFEFE);
    transform: translateY(-2px);
}

.dark .quick-modal-actions .btn-view-event {
    color: #5B8CFF;
    border-color: #5B8CFF;
}

.dark .quick-modal-actions .btn-view-event:hover {
    background: #5B8CFF;
    color: var(--color-white, #FEFEFE);
}

@keyframes quickModalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes quickModalSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 480px) {
    .quick-modal {
        max-height: 95vh;
        border-radius: 16px;
    }
    
    .quick-modal-body {
        padding: 16px;
        gap: 16px;
    }
    
    .quick-modal-image {
        min-height: 200px;
        flex: 0 0 auto;
        height: 200px;
    }
    
    .quick-modal-info .product-name {
        font-size: 1.5rem;
    }
    
    .quick-modal-info .product-price {
        font-size: 1.8rem;
    }
    
    .quick-modal-actions {
        flex-direction: column;
    }
    
    .quick-modal-actions .btn-add-to-bag-modal,
    .quick-modal-actions .btn-view-event {
        width: 100%;
        justify-content: center;
    }
    
    .quick-modal-close {
        top: 10px;
        right: 12px;
        font-size: 1.6rem;
    }
}

/* ============================================================
   RESPONSIVE - Ajustes para el carrito en móviles
   ============================================================ */
@media (max-width: 768px) {
    .bag-dropdown {
        width: 94vw;
        right: -10px;
        max-height: 70vh;
        padding: 16px;
    }
    
    .bag-item {
        padding: 10px 0;
        gap: 10px;
    }
    
    .bag-item-image {
        width: 44px;
        height: 44px;
    }
    
    .bag-item-name {
        font-size: 0.8rem;
    }
    
    .bag-item-price {
        font-size: 0.85rem;
    }
    
    .bag-footer .bag-total-amount {
        font-size: 1.3rem;
    }
    
    .bag-footer .btn-checkout {
        padding: 12px;
        font-size: 1rem;
    }
    
    .toast-notification {
        bottom: 20px;
        padding: 12px 20px;
        font-size: 0.85rem;
        max-width: 94vw;
    }
    
    .btn-add-to-bag {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
    
    .btn-add-to-bag .btn-text {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .bag-dropdown {
        width: 96vw;
        right: -6px;
        padding: 14px;
    }
    
    .bag-item {
        padding: 8px 0;
        gap: 8px;
    }
    
    .bag-item-image {
        width: 38px;
        height: 38px;
        border-radius: 8px;
    }
}

/* ============================================================
   MODO OSCURO - Ajustes para el carrito
   NOTA: Estos estilos se integran con dark-mode.css
   ============================================================ */
.dark .bag-dropdown {
    background: #1a1a1a;
    border-color: rgba(255, 255, 255, 0.08);
}

.dark .bag-item {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

.dark .bag-item-name {
    color: var(--color-white, #FEFEFE);
}

.dark .bag-item-price {
    color: #5B8CFF;
}

.dark .bag-empty {
    color: #aaa;
}

.dark .bag-empty i {
    color: #444;
}

.dark .bag-footer {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.dark .bag-footer .bag-total-label {
    color: #aaa;
}

.dark .bag-footer .bag-total-amount {
    color: #5B8CFF;
}

.dark .toast-notification {
    background: #2a2a2a;
    border-color: rgba(255, 255, 255, 0.06);
}

.dark .bag-badge .bag-count {
    box-shadow: 0 2px 12px rgba(254, 2, 1, 0.5);
}