/* Estilos para los botones del carrito */
.scfv-btn {
    background-color: #000000 !important;
    color: #ffffff !important;
    border-radius: 12px !important;
    margin-right: 10px !important;
    padding: 10px 20px !important; /* Aumentado el padding horizontal */
    border: none !important;
    text-decoration: none !important;
    display: inline-block !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    font-weight: 600;
    min-width: 150px !important; /* Ancho mínimo aumentado para todos los botones */
    text-align: center !important;
}
.scfv-btn:hover {
    background-color: #333333 !important;
}

/* Responsive y container */
.scfv-botones-carrito-container {
    margin: 20px 0 !important;
    width: 100% !important;
}
.scfv-botones-carrito-container .d-flex {
    display: flex !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
}
@media (max-width: 768px) {
    .scfv-botones-carrito-container.d-flex {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 16px !important;
        width: 100% !important;
        max-width: 400px !important; /* Ancho máximo para el contenedor en responsive */
        margin: 0 auto !important; /* Centrar el contenedor */
    }
    .scfv-btn {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        margin: 0 !important;
        text-align: center !important;
        font-size: 1.1em !important;
        padding: 16px 24px !important; /* Aumentado el padding horizontal */
        border-radius: 12px !important;
        box-sizing: border-box !important;
        min-height: 56px !important; /* Altura mínima para todos los botones */
    }
}

/* Mejoras para móviles pequeños */
@media (max-width: 480px) {
    .scfv-modal-content {
        width: 98% !important;
        min-width: unset !important;
        max-width: 100vw !important;
        margin: 2% auto !important;
        padding: 6px !important;
    }
    .scfv-carrito-tabla th, .scfv-carrito-tabla td {
        font-size: 12px !important;
        padding: 4px 1px !important;
        word-break: break-word !important;
    }
    .scfv-thumb {
        width: 26px !important;
        height: 26px !important;
    }
    .scfv-btn {
        font-size: 1em !important;
        padding: 14px 20px !important; /* Aumentado el padding horizontal */
        min-height: 52px !important; /* Altura mínima para todos los botones */
    }
    .scfv-botones-carrito-container.d-flex {
        max-width: 320px !important; /* Ancho máximo para el contenedor en pantallas pequeñas */
    }
    .scfv-close {
        font-size: 2em !important;
    }
    /* Hacer tabla scrolleable horizontalmente si es necesario */
    .scfv-carrito-tabla {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 375px) {
    .scfv-modal-content {
        width: 100vw !important;
        margin: 0 !important;
        border-radius: 0 !important;
        padding: 2px !important;
    }
    .scfv-btn {
        font-size: 0.95em !important;
        padding: 12px 16px !important; /* Aumentado el padding horizontal */
        min-height: 48px !important; /* Altura mínima para todos los botones */
    }
    .scfv-carrito-tabla th, .scfv-carrito-tabla td {
        font-size: 11px !important;
        padding: 2px 0 !important;
    }
    .scfv-thumb {
        width: 20px !important;
        height: 20px !important;
    }
}

/* Mejoras para móviles pequeños */
@media (max-width: 480px) {
    .scfv-modal-content {
        width: 98% !important;
        min-width: unset !important;
        max-width: 100vw !important;
        margin: 2% auto !important;
        padding: 10px !important;
    }
    .scfv-carrito-tabla th, .scfv-carrito-tabla td {
        font-size: 12px !important;
        padding: 4px 1px !important;
    }
    .scfv-thumb {
        width: 26px !important;
        height: 26px !important;
    }
    .scfv-btn {
        font-size: 1em !important;
        padding: 12px 0 !important;
    }
    .scfv-close {
        font-size: 2em !important;
    }
}

@media (max-width: 375px) {
    .scfv-modal-content {
        width: 100vw !important;
        margin: 0 !important;
        border-radius: 0 !important;
        padding: 4px !important;
    }
    .scfv-btn {
        font-size: 0.95em !important;
        padding: 10px 16px !important; /* Aumentado el padding horizontal */
        min-height: 46px !important; /* Altura mínima para todos los botones */
    }
    .scfv-carrito-tabla th, .scfv-carrito-tabla td {
        font-size: 11px !important;
        padding: 2px 0 !important;
    }
    .scfv-thumb {
        width: 20px !important;
        height: 20px !important;
    }
}
#scfv-toast .scfv-toast-message {
    background: #000;
    color: #fff;
    border-radius: 12px;
    padding: 16px 24px;
    font-size: 16px;
}

/* Miniatura del producto en el modal */
.scfv-thumb {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 8px;
    background: #f3f3f3;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* Tabla de productos en el modal */
.scfv-carrito-tabla {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}
.scfv-carrito-tabla th, .scfv-carrito-tabla td {
    padding: 8px 6px;
    text-align: center;
    border-bottom: 1px solid #eee;
}
.scfv-carrito-tabla th {
    background: #f9f9f9;
    font-weight: 700;
}
/* Estilos para el modal de Bootstrap 5 */
#scfv-cart-modal {
  z-index: 1060 !important; /* Asegura que esté por encima del backdrop */
}

#scfv-cart-modal .modal-dialog {
  margin-top: 2rem;
  margin-bottom: 2rem;
  max-width: 800px;
}

#scfv-cart-modal .modal-content {
  border-radius: 12px;
  border: none;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

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

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

/* Estilos para las tarjetas de productos */
.scfv-cart-item-card {
  background: #ffffff;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  border: 1px solid #f0f0f0;
}

.scfv-cart-item-card .scfv-thumb-wrapper img {
  width: 80px !important;
  height: auto !important;
  margin-bottom: 8px;
  border-radius: 6px;
}

.scfv-cart-item-card .scfv-producto-nombre {
  font-size: 1.1em;
  font-weight: 600;
  text-align: center;
  margin-bottom: 5px;
  color: #333;
}

.scfv-cart-item-card .scfv-cantidad-precio {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-bottom: 5px;
  width: 100%;
}

.scfv-cart-item-card .scfv-cantidad-precio input {
  width: 70px !important;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 5px;
}

.scfv-cart-item-card .scfv-producto-precio {
  font-weight: 500;
  color: #555;
}

.scfv-cart-item-card .scfv-producto-subtotal {
  font-size: 1.1em;
  color: #0099de;
  font-weight: 600;
}

/* Botón de actualizar */
#scfv-actualizar-cantidades {
  padding: 10px 25px;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.3s ease;
}

#scfv-actualizar-cantidades:hover {
  background-color: #333;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Responsive ajustes */
@media (max-width: 768px) {
  #scfv-cart-modal .modal-dialog {
    margin: 1rem auto;
    max-width: 95%;
  }
  
  #scfv-cart-modal .modal-content {
    border-radius: 12px;
  }
  
  #scfv-cart-modal .modal-body {
    padding: 1rem;
  }
  
  #scfv-actualizar-cantidades {
    width: 100%;
    max-width: 100%;
  }
  
  .scfv-modal-content {
    padding: 8px !important;
    gap: 10px;
    width: 99vw !important;
    max-width: 100vw !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }
  
  .scfv-carrito-tabla {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .scfv-carrito-tabla th, .scfv-carrito-tabla td {
    min-width: 90px;
    font-size: 13px;
    padding: 6px 2px;
  }
  
  .scfv-thumb {
    width: 32px;
    height: 32px;
  }
  
  #scfv-actualizar-cantidades {
    margin: 0 auto;
    margin-top: 12px;
    width: 100%;
    max-width: 320px;
    display: block;
  }
}

/* Estilos para el botón de actualizar carrito de WooCommerce */
.woocommerce button.button {
    background-color: #000000 !important;
    color: #ffffff !important;
    border-radius: 12px !important;
    padding: 10px 20px !important; /* Aumentado el padding horizontal */
    min-height: 46px !important; /* Altura mínima para el botón */
}

.woocommerce button.button:hover {
    background-color: #333333 !important;
    color: #ffffff !important;
}

/* Estilos para el modal */
.scfv-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
}

.scfv-modal-content {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    background-color: #ffffff;
    margin: 5% auto;
    padding: 20px;
    border-radius: 12px;
    width: 80%;
    max-width: 800px;
    position: relative;
    box-sizing: border-box;
}

.scfv-close {
    color: #aaaaaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.scfv-close:hover,
.scfv-close:focus {
    color: #000000;
    text-decoration: none;
}

.scfv-cart-items {
    margin-top: 20px;
}

/* Estilos para los controles de cantidad */
.scfv-cart-quantity {
    width: 50px;
    padding: 5px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 0 5px;
    display: inline-block;
}

.scfv-quantity-btn {
    display: inline-block;
    width: 30px;
    height: 30px;
    background-color: #000000;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    vertical-align: middle;
}

.scfv-quantity-btn:hover {
    background-color: #333333;
}

.quantity {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Estilos para la tabla de productos */
.scfv-cart-items table {
    width: 100%;
    border-collapse: collapse;
}

.scfv-cart-items th,
.scfv-cart-items td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

.scfv-cart-items th {
    background-color: #f5f5f5;
}

.scfv-cart-items .product-thumbnail img {
    width: 60px;
    height: auto;
}

.scfv-update-cart {
    margin-top: 15px !important;
    float: right;
}

/* Estilos para el toast de notificaciones */
.scfv-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: none;
    max-width: 300px;
}

.scfv-toast-content {
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    color: #ffffff;
    font-weight: bold;
}

.scfv-toast.success .scfv-toast-content {
    background-color: #4CAF50;
}

.scfv-toast.error .scfv-toast-content {
    background-color: #F44336;
}

.scfv-toast.info .scfv-toast-content {
    background-color: #2196F3;
}

/* Asegurar que SweetAlert2 aparezca por encima del modal */
.swal2-container {
    z-index: 20000 !important;
}