/* CONTENEDOR GENERAL - AISLADO DE TEMAS */
.bip-wrapper {
  margin: 30px 0 !important;
  padding: 20px !important;
  border: 1px solid #eee !important;
  border-radius: 8px !important;
  background: #fafafa !important;
  position: relative !important;
  z-index: 1 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  font-size: 14px !important;
  line-height: 1.4 !important;
  color: #333 !important;
  box-sizing: border-box !important;
}

/* AISLAR DE ESTILOS DE TEMA */
.bip-wrapper * {
  box-sizing: border-box !important;
}

.bip-wrapper input,
.bip-wrapper select,
.bip-wrapper button {
  font-family: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
}

/* FORMULARIO - HORIZONTAL PARA PANTALLA COMPLETA */
#bip-form {
  display: flex;
  flex-wrap: nowrap;
  gap: 15px;
  align-items: flex-end;
  justify-content: space-between;
  width: 100%;
  padding: 20px;
  border-radius: 10px;
  background: #f9f9f9;
  margin: 0 auto;
}

/* CAMPOS DE FILTRO - HORIZONTAL PARA PANTALLA COMPLETA */
.bip-filtro {
  flex: 1;
  min-width: 150px;
  display: flex;
  flex-direction: column;
}

.bip-filtro label {
  font-weight: bold;
  margin-bottom: 5px;
  color: #444;
}

/* INPUTS Y SELECTS - ESTILOS EXACTOS DEL ORIGINAL */
.bip-filtro input,
.bip-filtro select {
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 16px;
  width: 100%;
  height: 42px;
  box-sizing: border-box;
}

/* SELECT ESPECÍFICO - ARREGLAR LETRAS CORTADAS */
.bip-filtro select {
  font-size: 14px;
  padding: 8px 12px;
  line-height: 1.4;
}

/* BOTONES - HORIZONTAL PARA PANTALLA COMPLETA */
.bip-botones {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

/* BOTÓN BUSCAR - ESTILOS ULTRA-FORZADOS PARA WOODMART/ELEMENTOR */
.bip-buscar {
  background-color: #ed1c25 !important;
  background: #ed1c25 !important;
  color: #fff !important;
  border: 2px solid #ed1c25 !important;
  border-color: #ed1c25 !important;
  padding: 10px 20px !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  font-weight: bold !important;
  transition: all 0.3s ease !important;
  height: 42px !important;
  box-sizing: border-box !important;
  font-size: 14px !important;
  line-height: 1.4 !important;
  text-decoration: none !important;
  display: inline-block !important;
  text-align: center !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
  user-select: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
}

.bip-buscar:hover,
.bip-buscar:focus,
.bip-buscar:active {
  background-color: #c41e3a !important;
  background: #c41e3a !important;
  color: #fff !important;
  border-color: #c41e3a !important;
  text-decoration: none !important;
  outline: none !important;
  box-shadow: 0 2px 4px rgba(237, 28, 37, 0.3) !important;
}

.bip-buscar:visited {
  background-color: #ed1c25 !important;
  color: #fff !important;
}

/* BOTÓN RESET - ESTILOS EXACTOS DEL ORIGINAL */
.bip-reset {
  background-color: #f3f3f3;
  color: #000;
  border: 2px solid #f3f3f3;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
  height: 42px;
  box-sizing: border-box;
}

.bip-reset:hover {
  background-color: #e0e0e0;
}

/* RESPONSIVE - SOLO EN MÓVIL MUY PEQUEÑO */
@media (max-width: 480px) {
  #bip-form {
    flex-direction: column;
    align-items: stretch;
  }
  
  .bip-botones {
    flex-direction: column;
  }
}

/* RESULTADOS */
#bip-resultados {
  margin-top: 30px;
  width: 100%;
  display: block;
}

/* CATEGORÍA WRAPPER */
.bip-categoria-wrapper {
  display: block;
  width: 100%;
  margin-bottom: 40px;
  clear: both;
  padding: 0 10px;
}

.bip-categoria-wrapper h3 {
  font-size: 20px;
  margin-bottom: 10px;
  color: #222;
  font-weight: bold;
}

/* GRID DE PRODUCTOS */
.bip-categoria {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-bottom: 20px;
}

/* PRODUCTO */
.bip-producto {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 15px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bip-producto:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.bip-producto img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin-bottom: 10px;
}

.bip-producto h4 {
  font-size: 15px;
  margin: 10px 0 5px;
  line-height: 1.3;
}

.bip-producto h4 a {
  color: #333;
  text-decoration: none;
  transition: color 0.2s ease;
}

.bip-producto h4 a:hover {
  color: #ed1c25;
}

.bip-producto p {
  font-size: 14px;
  color: #222;
  font-weight: bold;
}

/* RESPONSIVE PARA PRODUCTOS */
@media screen and (max-width: 992px) {
  .bip-categoria {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
}

@media screen and (max-width: 576px) {
  .bip-categoria {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  .bip-producto {
    padding: 10px;
  }
  
  .bip-producto h4 {
    font-size: 13px;
  }
  
  .bip-producto p {
    font-size: 12px;
  }
}

/* ===== PESTAÑAS RESPONSIVAS ===== */

/* CONTENEDOR DE PESTAÑAS */
.bip-pestanas {
  margin-top: 30px;
  width: 100%;
}

/* NAVEGACIÓN DE PESTAÑAS - GRID RESPONSIVO */
.bip-pestanas-nav {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 2px solid #eee;
  padding-bottom: 10px;
}

/* DESKTOP: 6 columnas */
@media (min-width: 1200px) {
  .bip-pestanas-nav {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* TABLET: 3 columnas */
@media (min-width: 768px) and (max-width: 1199px) {
  .bip-pestanas-nav {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* MÓVIL: 2 columnas */
@media (max-width: 767px) {
  .bip-pestanas-nav {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* BOTÓN DE PESTAÑA */
.bip-pestana-nav {
  background-color: #f8f8f8;
  color: #666;
  border: 2px solid #e0e0e0;
  padding: 12px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
  transition: all 0.3s ease;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bip-pestana-nav:hover {
  background-color: #e8e8e8;
  border-color: #ccc;
}

.bip-pestana-nav.active {
  background-color: #ed1c25;
  color: #fff;
  border-color: #ed1c25;
}

/* CONTENIDO DE PESTAÑAS */
.bip-pestana-content {
  display: none;
}

.bip-pestana-content.active {
  display: block;
}

/* BOTÓN VER MÁS */
.bip-ver-mas {
  text-align: center;
  margin-top: 20px;
}

.bip-boton-mas {
  display: inline-block;
  background-color: #ed1c25;
  color: #fff;
  border: 2px solid #ed1c25;
  border-radius: 4px;
  padding: 10px 20px;
  font-weight: bold;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
}

.bip-boton-mas:hover {
  background-color: #c41e3a;
  color: #fff;
  border-color: #c41e3a;
}

/* ===== PROTECCIÓN CONTRA WOODMART/ELEMENTOR ===== */

/* Forzar estilos del botón buscar contra temas */
.bip-wrapper .bip-buscar,
.bip-wrapper button.bip-buscar,
.bip-wrapper input[type="button"].bip-buscar,
.bip-wrapper input[type="submit"].bip-buscar {
  background-color: #ed1c25 !important;
  background: #ed1c25 !important;
  color: #fff !important;
  border: 2px solid #ed1c25 !important;
  border-color: #ed1c25 !important;
  padding: 10px 20px !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  font-weight: bold !important;
  font-size: 14px !important;
  height: 42px !important;
  box-sizing: border-box !important;
  display: inline-block !important;
  text-align: center !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
  user-select: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  text-decoration: none !important;
  outline: none !important;
  box-shadow: none !important;
  transition: all 0.3s ease !important;
}

.bip-wrapper .bip-buscar:hover,
.bip-wrapper .bip-buscar:focus,
.bip-wrapper .bip-buscar:active,
.bip-wrapper button.bip-buscar:hover,
.bip-wrapper input[type="button"].bip-buscar:hover,
.bip-wrapper input[type="submit"].bip-buscar:hover {
  background-color: #c41e3a !important;
  background: #c41e3a !important;
  color: #fff !important;
  border-color: #c41e3a !important;
  text-decoration: none !important;
  outline: none !important;
  box-shadow: 0 2px 4px rgba(237, 28, 37, 0.3) !important;
}

/* Proteger contra estilos de Woodmart */
.woodmart-button-wrapper .bip-buscar,
.elementor-button-wrapper .bip-buscar,
.wd-btn .bip-buscar,
.btn .bip-buscar {
  background-color: #ed1c25 !important;
  background: #ed1c25 !important;
  color: #fff !important;
  border: 2px solid #ed1c25 !important;
}

/* Proteger contra estilos de Elementor */
.elementor-button .bip-buscar,
.elementor-widget-button .bip-buscar {
  background-color: #ed1c25 !important;
  background: #ed1c25 !important;
  color: #fff !important;
  border: 2px solid #ed1c25 !important;
}

/* Asegurar que el botón mantenga su estilo en todos los contextos */
.bip-buscar[style*="background"],
.bip-buscar[style*="color"],
.bip-buscar[style*="border"] {
  background-color: #ed1c25 !important;
  background: #ed1c25 !important;
  color: #fff !important;
  border: 2px solid #ed1c25 !important;
}
