/* =========================================
   TD – Header Icons (Astra header widget)
   Forzar blanco, sin fondo y buscador oculto
========================================= */

/* Contexto exacto del widget del header (más especificidad) */
.site-header .header-widget-area .td-header-icons {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Lupa (button) — anula por completo estilos de Astra para <button> */
.site-header .header-widget-area .td-header-icons button.td-icon {
  /* Astra pinta botones con var(--ast-global-color-0) → lo anulamos */
  --ast-global-color-0: transparent;
  --ast-global-active-color: transparent;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff !important;

  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;

  border: 0 !important;
  border-color: transparent !important;
  box-shadow: none !important;
  outline: 0 !important;

  padding: 0 !important;
  margin: 0 !important;

  line-height: 1 !important;
  min-height: 0 !important;
  min-width: 0 !important;

  -webkit-appearance: none !important;
  appearance: none !important;
}

/* Carrito (link) — Astra pinta links con var(--ast-global-color-0) → forzar blanco */
.site-header .header-widget-area .td-header-icons a.td-icon {
  color: #fff !important;
  text-decoration: none !important;

  background: transparent !important;
  background-color: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
  padding: 0 !important;
}

/* Estados hover/focus/active sin fondo */
.site-header .header-widget-area .td-header-icons .td-icon:hover,
.site-header .header-widget-area .td-header-icons .td-icon:focus,
.site-header .header-widget-area .td-header-icons .td-icon:active {
  color: #fff !important;
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  opacity: .9;
}

/* Evitar pseudo-elementos del tema */
.site-header .header-widget-area .td-header-icons .td-icon::before,
.site-header .header-widget-area .td-header-icons .td-icon::after {
  content: none !important;
}

/* SVG hereda el color blanco (por si Astra colorea path) */
.site-header .header-widget-area .td-header-icons .td-icon svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: currentColor !important;
}
.site-header .header-widget-area .td-header-icons .td-icon svg path,
.site-header .header-widget-area .td-header-icons .td-icon svg circle,
.site-header .header-widget-area .td-header-icons .td-icon svg rect {
  fill: currentColor !important;
}

/* Contador del carrito */
.site-header .header-widget-area .td-cart-link { position: relative; }
.site-header .header-widget-area .td-cart-count {
  position: absolute;
  top: -6px;
  right: -10px;
  background: #e53935;
  color: #fff;
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

/* =========================
   Buscador: oculto por defecto
========================= */
.site-header .header-widget-area .td-search-form {
  position: absolute;
  right: 36px;                /* 20px icono + margen */
  top: 50%;
  transform: translateY(-50%);

  /* Oculto por defecto (aunque el tema meta estilos) */
  width: 0 !important;
  max-width: 0 !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  overflow: hidden !important;

  transition: width .25s ease, opacity .2s ease, visibility 0s linear .25s;
  z-index: 30;
}

/* Al abrir con la clase del JS */
.site-header .header-widget-area .td-header-icons.is-search-open .td-search-form {
  width: 180px !important;
  max-width: 180px !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  overflow: visible !important;
  transition: width .25s ease, opacity .2s ease;
}

.site-header .header-widget-area .td-search-field {
  width: 100%;
  height: 36px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 0 12px;
  background: #fff;
  color: #111;
  outline: 0;
  box-shadow: none;
}

/* Mobile */
@media (max-width: 768px) {
  .site-header .header-widget-area .td-header-icons.is-search-open .td-search-form {
    width: 200px !important;
    max-width: 200px !important;
  }
}
