/**
 * ChaosBoost Cart Modal - MOBILE OPTIMIZED
 * Con imágenes personalizadas y excelente adaptación mobile
 */

/* Prevent body scroll when modal is open */
body.cart-modal-open {
    overflow: hidden;
}

/* ========== CART ICON ========== */
.chaosboost-cart-icon-wrapper {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.chaosboost-cart-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chaosboost-cart-icon:hover {
    transform: scale(1.1);
}

.chaosboost-cart-icon svg {
    width: 24px;
    height: 24px;
    fill: #FFFFFF;
}

.chaosboost-cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #FFC908;
    color: #000;
    font-family: 'Rajdhani', sans-serif;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
    animation: cartBadgePop 0.3s ease;
}

@keyframes cartBadgePop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ========== MODAL CONTAINER ========== */
.chaosboost-cart-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.chaosboost-cart-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(12.35px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ========== MODAL CONTENT ========== */
.chaosboost-cart-modal-content {
    position: relative;
    width: 1021px;
    min-height: 447px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.87) 0%, rgba(26, 21, 0, 0.76) 34.25%);
    backdrop-filter: blur(12.35px);
    border-radius: 12px;
    filter: drop-shadow(0px 0px 59px rgba(0, 0, 0, 0.8));
    
    z-index: 10001;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== CLOSE BUTTON ========== */
.chaosboost-cart-modal-close {
    position: absolute;
    top: 40px;
    right: 35px;
    
    background: #FFD000;
    border: none;
    width: 39px;
    height: 39px;
    border-radius: 12px;
    box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
    
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10002;
}

.chaosboost-cart-modal-close:hover {
    background: #FFC908;
    transform: scale(1.05);
}

.chaosboost-cart-modal-close::before,
.chaosboost-cart-modal-close::after {
    content: '';
    position: absolute;
    width: 21px;
    height: 2px;
    background: #000000;
}

.chaosboost-cart-modal-close::before {
    transform: rotate(45deg);
}

.chaosboost-cart-modal-close::after {
    transform: rotate(-45deg);
}

/* ========== TITLE ========== */
.cart-modal-title {
    font-family: 'Rajdhani', sans-serif;
    font-style: normal;
    font-weight: 700;
    font-size: 45px;
    line-height: 86.14%;
    
    color: #FFFFFF;
    text-align: center;
    
    padding: 35px 50px 25px;
    margin: 0;
    
    background-image: url("https://dragonboosting.com/wp-content/uploads/2025/11/image-4-scaled.webp");
    background-repeat: no-repeat;
    background-position: center bottom;
    background-size: 75% auto;
}

/* ========== BODY ========== */
.cart-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 25px 40px;
}

/* ========== EMPTY CART ========== */
.cart-modal-empty {
    text-align: center;
   
    padding: 74px 38px 1px 38px;
}

.cart-modal-empty p {
        font-family: 'Rajdhani', sans-serif;
    color: #FFFFFF;
    font-size: 22px;
    font-weight: 500;
    height: 119px;
    background-image: url(https://dragonboosting.com/wp-content/uploads/2025/11/image-4-scaled.webp);
    background-repeat: no-repeat;
    background-position: center bottom;
    background-size: contain;
    margin-bottom: 30px;
        text-align: center !important;
}

.btn-continue-shopping {
    background: #FFC908;
    color: #000000;
    border: none;
    padding: 15px 40px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 28px;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-continue-shopping:hover {
    background: #FFD000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 201, 8, 0.4);
}

/* ========== CART ITEMS ========== */
.cart-modal-items {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ========== CART ITEM ========== */
.cart-modal-item {
    padding: 25px 0;
    position: relative;
    
    background-image: url("https://dragonboosting.com/wp-content/uploads/2025/11/image-4-scaled.webp");
    background-repeat: no-repeat;
    background-position: center bottom;
    background-size: 82% auto;
    
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    align-items: center;
}

.cart-modal-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(255, 201, 8, 0.2);
}

.cart-modal-item:last-child::after {
    display: none;
}

/* ========== ITEM DETAILS ========== */
.cart-modal-item-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cart-modal-item-details h4 {
    font-family: 'Rajdhani', sans-serif;
    font-style: normal;
    font-weight: 700;
    font-size: 22px;
    line-height: 86.14%;
    
    color: #FFFFFF;
    margin: 0;
}

/* ========== ITEM OPTIONS ========== */
.cart-modal-item-options {
    font-family: 'Rajdhani', sans-serif;
    font-style: normal;
    font-weight: 500;
    font-size: 14px;
    line-height: 122%;
    
    color: #FFFFFF;
    
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cart-modal-item-options .option-item {
    display: flex;
    gap: 5px;
}

.cart-modal-item-options strong {
    color: #FFC908;
}

/* ========== ITEM CONTROLS ========== */
.cart-modal-item-controls {
    display: flex;
    align-items: center;
    gap: 74px;
}

/* ========== QUANTITY CONTROLS ========== */
.cart-modal-quantity {
    display: flex;
    align-items: center;
    gap: 0;
    
    background: linear-gradient(90deg, rgba(128, 105, 0, 0.4872) 0%, rgba(255, 201, 8, 0.84) 131.34%);
    border-radius: 12px;
    
    width: 176px;
    height: 39px;
    
    padding: 8px;
}

.cart-modal-qty-btn {
    background: #FFFFFF;
    border: none;
    
    cursor: pointer;
    width: 34px;
    height: 100%;
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    transition: all 0.2s ease;
    user-select: none;
    
    padding: 0;
    position: relative;
}

.cart-modal-qty-btn.minus {
    border-radius: 2px 0 0 2px;
    background: url('https://dragonboosting.com/wp-content/uploads/2025/11/image-20.webp') center center no-repeat;
    background-size: 34px 16px;
}

.cart-modal-qty-btn.plus {
    border-radius: 0 2px 2px 0;
    background: url('https://dragonboosting.com/wp-content/uploads/2025/11/image-21.webp') center center no-repeat;
    background-size: 34px 16px;
}

.cart-modal-qty-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.cart-modal-qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cart-modal-qty {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 28px;
    line-height: 122%;
    
    color: #FFFFFF;
    
    flex: 1;
    text-align: center;
    user-select: none;
}

/* ========== ITEM PRICE ========== */
.cart-modal-item-price {
    font-family: 'Rajdhani', sans-serif;
    font-style: normal;
    font-weight: 700;
    font-size: 28px;
    line-height: 122%;
    
    color: #FFC908;
    
    min-width: 90px;
    text-align: center;
}

/* ========== REMOVE BUTTON ========== */
.cart-modal-remove-item {
    background: #362C00;
    border: none;
    
    width: 39px;
    height: 39px;
    border-radius: 12px;
    box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
    
    cursor: pointer;
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    transition: all 0.3s ease;
    
    background-image: url('https://dragonboosting.com/wp-content/uploads/2025/11/image-22.webp');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 24px 24px;
    background-color: #362C00;
}

.cart-modal-remove-item:hover:not(:disabled) {
    background-color: #4a3a00;
    transform: scale(1.05);
}

.cart-modal-remove-item:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cart-modal-remove-item svg {
    display: none;
}

/* ========== CART FOOTER ========== */
.cart-modal-footer {
    padding: 25px 0px 30px 288px;
    position: relative;
}

/* ========== TOTAL ========== */
.cart-modal-total {
    display: none;
}

/* ========== ACTION BUTTONS ========== */
.cart-modal-actions {
    display: flex;
    gap: 35px;
    align-items: center;
}

.cart-modal-actions button {
    height: 54px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    
    font-family: 'Rajdhani', sans-serif;
    font-style: normal;
    font-weight: 700;
    font-size: 28px;
    line-height: 86.14%;
    
    transition: all 0.3s ease;
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    width: 39%;
}

.btn-checkout {
    background: #FFC908;
    color: #000000;
    width: 214px;
}

.btn-checkout:hover {
    background: #FFD000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 201, 8, 0.4);
}

.btn-checkout:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-continue {
    background: #362C00;
    color: #FFFFFF;
    flex: 1;
}

.btn-continue:hover {
    background: #4a3a00;
}

/* ========== LOADING STATE ========== */
.cart-modal-loading {
    text-align: center;
    padding: 60px 20px;
}

.cart-modal-loading p {
    font-family: 'Rajdhani', sans-serif;
    color: #FFFFFF;
    font-size: 18px;
    font-weight: 500;
}

/* ========== NOTIFICATIONS ========== */
.chaosboost-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.87) 0%, rgba(26, 21, 0, 0.76) 100%);
    backdrop-filter: blur(12.35px);
    border: 2px solid #FFC908;
    border-radius: 12px;
    
    font-family: 'Rajdhani', sans-serif;
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 600;
    
    z-index: 10003;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.3s ease;
    
    box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.5);
    max-width: 350px;
}

.chaosboost-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.chaosboost-notification.success {
    border-color: #4CAF50;
}

.chaosboost-notification.error {
    border-color: #ff4444;
}

/* ========== SCROLLBAR ========== */
.cart-modal-body::-webkit-scrollbar {
    width: 8px;
}

.cart-modal-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.cart-modal-body::-webkit-scrollbar-thumb {
    background: #FFC908;
    border-radius: 4px;
}

.cart-modal-body::-webkit-scrollbar-thumb:hover {
    background: #FFD000;
}

/* ========== RESPONSIVE - TABLET ========== */
@media (max-width: 1100px) {
    .chaosboost-cart-modal-content {
        width: 95%;
        max-width: 1021px;
    }
    
    .cart-modal-footer {
        padding: 25px 40px 30px;
    }
}

/* ========== RESPONSIVE - MOBILE (OPTIMIZADO) ========== */
@media (max-width: 768px) {
    .chaosboost-cart-modal {
        padding: 10px;
        align-items: flex-start;
        padding-top: 20px;
    }
    
    .chaosboost-cart-modal-content {
        width: 100%;
        max-width: 100%;
        min-height: auto;
        max-height: 95vh;
        border-radius: 16px;
    }
    
    /* Close button más accesible en mobile */
    .chaosboost-cart-modal-close {
        top: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
    }
    
    .chaosboost-cart-modal-close::before,
    .chaosboost-cart-modal-close::after {
        width: 18px;
    }
    
    /* Title responsive */
    .cart-modal-title {
        font-size: 32px;
        padding: 50px 20px 20px 20px;
        background-size: 80% auto;
    }
    
    /* Body con mejor padding */
    .cart-modal-body {
        padding: 15px 20px;
    }
    
    /* Item en columna para mejor visualización */
    .cart-modal-item {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 20px 0;
        background-size: 100% auto;
    }
    
    .cart-modal-item-details h4 {
        font-size: 20px;
        line-height: 1.2;
    }
    
    .cart-modal-item-options {
        font-size: 13px;
    }
    
    /* Controls en fila con mejor espaciado */
    .cart-modal-item-controls {
        justify-content: space-between;
        width: 100%;
        gap: 15px;
    }
    
    /* Quantity control más grande y táctil */
    .cart-modal-quantity {
        width: 140px;
        height: 44px;
        flex-shrink: 0;
    }
    
    .cart-modal-qty-btn {
        width: 36px;
    }
    
    .cart-modal-qty-btn.minus,
    .cart-modal-qty-btn.plus {
        background-size: 30px 14px;
    }
    
    .cart-modal-qty {
        font-size: 24px;
    }
    
    /* Price más visible */
    .cart-modal-item-price {
        font-size: 24px;
        min-width: 80px;
    }
    
    /* Remove button más grande */
    .cart-modal-remove-item {
        width: 44px;
        height: 44px;
        background-size: 22px 22px;
        flex-shrink: 0;
    }
    
    /* Footer optimizado */
    .cart-modal-footer {
        padding: 20px;
    }
    
    /* Buttons en columna */
    .cart-modal-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .cart-modal-actions button {
        width: 100% !important;
        height: 52px;
        font-size: 22px;
    }
    
    .btn-checkout {
        order: 1;
    }
    
    .btn-continue {
        order: 2;
    }
    
    /* Empty cart */
    .cart-modal-empty {
        padding: 40px 20px;
    }
    
    .cart-modal-empty p {
        font-size: 20px;
    }
    
    .btn-continue-shopping {
        font-size: 22px;
        padding: 12px 30px;
    }
    
    /* Notifications en mobile */
    .chaosboost-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        font-size: 14px;
        padding: 12px 20px;
    }
}

/* ========== RESPONSIVE - SMALL MOBILE ========== */
@media (max-width: 480px) {
    .cart-modal-title {
        font-size: 28px;
        padding: 45px 15px 18px 15px;
        background-size: 90% auto;
    }
    
    .cart-modal-body {
        padding: 12px 15px;
    }
    
    .cart-modal-item {
        padding: 18px 0;
    }
    
    .cart-modal-item-details h4 {
        font-size: 18px;
    }
    
    .cart-modal-item-options {
        font-size: 12px;
    }
    
    /* Controls más compactos pero táctiles */
    .cart-modal-item-controls {
        gap: 10px;
    }
    
    .cart-modal-quantity {
        width: 130px;
        height: 42px;
    }
    
    .cart-modal-qty-btn {
        width: 34px;
    }
    
    .cart-modal-qty-btn.minus,
    .cart-modal-qty-btn.plus {
        background-size: 28px 13px;
    }
    
    .cart-modal-qty {
        font-size: 22px;
    }
    
    .cart-modal-item-price {
        font-size: 22px;
        min-width: 70px;
    }
    
    .cart-modal-remove-item {
        width: 42px;
        height: 42px;
        background-size: 20px 20px;
    }
    
    .cart-modal-footer {
        padding: 18px 15px;
    }
    
    .cart-modal-actions button {
        height: 48px;
        font-size: 20px;
    }
    
    .cart-modal-empty p {
        font-size: 18px;
        text-align: center !important;
        height: 76px;
    }
    
    .btn-continue-shopping {
        font-size: 20px;
        padding: 10px 25px;
    }
}

/* ========== LANDSCAPE MOBILE ========== */
@media (max-width: 900px) and (orientation: landscape) {
    .chaosboost-cart-modal {
        padding-top: 10px;
    }
    
    .chaosboost-cart-modal-content {
        max-height: 90vh;
    }
    
    .cart-modal-title {
        font-size: 26px;
        padding: 40px 20px 15px;
    }
    
    .cart-modal-body {
        padding: 12px 20px;
    }
    
    .cart-modal-item {
        padding: 15px 0;
        grid-template-columns: 2fr 3fr;
        gap: 20px;
    }
    
    .cart-modal-item-controls {
        gap: 20px;
    }
}

/* ========== EXTRA SMALL DEVICES ========== */
@media (max-width: 360px) {
    .cart-modal-title {
        font-size: 24px;
        padding: 40px 12px 15px;
    }
    
    .cart-modal-quantity {
        width: 120px;
        height: 40px;
    }
    
    .cart-modal-qty-btn {
        width: 32px;
    }
    
    .cart-modal-qty {
        font-size: 20px;
    }
    
    .cart-modal-item-price {
        font-size: 20px;
    }
    
    .cart-modal-remove-item {
        width: 40px;
        height: 40px;
        background-size: 18px 18px;
    }
}