/* ============================================= */
/* Cart Template — Independent Cart for AI Tmpl  */
/* 100% independiente de cart-standard.css y      */
/* de cualquier estilo del template AI            */
/* ============================================= */

/* Ensure SweetAlert2 always appears above the cart modal */
.swal2-container {
    z-index: 10100 !important;
}

/* ---- Floating Cart Button (bottom-left) ---- */
#btnCartFloat {
    position: fixed;
    bottom: 28px;
    left: 28px;
    z-index: 9999;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(255, 65, 108, 0.5), 0 0 0 0 rgba(255, 65, 108, 0.4);
    display: none;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    animation: ctPulse 2s infinite;
}

#btnCartFloat:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 40px rgba(255, 65, 108, 0.6);
    animation: none;
}

#btnCartFloat:active {
    transform: scale(0.95);
}

@keyframes ctPulse {
    0% { box-shadow: 0 8px 30px rgba(255, 65, 108, 0.5), 0 0 0 0 rgba(255, 65, 108, 0.4); }
    70% { box-shadow: 0 8px 30px rgba(255, 65, 108, 0.5), 0 0 0 18px rgba(255, 65, 108, 0); }
    100% { box-shadow: 0 8px 30px rgba(255, 65, 108, 0.5), 0 0 0 0 rgba(255, 65, 108, 0); }
}

@keyframes ctBtnEnter {
    from { opacity: 0; transform: scale(0.3) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes ctBtnExit {
    from { opacity: 1; transform: scale(1) translateY(0); }
    to { opacity: 0; transform: scale(0.3) translateY(20px); }
}

#btnCartFloat.ct-show {
    display: flex;
    animation: ctBtnEnter 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards, ctPulse 2s 0.4s infinite;
}

#btnCartFloat.ct-hide {
    animation: ctBtnExit 0.3s ease forwards;
}

/* Badge counter */
.ct-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: #fff;
    color: #ff416c;
    font-size: 0.75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    line-height: 1;
}

/* ---- Modal Overlay ---- */
.ct-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ct-modal-overlay.ct-active {
    display: flex;
    opacity: 1;
}

/* ---- Modal Container ---- */
.ct-modal {
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    background: rgba(18, 18, 28, 0.95);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(30px) scale(0.95);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    color: #fff;
}

.ct-modal-overlay.ct-active .ct-modal {
    transform: translateY(0) scale(1);
}

/* Modal Header */
.ct-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ct-modal-header-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
}

.ct-modal-header-title i {
    color: #ff416c;
    font-size: 1.3rem;
    filter: drop-shadow(0 0 8px rgba(255, 65, 108, 0.5));
}

.ct-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.ct-modal-close:hover {
    background: rgba(255, 65, 108, 0.15);
    color: #ff416c;
    border-color: rgba(255, 65, 108, 0.3);
}

/* Modal Body */
.ct-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.ct-modal-body::-webkit-scrollbar {
    width: 5px;
}

.ct-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.ct-modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

/* Section labels */
.ct-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ct-section-label i {
    font-size: 0.75rem;
    color: #4CAF50;
}

/* Boleto items grid */
.ct-boletos-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1.25rem;
}

.ct-boleto-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.15) 0%, rgba(76, 175, 80, 0.05) 100%);
    border: 1px solid rgba(76, 175, 80, 0.25);
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ct-boleto-item:hover {
    background: linear-gradient(135deg, rgba(255, 65, 108, 0.2) 0%, rgba(255, 65, 108, 0.08) 100%);
    border-color: rgba(255, 65, 108, 0.4);
}

.ct-boleto-item .ct-remove-icon {
    font-size: 0.65rem;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.ct-boleto-item:hover .ct-remove-icon {
    opacity: 1;
    color: #ff416c;
}

/* Paquete items */
.ct-paquetes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 1.25rem;
}

.ct-paquete-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    transition: all 0.2s ease;
}

.ct-paquete-item:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
}

.ct-paquete-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ct-paquete-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.2) 0%, rgba(108, 92, 231, 0.08) 100%);
    border: 1px solid rgba(108, 92, 231, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a29bfe;
    font-size: 1rem;
}

.ct-paquete-details {
    display: flex;
    flex-direction: column;
}

.ct-paquete-qty {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
}

.ct-paquete-price {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.ct-paquete-remove {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 65, 108, 0.08);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.ct-paquete-remove:hover {
    background: rgba(255, 65, 108, 0.2);
    border-color: rgba(255, 65, 108, 0.4);
    color: #ff416c;
}

/* Divider */
.ct-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 0.5rem 0 1rem;
}

/* Summary Table */
.ct-summary {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.ct-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.ct-summary-row + .ct-summary-row {
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.ct-summary-row .ct-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ct-summary-row .ct-label i {
    color: #4CAF50;
    font-size: 0.8rem;
    width: 18px;
    text-align: center;
}

.ct-summary-row .ct-value {
    font-weight: 700;
    color: #fff;
}

.ct-summary-row.ct-total {
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 2px solid rgba(76, 175, 80, 0.2) !important;
    font-size: 1rem;
}

.ct-summary-row.ct-total .ct-value {
    color: #4CAF50;
    font-size: 1.2rem;
    text-shadow: 0 0 12px rgba(76, 175, 80, 0.3);
}

/* Empty cart state */
.ct-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: rgba(255, 255, 255, 0.4);
}

.ct-empty i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.3;
}

.ct-empty p {
    font-size: 0.95rem;
    margin: 0;
}

/* Modal Footer */
.ct-modal-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: center;
}

.ct-btn-comprar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 14px 32px;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(255, 65, 108, 0.4);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.ct-btn-comprar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transition: left 0.5s ease;
}

.ct-btn-comprar:hover::before {
    left: 100%;
}

.ct-btn-comprar:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(255, 65, 108, 0.55);
}

.ct-btn-comprar:active {
    transform: translateY(1px);
}

/* ============================================= */
/* Responsive                                     */
/* ============================================= */
@media (max-width: 576px) {
    #btnCartFloat {
        bottom: 18px;
        left: 18px;
        width: 56px;
        height: 56px;
        font-size: 1.3rem;
    }

    .ct-modal {
        max-height: 90vh;
        border-radius: 20px;
        margin: 0.5rem;
    }

    .ct-modal-header,
    .ct-modal-body,
    .ct-modal-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .ct-modal-header-title {
        font-size: 1.05rem;
    }

    .ct-boleto-item {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .ct-btn-comprar {
        padding: 12px 24px;
        font-size: 0.95rem;
    }
}
