/* ==========================================================================
   Importación de Fuentes
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&display=swap');

/* ==========================================================================
   Variables CSS (Custom Properties)
   Define colores, gradientes, sombras, transiciones y fuentes para reutilizar.
   ========================================================================== */
:root {
    --gradient-primary: linear-gradient(135deg, #2944b8 0%, #6423a5 100%);
    --gradient-secondary: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    --text-color: #ffffff; /* Color de texto claro */
    --text-dark: #2d3748;   /* Color de texto oscuro */
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.15); /* Sombra estándar */
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); /* Transición suave */
    --font-principal: 'Quicksand', sans-serif; /* Fuente principal */

    /* Colores adicionales para estados de stock y botones */
    --color-success: #28a745; /* Verde para éxito/stock */
    --color-warning: #ffc107; /* Amarillo para advertencia/últimas unidades */
    --color-danger: #dc3545;  /* Rojo para error/agotado */
    --color-info: #17a2b8;    /* Azul claro para información */
    --color-primary-blue: #007bff; /* Azul primario para botones/enlaces */
    --color-dark-blue: #0056b3; /* Azul oscuro para hover */
}

/* ==========================================================================
   Estilos Base y Reset
   Aplica un reseteo básico de márgenes/rellenos y define la fuente global.
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* Incluye padding y borde en el tamaño total */
    font-family: var(--font-principal); /* Aplica la fuente principal */
}

body {
    background-color: #f8f9fa; /* Fondo ligero para el cuerpo */
    line-height: 1.6; /* Mejora la legibilidad del texto */
    color: #333; /* Color de texto por defecto */
}

/* ==========================================================================
   Barra de Navegación (Navbar)
   Estilos para la cabecera principal y la navegación.
   ========================================================================== */
.navbar {
    background: white; /* Fondo blanco para la barra de navegación */
    height: 85px; /* Altura inicial */
    display: flex;
    justify-content: center;
    align-items: center;
    position: sticky; /* Se mantiene en la parte superior al hacer scroll */
    top: 0;
    z-index: 1000; /* Asegura que esté por encima de otros elementos */
    box-shadow: var(--shadow); /* Sombra definida en variables */
    transition: var(--transition); /* Transición para cambios de altura/sombra */
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%; /* Ocupa toda la altura de la navbar */
    width: 100%;
    max-width: 1400px; /* Ancho máximo para centrar el contenido */
    padding: 0 2rem; /* Relleno lateral */
}

.navbar-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1976d2; /* Color principal del logo */
    letter-spacing: -0.5px;
}

.logo-highlight {
    background: var(--gradient-secondary); /* Gradiente para resaltar texto */
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent; /* Hace que el texto use el gradiente */
    margin-left: 4px;
}

.logo-img {
    width: 40px;
    height: 40px;
    object-fit: contain; /* Ajusta la imagen sin recortarla */
    margin-right: 10px;
}

.navbar-menu {
    display: flex;
    list-style: none; /* Elimina los puntos de la lista */
    gap: 2rem; /* Espacio entre los elementos del menú */
}

.navbar-item {
    position: relative; /* Para el indicador activo */
}

.navbar-link {
    color: #1976d2;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    transition: var(--transition);
    padding: 0.5rem 0;
    position: relative;
}

.navbar-link:hover {
    color: #0d47a1; /* Color al pasar el ratón */
    text-shadow: none;
}

.navbar-link.active {
    color: #0d47a1; /* Color del enlace activo */
}

.navbar-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: #1976d2; /* Barra debajo del enlace activo */
    transform: scaleX(1);
    transition: var(--transition);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem; /* Espacio entre los elementos de acciones (búsqueda, usuario, etc.) */
}

/* Estilos para el campo de búsqueda */
.navbar-search {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.2); /* Fondo semi-transparente */
    border-radius: 30px;
    padding: 0.3rem 0.3rem 0.3rem 1rem;
    backdrop-filter: blur(5px); /* Efecto de desenfoque */
    transition: var(--transition);
}

.navbar-search:focus-within {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.search-input {
    background: transparent;
    border: 1.5px solid royalblue; /* Borde inicial */
    outline: none; /* Elimina el contorno al enfocar */
    color: black;
    font-size: 0.9rem;
    width: 150px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    box-shadow: 0 0 0 2px rgba(65, 105, 225, 0.2);
}

.search-input:focus {
    border-color: #003cff; /* Color del borde al enfocar */
    box-shadow: 0 0 0 3px rgba(0, 60, 255, 0.25); /* Sombra al enfocar */
}

.search-input::placeholder {
    color: rgba(0, 0, 0, 0.5); /* Color de placeholder más visible */
}

.search-btn {
    background: white;
    color: #333;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.navbar-button {
    display: flex;
    background: transparent;
    color: #1976d2;
    border: 2px solid #1976d2;
    border-radius: 30px;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    align-items: center;
    gap: 5px;
}

.navbar-button:hover {
    background: #1976d2;
    color: white;
}

/* Icono de hamburguesa para menú móvil */
.navbar-toggle {
    display: none; /* Oculto por defecto, visible en móvil */
    cursor: pointer;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
}

.bar {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #1976d2;
    transition: var(--transition);
}

/* Estilos para usuario logueado en la navbar */
.navbar-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.navbar-user-info .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%; /* Circular para avatares */
    object-fit: cover;
    border: 1px solid #ddd; /* Borde suave para la imagen de perfil */
}

.navbar-user-info .user-name {
    font-weight: 500;
    font-size: 0.95rem;
    color: black;
}

/* ==========================================================================
   Barra Superior de Contacto (Top Bar)
   ========================================================================== */
.top-bar {
    background: linear-gradient(to right, #f1f1f1, #e4e4e4);
    font-size: 0.85rem; /* Un poco más pequeño para ser sutil */
    text-align: center;
    padding: 0.4rem; /* Relleno ajustado */
    color: #555; /* Color de texto más suave */
}

.top-bar a {
    color: #00aab3; /* Color específico para enlaces de contacto */
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.top-bar a:hover {
    color: #007c83; /* Oscurece al pasar el ratón */
}

.top-bar i {
    color: #25d366; /* Color de WhatsApp */
    margin-right: 0.2rem;
}

/* ==========================================================================
   Sección Hero (Principal)
   ========================================================================== */
.hero {
    background: url('https://images.unsplash.com/photo-1588776814546-ec7e8cbf3bc0?auto=format&fit=crop&w=1400&q=80') no-repeat center center/cover;
    color: white;
    padding: 100px 20px;
    text-align: center;
    position: relative;
    display: flex; /* Para centrar contenido verticalmente */
    align-items: center;
    min-height: 500px; /* Altura mínima para la sección hero */
}

.hero::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); /* Overlay oscuro para el texto */
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: auto;
}

.hero h1 {
    font-size: 3rem; /* Tamaño de fuente más grande */
    margin-bottom: 1.2rem;
    line-height: 1.2;
}

.hero p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.9; /* Ligeramente más transparente */
}

.hero-btn {
    background: white;
    color: #6423a5;
    font-weight: bold;
    padding: 0.8rem 1.8rem; /* Relleno ajustado */
    border-radius: 30px;
    text-decoration: none;
    transition: var(--transition);
    display: inline-block; /* Para aplicar padding correctamente */
}

.hero-btn:hover {
    background: #eee;
    transform: translateY(-3px); /* Pequeño efecto al pasar el ratón */
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* ==========================================================================
   Sección de Servicios
   ========================================================================== */
.services {
    padding: 80px 20px;
    text-align: center;
    background: #f1f4f9;
}

.services h2 {
    font-size: 2.2rem; /* Tamaño de fuente ajustado */
    margin-bottom: 2.5rem;
    color: var(--text-dark);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: auto;
}

.service-card {
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card i {
    font-size: 2.5rem; /* Iconos un poco más grandes */
    color: #6423a5;
    margin-bottom: 1rem;
}

.service-card h3 {
    font-size: 1.3rem; /* Títulos un poco más grandes */
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.service-card p {
    color: #555;
    font-size: 0.95rem;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2); /* Sombra más pronunciada al hover */
}

/* ==========================================================================
   Sección de Testimonios
   ========================================================================== */
.testimonios {
    background: #fff;
    padding: 80px 20px;
    text-align: center;
}

.testimonios h2 {
    font-size: 2.2rem;
    color: var(--text-dark);
    margin-bottom: 2.5rem;
}

.testimonios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: auto;
}

.testimonio {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    font-style: italic;
    display: flex; /* Permite alinear el icono de comillas */
    flex-direction: column;
    justify-content: space-between;
    height: 100%; /* Asegura que todas las tarjetas tengan la misma altura */
}

.testimonio p {
    font-size: 1rem;
    color: #444;
    margin-bottom: 1rem;
}

.testimonio h4 {
    margin-top: auto; /* Empuja el nombre al final */
    color: #6423a5;
    font-style: normal;
    font-weight: 600;
}

/* Opcional: Icono de comillas en testimonios */
.testimonio::before {
    content: "\201C"; /* Comilla doble izquierda */
    font-size: 3rem;
    color: #ccc;
    display: block;
    margin-bottom: 10px;
    line-height: 1;
}
.testimonio::after {
    content: "\201D"; /* Comilla doble derecha */
    font-size: 3rem;
    color: #ccc;
    display: block;
    margin-top: 10px;
    text-align: right;
    line-height: 1;
}


/* ==========================================================================
   Sección de Productos Destacados
   ========================================================================== */
.destacados {
    padding: 80px 20px;
    background: #f1f4f9;
    text-align: center;
}

.destacados h2 {
    font-size: 2.2rem;
    color: var(--text-dark);
    margin-bottom: 2.5rem;
}

.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); /* Min-width ajustado */
    gap: 2rem;
    max-width: 1200px;
    margin: auto;
}

.producto {
    background: white;
    padding: 1rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex; /* Para un mejor control del contenido */
    flex-direction: column;
    justify-content: space-between;
}

.producto img {
    width: 100%;
    height: 150px; /* Altura fija para uniformidad */
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 1rem;
    background-color: #f9f9f9; /* Fondo claro para imágenes */
}

.producto h3 {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.producto p {
    color: #555;
    font-size: 0.9rem;
}

.producto:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   Sección de Contacto
   ========================================================================== */
.contacto {
    padding: 80px 20px;
    background: white;
    text-align: center;
}

.contacto h2 {
    color: var(--text-dark);
    font-size: 2.2rem;
    margin-bottom: 2.5rem;
}

.contacto-form {
    max-width: 600px;
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 20px; /* Relleno para que no esté pegado a los bordes en móviles */
    border: 1px solid #eee; /* Borde suave */
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.contacto-form input,
.contacto-form textarea {
    padding: 0.8rem;
    border-radius: 10px;
    border: 1px solid #ccc;
    font-size: 0.95rem;
    resize: vertical; /* Permite redimensionar solo verticalmente */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.contacto-form input:focus,
.contacto-form textarea:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
    outline: none;
}

.contacto-form button {
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 0.8rem 1.5rem; /* Ajustado */
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
}

.contacto-form button:hover {
    background: var(--gradient-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    background: #111;
    color: #eee;
    padding: 2.5rem 1rem;
    text-align: center;
    font-size: 0.95rem;
}

.footer-content {
    max-width: 900px;
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.footer-content p {
    margin: 0;
    line-height: 1.5;
}

/* ==========================================================================
   Catálogo de Productos
   Estilos específicos para la página de catálogo, incluyendo filtros.
   ========================================================================== */
.catalogo {
    padding: 60px 20px; /* Relleno ajustado */
    background: #f8f9fa;
    text-align: center;
}

.catalogo h2 {
    font-size: 2.2rem;
    color: var(--text-dark);
    margin-bottom: 2rem;
}

.catalogo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Min-width ligeramente mayor */
    gap: 2rem;
    max-width: 1200px;
    margin: 2rem auto; /* Más espacio vertical */
}

.catalogo-item {
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative; /* Para la marca de agua de agotado */
}

.catalogo-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.catalogo-item img {
    width: 100%;
    height: 200px;
    object-fit: contain; /* Asegura que la imagen completa sea visible */
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    background-color: #f9f9f9;
    padding: 10px;
    box-sizing: border-box;
    pointer-events: none; /* Evita clics en la imagen cuando está agotado */
}

.catalogo-info {
    padding: 1rem;
    text-align: left;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Permite que el contenido se expanda */
}

.catalogo-info h3 {
    font-size: 1.2rem; /* Título un poco más grande */
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    min-height: 2.4rem; /* Evita que el título se mueva si es de una línea */
}

.catalogo-info p {
    font-size: 0.95rem; /* Tamaño de texto ajustado */
    color: #555;
    margin-bottom: 0.5rem;
}

.catalogo-precio {
    font-weight: bold;
    color: var(--color-success); /* Verde para el precio */
    font-size: 1.1rem; /* Precio un poco más grande */
    margin-top: auto; /* Empuja el precio hacia abajo si hay espacio */
}

/* Estilos para el estado del stock */
.estado-verde {
    color: var(--color-success); /* Verde */
    font-weight: bold;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.estado-amarillo {
    color: var(--color-warning); /* Naranja */
    font-weight: bold;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.estado-rojo {
    color: var(--color-danger); /* Rojo */
    font-weight: bold;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Estilos para productos agotados */
.catalogo-item.agotado {
    position: relative;
    opacity: 0.6; /* Menor opacidad para indicar "agotado" */
    filter: grayscale(100%); /* Desaturado */
    cursor: not-allowed; /* Cursor de "no permitido" */
}

.catalogo-item.agotado .marca-agua {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.8);
    color: var(--color-danger); /* Rojo fuerte */
    font-size: 1.8rem;
    font-weight: bold;
    padding: 0.4rem 1rem;
    border-radius: 8px;
    z-index: 10;
    pointer-events: none; /* Evita que la marca de agua bloquee clics */
    text-align: center;
    text-transform: uppercase;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    white-space: nowrap; /* Evita salto de línea */
}

/* Filtros del Catálogo */
.filtros-container {
    background: #fff;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
    margin: 1rem auto;
    max-width: 1000px;
    display: flex; /* Para organizar el título y el formulario */
    flex-direction: column;
}

.filtros-titulo {
    font-size: 1.6rem; /* Título de filtros más prominente */
    margin-bottom: 1rem;
    color: var(--text-dark);
    text-align: center;
}

.filtros-formulario {
    display: flex;
    flex-wrap: wrap; /* Permite que los elementos se envuelvan */
    gap: 1.2rem; /* Espacio entre los grupos de filtros */
    justify-content: center; /* Centra los grupos de filtros */
}

.filtro-grupo {
    flex: 1 1 220px; /* Flexibilidad y ancho base */
    display: flex;
    flex-direction: column;
}

.filtro-grupo label {
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: 600; /* Más énfasis en las etiquetas */
    color: #444;
}

.filtro-grupo input[type="text"],
.filtro-grupo select {
    padding: 10px;
    border: 1px solid #ddd; /* Borde sólido */
    border-radius: 6px;
    background: #fdfdfd;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05); /* Sombra interna suave */
}

.filtro-grupo input[type="range"] {
    -webkit-appearance: none; /* Eliminar estilo predeterminado */
    width: 100%;
    height: 8px;
    background: #ddd;
    border-radius: 5px;
    outline: none;
    opacity: 0.7;
    transition: opacity .2s;
}

.filtro-grupo input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-primary-blue);
    cursor: pointer;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.filtro-grupo input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-primary-blue);
    cursor: pointer;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.filtro-grupo input:focus,
.filtro-grupo select:focus {
    border-color: var(--color-primary-blue);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.precio-valor {
    margin-top: 5px;
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}


.filtro-alfabetico {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem; /* Espacio ajustado */
    justify-content: center; /* Centrar las letras */
    padding: 0 10px; /* Relleno para que no se pegue a los bordes */
}

.filtro-alfabetico span {
    background-color: #e2e6ea;
    padding: 6px 12px; /* Relleno ajustado */
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    user-select: none; /* Evita la selección de texto */
    min-width: 35px; /* Ancho mínimo para letras */
    text-align: center;
}

.filtro-alfabetico span:hover,
.filtro-alfabetico span.active {
    background-color: var(--color-primary-blue);
    color: white;
    transform: translateY(-2px); /* Pequeño efecto al pasar el ratón */
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.2);
}

/* Añadir espacio vertical entre cantidad-control y botones */
.botones-producto {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 0 12px;
}

/* Se asegura que haya separación vertical entre cantidad y los botones */
.botones-producto .cantidad-control {
    margin-bottom: 8px;
    flex-shrink: 0;
}

.cantidad-control {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ccc;
    border-radius: 5px;
    overflow: hidden;
    width: auto;
    margin: 0 auto;
}

.cantidad-control .input-cantidad {
    width: 40px;
    height: 100%;
    text-align: center;
    border: none;
    outline: none;
    font-size: 1rem;
    line-height: 1;
    padding: 6px 0;
    -moz-appearance: textfield;
}

.cantidad-control button {
    background-color: #f1f1f1;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1rem;
    color: #555;
    transition: background-color 0.2s ease;
}

.cantidad-control button:hover {
    background-color: #e0e0e0;
}

.cantidad-control .input-cantidad::-webkit-outer-spin-button,
.cantidad-control .input-cantidad::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Botón Agregar al Carrito */
.btn-agregar-carrito {
    background-color: var(--color-primary-blue);
    color: white;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    min-width: 150px; /* Evita que se hagan muy pequeños en pantallas chicas */
    transition: background 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.btn-agregar-carrito i {
    margin-right: 8px;
}
.btn-agregar-carrito:hover {
    background-color: var(--color-dark-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.btn-agregar-carrito:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.8;
    transform: none;
    box-shadow: none;
}

/* Botón Ver Detalle */
.btn-detalle {
    background-color: var(--color-success);
    color: white;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    min-width: 150px;
    transition: background 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.btn-detalle i {
    margin-right: 8px;
}
.btn-detalle:hover {
    background-color: #1e7e34;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   Estilos del Modal (Detalle de Producto)
   ========================================================================== */
.modal-detalle {
    display: none; /* Oculto por defecto */
    position: fixed; /* Fijo en la pantalla */
    z-index: 999; /* Por encima de todo */
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.7); /* Fondo oscuro semi-transparente */
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px); /* Efecto de desenfoque de fondo */
}

.modal-detalle .modal-contenido {
    text-align: justify;
    background-color: #fff;
    padding: 25px; /* Relleno ajustado */
    border-radius: 12px;
    border: 1px solid #ddd;
    max-width: 600px;
    width: 90%;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3); /* Sombra más pronunciada */
    animation: fadeInScale 0.3s ease-out; /* Animación de entrada */
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-detalle .modal-contenido img {
    width: 100%;
    max-height: 250px; /* Altura máxima para la imagen */
    object-fit: contain;
    margin-bottom: 20px; /* Más espacio */
    border-radius: 8px;
    background-color: #f9f9f9;
}

.modal-detalle .modal-contenido h2 {
    font-size: 1.8rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
    text-align: center;
}

.modal-detalle .modal-contenido p {
    font-size: 1rem;
    line-height: 1.7;
    color: #444;
    margin-bottom: 1rem;
}

.modal-detalle .cerrar-modal {
    position: absolute;
    top: 15px; /* Posición ajustada */
    right: 20px;
    font-size: 28px; /* Tamaño del icono de cerrar */
    cursor: pointer;
    color: #555;
    transition: color 0.3s ease, transform 0.3s ease;
}

.modal-detalle .cerrar-modal:hover {
    color: #333;
    transform: rotate(90deg); /* Pequeña animación */
}

/* ==========================================================================
   Carrito de Compras (Sección en la página principal)
   ========================================================================== */
.carrito-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 1.5rem; /* Relleno ajustado */
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1); /* Sombra más suave */
}
.carrito-container h2 {
    text-align: center;
    margin-bottom: 1.5rem; /* Más espacio */
    font-size: 2rem;
    color: var(--text-dark);
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem; /* Más espacio */
}
table th, table td {
    border: 1px solid #e0e0e0; /* Bordes de tabla más suaves */
    padding: 1rem; /* Relleno ajustado */
    text-align: center;
    vertical-align: middle; /* Alineación vertical */
}
table th {
    background-color: #f0f0f0; /* Fondo de encabezado de tabla */
    font-weight: 600;
    color: #333;
}
table tr:nth-child(even) {
    background-color: #f9f9f9; /* Rayado de filas para legibilidad */
}
table tr:hover {
    background-color: #f2f2f2; /* Efecto hover en filas */
}

.total {
    text-align: right;
    font-weight: bold;
    font-size: 1.4rem; /* Tamaño de fuente más grande para el total */
    color: var(--text-dark);
    padding-top: 1rem; /* Espacio superior */
    border-top: 2px solid #eee; /* Línea separadora */
}
.btn-pagar {
    display: block;
    margin: 1.5rem auto 0; /* Más espacio */
    padding: 0.8rem 2rem; /* Relleno más generoso */
    background-color: var(--color-primary-blue);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem; /* Tamaño de fuente ajustado */
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.2);
}
.btn-pagar:hover {
    background-color: var(--color-dark-blue);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 123, 255, 0.3);
}

.btn-eliminar {
    background-color: var(--color-danger); /* Rojo de peligro */
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px; /* Relleno ajustado */
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
}
.btn-eliminar:hover {
    background-color: #c82333; /* Rojo más oscuro al hover */
    transform: scale(1.05);
}

/* Icono de Carrito en la Navbar */
.carrito-icon {
    position: relative;
    display: inline-block;
}

.cart-badge {
    position: absolute;
    top: -8px; /* Posición ajustada */
    right: -8px;
    background-color: var(--color-danger); /* Rojo para la insignia */
    color: white;
    font-size: 11px; /* Tamaño de fuente ajustado */
    font-weight: bold;
    padding: 3px 6px; /* Relleno ajustado */
    border-radius: 50%; /* Completamente redondo */
    line-height: 1;
    min-width: 20px; /* Asegura un tamaño mínimo */
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* ==========================================================================
   Botón "Subir" (Scroll to Top)
   ========================================================================== */
#btnSubir {
    display: none; /* Oculto por defecto */
    position: fixed;
    bottom: 30px;
    right: 20px;
    z-index: 999;
    font-size: 22px; /* Tamaño del icono */
    background-color: var(--color-primary-blue);
    color: white;
    border: none;
    padding: 15px 18px; /* Relleno generoso para un botón circular */
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    transition: background-color 0.3s, opacity 0.3s, transform 0.3s;
}

#btnSubir:hover {
    background-color: var(--color-dark-blue);
    transform: translateY(-3px); /* Pequeño efecto al pasar el ratón */
}

/* Añade estos estilos si no los tienes en pagina.css */
.pagination {
	text-align: center;
	margin-top: 20px;
	margin-bottom: 40px;
}
.pagination a, .pagination span {
	display: inline-block;
	padding: 8px 12px;
	margin: 0 4px;
	border: 1px solid #ddd;
	text-decoration: none;
	color: #333;
	border-radius: 4px;
	transition: background-color 0.3s ease;
}
.pagination a:hover {
	background-color: #f0f0f0;
}
.pagination .active {
	background-color: #007bff;
	color: white;
	border-color: #007bff;
	font-weight: bold;
}
.pagination .disabled {
	color: #ccc;
	pointer-events: none; /* Deshabilita clics */
	cursor: not-allowed;
	background-color: #f9f9f9;
}

/* ==========================================================================
   Media Queries (Diseño Responsive)
   Ajusta el diseño para diferentes tamaños de pantalla.
   ========================================================================== */

/* Pantallas medianas (tabletas y laptops pequeñas) */
@media screen and (max-width: 1200px) {
	.botones-producto {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 0 15px;
    }
    .cantidad-control {
        margin-right: 0;
        justify-content: center;
        margin-bottom: 10px;
    }
    .btn-agregar-carrito,
    .btn-detalle {
        width: 100%;
    }
    .navbar-container {
        padding: 0 1.5rem;
    }
    .catalogo-grid, .productos-grid, .services-grid, .testimonios-grid {
        gap: 1.5rem; /* Reduce el espacio entre elementos */
    }
}

/* Pantallas más pequeñas (tabletas en vertical, móviles grandes) */
@media screen and (max-width: 992px) {
	.navbar-search {
        display: none !important; /* Oculta la barra de búsqueda en móvil */
    }
    .navbar-menu {
        gap: 1.5rem;
    }
    .navbar-actions {
        gap: 1rem;
    }
    .hero h1 {
        font-size: 2.5rem;
    }
    .services h2, .testimonios h2, .destacados h2, .contacto h2, .catalogo h2 {
        font-size: 2rem;
    }
    .filtros-formulario {
        gap: 1rem;
    }
    .filtro-grupo {
        flex: 1 1 180px; /* Reduce un poco el ancho base */
    }
    .catalogo-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Más columnas en pantallas pequeñas */
    }
    .carrito-container {
        padding: 1rem;
    }
    table th, table td {
        padding: 0.6rem; /* Reduce el padding de las celdas de la tabla */
        font-size: 0.9rem;
    }
    .total {
        font-size: 1.2rem;
    }
}

/* Pantallas pequeñas (teléfonos móviles) */
@media screen and (max-width: 768px) {
    .navbar-logo span {
        /* Opcional: Ocultar el texto del logo y dejar solo la imagen */
        /* display: none; */
        display: inline; /* Mantener si el logo es lo suficientemente corto */
    }
    .navbar {
        height: 70px; /* Altura ajustada para móvil */
    }
    .navbar-menu {
        position: fixed;
        top: 70px; /* Ajuste a la nueva altura de la navbar */
        left: -100%; /* Oculto a la izquierda */
        width: 100%;
        height: calc(100vh - 70px); /* Ocupa el resto de la altura de la ventana */
        background: white; /* Fondo blanco para el menú desplegable */
        flex-direction: column;
        align-items: center;
        padding: 2rem 0;
        gap: 1.5rem;
        transition: var(--transition);
        box-shadow: inset 0 5px 10px rgba(0,0,0,0.05); /* Sombra interna para el menú */
        overflow-y: auto; /* Para permitir scroll si el contenido es largo */
    }
    .navbar-menu.active {
        left: 0; /* Muestra el menú al activar */
    }
    .navbar-item {
        width: 100%;
        text-align: center;
    }
    .navbar-link {
        font-size: 1.1rem; /* Enlaces más grandes para fácil clic */
        padding: 0.8rem 0;
    }
    .navbar-link.active::after {
        width: 50%;
        left: 25%;
    }
    .navbar-search {
        display: none !important; /* Oculta la barra de búsqueda en móvil */
    }
    .navbar-actions {
        flex-direction: row;
        justify-content: flex-end;
        gap: 0.5rem;
    }
    .navbar-button {
        padding: 0.4rem 1rem;
        font-size: 0.85rem;
        box-shadow: none;
    }
    .navbar-toggle {
        display: flex; /* Muestra el icono de hamburguesa */
    }
    /* Animación del icono de hamburguesa */
    .navbar-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .navbar-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    .navbar-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .hero {
        padding: 80px 15px;
        min-height: 400px;
    }
    .hero h1 {
        font-size: 2rem;
    }
    .hero p {
        font-size: 1rem;
    }

    .services-grid, .testimonios-grid, .productos-grid {
        grid-template-columns: 1fr; /* Una columna en móvil */
    }

    .filtros-formulario {
        flex-direction: column; /* Apila los filtros verticalmente */
        align-items: stretch;
    }
    .filtro-grupo {
        width: 100%; /* Ocupa todo el ancho disponible */
        flex: none;
    }

    .botones-producto {
        flex-direction: column; /* Apila los botones de producto */
        align-items: stretch;
    }
    .cantidad-control {
        width: 100%; /* Ocupa todo el ancho */
        margin-right: 0;
        margin-bottom: 10px; /* Espacio debajo del control de cantidad */
    }
    .btn-agregar-carrito, .btn-detalle {
        width: 100%; /* Asegura que los botones ocupen todo el ancho */
    }
    .modal-detalle .modal-contenido {
        width: 95%;
        padding: 20px;
    }
    .modal-detalle .modal-contenido img {
        max-height: 180px;
    }
    .modal-detalle .modal-contenido h2 {
        font-size: 1.5rem;
    }
    .carrito-container {
        margin: 1rem auto;
    }
    table th, table td {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    .total {
        font-size: 1.1rem;
    }
    .btn-pagar {
        padding: 0.6rem 1.2rem;
        font-size: 0.95rem;
    }
    .btn-eliminar {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}

@media (min-width: 481px) {
    .botones-producto {
        flex-direction: row;
        align-items: center;
    }
    .btn-agregar-carrito,
    .btn-detalle {
        flex: 1 1 auto;
        max-width: 140px;
    }
}

/* Pantallas muy pequeñas (ej. iPhone 5/SE) */
@media screen and (max-width: 480px) {
	.navbar-logo span {
        display: none; /* Oculta el texto del logo, deja solo la imagen */
    }
    .navbar-logo .logo-img {
        margin-right: 0; /* Sin margen si el texto desaparece */
    }
    .hero h1 {
        font-size: 1.8rem;
    }
    .hero p {
        font-size: 0.9rem;
    }
    .top-bar {
        font-size: 0.8rem;
        padding: 0.3rem;
    }
    .top-bar a {
        display: block; /* Cada enlace de contacto en su propia línea */
        margin: 2px 0;
    }
    .search-input {
        width: 120px; /* Reduce el ancho del input de búsqueda si se muestra */
    }
    .service-card, .testimonio, .producto {
        padding: 1.2rem;
    }
    .contacto-form {
        padding: 15px;
    }
    .filtro-alfabetico span {
        padding: 5px 8px;
        font-size: 12px;
        min-width: 30px;
    }
	.botones-producto {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 0 15px;
    }
    .cantidad-control {
        margin-right: 0;
        justify-content: center;
        margin-bottom: 10px;
    }
    .btn-agregar-carrito,
    .btn-detalle {
        width: 100%;
    }
    .modal-detalle .modal-contenido {
        padding: 15px;
    }
}