/*
 Theme Name: Astra Child
 Description: Tema hijo de Astra (Cangel)
 Template: astra
 Version: 1.0.0
*/

@import url("https://fonts.googleapis.com/css2?family=Anton&display=swap");

/* ===== PDP: Imagen de producto con tamaño fijo ===== */
:root {
  --cz-pdp-img: 550px;
  --cz-pdp-img-mobile: 340px;
}

/* Wrapper de la galería con ancho fijo */
.single-product div.product .woocommerce-product-gallery.cz-image-fixed {
  width: var(--cz-pdp-img);
  max-width: 100%;
  margin: 0;
}

/* Alto fijo del viewport y wrappers internos */
.single-product
  div.product
  .woocommerce-product-gallery.cz-image-fixed
  .flex-viewport,
.single-product
  div.product
  .woocommerce-product-gallery.cz-image-fixed
  .woocommerce-product-gallery__wrapper,
.single-product
  div.product
  .woocommerce-product-gallery.cz-image-fixed
  .woocommerce-product-gallery__image {
  height: var(--cz-pdp-img) !important;
}

/* La imagen rellena el contenedor */
.single-product
  div.product
  .woocommerce-product-gallery.cz-image-fixed
  .woocommerce-product-gallery__image
  a,
.single-product
  div.product
  .woocommerce-product-gallery.cz-image-fixed
  .woocommerce-product-gallery__image
  img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

@media (min-width: 981px) {
  .single-product div.product .woocommerce-product-gallery.cz-image-fixed {
    float: left;
  }
}

@media (max-width: 980px) {
  .single-product div.product .woocommerce-product-gallery.cz-image-fixed {
    width: var(--cz-pdp-img-mobile);
    float: none;
    margin-left: auto;
    margin-right: auto;
  }
  .single-product
    div.product
    .woocommerce-product-gallery.cz-image-fixed
    .flex-viewport,
  .single-product
    div.product
    .woocommerce-product-gallery.cz-image-fixed
    .woocommerce-product-gallery__wrapper,
  .single-product
    div.product
    .woocommerce-product-gallery.cz-image-fixed
    .woocommerce-product-gallery__image {
    height: var(--cz-pdp-img-mobile) !important;
  }
}

/* Ocultar el fieldset de Astra */
.single-product .summary .ast-single-product-payments {
  display: none !important;
}

/* Contenedor de métodos de pago */
.cz-trustbox {
  border: 1px solid #d7c8a2;
  border-radius: 12px;
  padding: 14px 16px;
  margin: 14px 0 22px;
  background: #fffaf0;
}
.cz-trustbox__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: #7a5f1a;
  margin-bottom: 10px;
}
.cz-trustbox__title::before,
.cz-trustbox__title::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: #d7c8a2;
  opacity: 0.9;
}
.cz-trustbox__title span {
  white-space: nowrap;
}

.cz-trustbox__icons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
  justify-content: center;
}
.cz-trustbox__icons img {
  height: 22px;
  width: auto;
}

.cz-trustbox__bullets {
  margin: 8px 0 0 16px;
  padding: 0;
  font-size: 0.92rem;
  color: #4a4a4a;
}
.cz-trustbox__bullets li {
  margin: 4px 0;
}

@media (max-width: 980px) {
  .cz-trustbox {
    margin: 12px 0 18px;
  }
  .cz-trustbox__icons img {
    height: 20px;
  }
}

/* Ocultar banner de categorías por defecto de Astra */
.tax-product_cat .ast-archive-entry-banner {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 0 !important;
}

/* ===== Hero de categorías ===== */
.cz-cat-hero {
  --overlay-from: rgba(0, 0, 0, 0.55);
  --overlay-to: rgba(0, 0, 0, 0.65);
  --hero-h: 340px;
  position: relative;
  display: grid;
  place-items: center;
  min-height: var(--hero-h);
  padding: 56px 16px;
  color: #fff;
  text-align: center;
  background:
    linear-gradient(180deg, var(--overlay-from), var(--overlay-to)),
    var(--cz-hero) center / cover no-repeat;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cz-cat-hero__inner {
  width: min(1100px, 92%);
  margin-inline: auto;
}

.cz-cat-hero__title {
  margin: 0;
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 800;
  letter-spacing: 2px;
  font-family: fantasy;
  text-transform: capitalize;
  color: #fff;
  text-shadow:
    0 0 8px rgba(0, 255, 255, 0.7),
    0 0 16px rgba(0, 255, 255, 0.4);
  opacity: 0;
  transform: translateY(20px);
  animation:
    czHeroFadeIn 1.8s cubic-bezier(0.19, 1, 0.22, 1) forwards,
    czHeroGlow 3s ease-in-out infinite alternate;
}

@keyframes czHeroFadeIn {
  0% {
    opacity: 0;
    transform: translateY(40px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes czHeroGlow {
  0% {
    text-shadow:
      0 0 4px rgba(0, 255, 255, 0.3),
      0 0 8px rgba(0, 255, 255, 0.3);
  }
  100% {
    text-shadow:
      0 0 12px rgba(0, 255, 255, 0.8),
      0 0 24px rgba(0, 255, 255, 0.6);
  }
}

.cz-cat-hero__desc {
  margin-top: 10px;
  font-size: clamp(14px, 1.7vw, 18px);
  line-height: 1.5;
  opacity: 0.92;
}

/* Ajuste de espacios en el listado que sigue al hero */
.tax-product_cat .products,
.tax-product_cat .woocommerce-result-count,
.tax-product_cat .woocommerce-notices-wrapper {
  margin-top: 18px;
}

/* Responsive: héroe más alto en desktop */
@media (min-width: 992px) {
  .cz-cat-hero {
    --hero-h: 420px;
    padding: 72px 16px;
  }
}

/* ==========================================================================
   CARRUSELES CZ (genérico)
   ========================================================================== */

/* Contenedor base */
.cz-carousel {
  position: relative;
  margin-inline: auto;
  max-width: 100%;
}

/* Listas Splide sobre WooCommerce y Woo Blocks */
.cz-carousel ul.products.splide__list,
.cz-carousel ul.wc-block-grid__products.splide__list {
  display: flex !important;
  gap: 16px;
  padding: 0;
  list-style: none;
  justify-content: flex-start;
}

/* Items (cards) */
.cz-carousel ul.products li.product,
.cz-carousel ul.wc-block-grid__products li.wc-block-grid__product {
  flex: 1 0 calc(25% - 12px);
  max-width: calc(25% - 12px);
  float: none !important;
  margin: 0 !important;
}

/* Responsivo (ajustable por sección con modifiers .cz-carousel--*) */
@media (max-width: 1024px) {
  .cz-carousel ul.products li.product,
  .cz-carousel ul.wc-block-grid__products li.wc-block-grid__product {
    flex-basis: calc(33.333% - 12px);
    max-width: calc(33.333% - 12px);
  }
}

@media (max-width: 768px) {
  .cz-carousel ul.products li.product,
  .cz-carousel ul.wc-block-grid__products li.wc-block-grid__product {
    flex-basis: calc(50% - 10px);
    max-width: calc(50% - 10px);
  }
}

@media (max-width: 480px) {
  .cz-carousel ul.products li.product,
  .cz-carousel ul.wc-block-grid__products li.wc-block-grid__product {
    flex-basis: calc(50% - 8px);
    max-width: calc(50% - 8px);
  }
}

/* Track */
.cz-carousel .splide__track {
  overflow: hidden;
  padding-inline: 6px;
}

/* Imágenes de producto */
.cz-carousel li.product .woocommerce-LoopProduct-link img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}

/* Flechas */
.cz-carousel .splide__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  opacity: 0.85;
  z-index: 2;
}
.cz-carousel .splide__arrow:hover {
  background: rgba(0, 0, 0, 0.24);
  opacity: 1;
}
.cz-carousel .splide__arrow--prev {
  left: -6%;
  top: 38%;
}
.cz-carousel .splide__arrow--next {
  right: -7%;
  top: 38%;
}

@media (max-width: 768px) {
  .cz-carousel .splide__arrow {
    width: 28px;
    height: 28px;
  }
  .cz-carousel .splide__arrow--prev {
    left: -10px;
  }
  .cz-carousel .splide__arrow--next {
    right: -10px;
  }
}

/* ===== Contenedor tipo pergamino para Términos ===== */
.cz-terms-parchment {
  /* layout */
  max-width: 980px;
  margin: clamp(20px, 4vw, 44px) auto;
  padding: clamp(24px, 3vw, 40px) clamp(18px, 3vw, 32px);
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  position: relative;
  overflow: hidden;

  /* base “papel” visible */
  background:
    radial-gradient(
      140% 100% at 50% -10%,
      rgba(255, 255, 255, 0.18) 0%,
      rgba(255, 255, 255, 0) 55%
    ),
    linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.1)), #f2e6c9;
  color: #2a2823;

  /* sombra externa e inset */
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.22),
    0 2px 0 rgba(255, 255, 255, 0.35) inset,
    0 -2px 0 rgba(0, 0, 0, 0.06) inset;
}

/* grano/fibras + viñeteado */
.cz-terms-parchment::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'>\
<filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/>\
<feColorMatrix type='saturate' values='0'/>\
<feComponentTransfer><feFuncA type='table' tableValues='0 0.05 0.1 0.14 0.05 0'/></feComponentTransfer>\
</filter>\
<rect width='120' height='120' filter='url(#n)' opacity='0.35'/>\
</svg>")
      repeat,
    radial-gradient(55% 80% at 50% 110%, rgba(0, 0, 0, 0.18), transparent 70%);
  mix-blend-mode: multiply;
  opacity: 0.55;
  z-index: 1;
}

/* bordes gastados/manchas */
.cz-terms-parchment::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(30% 18% at 0% 0%, rgba(0, 0, 0, 0.2), transparent 70%),
    radial-gradient(30% 18% at 100% 0%, rgba(0, 0, 0, 0.16), transparent 70%),
    radial-gradient(60% 25% at 50% 100%, rgba(0, 0, 0, 0.18), transparent 70%),
    conic-gradient(
      from 180deg at 60% 40%,
      transparent 0 20%,
      rgba(0, 0, 0, 0.05) 20% 35%,
      transparent 35% 100%
    );
  opacity: 0.55;
}

/* contenido por encima de ::before/::after */
.cz-terms-parchment > * {
  position: relative;
  z-index: 2;
}

/***** TIPOGRAFÍA Y ESPACIADOS *****/
.cz-terms-parchment h1 {
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.15;
  margin: 0 0 0.6em;
  letter-spacing: 0.2px;
  text-align: center;
  color: #1f1c16;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
  font-weight: 800;
}
.cz-terms-parchment h2 {
  font-size: clamp(19px, 2vw, 24px);
  line-height: 1.25;
  margin: 1.6em 0 0.5em;
  font-weight: 700;
  color: #1f1c16;
  border-top: 1px dashed rgba(0, 0, 0, 0.14);
  padding-top: 12px;
}
.cz-terms-parchment h3 {
  font-size: clamp(17px, 1.8vw, 21px);
  margin: 1.2em 0 0.4em;
  font-weight: 600;
}
.cz-terms-parchment p {
  margin: 0 0 0.9em;
  line-height: 1.65;
}
.cz-terms-parchment ul {
  margin: 0.2em 0 1em 1.2em;
}
.cz-terms-parchment li {
  margin: 0.35em 0;
}

/* línea divisoria sutil tras el primer párrafo */
.cz-terms-parchment h1 + p {
  border-top: 1px dashed rgba(0, 0, 0, 0.12);
  padding-top: 12px;
}

/***** RESPONSIVO *****/
@media (max-width: 768px) {
  .cz-terms-parchment {
    border-radius: 14px;
    padding: 24px 18px;
  }
}

/* ==========================================================================
   CARRUSEL HERO (HOME) CZ
   ========================================================================== */

.cz-hero-carousel {
  position: relative;
  width: 100%;
  margin: 0 auto;
  height: 450px; /* altura en desktop */
  overflow: hidden;
}

/* Todas las imágenes del slider */
.cz-hero-carousel img.cz-slide {
  position: absolute;
  inset: 0; /* top:0, right:0, bottom:0, left:0 */
  width: 100%;
  height: 100%;
  object-fit: cover; /* llenar el contenedor sin deformar */
  display: block;
  margin: 0;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
}

/* Imagen visible */
.cz-hero-carousel img.cz-slide.active {
  opacity: 1;
}

/* Altura en mobile */
@media (max-width: 768px) {
  .cz-hero-carousel {
    height: 350px;
  }
}

/* ==========================================================================
   CARRUSEL DE GÉNEROS CZ
   ========================================================================== */

/* Asegura que cada slide centre la tarjeta */
.cz-genres-carousel .splide__slide {
  display: flex;
  justify-content: center;
}

/* Tarjeta de género */
.cz-genre-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 150px;
  height: 260px;
  text-decoration: none;
  border-radius: 16px;
  overflow: hidden;
  background: #111;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

/* Contenedor de la imagen */
.cz-genre-card__thumb {
  width: 100%;
  height: 100%;
  background: #1e1e1e;
}

.cz-genre-card__thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* Hover (desktop) */
.cz-genre-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.5);
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
  .cz-genre-card {
    width: 120px;
    height: 120px;
    border-radius: 12px;
  }

  .cz-genre-card__thumb {
    height: 100%;
  }

  .cz-genre-card__name {
    font-size: 0.75rem;
    padding: 0.35rem 0.5rem 0.6rem;
  }
}

/* ==========================================================================
   Flechas del carrusel de Géneros (Splide)
   ========================================================================== */

.cz-genres-carousel .splide__arrows {
  pointer-events: none; /* solo los botones reciben el click */
}

.cz-genres-carousel .splide__arrow {
  pointer-events: auto;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
  transition:
    transform 0.15s ease,
    opacity 0.15s ease,
    background 0.15s ease;
  backdrop-filter: blur(4px);
}

/* Icono de la flecha (SVG) */
.cz-genres-carousel .splide__arrow svg {
  width: 14px;
  height: 14px;
  fill: #ffffff;
}

/* Posición en desktop: centradas verticalmente */
.cz-genres-carousel .splide__arrow--prev {
  left: -3rem;
}

.cz-genres-carousel .splide__arrow--next {
  right: -3rem;
}

/* Hover (solo desktop) */
@media (hover: hover) {
  .cz-genres-carousel .splide__arrow:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.75);
  }
}

/* Desactivadas */
.cz-genres-carousel .splide__arrow:disabled {
  opacity: 0.25;
  box-shadow: none;
  cursor: default;
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
  .cz-genres-carousel .splide__arrow {
    width: 26px;
    height: 26px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    opacity: 0.85;
  }

  .cz-genres-carousel .splide__arrow svg {
    width: 10px;
    height: 10px;
  }

  /* Más cerca de las cards y dentro del carrusel */
  .cz-genres-carousel .splide__arrow--prev {
    left: 0.75rem;
  }

  .cz-genres-carousel .splide__arrow--next {
    right: 0.75rem;
  }
}

/* Ocultar botón flotante nativo de Astra */
.ast-scroll-top-icon {
  display: none !important;
}

/* ==========================================================================
   Botón flotante de WhatsApp CZ
  ========================================================================== */
/* Contenedor flotante (ancla) */
.cz-whatsapp-float {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

/* Burbuja circular */
.cz-whatsapp-float__icon {
  width: 60px;
  height: 60px;
  border-radius: 999px;
  background: #1fd340;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.cz-whatsapp-float__icon::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("/wp-content/themes/astra-child/assets/icons/whatsapp.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 60%;
}

/* Hover (solo desktop) */
@media (hover: hover) {
  .cz-whatsapp-float__icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  }
}

/* Mobile */
@media (max-width: 768px) {
  .cz-whatsapp-float {
    right: 1rem;
    bottom: 1rem;
  }

  .cz-whatsapp-float__icon {
    width: 70px;
    height: 70px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  }

  .cz-whatsapp-float__icon::before {
    background-size: 55%;
  }
}

/* Banner superior rotando mensajes */
.cz-top-banner {
  width: 100%;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-image: url("/wp-content/uploads/2025/07/Fondo-Background-scaled-e1756167475769.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.cz-top-banner__inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: "Anton", sans-serif;
  font-size: 22px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 400;
  color: #f4f4f4;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
}

.cz-top-banner__item {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  white-space: nowrap;
  animation: czBannerRotate 20s infinite;
}

.cz-top-banner__item:nth-child(1) {
  animation-delay: 0s;
}

.cz-top-banner__item:nth-child(2) {
  animation-delay: 5s;
}

.cz-top-banner__item:nth-child(3) {
  animation-delay: 10s;
}

.cz-top-banner__item:nth-child(4) {
  animation-delay: 15s;
}

@keyframes czBannerRotate {
  0% {
    opacity: 0;
  }
  5% {
    opacity: 1;
  }
  20% {
    opacity: 1;
  }
  25% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .cz-top-banner {
    height: 48px;
  }

  .cz-top-banner__inner {
    font-size: 14px;
    letter-spacing: 0.05em;
  }
}

/* Oculta el select y la etiqueta del atributo "Método de pago"
   Funciona con attribute_pa_metodo-de-pago y attribute_metodo-de-pago */
table.variations select[name^="attribute_"][name$="metodo-de-pago"] {
  position: absolute !important;
  left: -9999px !important;
}

table.variations label[for$="metodo-de-pago"] {
  display: none !important;
}

/* Contenedor custom de métodos de pago */
.cz-payment-methods {
  margin-top: 12px;
  margin-bottom: 8px;
}

.cz-payment-label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

/* Botones */
.cz-payment-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px; /* 👈 separa de la cantidad */
}

.cz-pay-btn {
  border-radius: 999px;
  padding: 6px 14px;
  border: 1px solid #444;
  background: #111;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.cz-pay-btn:hover {
  transform: translateY(-1px);
}

/* Activo: sin borde verde, usamos el dorado del theme */
.cz-pay-btn.is-active {
  border-color: #e3aa55;
  background: #e3aa55;
  color: #000;
  box-shadow: none;
}

/* Botón principal deshabilitado (extra) */
.single_add_to_cart_button.cz-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Precio "Desde $X" en cards de producto */
.price-from {
  font-weight: 700;
  font-size: 1.1em;
  display: inline-block;
}

/* ==========================================================================
   BUSCADOR DE PRODUCTOS EN HEADER
   ========================================================================== */

/* IMPORTANTE: Forzar flexbox en el header para que todo quede en una línea */
#ast-desktop-header .ast-builder-grid-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: nowrap !important;
  gap: 15px !important;
}

/* Las secciones del header deben comportarse como flex items */
#ast-desktop-header .site-header-primary-section-left,
#ast-desktop-header .site-header-primary-section-right {
  flex: 0 0 auto !important;
}

/* Reducir gaps del grid de Astra - selectores más específicos */
.ast-builder-grid-row-container.site-header-focus-item {
  column-gap: 8px !important;
}

.ast-builder-grid-row.ast-builder-grid-row-has-sides {
  grid-column-gap: 8px !important;
  column-gap: 8px !important;
}

/* Reducir padding de las secciones del header */
.site-header-primary-section-left.site-header-section,
.site-header-primary-section-right.site-header-section {
  padding: 0 8px !important;
}

/* La sección derecha debe usar flex para alinear items */
.site-header-primary-section-right .ast-flex {
  display: flex !important;
  align-items: center;
  gap: 10px !important;
  flex-wrap: nowrap !important;
}

/* Wrapper principal - crece para ocupar espacio central */
.cz-search-wrapper {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  flex: 1 1 auto; /* Crece para ocupar espacio disponible */
  max-width: 400px; /* Límite máximo reducido */
  min-width: 200px;
  padding: 0 15px !important;
  margin: 0 !important;
  position: relative !important;
}

/* Ocultar versión mobile en desktop */
.cz-search-mobile {
  display: none !important;
}

@media (max-width: 921px) {
  /* Ocultar versión desktop en mobile */
  .cz-search-desktop {
    display: none !important;
  }

  /* Mostrar versión mobile */
  .cz-search-mobile {
    display: block !important;
    width: 100%;
    max-width: 100%;
    padding: 12px 20px !important;
    min-width: auto;
    flex: none;
  }
}

/* Contenedor centrado */
.cz-search-container {
  max-width: 100%;
  margin: 0;
  padding: 0;
  position: relative;
  width: 100%;
}

/* Formulario de búsqueda */
.cz-search-form {
  width: 100%;
  max-width: 100%;
  margin: 0;
}

/* Wrapper del input con icono */
.cz-search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: #fff;
  border: 2px solid #dca54a;
  border-radius: 50px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(227, 170, 85, 0.15);
}

.cz-search-input-wrapper:focus-within {
  border-color: #d99a45; /* Dorado más oscuro al hacer focus */
  box-shadow: 0 4px 12px rgba(227, 170, 85, 0.25);
  transform: translateY(-1px);
}

/* Icono de búsqueda */
.cz-search-icon {
  position: absolute;
  right: 16px;
  width: 18px;
  height: 18px;
  pointer-events: none;
  z-index: 2;
  filter: brightness(0) saturate(100%) invert(61%) sepia(26%) saturate(1033%)
    hue-rotate(359deg) brightness(93%) contrast(87%); /* Tono dorado para el ícono */
}

/* Input de búsqueda - padding ajustado */
.cz-search-input {
  width: 100%;
  padding: 10px 45px 10px 16px; /* Padding derecho mayor para el ícono */
  border: none !important;
  background: transparent;
  font-size: 14px;
  outline: none !important;
  box-shadow: none !important;
  color: #333;
  font-family: inherit;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.cz-search-input:focus {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.cz-search-input::placeholder {
  color: #999;
  font-weight: 400;
}

/* Contenedor de resultados (autocomplete) */
.cz-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 450px;
  overflow-y: auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 9999;
  padding: 8px 0;
}

/* Cada item de resultado */
.cz-search-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  text-decoration: none;
  color: #333;
  transition: background 0.2s ease;
  border-bottom: 1px solid #f5f5f5;
}

.cz-search-item:hover {
  background: #f9f9f9;
}

.cz-search-item:last-child {
  border-bottom: none;
}

/* Imagen del producto */
.cz-search-item__image {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: #f5f5f5;
}

/* Info del producto */
.cz-search-item__info {
  flex: 1;
  min-width: 0;
}

.cz-search-item__title {
  font-size: 14px;
  font-weight: 600;
  color: #222;
  margin: 0 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cz-search-item__price {
  font-size: 15px;
  font-weight: 700;
  color: #e3aa55;
}

/* Mensaje cuando no hay resultados */
.cz-search-empty {
  padding: 24px 16px;
  text-align: center;
  color: #666;
  font-size: 14px;
}

/* Loading spinner */
.cz-search-loading {
  padding: 24px 16px;
  text-align: center;
  color: #999;
  font-size: 14px;
}

.cz-search-loading::after {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-left: 8px;
  border: 2px solid #e3aa55;
  border-top-color: transparent;
  border-radius: 50%;
  animation: czSearchSpin 0.6s linear infinite;
}

@keyframes czSearchSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive: Tablet y Mobile - buscador en su propia fila */
@media (max-width: 921px) {
  .cz-search-wrapper {
    width: 100%;
    max-width: 100%;
    padding: 12px 20px !important;
  }

  /* Restaurar gaps normales en mobile */
  .ast-builder-grid-row-container.site-header-focus-item {
    column-gap: 20px !important;
  }

  .site-header-primary-section-left.site-header-section,
  .site-header-primary-section-right.site-header-section {
    padding: 0 15px !important;
  }
}

/* Responsive: Mobile */
@media (max-width: 768px) {
  .cz-search-wrapper {
    min-width: auto;
    padding: 10px 16px !important;
  }

  .cz-search-container {
    padding: 0;
  }

  .cz-search-input {
    padding: 12px 16px 12px 46px;
    font-size: 14px;
  }

  .cz-search-icon {
    right: 16px;
    width: 18px;
    height: 18px;
  }

  .cz-search-results {
    max-height: 350px;
  }

  .cz-search-item {
    padding: 10px 14px;
  }

  .cz-search-item__image {
    width: 50px;
    height: 50px;
  }

  .cz-search-item__title {
    font-size: 13px;
  }

  .cz-search-item__price {
    font-size: 14px;
  }
}
