/* ─── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 1100px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .main-layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 84px;
    left: 0;
    bottom: 0;
    width: min(320px, 100%);
    max-width: 320px;
    display: none;
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    z-index: 1001;
    box-shadow: 2px 0 30px rgba(0, 0, 0, 0.15);
    background: var(--white);
  }

  .sidebar.open {
    display: block;
    transform: translateX(0);
  }

  .mobile-filter-toggle { display: flex; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .product-grid { grid-template-columns: 1fr; }
  .header-inner { gap: 8px; }
  .nav { display: none; }
  .wa-btn-header span { display: none; }
  .wa-btn-header { padding: 8px 10px; }
  .cart-toggle { padding: 8px 10px; gap: 6px; font-size: 0.82rem; }
  .header-actions { gap: 6px; }
  .logo-shape { width: 38px; height: 38px; }
  .logo-name { font-size: 0.88rem; }
  .footer-inner { grid-template-columns: 1fr; }
  .category-banner { flex-direction: column; gap: 16px; text-align: center; align-items: stretch; }
  .banner-details { max-width: 100%; }
  .banner-card { width: 100%; max-width: none; }
  .banner-tags { justify-content: center; }
  .trust-strip { grid-template-columns: 1fr; }
  .chatbot-container { width: calc(100% - 24px); height: 60vh; right: 12px; bottom: 80px; }
}

/* Otras media queries que estaban al final */
@media (max-width: 600px) {
  .catalog-controls {
    width: 100%;
    flex-wrap: wrap;
  }
  .search-input {
    min-width: 0;
    max-width: none;
    flex: 1 1 100%;
  }
  .sort-select {
    flex: 1 1 100%;
  }
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, 100%);
    max-width: 320px;
    z-index: 1000;
    background: var(--white);
    transform: translateX(-110%);
    transition: transform 0.28s ease;
    box-shadow: 2px 0 30px rgba(0, 0, 0, 0.16);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .catalog {
    position: relative;
  }

  .mobile-filter-toggle {
    display: flex;
  }

  .catalog-header {
    justify-content: space-between;
    gap: 14px;
  }
}

@media (max-width: 700px) {
  .welcome-box {
    padding: 28px 20px;
  }
  .catalog-header {
    justify-content: space-between;
    gap: 14px;
  }

  .header-inner {
    justify-content: space-between;
    padding: 0 18px;
  }

  .banner-text h2 {
    font-size: 1.4rem;
  }

  .banner-text p {
    font-size: 0.92rem;
  }

  .chatbot-container {
    width: calc(100% - 28px);
    right: 14px;
    bottom: 80px;
  }
}

/* ─── GRILLA DE PRODUCTOS MOBILE (2 columnas uniformes) ─── */
@media (max-width: 560px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .product-card {
    flex-direction: column;
    aspect-ratio: auto;
  }

  .product-img-wrap {
    width: 100%;
    min-width: 0;
    aspect-ratio: 1 / 1;
    flex-shrink: 1;
  }

  .product-img-wrap img {
    padding: 8px;
  }

  .product-info {
    padding: 10px;
    gap: 6px;
  }

  .product-brand {
    font-size: 0.65rem;
    letter-spacing: 0.8px;
    margin-bottom: 0;
  }

  .product-name {
    font-size: 0.92rem;
    min-height: 2.6em;
  }

  .product-notes {
    font-size: 0.75rem;
    min-height: 3em;
  }

  .price-original { font-size: 0.7rem; }
  .price-final    { font-size: 1.05rem; }
  .price-off-badge { font-size: 0.62rem; padding: 2px 6px; }

  .product-installment,
  .product-shipping {
    font-size: 0.68rem;
  }

  .product-actions {
    padding: 10px;
    margin-top: auto;
  }

  .btn-cart {
    padding: 10px 6px;
    font-size: 0.72rem;
    min-height: 40px;
  }

  .product-badge,
  .out-of-stock-badge {
    top: 8px;
    left: 8px;
    padding: 5px 8px;
    font-size: 0.62rem;
  }
}

/* ─── CARDS MÁS COMPACTAS ─── */

/* Desktop / tablet: imagen cuadrada en vez de vertical */
.product-img-wrap {
  aspect-ratio: 1 / 1;
}

@media (max-width: 560px) {
  .product-info {
    padding: 8px 10px;
    gap: 4px;
  }

  .product-volume {
    font-size: 0.62rem;
    padding: 2px 8px;
    margin-top: 0;
  }

  .product-name {
    font-size: 0.88rem;
    line-height: 1.25;
    min-height: 2.5em;
  }

  .product-notes {
    -webkit-line-clamp: 1;
    min-height: 0;
    line-height: 1.35;
  }

  .product-pricing {
    margin-top: 4px;
    padding-top: 6px;
  }

  .price-row {
    gap: 4px;
    margin-bottom: 2px;
  }

  .product-installment {
    margin-bottom: 0;
    line-height: 1.3;
  }

  .product-shipping {
    font-size: 0.65rem;
    line-height: 1.3;
  }

  .product-actions {
    padding: 8px 10px 10px;
  }

  .btn-cart {
    min-height: 38px;
    padding: 8px 6px;
  }

  /* ─── IMAGEN DE PRODUCTO CENTRADA ─── */
  .product-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .product-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    margin: 0 auto;
  }

  .product-img-wrap .img-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.7rem;
    display: grid;
    place-items: center;
    z-index: 3;
    transition: background 0.2s ease, color 0.2s ease;
  }

  .product-img-wrap .img-nav.prev { left: 6px; }
  .product-img-wrap .img-nav.next { right: 6px; }

  .product-img-wrap .img-nav:hover {
    transform: translateY(-50%);
    background: var(--gold);
    color: var(--black);
  }

  .product-img-wrap .img-counter {
    position: absolute;
    bottom: 8px;
    right: 8px;
    z-index: 3;
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
  }

  .product-main-img { transition: opacity 0.3s ease; }
}

/* ─── FILTROS OCULTOS (desktop y mobile) ─── */
main.main-layout:not(.order-page),
.sidebar,
.sidebar-backdrop,
.mobile-filter-toggle {
  display: none !important;
}

/* ─── STICKY: header + promo-bar + breadcrumb ─── */
:root { --header-h: 117px; }
@media (max-width: 1000px) {
  :root { --header-h: 111px; }
}

body { overflow-x: clip; }

.breadcrumb {
  position: sticky;
  top: calc(var(--header-h) - 1px);
  z-index: 99;
  background:
    linear-gradient(rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.02)),
    var(--black);
}

@media (min-width: 1381px) {
  .breadcrumb {
    max-width: none;
    padding-inline: calc((100% - 1380px) / 2 + 24px);
  }
}

html { scroll-padding-top: 176px; }

/* [INICIO_CAMBIOS_NAV_DROPDOWN] */
.nav-dropdown { position: relative; }

.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 16px;
  border-radius: 8px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--light-text);
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
}

.nav-dropdown-toggle::after {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 16px;
  right: 16px;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s ease;
}

.nav-dropdown-toggle:hover,
.nav-dropdown-toggle.active { color: var(--white); background: rgba(212, 175, 84, 0.1); }
.nav-dropdown-toggle.active { color: var(--gold); }

.nav-dropdown-toggle:hover::after,
.nav-dropdown-toggle.active::after,
.nav-dropdown.open .nav-dropdown-toggle::after { transform: scaleX(1); }

.nav-dropdown-caret { transition: transform 0.25s ease; flex-shrink: 0; }

.nav-dropdown.open .nav-dropdown-caret,
.nav-dropdown:hover .nav-dropdown-caret { transform: rotate(180deg); }

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 190px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-h);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 200;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }

.nav-dropdown-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--light-text);
  white-space: nowrap;
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a:focus-visible { background: rgba(212, 175, 84, 0.12); color: var(--gold); }

.nav-dropdown-toggle:focus-visible,
.nav-dropdown-menu a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
/* [FIN_CAMBIOS_NAV_DROPDOWN] */

/* [INICIO_CAMBIOS_MOBILE_NAV] */
.mobile-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  color: var(--white);
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.mobile-nav-toggle:hover,
.mobile-nav-toggle:focus-visible {
  border-color: var(--gold);
  color: var(--gold);
}

.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1500;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.mobile-nav-overlay.open { opacity: 1; visibility: visible; }

.mobile-nav-panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  max-height: 100%;
  overflow-y: auto;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-h);
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.mobile-nav-overlay.open .mobile-nav-panel { transform: translateY(0); }

.mobile-nav-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.mobile-nav-title {
  font-family: var(--font-disp);
  font-weight: 700;
  color: var(--white);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mobile-nav-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  color: var(--light-text);
  font-size: 1.1rem;
}

.mobile-nav-close:hover { color: var(--gold); }

.mobile-nav-list { display: flex; flex-direction: column; padding: 8px 0 16px; }

.mobile-nav-link {
  padding: 16px 20px;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--light-text);
  border-bottom: 1px solid var(--divider);
}

.mobile-nav-link:hover { color: var(--gold); background: rgba(212, 175, 84, 0.06); }

.mobile-nav-accordion { border-bottom: 1px solid var(--divider); }

.mobile-nav-accordion-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--light-text);
  cursor: pointer;
}

.mobile-nav-accordion-btn:hover { color: var(--gold); }

.mobile-nav-chevron { transition: transform 0.25s ease; flex-shrink: 0; }

.mobile-nav-accordion.open .mobile-nav-chevron { transform: rotate(180deg); }

.mobile-nav-sublist {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  background: rgba(255, 255, 255, 0.02);
}

.mobile-nav-accordion.open .mobile-nav-sublist { max-height: 300px; }

.mobile-nav-sublink {
  display: block;
  padding: 13px 20px 13px 36px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--mid-text);
}

.mobile-nav-sublink:hover { color: var(--gold); }

.mobile-nav-close:focus-visible,
.mobile-nav-toggle:focus-visible,
.mobile-nav-accordion-btn:focus-visible,
.mobile-nav-link:focus-visible,
.mobile-nav-sublink:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}

@media (max-width: 1000px) {
  .mobile-nav-toggle { display: inline-flex; }
}

@media (min-width: 1001px) {
  .mobile-nav-overlay { display: none !important; }
}
/* [FIN_CAMBIOS_MOBILE_NAV] */
/* [FIX_DESKTOP_MOBILE_NAV_HIDE] */
@media (min-width: 1001px) {
  .mobile-nav-overlay,
  .mobile-nav-overlay .mobile-nav-panel,
  .mobile-nav-overlay .mobile-nav-list {
    display: none !important;
  }
}
