/* ===================================
   CARRITO PREMIUM - ESTILOS ESPECÍFICOS
   Solo para carrito.php
   ================================== */

/* Contenedor principal del carrito premium */
.carrito-premium {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(180deg, #f3f4f6 0%, #eef0f3 100%);
    min-height: auto;
    padding: 12px 0 24px;
    overflow-x: clip;
    width: 100%;
    box-sizing: border-box;
}

/* Columna única centrada — NO usar .container de Bootstrap aquí */
/* Columna centrada: angosta en móvil, dos columnas en desktop */
.carrito-premium > .carrito-shell {
    --cart-column-width: 1280px;
    width: 100%;
    max-width: var(--cart-column-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .carrito-premium > .carrito-shell {
        --cart-column-width: 1280px;
    }
}

.carrito-premium .cart-layout {
    --bs-gutter-x: 0;
    --bs-gutter-y: 0.65rem;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0;
}

.carrito-premium .cart-layout > [class*="col-"] {
    padding-left: 0;
    padding-right: 0;
}

@media (min-width: 768px) {
    .carrito-premium .cart-layout {
        --bs-gutter-x: 0.85rem;
        --bs-gutter-y: 0;
        margin-left: calc(-0.5 * var(--bs-gutter-x));
        margin-right: calc(-0.5 * var(--bs-gutter-x));
        align-items: stretch;
    }

    .carrito-premium .cart-layout > [class*="col-"] {
        padding-left: calc(var(--bs-gutter-x) * 0.5);
        padding-right: calc(var(--bs-gutter-x) * 0.5);
    }

    .carrito-premium .cart-products-col,
    .carrito-premium .cart-summary-col {
        display: flex;
        flex-direction: column;
    }

    .carrito-premium .cart-products-card,
    .carrito-premium .cart-summary-card {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 100%;
    }

    .carrito-premium .cart-products-card .modern-card-body,
    .carrito-premium .cart-summary-card .modern-card-body {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .carrito-premium .cart-summary-actions {
        grid-template-columns: 1fr;
        margin-top: auto;
    }
}

.carrito-premium .cart-summary-col {
    margin-top: 2px;
}

.carrito-premium .cart-summary-card .modern-card-body {
    padding-bottom: 18px;
}

.carrito-premium .cart-summary-actions {
    display: grid;
    gap: 10px;
    margin-top: 4px;
}

@media (min-width: 576px) {
    .carrito-premium .cart-summary-actions {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
}

/* ===== MODERN CARDS PREMIUM ===== */
.carrito-premium .modern-card {
    background: white;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transition: box-shadow 0.25s ease;
    position: relative;
}

.carrito-premium .modern-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff6348, #ff4757, #e83e8c);
}

.carrito-premium .modern-card:hover {
    transform: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.carrito-premium .modern-card-header {
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    padding: 11px 14px;
    border-bottom: 1px solid rgba(255, 99, 72, 0.12);
    position: relative;
}

.carrito-premium .modern-card-header h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 12px;
}

.carrito-premium .modern-card-header h4 i {
    color: #ff6348;
    font-size: 1.2rem;
}

.carrito-premium .modern-card-body {
    padding: 12px 14px;
}

.carrito-premium .cart-items-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ===== CART ITEMS PREMIUM ===== */
.carrito-premium .cart-item {
    background: #fafbfc;
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 0;
    border: 1px solid #eceff3;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
    box-shadow: none;
    gap: 8px;
}

.carrito-premium .cart-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 99, 72, 0.05), transparent);
    transition: left 0.6s ease;
}

.carrito-premium .cart-item:hover {
    border-color: #ff6348;
    transform: none;
    box-shadow: 0 6px 16px rgba(255, 99, 72, 0.1);
}

.carrito-premium .cart-item:hover::before {
    left: 100%;
}

.carrito-premium .cart-item-image {
    flex: 0 0 52px;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: none;
}

.carrito-premium .cart-item-image img,
.carrito-premium .cart-item-thumb {
    border-radius: 10px;
    transition: none;
    width: 52px;
    height: 52px;
    object-fit: cover;
    display: block;
}

.carrito-premium .cart-item:hover .cart-item-image img {
    transform: none;
}

.carrito-premium .cart-item-info {
    min-width: 0;
}

.carrito-premium .cart-item-info h5 {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 2px;
    font-size: 0.88rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.carrito-premium .cart-item-info .text-muted {
    color: #6c757d !important;
    font-size: 0.74rem;
    font-weight: 500;
    margin-bottom: 2px;
    line-height: 1.3;
}

.carrito-premium .cart-item-info .fw-bold {
    color: #ff6348;
    font-size: 0.86rem;
    font-weight: 700;
    text-shadow: none;
}

.carrito-premium .cart-item-controls {
    flex-shrink: 0;
    gap: 6px;
}

.carrito-premium .cart-item-controls .btn-danger-modern {
    padding: 6px 10px;
    min-width: 34px;
    border-radius: 8px;
}

/* ===== QUANTITY CONTROLS PREMIUM ===== */
.carrito-premium .quantity-controls {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: none;
    border: 1px solid #e5e7eb;
    transition: border-color 0.2s ease;
    display: flex;
    align-items: center;
}

.carrito-premium .quantity-controls:hover {
    border-color: #ff6348;
    box-shadow: none;
}

.carrito-premium .quantity-controls .btn {
    border-radius: 0;
    border: none;
    padding: 4px 8px;
    background: #f8f9fa;
    color: #2c3e50;
    transition: background 0.2s ease, color 0.2s ease;
    font-weight: 600;
    font-size: 0.72rem;
    min-width: 28px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carrito-premium .quantity-controls .btn:hover {
    background: #ff6348;
    color: white;
    transform: scale(1.1);
}

.carrito-premium .quantity-controls input {
    border: none;
    background: white;
    font-weight: 700;
    color: #2c3e50;
    text-align: center;
    font-size: 0.82rem;
    width: 32px;
    padding: 4px 2px;
}

.carrito-premium .quantity-controls input:focus {
    outline: none;
    box-shadow: none;
}

/* ===== BUTTONS PREMIUM ===== */
.carrito-premium .btn-modern {
    border-radius: 10px;
    font-weight: 700;
    padding: 10px 14px;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    border: none;
    position: relative;
    overflow: hidden;
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.84rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    justify-content: center;
}

.carrito-premium .btn-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s ease;
}

.carrito-premium .btn-modern:hover::before {
    left: 100%;
}

.carrito-premium .btn-primary-modern {
    background: linear-gradient(135deg, #ff6348 0%, #ff4757 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(255, 99, 72, 0.3);
}

.carrito-premium .btn-primary-modern:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 18px 45px rgba(255, 99, 72, 0.4);
    color: white;
    background: linear-gradient(135deg, #ff4757, #ff3742);
}

.carrito-premium .btn-danger-modern {
    background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.3);
}

.carrito-premium .btn-danger-modern:hover,
.carrito-premium .btn-danger-modern:focus {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 18px 45px rgba(255, 107, 53, 0.4);
    color: white;
    background: linear-gradient(135deg, #e55a24, #FF6B35);
    outline-color: #FF6B35;
}

.carrito-premium .btn-success-modern {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(40, 167, 69, 0.3);
}

.carrito-premium .btn-success-modern:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 18px 45px rgba(40, 167, 69, 0.4);
    color: white;
    background: linear-gradient(135deg, #20c997, #17a2b8);
}

/* ===== SUMMARY SECTION PREMIUM ===== */
.carrito-premium .summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
    transition: none;
    font-size: 0.88rem;
    font-weight: 500;
}

.carrito-premium .summary-item:hover {
    background: transparent;
    padding-left: 0;
    border-radius: 0;
}

.carrito-premium .summary-item:last-child {
    border-bottom: none;
}

.carrito-premium .summary-item span:first-child {
    color: #6c757d;
    font-weight: 600;
}

.carrito-premium .summary-item span:last-child {
    color: #2c3e50;
    font-weight: 700;
    font-size: 0.92rem;
}

.carrito-premium .summary-total {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 14px;
    margin-top: 12px;
    border: 1px solid rgba(255, 99, 72, 0.1);
    box-shadow: none;
    position: relative;
    overflow: hidden;
}

.carrito-premium .summary-total::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #FF6B35, #F7931E);
}

.carrito-premium .summary-total h5 {
    color: #2c3e50;
    font-weight: 700;
    margin: 0;
    font-size: 0.95rem;
}

.carrito-premium .summary-total h3,
.carrito-premium .summary-total #summaryTotal {
    color: #FF6B35 !important;
    font-weight: 800;
    margin: 0;
    font-size: 1.35rem;
    text-shadow: none;
}

.carrito-premium .checkout-progress {
    display: none !important;
}

/* ===== EMPTY CART STATE ===== */
.carrito-premium .empty-cart {
    text-align: center;
    padding: 28px 16px;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-radius: 16px;
    border: 2px dashed #dee2e6;
    margin: 12px 0;
}

.carrito-premium .empty-cart-icon {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.carrito-premium .empty-cart h3 {
    color: #6c757d;
    font-weight: 600;
    margin-bottom: 15px;
}

.carrito-premium .empty-cart p {
    color: #adb5bd;
    font-size: 1.1rem;
    margin-bottom: 25px;
}

/* ===== LOADING STATES ===== */
.carrito-premium .loading-container {
    padding: 20px 8px;
    text-align: center;
}

.carrito-premium .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3em;
    color: #ff6348;
}

.carrito-premium .loading-container p {
    font-size: 1.1rem;
    font-weight: 600;
    color: #6c757d;
}

/* ===== SHIPPING CALCULATOR ===== */
.carrito-premium .shipping-calculator {
    background: linear-gradient(135deg, #e3f2fd, #ffffff);
    border-radius: 16px;
    padding: 20px;
    margin: 20px 0;
    border: 2px solid rgba(33, 150, 243, 0.1);
    box-shadow: 0 8px 25px rgba(33, 150, 243, 0.1);
}

.carrito-premium .shipping-calculator h6 {
    color: #1976d2;
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.carrito-premium .shipping-calculator .form-control {
    border-radius: 12px;
    border: 2px solid #e9ecef;
    padding: 12px 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.carrito-premium .shipping-calculator .form-control:focus {
    border-color: #1976d2;
    box-shadow: 0 0 0 0.2rem rgba(33, 150, 243, 0.25);
}

/* ===== COUPON SECTION ===== */
.carrito-premium .coupon-section {
    background: linear-gradient(135deg, #fff3e0, #ffffff);
    border-radius: 16px;
    padding: 20px;
    margin: 20px 0;
    border: 2px solid rgba(255, 152, 0, 0.1);
    box-shadow: 0 8px 25px rgba(255, 152, 0, 0.1);
}

.carrito-premium .coupon-section h6 {
    color: #f57c00;
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.carrito-premium .coupon-input-group {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.carrito-premium .coupon-input-group .form-control {
    border-radius: 12px;
    border: 2px solid #e9ecef;
    padding: 12px 16px;
    font-weight: 600;
    flex: 1;
}

.carrito-premium .coupon-input-group .btn {
    border-radius: 12px;
    padding: 12px 20px;
    font-weight: 700;
    white-space: nowrap;
}

/* ===== PROGRESS INDICATOR ===== */
.carrito-premium .checkout-progress {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 0;
    width: min(100%, 500px);
    max-width: 500px;
    margin: 8px auto 16px;
    padding: 12px 16px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

.carrito-premium .progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
}

.carrito-premium .progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    right: -50%;
    width: 100%;
    height: 2px;
    background: #dee2e6;
    z-index: 1;
}

.carrito-premium .progress-step.active:not(:last-child)::after {
    background: #ff6348;
}

.carrito-premium .progress-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    margin-bottom: 8px;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.carrito-premium .progress-step.active .progress-circle {
    background: #ff6348;
    box-shadow: 0 4px 15px rgba(255, 99, 72, 0.3);
}

.carrito-premium .progress-step.completed .progress-circle {
    background: #28a745;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.carrito-premium .progress-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #6c757d;
    text-align: center;
    line-height: 1.2;
    max-width: 72px;
}

.carrito-premium .progress-step.active .progress-label {
    color: #ff6348;
}

/* ===== PRODUCT RECOMMENDATIONS ===== */
.carrito-premium .recommendations-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.carrito-premium .recommendations-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #2c3e50;
    margin-bottom: 25px;
    text-align: center;
    position: relative;
}

.carrito-premium .recommendations-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #ff6348, #ff4757);
    border-radius: 2px;
}

.carrito-premium .recommendation-card {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
}

.carrito-premium .recommendation-card:hover {
    transform: translateY(-5px);
    border-color: #ff6348;
    box-shadow: 0 15px 40px rgba(255, 99, 72, 0.15);
}

.carrito-premium .recommendation-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.carrito-premium .recommendation-card:hover img {
    transform: scale(1.05);
}

.carrito-premium .recommendation-card h6 {
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1rem;
    line-height: 1.3;
}

.carrito-premium .recommendation-card .price {
    color: #ff6348;
    font-weight: 800;
    font-size: 1.1rem;
    margin-bottom: 15px;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .carrito-premium .modern-card-body {
        padding: 12px 14px;
    }
}

@media (max-width: 768px) {
    .carrito-premium {
        padding-bottom: 16px;
    }

    .carrito-premium > .carrito-shell {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }

    .carrito-premium .modern-card {
        border-radius: 12px;
    }

    .carrito-premium .modern-card:hover {
        transform: none;
    }
    
    .carrito-premium .cart-item {
        flex-wrap: wrap;
        text-align: left;
        gap: 8px;
        padding: 10px;
    }
    
    .carrito-premium .cart-item-controls {
        width: 100%;
        justify-content: flex-end;
        margin-left: 60px;
        flex-wrap: nowrap;
        gap: 6px;
    }
    
    .carrito-premium .modern-card-header {
        padding: 11px 12px;
    }

    .carrito-premium .modern-card-header h4 {
        font-size: 0.95rem;
    }
    
    .carrito-premium .modern-card-body {
        padding: 12px 10px;
    }
    
    .carrito-premium .summary-total {
        padding: 20px;
    }
    
    .carrito-premium .checkout-progress {
        width: min(100%, 500px);
        margin-left: auto;
        margin-right: auto;
        padding: 10px 12px;
    }
    
    .carrito-premium .progress-step:not(:last-child)::after {
        display: none;
    }
    
    .carrito-premium .coupon-input-group {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .carrito-premium .btn-modern {
        padding: 12px 20px;
        font-size: 0.85rem;
        min-width: 120px;
    }
    
    .carrito-premium .quantity-controls {
        max-width: 140px;
        margin: 0 auto;
    }
    
    .carrito-premium .summary-total h3 {
        font-size: 1.8rem;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.carrito-premium .cart-item {
    animation: slideInUp 0.5s ease-out;
}

.carrito-premium .cart-item:nth-child(2) {
    animation-delay: 0.1s;
}

.carrito-premium .cart-item:nth-child(3) {
    animation-delay: 0.2s;
}

.carrito-premium .modern-card {
    animation: fadeInScale 0.6s ease-out;
}

.carrito-premium .summary-total {
    animation: fadeInScale 0.6s ease-out 0.3s both;
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    padding: 16px 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    transform: translateX(400px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left: 4px solid #28a745;
}

.toast.error {
    border-left: 4px solid #dc3545;
}

.toast.warning {
    border-left: 4px solid #ffc107;
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.toast.success .toast-icon {
    background: #28a745;
}

.toast.error .toast-icon {
    background: #dc3545;
}

.toast.warning .toast-icon {
    background: #ffc107;
}

.toast-message {
    flex: 1;
    font-weight: 600;
    color: #2c3e50;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    color: #2c3e50;
}