/* ==========================================================================
   ILRITORNO — critical-fixes.css
   Fixes urgentes según feedback David
   ========================================================================== */

/* ============================================================
   POP-UP visibilidad (no se mostraba en desktop ni mobile)
   ============================================================ */
.ir-popup {
  display: flex !important;
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
  visibility: hidden;
}
.ir-popup[hidden] {
  display: none !important;
}
.ir-popup.is-visible,
.ir-popup:not([hidden]) {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

/* ============================================================
   PRODUCTOS RELACIONADOS — 1 fila scroll horizontal
   ============================================================ */
.related.products,
.up-sells.upsells {
  margin-top: 4rem !important;
  padding-top: 3rem !important;
  border-top: 1px solid var(--ir-line) !important;
}

.related.products > h2,
.up-sells.upsells > h2 {
  text-align: center !important;
  font-size: 2rem !important;
  font-family: var(--ir-font-display) !important;
  font-weight: 400 !important;
  margin-bottom: 2rem !important;
}

.related.products ul.products,
.up-sells.upsells ul.products {
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  gap: 1.5rem !important;
  padding: 0.5rem 0 1.5rem !important;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--ir-earth) var(--ir-line);
}

.related.products ul.products::-webkit-scrollbar,
.up-sells.upsells ul.products::-webkit-scrollbar {
  height: 6px;
}
.related.products ul.products::-webkit-scrollbar-track,
.up-sells.upsells ul.products::-webkit-scrollbar-track {
  background: var(--ir-line);
  border-radius: 3px;
}
.related.products ul.products::-webkit-scrollbar-thumb,
.up-sells.upsells ul.products::-webkit-scrollbar-thumb {
  background: var(--ir-earth);
  border-radius: 3px;
}

.related.products ul.products li.product,
.up-sells.upsells ul.products li.product {
  flex: 0 0 calc(50% - 0.75rem) !important;
  max-width: calc(50% - 0.75rem) !important;
  scroll-snap-align: start;
  min-width: 0;
}

@media (min-width: 768px) {
  .related.products ul.products li.product,
  .up-sells.upsells ul.products li.product {
    flex: 0 0 calc(50% - 0.75rem) !important;
    max-width: calc(50% - 0.75rem) !important;
  }
}

@media (max-width: 600px) {
  .related.products ul.products li.product,
  .up-sells.upsells ul.products li.product {
    flex: 0 0 calc(85% - 0.75rem) !important;
    max-width: calc(85% - 0.75rem) !important;
  }
}

/* ============================================================
   MI CUENTA — fix logged in (columnas rotas)
   ============================================================ */
body.woocommerce-account.logged-in .woocommerce {
  display: block !important;
}

@media (min-width: 1024px) {
  body.woocommerce-account.logged-in .woocommerce {
    display: grid !important;
    grid-template-columns: 280px 1fr !important;
    gap: 3rem !important;
    align-items: start !important;
  }
}

body.woocommerce-account .woocommerce-MyAccount-navigation,
body.woocommerce-account .woocommerce-MyAccount-content {
  width: 100% !important;
  float: none !important;
  margin: 0 !important;
}

body.woocommerce-account .woocommerce-MyAccount-content {
  min-width: 0 !important;
}

/* Forzar lista de pedidos / direcciones a no romper */
body.woocommerce-account .u-columns,
body.woocommerce-account .col2-set,
body.woocommerce-account .addresses {
  display: block !important;
  width: 100% !important;
}

body.woocommerce-account .col-1,
body.woocommerce-account .col-2,
body.woocommerce-account .u-column1,
body.woocommerce-account .u-column2 {
  width: 100% !important;
  float: none !important;
  margin: 0 0 1.5rem !important;
  padding: 0 !important;
}

@media (min-width: 768px) {
  body.woocommerce-account .addresses,
  body.woocommerce-account.logged-in .col2-set {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 1.5rem !important;
  }
  body.woocommerce-account .addresses .col-1,
  body.woocommerce-account .addresses .col-2,
  body.woocommerce-account .addresses .u-column1,
  body.woocommerce-account .addresses .u-column2,
  body.woocommerce-account.logged-in .col2-set .col-1,
  body.woocommerce-account.logged-in .col2-set .col-2 {
    margin: 0 !important;
  }
}

/* ============================================================
   SINGLE BLOG — sin espacios extras de header/footer
   ============================================================ */
body.single-post .single-post {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

body.single-post #site-main,
body.single-post .site-wrapper {
  background: transparent !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.single-post .single-post__hero {
  padding-block: 3rem 2rem !important;
  background: rgba(195, 198, 169, 0.10);
}

body.single-post .single-post__body {
  padding-bottom: 3rem !important;
}

/* Quitar márgenes que crean bandas de color */
body.single-post .container > * + * {
  margin-top: 0;
}

/* Comentarios single post — bg transparente */
body.single-post .comments-area {
  background: transparent !important;
  padding-block: 2rem !important;
}

/* ============================================================
   POP-UP visibility forced
   ============================================================ */
.ir-popup__panel {
  transform: scale(0.92) translateY(20px);
  transition: transform 350ms cubic-bezier(.34, 1.56, .64, 1);
}
.ir-popup.is-visible .ir-popup__panel,
.ir-popup:not([hidden]) .ir-popup__panel {
  transform: scale(1) translateY(0);
}
