/* Estilos para el carrito */
.empty-cart-message {
    padding: 2rem;
    text-align: center;
}

.empty-cart-message h4 {
    margin-bottom: 1rem;
    color: #666;
}

.empty-cart-message p {
    margin-bottom: 1.5rem;
    color: #888;
}

.alert {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
}

.alert-success {
    color: #0a3622;
    background-color: #d1e7dd;
    border-color: #a3cfbb;
}

.alert-danger {
    color: #58151c;
    background-color: #f8d7da;
    border-color: #f1aeb5;
}

.alert-dismissible .btn-close {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    padding: 1.25rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
}

.btn-close::before {
    content: '×';
    font-size: 1.5rem;
    line-height: 1;
}

.fade.show {
    opacity: 1;
}

/* Estados de loading para controles de cantidad */
.quantify-value button:disabled,
.quantify-value input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.quantify-value.loading {
    position: relative;
}

.quantify-value.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mejorar el diseño de las notificaciones */
.cart-notification {
    border-radius: 8px;
    font-weight: 500;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.cart-notification .btn-close {
    padding: 0.75rem;
}

/* Estilos para controles de cantidad del carrito */
.card-cart-contador {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    width: fit-content;
}

.card-cart-contador .menos,
.card-cart-contador .mas {
    background: #f8f9fa;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

.card-cart-contador .menos:hover,
.card-cart-contador .mas:hover {
    background: #e9ecef;
}

.card-cart-contador .count-input {
    border: none;
    text-align: center;
    width: 60px;
    padding: 8px 4px;
    outline: none;
}

/* Estilos para el producto en el carrito */
.product {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.product-media img {
    border-radius: 4px;
}

.product-info {
    flex: 1;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #333;
}

.product-sku {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.product-price {
    font-size: 0.875rem;
    font-weight: 600;
    color: #007bff;
}

/* Estilos para el formulario de checkout */
.wrapper-form-carrito {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.title-form {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #333;
}

.form-group {
    margin-bottom: 1.25rem;
}

.input-form {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-control-contacto {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control-contacto:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-control-contacto.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Estilos para opciones de pago y entrega */
.payment-options,
.delivery-options {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1rem;
}

.form-check {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    margin: 0;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.form-check:hover {
    background-color: #f8f9fa;
}

.form-check-input {
    margin-right: 0.75rem;
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
}

.form-check-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check-input:checked + .form-check-label {
    color: #007bff;
    font-weight: 600;
}

/* Estilos para el resumen del pedido */
.order-summary {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1.25rem;
}

.order-summary h5 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 0.5rem;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.95rem;
}

.summary-line.total-line {
    border-top: 1px solid #e9ecef;
    margin-top: 0.5rem;
    padding-top: 1rem;
    font-size: 1.1rem;
}

.btn-enviar {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-enviar:hover {
    background: #0056b3;
}

.btn-enviar:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Estilos para campos de delivery */
#delivery-fields {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1rem;
    margin-top: 1rem;
    background: #fff;
}

#delivery-fields h5 {
    color: #007bff;
    font-size: 1rem;
    font-weight: 600;
}

/* Estilos para el botón de eliminar */
.card-btn-remove {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

.card-btn-remove:hover {
    background: #c82333;
}

/* Estilos para modales */
.modal-content {
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
}

.modal-title {
    font-weight: 600;
    color: #333;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
}

.close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.7;
}

.close:hover {
    opacity: 1;
}

/* Estilos para el empty cart */
.empty-cart {
    padding: 3rem 1rem;
}

.empty-cart h3 {
    color: #666;
    margin-bottom: 1rem;
}

.empty-cart p {
    color: #888;
    margin-bottom: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .product {
        flex-direction: column;
        text-align: center;
    }
    
    .product-media {
        margin-bottom: 1rem;
    }
    
    .wrapper-form-carrito {
        padding: 1.5rem;
    }
    
    .card-cart-contador {
        margin: 0 auto;
    }
}
