/* ===== Mamafit · tablet y celular según la web en línea ===== */

@media (max-width:921px){
  /* Header: 55 px en tablet; hamburguesa con marco, logo a su lado e íconos juntos a la derecha */
  #ast-mobile-header .ast-primary-header-bar.main-header-bar{ min-height:55px; padding:0; border:0 !important; box-shadow:0 0 10px rgba(0,0,0,.15); }
  #ast-mobile-header .ast-primary-header-bar .site-primary-header-wrap.ast-container{ padding:0 8px 0 10px; }
  #ast-mobile-header .ast-primary-header-bar .ast-builder-grid-row{ display:flex; align-items:center; min-height:55px !important; height:55px; gap:10px; }
  #ast-mobile-header .site-header-primary-section-left{ flex:0 0 auto; }
  #ast-mobile-header .site-header-primary-section-center{ flex:1 1 auto; justify-content:flex-start; }
  #ast-mobile-header .site-header-primary-section-right{ flex:0 0 auto; display:flex; align-items:center; justify-content:flex-end; gap:12px; }
  #ast-mobile-header .site-header-primary-section-right .ast-builder-layout-element,#ast-mobile-header .site-header-primary-section-right .ast-header-account-wrap,#ast-mobile-header .site-header-primary-section-right .ast-header-account{ display:flex; align-items:center; margin:0; padding:0; }
  #ast-mobile-header .site-branding{ padding:0; }
  #ast-mobile-header .site-logo-img img{ width:150px !important; max-width:150px !important; height:auto; }
  #ast-mobile-header .ast-header-search .ast-search-icon a{ display:flex; margin:0; padding:0; }
  #ast-mobile-header .ast-header-search .ast-search-icon .astra-search-icon{ width:20px; height:20px; line-height:20px; }
  #ast-mobile-header .ast-header-woo-cart{ margin-right:5px !important; }

  /* Botón de menú: cuadro de 32 px con borde rosa y tres barras gruesas; abierto, una X morada */
  #ast-mobile-header .menu-toggle,#ast-mobile-header .menu-toggle:hover,#ast-mobile-header .menu-toggle:focus{ display:flex; align-items:center; justify-content:center; width:32px; height:32px; min-width:32px; min-height:32px; padding:0; border:1px solid var(--mf-rosa); border-radius:0; background:transparent; }
  #ast-mobile-header .menu-toggle .mobile-menu-toggle-icon svg{ display:none; }
  #ast-mobile-header .menu-toggle .mobile-menu-toggle-icon{ display:block; width:18px; height:14px; margin:0; background:linear-gradient(var(--mf-rosa),var(--mf-rosa)) 0 0/18px 3px no-repeat,linear-gradient(var(--mf-rosa),var(--mf-rosa)) 0 5.5px/18px 3px no-repeat,linear-gradient(var(--mf-rosa),var(--mf-rosa)) 0 11px/18px 3px no-repeat; }
  #ast-mobile-header .menu-toggle.toggled .mobile-menu-toggle-icon{ position:relative; background:none; }
  #ast-mobile-header .menu-toggle.toggled .mobile-menu-toggle-icon::before,#ast-mobile-header .menu-toggle.toggled .mobile-menu-toggle-icon::after{ content:""; position:absolute; left:-1px; top:5.5px; width:20px; height:3px; background:var(--mf-morado); transform:rotate(45deg); }
  #ast-mobile-header .menu-toggle.toggled .mobile-menu-toggle-icon::after{ transform:rotate(-45deg); }

  /* Menú desplegable: panel blanco, mayúsculas de 14 px, flecha junto al texto y sin líneas */
  #ast-mobile-header .ast-mobile-header-content{ max-height:calc(100svh - 70px); overflow-y:auto; background:#fff; box-shadow:0 8px 18px rgba(0,0,0,.12); }
  #ast-mobile-header .ast-mobile-header-content .main-header-menu,#ast-mobile-header .ast-mobile-header-content .sub-menu{ border:0 !important; background:#fff; }
  #ast-mobile-header .ast-mobile-header-content .menu-item{ display:flex; flex-wrap:wrap; align-items:center; width:100%; margin:0; border:0 !important; }
  #ast-mobile-header .ast-mobile-header-content .menu-item > .menu-link{ flex:0 1 auto; width:auto; padding:13px 6px 13px 10px !important; border:0 !important; font-size:14px; line-height:21px; text-transform:uppercase; color:#000; background:transparent; }
  #ast-mobile-header .ast-mobile-header-content .menu-item.current-menu-item > .menu-link{ color:var(--mf-rosa); }
  #ast-mobile-header .ast-mobile-header-content .ast-menu-toggle{ position:static; display:flex; align-items:center; justify-content:center; width:44px; height:47px; padding:0; margin:0; border:0 !important; background:transparent; color:#000; transform:none; }
  #ast-mobile-header .ast-mobile-header-content .menu-link .ast-header-navigation-arrow,#ast-mobile-header .ast-mobile-header-content .menu-link > .ast-icon{ display:none; }
  #ast-mobile-header .ast-mobile-header-content .sub-menu{ flex:0 0 100%; padding-left:14px; box-shadow:none; }
  #ast-mobile-header .ast-mobile-header-content .sub-menu .menu-link{ padding:10px 10px !important; font-size:13px; }

  /* Franja de envíos */
  #ast-mobile-header .ast-below-header-bar{ min-height:0; padding:0; }
  #ast-mobile-header .ast-below-header-bar .ast-builder-grid-row,#ast-mobile-header .ast-below-header-bar .site-below-header-wrap{ min-height:0 !important; }
  #ast-mobile-header .ast-below-header-bar .ast-header-html{ padding:10px 0; font-size:14px; font-weight:400; line-height:21px; }
}

@media (max-width:767px){
  #ast-mobile-header .ast-primary-header-bar.main-header-bar,#ast-mobile-header .ast-primary-header-bar .ast-builder-grid-row{ min-height:50px !important; height:50px; }
  #ast-mobile-header .site-logo-img img{ width:134px !important; max-width:134px !important; }

  /* Footer centrado, como el original */
  .site-footer .site-primary-footer-wrap .site-footer-section{ align-items:center; text-align:center; }
  .site-footer .footer-widget-area,.site-footer .widget{ width:100%; text-align:center; }
  .site-footer .widget_nav_menu ul{ display:inline-block; text-align:left; }
  .site-footer .ast-footer-social-1-wrap,.site-footer .ast-footer-social-wrap{ justify-content:center; gap:14px; }
  .site-footer .widget_custom_html img{ display:block; margin:0 auto; }
  .site-footer .widget-title{ text-align:center; }
  .site-footer .site-below-footer-wrap .ast-builder-grid-row{ padding-top:18px; padding-bottom:18px; }
  .site-footer .ast-footer-copyright{ text-align:center; line-height:2.1; }
}

/* Footer: fondo gris muy claro en todas las pantallas */
.site-footer .site-primary-footer-wrap{ background:#f7f9f9 !important; }

/* ===== Boletín: campo transparente con borde blanco y botón blanco ===== */
@media (min-width:768px){
}

@media (max-width:921px){
  /* márgenes laterales exactos */
  #masthead #ast-mobile-header .ast-primary-header-bar .site-primary-header-wrap.ast-container{ padding-left:0; padding-right:0; margin:0; max-width:100%; }
  #masthead #ast-mobile-header .ast-primary-header-bar .ast-builder-grid-row{ padding:0 0 0 10px; }
  #masthead #ast-mobile-header .site-header-primary-section-left,#masthead #ast-mobile-header .site-header-primary-section-left .ast-builder-layout-element{ margin:0; padding:0; }
  #masthead #ast-mobile-header .ast-header-woo-cart{ margin:0 9px 0 0 !important; }
  /* menú: texto y flecha en la misma línea, alineados a la izquierda */
  #masthead #ast-mobile-header .ast-mobile-header-content .main-header-menu .menu-item{ display:flex !important; flex-direction:row; flex-wrap:wrap; justify-content:flex-start !important; text-align:left; }
  #masthead #ast-mobile-header .ast-mobile-header-content .main-header-menu .menu-item > .menu-link{ display:block; flex:0 0 auto !important; width:auto !important; text-align:left; justify-content:flex-start; }
  #masthead #ast-mobile-header .ast-mobile-header-content .main-header-menu .menu-item > .ast-menu-toggle{ position:static !important; flex:0 0 36px; width:36px !important; height:47px; right:auto; top:auto; }
  #masthead #ast-mobile-header .ast-mobile-header-content .main-header-menu .menu-item > .sub-menu{ flex:0 0 100%; width:100%; }
}
@media (max-width:921px){ #masthead #ast-mobile-header .ast-primary-header-bar.main-header-bar{ padding-left:0 !important; padding-right:0 !important; } }
@media (max-width:767px){
  #colophon .ast-footer-social-1-wrap{ display:flex !important; width:100%; justify-content:center !important; }
  #colophon .ast-footer-copyright,#colophon .ast-footer-copyright p{ display:block; width:100%; max-width:100%; padding:0 8px; white-space:normal; text-align:center; }
  #colophon .site-below-footer-wrap .ast-builder-grid-row-container-inner,#colophon .site-below-footer-wrap .ast-builder-grid-row{ max-width:100%; min-width:0; grid-template-columns:minmax(0,1fr) !important; }
}
@media (max-width:921px){
  #masthead #ast-mobile-header .ast-mobile-header-content .main-header-menu .menu-item > .menu-link{ order:1; }
  #masthead #ast-mobile-header .ast-mobile-header-content .main-header-menu .menu-item > .ast-menu-toggle{ order:2; box-shadow:none !important; background:transparent !important; }
  #masthead #ast-mobile-header .ast-mobile-header-content .main-header-menu .menu-item > .sub-menu{ order:3; position:static !important; inset:auto; transform:none !important; margin:0; visibility:visible; opacity:1; }
  #masthead #ast-mobile-header .ast-mobile-header-content .main-header-menu .menu-item > .ast-menu-toggle svg,#masthead #ast-mobile-header .ast-mobile-header-content .main-header-menu .menu-item > .ast-menu-toggle .ast-icon{ transition:transform .25s; }
  #masthead #ast-mobile-header .ast-mobile-header-content .main-header-menu .menu-item > .ast-menu-toggle[aria-expanded="true"] .ast-icon{ transform:rotate(180deg); }
}
@media (max-width:921px){
  #masthead #ast-mobile-header .ast-mobile-header-content .main-header-menu .menu-item{ display:grid !important; grid-template-columns:auto 36px 1fr; grid-auto-rows:min-content; align-content:start; height:auto !important; min-height:0 !important; max-height:none !important; }
  #masthead #ast-mobile-header .ast-mobile-header-content .main-header-menu .menu-item > .menu-link{ grid-column:1; grid-row:1; height:47px; }
  #masthead #ast-mobile-header .ast-mobile-header-content .main-header-menu .menu-item:not(.menu-item-has-children) > .menu-link{ grid-column:1 / -1; }
  #masthead #ast-mobile-header .ast-mobile-header-content .main-header-menu .menu-item > .ast-menu-toggle{ grid-column:2; grid-row:1; align-self:center; }
  #masthead #ast-mobile-header .ast-mobile-header-content .main-header-menu .menu-item > .sub-menu{ grid-column:1 / -1; grid-row:2; width:100%; height:auto !important; top:auto !important; }
  #masthead #ast-mobile-header .ast-mobile-header-content .main-header-menu .sub-menu .menu-item > .menu-link{ height:auto; }
}

/* Boletín: sin texto extra ni huecos */
@media (max-width:767px){ #colophon .widget_nav_menu li{ margin-bottom:8px; } }

/* Tablet: carruseles con 4 tarjetas, como el original */
@media (min-width:768px) and (max-width:1024px){
  .mf-carrusel{ padding:0 30px; }
  .mf-pista{ gap:12px; }
  .mf-pista > .mf-card{ flex-basis:calc((100% - 36px) / 4); }
  .mf-pista .mf-card .mf-card__titulo,.mf-pista .mf-card .mf-card__titulo a{ font-size:16px; }
  .mf-pista .mf-card .button{ padding:8px 8px; font-size:13px; }
}

/* ===== Tienda y ficha en celular / tablet ===== */
.mf-filtrar{ display:none; }
@media (max-width:921px){
  .mf-con-filtrar .mf-filtrar{ display:flex; align-items:center; justify-content:center; gap:8px; width:100%; min-height:46px; margin:0 0 14px; padding:10px 16px; border:1px solid var(--mf-rosa); border-radius:3px; background:#fff; color:var(--mf-rosa); font-size:14px; font-weight:700; }
  .mf-con-filtrar .mf-filtrar[aria-expanded="true"]{ background:var(--mf-rosa); color:#fff; }
  .mf-con-filtrar .site-content > .ast-container{ display:flex; flex-direction:column; }
  .mf-con-filtrar .mf-filtrar{ order:1; margin-top:14px; }
  .mf-con-filtrar #secondary{ order:2; display:none; width:100%; margin:0 0 10px; padding:0 4px; border:0 !important; }
  .mf-con-filtrar #secondary.es-abierto{ display:block; }
  .mf-con-filtrar #primary{ order:3; width:100%; margin:0; padding-top:0; }
  .post-type-archive-product .site-content > .ast-container,.tax-product_cat .site-content > .ast-container{ padding-top:0; }
  .post-type-archive-product #primary .woocommerce-breadcrumb,.tax-product_cat #primary .woocommerce-breadcrumb{ margin-top:6px; }
}
@media (max-width:767px){
  body.single-product .product_title{ font-size:25px; line-height:1.15; }
}
@media (max-width:921px){ body.mf-con-filtrar .site-content > .ast-container{ flex-direction:column !important; } }

/* Flechas del menú móvil: giran sobre su propio centro. Se anula el volteo que Astra aplica a todo el botón
   y el margen de 10 px que descentraba la flecha respecto del eje de giro. */
@media (max-width:1024px){
  #masthead #ast-mobile-header .ast-mobile-header-content .main-header-menu .menu-item > .ast-menu-toggle,
  #masthead #ast-mobile-header .ast-mobile-header-content .main-header-menu .menu-item.ast-submenu-expanded > .ast-menu-toggle{ transform:none !important; transition:none !important; }
  #masthead #ast-mobile-header .ast-mobile-header-content .main-header-menu .menu-item > .ast-menu-toggle > .ast-icon{ display:block; flex:0 0 14px; width:14px; height:14px; margin:0; padding:0; background:currentColor; -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 20 320 512'%3E%3Cpath d='M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z'/%3E%3C/svg%3E") center/contain no-repeat; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 20 320 512'%3E%3Cpath d='M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z'/%3E%3C/svg%3E") center/contain no-repeat; transform-origin:50% 50%; transition:transform .25s ease; }
  #masthead #ast-mobile-header .ast-mobile-header-content .main-header-menu .menu-item > .ast-menu-toggle > .ast-icon svg,#masthead #ast-mobile-header .ast-mobile-header-content .main-header-menu .menu-item > .ast-menu-toggle > .ast-icon::after{ display:none !important; }
}
@media (prefers-reduced-motion:reduce){ #masthead #ast-mobile-header .ast-menu-toggle > .ast-icon{ transition:none !important; } }

/* =========== Revisión responsive (el diseño de escritorio es la referencia) =========== */
/* 404: aire arriba y abajo (Astra anulaba el relleno) */
body #page main#primary.mf-404{ margin:0; padding:70px 20px 90px; }
@media (max-width:767px){ body #page main#primary.mf-404{ padding:40px 0 56px; } }

@media (max-width:921px){
  /* Carrito y finalizar compra: el título no se pega a la franja */
  body.woocommerce-cart #page .site-content #primary,body.woocommerce-checkout #page .site-content #primary{ padding-top:30px; padding-bottom:44px; }
  body.woocommerce-cart #primary .entry-header,body.woocommerce-checkout #primary .entry-header{ margin-bottom:18px; }
  body.woocommerce-cart #primary .entry-title,body.woocommerce-checkout #primary .entry-title{ margin:0; }
  /* Tienda, categorías, listados y búsqueda: separación antes del footer */
  body:is(.woocommerce-shop,.tax-product_cat,.tax-product_tag,.search,.mf-con-filtrar) #page .site-content #primary{ padding-bottom:52px; }
}
@media (min-width:922px) and (max-width:1024px){
  body:is(.woocommerce-cart,.woocommerce-checkout) #page .site-content #primary{ padding-top:40px; padding-bottom:56px; }
}

/* Footer en celular: títulos, enlaces y copyright centrados sobre el mismo eje */
@media (max-width:767px){
  #colophon .widget_nav_menu ul{ display:block !important; margin-left:0; margin-right:0; text-align:center !important; }
  #colophon .widget_nav_menu li{ text-align:center; }
  #colophon .widget_nav_menu a{ display:inline-block; padding:3px 8px; }
  #colophon .mf-copy-sep{ display:block; height:0; overflow:hidden; font-size:0; }
  #colophon .ast-footer-copyright{ line-height:1.9; }
}

/* Boletín de la portada: mismo aire lateral que el resto del contenido */
@media (max-width:767px){
  .elementor .mf-form--boletin{ padding-left:20px; padding-right:20px; }
}

/* Páginas informativas en celular: margen lateral igual al de la tienda y el blog */
@media (max-width:767px){
  body:is(.page-id-4777,.page-id-4782,.page-id-1248,.page-id-1255) .elementor > .e-con{ --padding-left:16px; --padding-right:16px; }
}

/* Contáctanos: sin hueco bajo el botón de enviar */
.mf-form.mf-form--contacto{ margin-bottom:0; }

/* Textos pequeños */
.woocommerce-checkout form.checkout small,.woocommerce-checkout .mf-pais small{ font-size:12.5px !important; }
body.single-post #primary .post-navigation a .ast-post-nav{ font-size:12.5px; }

/* Carrito en celular y tablet vertical: la × va en la esquina (sin una fila vacía) y la foto se ve mejor */
@media (max-width:768px){
  body.woocommerce-cart table.shop_table_responsive tr.cart_item{ position:relative; display:block; }
  body.woocommerce-cart table.shop_table_responsive tr.cart_item td.product-remove{ position:absolute; z-index:2; top:12px; right:12px; width:auto; padding:0 !important; border:0 !important; background:transparent !important; }
  body.woocommerce-cart table.shop_table_responsive tr.cart_item td.product-thumbnail{ padding-top:16px !important; padding-bottom:16px !important; border-top:0 !important; }
  body.woocommerce-cart table.shop_table_responsive tr.cart_item td.product-thumbnail img{ width:96px !important; max-width:96px !important; }
}

/* Celulares angostos: cupón a todo el ancho y textos de ayuda de los campos sin cortes */
@media (max-width:420px){
  body.woocommerce-cart table.cart td.actions .coupon{ display:flex; flex-direction:column; gap:8px; width:100%; }
  body.woocommerce-cart table.cart td.actions .coupon #coupon_code{ width:100% !important; max-width:100%; margin:0; float:none; }
  body.woocommerce-cart table.cart td.actions .coupon .button{ width:100%; margin:0; float:none; }
  body.woocommerce-checkout form.checkout input.input-text::placeholder{ font-size:14px; }
}

/* ---------- Tablet vertical: se conserva la composición de escritorio ---------- */
@media (min-width:768px) and (max-width:921px){
  /* Tienda, categorías y búsqueda: 3 columnas como en escritorio */
  body.woocommerce-page #primary ul.products,body.woocommerce #primary ul.products,body.mf-con-filtrar #primary ul.products{ grid-template-columns:repeat(3,minmax(0,1fr)) !important; column-gap:16px; }
  /* Relacionados del producto: 4 en una fila */
  body.single-product #primary .related.products ul.products,body.single-product #primary .up-sells ul.products{ grid-template-columns:repeat(4,minmax(0,1fr)) !important; column-gap:12px; }
  body.single-product #primary .related ul.products .button{ padding-left:8px; padding-right:8px; white-space:normal; }
  /* Ficha de producto: foto a la izquierda y datos a la derecha */
  body.single-product #page #primary div.product > div.woocommerce-product-gallery{ float:left; width:47% !important; max-width:47%; margin-right:0; }
  body.single-product #page #primary div.product > div.summary{ float:right; width:49% !important; max-width:49%; margin-top:0; }
  /* Footer: el título de las tarjetas en una sola línea */
  #colophon .widget-title{ font-size:16px !important; }
  /* Blog: 2 columnas */
  body:is(.blog,.archive) #primary .ast-row{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:20px; margin-left:0; margin-right:0; }
  body:is(.blog,.archive) #primary .ast-row::before,body:is(.blog,.archive) #primary .ast-row::after{ display:none; }
  body.blog #primary .ast-row > article,body.archive.category #primary .ast-row > article{ width:100%; max-width:100%; padding-left:0; padding-right:0; }
}
/* Páginas informativas en tablet: mismo margen lateral que el resto */
@media (min-width:768px) and (max-width:940px){
  body:is(.page-id-4777,.page-id-4782,.page-id-1248,.page-id-1255) .elementor > .e-con{ --padding-left:20px; --padding-right:20px; }
}
@media (min-width:768px) and (max-width:921px){
  body.blog #page #content > .ast-container,body.archive.category #page #content > .ast-container{ padding-left:20px; padding-right:20px; }
}

/* Buscador en celular: mientras está abierto, el logo se oculta para que no quede tapado a medias */
@media (max-width:921px){ #masthead #ast-mobile-header:has(.ast-search-menu-icon.ast-dropdown-active) .site-logo-img{ visibility:hidden; } }

/* ---------- Títulos en tablet (768–1024 px): promedio entre escritorio y celular ----------
   Los títulos hechos con Elementor tienen su tamaño de tablet en el propio widget (pestaña Estilo). */
@media (min-width:768px) and (max-width:1024px){
  /* Mi Cuenta: 40 / 32 */
  html body.woocommerce-account .mf-cuenta__titulo{ font-size:36px; line-height:41px; }
  /* Producto y relacionados: 32 / 25 */
  body.single-product #page #primary div.product .product_title,body.single-product #page #primary .related.products > h2{ font-size:28px !important; line-height:1.25; }
  /* Blog (38 / 29) y entrada (34 / 26) */
  body #page #primary .mf-blog-cabecera h1,body #page #primary .ast-archive-description h1{ font-size:34px; }
  body.single-post #page #primary .ast-article-single h1.entry-title{ font-size:30px; }
  /* 404: 38 / 26 */
  body #page .mf-404 .mf-404__titulo{ font-size:32px; }
}
