/* ===== REDISEÑO CARRITO Y PEDIDOS ===== */

/* Add to Cart Button Moderno */
.add-to-cart-modern {
    position: relative;
    background: linear-gradient(135deg, #FF6B35, #F7931E);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
    overflow: hidden;
    min-width: 140px;
}

.add-to-cart-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
    background: linear-gradient(135deg, #E55A2B, #E8841A);
}

.add-to-cart-modern:active {
    transform: translateY(0);
    transition: transform 0.1s;
}

.add-to-cart-modern.loading {
    pointer-events: none;
}

.add-to-cart-modern.added {
    background: linear-gradient(135deg, #10B981, #059669);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

/* Animación del botón */
.add-to-cart-modern .btn-text {
    display: inline-block;
    transition: all 0.3s ease;
}

.add-to-cart-modern .btn-icon {
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.add-to-cart-modern:hover .btn-icon {
    transform: scale(1.1);
}

.add-to-cart-modern.added .btn-icon {
    transform: rotate(360deg);
}

/* Quantity Selector Moderno */
.quantity-selector-modern {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 25px;
    padding: 4px;
    margin: 10px 0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.quantity-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.quantity-btn:hover {
    background: #FF6B35;
    color: white;
    transform: scale(1.1);
}

.quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.quantity-input {
    border: none;
    background: transparent;
    text-align: center;
    width: 50px;
    font-weight: 600;
    font-size: 16px;
    color: #333;
}

/* Modal del Carrito Rediseñado */
.cart-modal-modern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cart-modal-modern.active {
    opacity: 1;
    visibility: visible;
}

.cart-modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.8) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-modal-modern.active .cart-modal-content {
    transform: scale(1) translateY(0);
}

.cart-header {
    padding: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

.cart-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.cart-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.cart-body {
    padding: 25px;
    max-height: 400px;
    overflow-y: auto;
}

.cart-item-modern {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

.cart-item-modern:hover {
    background: #f8f9fa;
    margin: 0 -15px;
    padding: 15px;
    border-radius: 10px;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    object-fit: cover;
    margin-right: 15px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.cart-item-price {
    color: #FF6B35;
    font-weight: 700;
    font-size: 16px;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-remove-btn {
    background: #ff4757;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.cart-remove-btn:hover {
    background: #ff3838;
    transform: scale(1.1);
}

.cart-footer {
    padding: 25px;
    border-top: 1px solid #f0f0f0;
    background: #f8f9fa;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 700;
}

.cart-total-amount {
    color: #FF6B35;
}

.cart-actions {
    display: flex;
    gap: 15px;
}

.btn-continue-shopping {
    flex: 1;
    padding: 15px;
    border: 2px solid #ddd;
    background: white;
    color: #666;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-continue-shopping:hover {
    border-color: #FF6B35;
    color: #FF6B35;
}

.btn-checkout-modern {
    flex: 2;
    padding: 15px;
    background: linear-gradient(135deg, #FF6B35, #F7931E);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-checkout-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
}

/* Formulario de Checkout Rediseñado */
.checkout-modal-modern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.checkout-modal-modern.active {
    opacity: 1;
    visibility: visible;
}

.checkout-modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.8) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.checkout-modal-modern.active .checkout-modal-content {
    transform: scale(1) translateY(0);
}

.checkout-header {
    padding: 25px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    text-align: center;
}

.checkout-header h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
}

.checkout-steps {
    display: flex;
    justify-content: center;
    margin-top: 15px;
    gap: 15px;
}

.step {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: all 0.3s ease;
}

.step.active {
    background: white;
    color: #4facfe;
}

.checkout-body {
    padding: 30px;
    max-height: 500px;
    overflow-y: auto;
}

.form-group-modern {
    margin-bottom: 25px;
}

.form-label-modern {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-input-modern {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-input-modern:focus {
    outline: none;
    border-color: #4facfe;
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.form-input-modern.error {
    border-color: #ff4757;
    background: #fff5f5;
}

.form-row-modern {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.order-summary-modern {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
}

.summary-title {
    font-weight: 700;
    margin-bottom: 15px;
    color: #333;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e1e5e9;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 18px;
    color: #FF6B35;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #e1e5e9;
}

.checkout-footer {
    padding: 25px;
    background: #f8f9fa;
    display: flex;
    gap: 15px;
}

.btn-back {
    flex: 1;
    padding: 15px;
    border: 2px solid #ddd;
    background: white;
    color: #666;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-back:hover {
    border-color: #4facfe;
    color: #4facfe;
}

.btn-place-order {
    flex: 2;
    padding: 15px;
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.btn-place-order:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.btn-place-order:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-place-order .loading-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

.btn-place-order.loading .loading-spinner {
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animaciones y efectos */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Toast notifications */
.toast-modern {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    z-index: 10000;
    font-weight: 500;
    min-width: 300px;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
}

.toast-modern.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-modern.success {
    border-left: 4px solid #10B981;
}

.toast-modern.error {
    border-left: 4px solid #ff4757;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-content i {
    font-size: 18px;
}

.toast-modern.success .toast-content i {
    color: #10B981;
}

.toast-modern.error .toast-content i {
    color: #ff4757;
}

.toast-modern.error {
    border-left: 4px solid #ff4757;
}

/* Estilos adicionales para compatibilidad */
.checkout-steps {
    display: flex;
    justify-content: center;
    margin-top: 15px;
    gap: 30px;
}

.steps-labels {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 10px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.step.active {
    background: white;
    color: #4facfe;
    transform: scale(1.1);
}

.step.completed {
    background: #10B981;
    color: white;
}

.form-help {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

.delivery-options, .payment-methods {
    margin: 20px 0;
}

.delivery-option, .payment-option {
    margin: 10px 0;
}

.delivery-option label, .payment-option label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.delivery-option input:checked + label,
.payment-option input:checked + label {
    border-color: #4facfe;
    background: #f0f8ff;
}

.option-info strong {
    display: block;
    margin-bottom: 5px;
}

.option-info span {
    font-size: 12px;
    color: #666;
}

.option-price {
    font-weight: 700;
    color: #4facfe;
}

.customer-summary {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
}

.summary-section {
    border-top: 1px solid #e1e5e9;
    padding-top: 15px;
    margin-top: 15px;
}

.btn-next {
    flex: 2;
    padding: 15px;
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.4);
}

/* Ocultar sistema anterior temporalmente */
.checkout-modal {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .cart-modal-content,
    .checkout-modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .form-row-modern {
        grid-template-columns: 1fr;
    }
    
    .checkout-steps {
        gap: 10px;
    }
    
    .step {
        width: 25px;
        height: 25px;
        font-size: 12px;
    }
    
    .steps-labels {
        gap: 10px;
        font-size: 10px;
    }
}
