/* ==========================================================================
   MAFER HOME - GESTIÓN Y CATÁLOGO DE PRODUCTOS (Productos.css)
   Paleta de colores ejecutiva: Slate, Emerald, Clean Off-White, Soft Grays
   ========================================================================== */

:root {
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --accent: #10b981;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-cerrar{
  background-color: var(--text-main);
  color: #ffffff;
  border: none;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: 8px;
  margin-bottom: 10px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  }



*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Contenedor Principal del Panel */
.panel-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* Cabecera y Barra de Búsqueda Avanzada */
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  padding: 24px 32px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 20px;
}

.panel-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.02em;
}

.buscador-container {
  position: relative;
  width: 320px;
}

.buscador-container input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  background-color: #f1f5f9;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  color: var(--text-main);
  transition: var(--transition);
  outline: none;
}

.buscador-container input:focus {
  background-color: var(--bg-card);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Icono de búsqueda simulado por pseudo-elemento o se puede colocar SVG */
.buscador-container::before {
  content: "🔍";
  position: absolute;
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  opacity: 0.6;
}

/* Contenedor del Catálogo */
.catalogo-contenedor {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Secciones por Categoría */
.seccion-categoria {
  background: var(--bg-card);
  padding: 28px 32px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.seccion-categoria:hover {
  box-shadow: var(--shadow-md);
}

.seccion-categoria h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.01em;
}

/* Scroll Horizontal Fluido e Intuitivo */
.scroll-horizontal {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding: 8px 4px 20px 4px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.scroll-horizontal::-webkit-scrollbar {
  height: 8px;
}

.scroll-horizontal::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.scroll-horizontal::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
  transition: background 0.2s;
}

.scroll-horizontal::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Tarjeta de Producto (Card Estilizada) */
.producto-card {
  flex: 0 0 260px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
}

.producto-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: #cbd5e1;
}

/* Contenedor de la Imagen */
.producto-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.producto-card:hover img {
  transform: scale(1.04);
}

/* Información de la Card */
.card-info {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
  background: var(--bg-card);
}

.card-info h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.precio {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.01em;
}

/* Botón de Detalles Elegante */
.btn-detalles {
  background-color: var(--text-main);
  color: #ffffff;
  border: none;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: 8px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-detalles:hover {
  background-color: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

/* Responsive Design */
@media (max-width: 768px) {
  .panel-container {
    padding: 16px 12px;
  }
  
  .panel-header {
    padding: 18px 20px;
    flex-direction: column;
    align-items: stretch;
  }
  
  .buscador-container {
    width: 100%;
  }
  
  .seccion-categoria {
    padding: 20px 16px;
  }
  
  .producto-card {
    flex: 0 0 220px;
  }
}

/* ================= VENTANA MODAL (DETALLES) ================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
}

.modal-overlay.activo {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: #ffffff;
  width: 90%;
  max-width: 500px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  transform: translateY(20px);
  transition: transform 0.3s ease;
  position: relative;
}

.modal-overlay.activo .modal-content {
  transform: translateY(0);
}

.modal-content img {
  width: 100%;
  height: 240px;
  object-fit: cover;
}

.modal-cerrar {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.modal-cerrar:hover {
  background: rgba(0, 0, 0, 0.8);
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-atributos {
  background: #f8fafc;
  padding: 12px 16px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  color: #475569;
}

.btn-cotizar {
  background-color: #10b981;
  color: white;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 8px;
  text-align: center;
}

.btn-cotizar:hover {
  background-color: #059669;
}

.header-controles {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.buscador-container input,
.filtro-container select {
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 0.95rem;
    outline: none;
    background: #fff;
}

.filtro-container select {
    cursor: pointer;
    font-weight: 500;
}




/* =========================================
   MODAL DE COMPRA RÁPIDA (CARRITO / WHATSAPP)
   ========================================= */
   
.modal-overlay-compra {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(3px); /* Le da un toque premium al fondo */
}

.modal-box-compra {
    background: #ffffff;
    width: 90%;
    max-width: 400px;
    border-radius: 16px;
    padding: 25px;
    position: relative;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.btn-cerrar-modal {
    position: absolute;
    top: 15px; right: 15px;
    background: #f1f5f9;
    border: none;
    width: 32px; height: 32px;
    border-radius: 50%;
    font-size: 1.2rem;
    color: #64748b;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-cerrar-modal:hover { background: #e2e8f0; color: #e74c3c; }

/* Imagen y Textos */
.modal-img-wrap {
    text-align: center;
    margin-bottom: 15px;
}

.modal-img-wrap img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.modal-titulo-verde {
    text-align: center;
    color: #25D366;
    font-size: 1.6rem;
    font-weight: 800;
    margin: 10px 0 5px;
}

.modal-desc-centrada {
    text-align: center;
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 15px;
    line-height: 1.4;
}

.modal-precio-destacado {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 900;
    color: #1e293b;
    margin-bottom: 20px;
}

/* Formulario */
.checkout-controles {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.grupo-unidades {
    flex: 1;
    margin-top: 10px
}
.grupo-envio {
    flex: 2;
     margin-top: 10px
}

.modal-form-compra label {
    display: block;
    font-size: 0.8rem;
    font-weight: bold;
    color: #475569;
    margin-bottom: 6px;
}

.modal-form-compra input,
.modal-form-compra select {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #f8fafc;
    box-sizing: border-box;
    font-weight: bold;
    color: #334155;
    outline: none;
}
.modal-form-compra input:focus, .modal-form-compra select:focus {
    border-color: #25D366;
    background: #fff;
}

/* Botón WhatsApp */
.btn-ws-comprar {
    width: 100%;
    background: #25D366;
    color: white;
    border: none;
    padding: 14px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.2s, background 0.2s;
}
.btn-ws-comprar:hover {
    background: #1eb956;
    transform: translateY(-2px);
}


.modal-atributos {
    background: #ffffff;             /* Fondo blanco puro */
    padding: 15px;                   /* Espacio interno para que no esté apretado */
    border-radius: 10px;             /* Bordes bien redondeados */
    border: 1px solid #e2e8f0;       /* Un borde gris muy sutil */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05); /* Sombra suave para que parezca flotar */
    margin-bottom: 20px;             /* Separación con los botones de abajo */
    font-size: 0.9rem;
    color: #334155;
    text-align: left;
}


/* =========================================
   RESPONSIVIDAD PARA CELULARES
   ========================================= */
@media (max-width: 480px) {
    .modal-box {
        padding: 25px 20px;
        width: 92%;
        max-height: 92vh;
    }

    .modal-product-img {
        height: 180px;
    }

    #modal-titulo {
        font-size: 1.2rem;
    }

    .price-highlight {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }
}


/* =========================================
   DISEÑO BASE (ESCRITORIO Y GENERAL)
   ========================================= */
.modal-overlay-compra {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(3px); /* Le da un toque premium al fondo */
}

.modal-box-compra {
    background: #ffffff;
    width: 90%;
    max-width: 450px; /* Lo subí un poquito a 450px para que respire mejor en PC/Tablets */
    max-height: 90vh; /* MÁXIMA ALTURA: 90% de la pantalla */
    overflow-y: auto; /* IMPORTANTE: Activa scroll interno si la pantalla del celular es muy bajita */
    border-radius: 16px;
    padding: 25px;
    position: relative;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    animation: slideUp 0.3s ease-out;
}

/* Scrollbar personalizado para el modal (Toque premium) */
.modal-box-compra::-webkit-scrollbar { width: 6px; }
.modal-box-compra::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.btn-cerrar-modal {
    position: absolute;
    top: 15px; right: 15px;
    background: #f1f5f9;
    border: none;
    width: 32px; height: 32px;
    border-radius: 50%;
    font-size: 1.2rem;
    color: #64748b;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 10;
}

.btn-cerrar-modal:hover { background: #e2e8f0; color: #e74c3c; }

/* Imagen y Textos */
.modal-img-wrap {
    text-align: center;
    margin-bottom: 15px;
}

.modal-img-wrap img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.modal-titulo-verde {
    text-align: center;
    color: #25D366;
    font-size: 1.6rem;
    font-weight: 800;
    margin: 10px 0 5px;
}

.modal-desc-centrada {
    text-align: center;
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 15px;
    line-height: 1.4;
}

.modal-precio-destacado {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 900;
    color: #1e293b;
    margin-bottom: 20px;
}

/* Tarjeta de Atributos */
.modal-atributos {
    background: #ffffff;             
    padding: 15px;                   
    border-radius: 10px;             
    border: 1px solid #e2e8f0;       
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05); 
    margin-bottom: 20px;             
    font-size: 0.9rem;
    color: #334155;
    text-align: left;
}

.modal-atributos p {
    margin: 8px 0;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed #cbd5e1;
    padding-bottom: 6px;
}
.modal-atributos p:last-child {
    border-bottom: none; margin-bottom: 0; padding-bottom: 0;
}

/* Formulario */
.checkout-controles {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.grupo-unidades { flex: 1; margin-top: 10px; }
.grupo-envio { flex: 2; margin-top: 10px; }

.modal-form-compra label {
    display: block;
    font-size: 0.8rem;
    font-weight: bold;
    color: #475569;
    margin-bottom: 6px;
}

.modal-form-compra input,
.modal-form-compra select {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #f8fafc;
    box-sizing: border-box;
    font-weight: bold;
    color: #334155;
    outline: none;
}
.modal-form-compra input:focus, .modal-form-compra select:focus {
    border-color: #25D366;
    background: #fff;
}

/* =========================================
   BOTÓN PREMIUM DE WHATSAPP
   ========================================= */
.btn-ws-comprar {
    width: 100%;                     /* Ocupa todo el ancho disponible */
    background-color: #25D366;       /* Verde oficial de WhatsApp */
    color: #ffffff;                  /* Letra blanca */
    border: none;
    padding: 15px 20px;              /* Botón alto y cómodo para el dedo */
    border-radius: 10px;             /* Bordes redondeados modernos */
    font-size: 1.1rem;
    font-weight: 700;                /* Texto en negrita */
    font-family: inherit;
    cursor: pointer;
    
    /* Flexbox para alinear perfectamente el ícono y el texto */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;                       /* Espacio entre el ícono de WA y el texto */
    
    /* Efectos de transición y sombra */
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3); /* Sombra verde sutil que lo hace "flotar" */
}

/* Tamaño del ícono de WhatsApp */
.btn-ws-comprar i {
    font-size: 1.35rem;              /* Ícono ligeramente más grande que la letra */
}

/* Efecto al pasar el mouse por encima (Hover) */
.btn-ws-comprar:hover {
    background-color: #20bd5a;       /* Verde un tono más oscuro */
    transform: translateY(-3px);     /* El botón "sube" un poquito */
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.45); /* La sombra crece */
}

/* Efecto al hacer clic (Active) */
.btn-ws-comprar:active {
    transform: translateY(1px);      /* El botón se hunde al presionarlo */
    box-shadow: 0 2px 6px rgba(37, 211, 102, 0.3); /* La sombra se reduce */
}


/* =========================================
   ADAPTACIÓN RESPONSIVA (TABLETS Y MÓVILES)
   ========================================= */

/* TABLETS (hasta 768px) */
@media (max-width: 768px) {
    .modal-box-compra {
        max-width: 85%; /* Se hace un poco más ancho para aprovechar la pantalla */
        padding: 20px;
    }
}

/* TELÉFONOS MÓVILES (hasta 480px) */
@media (max-width: 480px) {
    .modal-box-compra {
        width: 95%; /* Ocupa casi todo el ancho de la pantalla */
        padding: 18px 15px; /* Reducimos el padding para que quepa más contenido */
    }

    .modal-img-wrap img {
        height: 160px; /* Reducimos la altura de la imagen para ahorrar espacio vertical */
    }

    .modal-titulo-verde {
        font-size: 1.4rem; /* Título un poco más pequeño */
    }

    .modal-precio-destacado {
        font-size: 1.5rem; /* Precio un poco más pequeño */
        margin-bottom: 15px;
    }

    .checkout-controles {
        flex-direction: column; /* Magia: Apilamos Unidades arriba y Envío abajo */
        gap: 5px; /* Reducimos el espacio entre ellos */
    }

    .grupo-unidades, .grupo-envio {
        margin-top: 5px;
        width: 100%; /* Ahora ocupan el 100% del ancho */
    }
    
    .btn-ws-comprar {
        margin-top: 10px; /* Separamos un poco el botón de compra */
    }
}



.carrusel-publico {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    width: 100%;
    height: 200px; /* Ajusta a la altura que tenían tus fotos */
    border-radius: 8px 8px 0 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.carrusel-publico::-webkit-scrollbar {
    display: none; /* Esconde la barra nativa */
}
.carrusel-publico img, 
.carrusel-publico video {
    flex: 0 0 100%; /* Cada imagen ocupa exactamente todo el cuadro */
    width: 100%;
    height: 100%;
    object-fit: cover; 
    scroll-snap-align: start;
}
.indicador-fotos {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    pointer-events: none; 
    backdrop-filter: blur(2px);
}

/* Fuerza al navegador a usar FontAwesome para este ícono específico */
.indicador-fotos i {
    font-family: "Font Awesome 6 Free", "FontAwesome" !important;
    font-weight: 900 !important; /* El peso 900 es obligatorio para que los íconos 'fas' funcionen */
}

