/* ===================================
   MODAL DEL CARRITO
   =================================== */

/* Badge del carrito */
#cartLink {
    position: relative;
}

#cartLink .icon-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#cartLink .icon-badge.show {
    display: flex !important;
}

.cart-modal,
.checkout-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
}

.cart-modal.active,
.checkout-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-modal-overlay,
.checkout-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.cart-modal-content,
.checkout-modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

.checkout-modal-content {
    max-width: 600px;
}

.cart-modal-header,
.checkout-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #f0f0f0;
}

.cart-modal-header h3,
.checkout-modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-modal-body,
.checkout-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px 0;
}

/* Items del carrito */
.cart-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    border-bottom: 1px solid #f0f0f0;
}

.cart-item img {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    object-fit: cover;
}

.cart-item-details {
    flex: 1;
}

.cart-item-details h4 {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 0 0 5px 0;
}

.cart-item-price {
    font-size: 14px;
    color: #FF8C42;
    font-weight: 600;
    margin: 0;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8f9fa;
    padding: 5px 10px;
    border-radius: 20px;
}

.btn-quantity {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: white;
    color: #666;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-quantity:hover {
    background: #FF8C42;
    color: white;
}

.quantity {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    min-width: 20px;
    text-align: center;
}

.btn-remove {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #fee;
    color: #e74c3c;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-remove:hover {
    background: #e74c3c;
    color: white;
}

/* Empty cart */
.empty-cart {
    text-align: center;
    padding: 60px 20px;
}

.empty-cart i {
    font-size: 64px;
    color: #ddd;
    margin-bottom: 20px;
}

.empty-cart h3 {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.empty-cart p {
    font-size: 14px;
    color: #666;
}

/* Footer del carrito */
.cart-modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #f0f0f0;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.total-amount {
    color: #FF8C42;
    font-size: 24px;
}

.btn-checkout {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #FF8C42 0%, #E74C3C 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 140, 66, 0.3);
}

/* ===================================
   FORMULARIO DE CHECKOUT
   =================================== */

.checkout-form {
    padding: 0 25px 20px;
}

.form-section {
    margin-bottom: 25px;
}

.form-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-section h4 i {
    color: #FF8C42;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #FF8C42;
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Métodos de pago */
.payment-methods {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.payment-option {
    position: relative;
    cursor: pointer;
}

.payment-option input {
    position: absolute;
    opacity: 0;
}

.payment-option span {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
}

.payment-option span i {
    font-size: 24px;
}

.payment-option input:checked + span {
    border-color: #FF8C42;
    background: #fff8f0;
    color: #FF8C42;
}

/* Resumen del checkout */
.checkout-summary {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
    color: #666;
}

.summary-row.total {
    border-top: 2px solid #e0e0e0;
    margin-top: 8px;
    padding-top: 12px;
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.summary-row.total span:last-child {
    color: #FF8C42;
    font-size: 24px;
}

.btn-submit-order {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #FF8C42 0%, #E74C3C 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-submit-order:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 140, 66, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .cart-modal-content,
    .checkout-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .payment-methods {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}
