/* --------------------------------------------------------------------------
 * CraftArt Storefront Responsive Polish v1.1.28
 * Ajustes finos responsive sin tocar lógica ni estructura.
 * -------------------------------------------------------------------------- */

@media (max-width: 1180px) {
  body.craftart-storefront-child .casf-search-shell,
  body.craftart-storefront-child .casf-404-shell,
  body.craftart-storefront-child.casf-product-search-page.woocommerce .ast-container,
  body.craftart-storefront-child.casf-product-search-page.woocommerce .ast-woocommerce-container,
  body.craftart-storefront-child.casf-product-search-page.woocommerce #primary,
  body.craftart-storefront-child.casf-product-search-page.woocommerce .site-main {
    max-width: calc(100vw - 28px) !important;
  }

  body.craftart-storefront-child .casf-default-footer__inner,
  body.craftart-storefront-child .casf-default-footer__bottom {
    max-width: calc(100vw - 28px) !important;
  }
}

@media (max-width: 1024px) {
  body.craftart-storefront-child .casf-default-footer__grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 26px !important;
  }

  body.craftart-storefront-child .casf-default-footer__newsletter {
    grid-column: span 2;
  }

  body.craftart-storefront-child .casf-search-product-grid,
  body.craftart-storefront-child .casf-search-results-grid,
  body.craftart-storefront-child .casf-404-product-grid,
  body.craftart-storefront-child .casf-404-quick-row,
  body.error404.craftart-storefront-child .casf-product-grid,
  body.error404.craftart-storefront-child .casf-quick-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.craftart-storefront-child.casf-product-search-page.woocommerce ul.products,
  body.craftart-storefront-child.woocommerce ul.products,
  body.craftart-storefront-child .woocommerce ul.products {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  body.casf-account-page .entry-content > .woocommerce,
  body.casf-account-page article.page .woocommerce {
    max-width: calc(100vw - 28px) !important;
  }
}

@media (max-width: 820px) {
  body.craftart-storefront-child .casf-search-state-grid,
  body.craftart-storefront-child .casf-404-hero,
  body.error404.craftart-storefront-child .casf-404-hero {
    grid-template-columns: 1fr !important;
  }

  body.craftart-storefront-child .casf-search-hero,
  body.craftart-storefront-child .casf-404-hero,
  body.error404.craftart-storefront-child .casf-404-hero {
    border-radius: 24px !important;
    padding: 24px !important;
  }

  body.craftart-storefront-child .casf-search-hero h1,
  body.craftart-storefront-child .casf-404-hero h1,
  body.error404.craftart-storefront-child .casf-404-hero h1 {
    font-size: clamp(30px, 8vw, 44px) !important;
    line-height: 1.03 !important;
  }

  body.craftart-storefront-child .casf-404-visual,
  body.error404.craftart-storefront-child .casf-404-visual {
    min-height: 220px !important;
  }

  body.craftart-storefront-child .casf-404-number,
  body.error404.craftart-storefront-child .casf-404-number {
    font-size: clamp(92px, 24vw, 150px) !important;
  }

  body.casf-account-page .casf-account-hero,
  body.casf-account-page .woocommerce-MyAccount-content,
  body.casf-account-page .woocommerce-MyAccount-navigation {
    border-radius: 22px !important;
  }

  body.casf-account-page .woocommerce-MyAccount-navigation ul {
    display: flex !important;
    overflow-x: auto !important;
    gap: 8px !important;
    padding-bottom: 4px !important;
    scrollbar-width: thin;
  }

  body.casf-account-page .woocommerce-MyAccount-navigation li {
    flex: 0 0 auto !important;
  }

  body.casf-account-page .woocommerce-MyAccount-navigation li a {
    white-space: nowrap !important;
  }
}

@media (max-width: 680px) {
  body.craftart-storefront-child .casf-search-experience,
  body.craftart-storefront-child .casf-404-page,
  body.error404.craftart-storefront-child .casf-404-page {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  body.craftart-storefront-child .casf-search-box,
  body.craftart-storefront-child .casf-search-hero form.search-form,
  body.craftart-storefront-child .casf-search-hero .woocommerce-product-search,
  body.craftart-storefront-child .casf-404-search,
  body.error404.craftart-storefront-child .casf-404-search,
  body.craftart-storefront-child .casf-default-footer__newsletter-form {
    grid-template-columns: 1fr !important;
    border-radius: 22px !important;
  }

  body.craftart-storefront-child .casf-search-box button,
  body.craftart-storefront-child .casf-search-hero form.search-form input[type="submit"],
  body.craftart-storefront-child .casf-search-hero form.search-form button,
  body.craftart-storefront-child .casf-search-hero .woocommerce-product-search button,
  body.craftart-storefront-child .casf-404-search button,
  body.error404.craftart-storefront-child .casf-404-search button,
  body.craftart-storefront-child .casf-search-btn-primary,
  body.craftart-storefront-child .casf-search-btn-secondary,
  body.craftart-storefront-child .casf-404-btn-primary,
  body.craftart-storefront-child .casf-404-btn-secondary,
  body.error404.craftart-storefront-child .ca-btn-primary,
  body.error404.craftart-storefront-child .ca-btn-secondary,
  body.craftart-storefront-child .casf-default-footer__newsletter-form button {
    width: 100% !important;
  }

  body.craftart-storefront-child .casf-search-empty-actions,
  body.craftart-storefront-child .casf-404-actions,
  body.error404.craftart-storefront-child .casf-404-actions,
  body.error404.craftart-storefront-child .ca-404-actions,
  body.craftart-storefront-child .casf-search-products-header,
  body.craftart-storefront-child .casf-search-results-top,
  body.craftart-storefront-child .casf-404-recommended-top,
  body.error404.craftart-storefront-child .ca-recommended-top {
    flex-direction: column !important;
  }

  body.craftart-storefront-child .casf-default-footer__grid,
  body.craftart-storefront-child .casf-default-footer__trust {
    grid-template-columns: 1fr !important;
  }

  body.craftart-storefront-child .casf-default-footer__newsletter {
    grid-column: auto !important;
  }

  body.craftart-storefront-child .casf-default-footer__brand,
  body.craftart-storefront-child .casf-default-footer__col,
  body.craftart-storefront-child .casf-default-footer__newsletter,
  body.craftart-storefront-child .casf-default-footer__bottom,
  body.craftart-storefront-child .casf-default-footer__legal {
    text-align: center !important;
    justify-items: center !important;
  }

  body.craftart-storefront-child .casf-default-footer__links,
  body.craftart-storefront-child .casf-default-footer__socials {
    justify-content: center !important;
    justify-items: center !important;
  }

  body.craftart-storefront-child .casf-default-footer__bottom {
    justify-content: center !important;
  }

  body.craftart-storefront-child.casf-product-search-page.woocommerce ul.products,
  body.craftart-storefront-child.woocommerce ul.products,
  body.craftart-storefront-child .woocommerce ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px !important;
  }

  body.craftart-storefront-child .woocommerce table.shop_table_responsive tr,
  body.craftart-storefront-child .woocommerce-page table.shop_table_responsive tr {
    border-radius: 18px !important;
    overflow: hidden !important;
  }
}

@media (max-width: 520px) {
  body.craftart-storefront-child .casf-search-product-grid,
  body.craftart-storefront-child .casf-search-results-grid,
  body.craftart-storefront-child .casf-404-product-grid,
  body.error404.craftart-storefront-child .casf-product-grid,
  body.error404.craftart-storefront-child .ca-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  body.craftart-storefront-child .casf-404-quick-row,
  body.error404.craftart-storefront-child .casf-quick-row,
  body.error404.craftart-storefront-child .ca-quick-row {
    grid-template-columns: 1fr !important;
  }

  body.craftart-storefront-child.casf-product-search-page.woocommerce ul.products,
  body.craftart-storefront-child.woocommerce ul.products,
  body.craftart-storefront-child .woocommerce ul.products,
  body.casf-shop-page ul.products,
  body.casf-shop-page .woocommerce ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  body.craftart-storefront-child.woocommerce ul.products li.product,
  body.craftart-storefront-child .woocommerce ul.products li.product,
  body.casf-shop-page ul.products li.product,
  body.casf-shop-page .woocommerce ul.products li.product,
  body.craftart-storefront-child .casf-search-product-card,
  body.craftart-storefront-child .casf-search-result-card,
  body.craftart-storefront-child .casf-404-product-card {
    padding: 10px !important;
    border-radius: 18px !important;
  }

  body.craftart-storefront-child.woocommerce ul.products li.product .woocommerce-loop-product__title,
  body.craftart-storefront-child .woocommerce ul.products li.product .woocommerce-loop-product__title,
  body.casf-shop-page ul.products li.product .woocommerce-loop-product__title,
  body.casf-shop-page .woocommerce ul.products li.product .woocommerce-loop-product__title,
  body.craftart-storefront-child .casf-search-product-card strong,
  body.craftart-storefront-child .casf-search-result-card strong,
  body.craftart-storefront-child .casf-404-product-card strong {
    font-size: 13px !important;
    line-height: 1.25 !important;
  }

  body.craftart-storefront-child .casf-search-empty-card,
  body.craftart-storefront-child .casf-search-help-card,
  body.craftart-storefront-child .casf-search-products-card,
  body.craftart-storefront-child .casf-search-results-preview,
  body.craftart-storefront-child .casf-404-recommended,
  body.error404.craftart-storefront-child .ca-recommended {
    border-radius: 20px !important;
    padding: 18px !important;
  }

  body.craftart-storefront-child .casf-search-suggestions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px !important;
  }

  body.craftart-storefront-child .casf-search-suggestions a {
    width: 100% !important;
  }

  body.craftart-storefront-child .casf-default-footer__payment-card {
    flex-direction: column !important;
    gap: 10px !important;
    padding: 14px !important;
  }

  body.craftart-storefront-child .casf-default-footer__payment-card strong {
    font-size: 20px !important;
  }

  body.craftart-storefront-child .casf-default-footer__inner {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  body.casf-account-page .woocommerce-MyAccount-content,
  body.casf-account-page .woocommerce-MyAccount-navigation,
  body.casf-account-page .casf-account-hero {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}


/* --------------------------------------------------------------------------
 * v1.1.28 - Mobile visual width consistency
 * Búsqueda y 404 usan el mismo ancho percibido que tienda.
 * -------------------------------------------------------------------------- */
@media (max-width: 680px) {
  body.craftart-storefront-child .casf-search-experience,
  body.craftart-storefront-child .casf-404-page,
  body.error404.craftart-storefront-child .casf-404-page {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  body.craftart-storefront-child .casf-search-shell,
  body.craftart-storefront-child .casf-404-shell,
  body.error404.craftart-storefront-child .casf-404-shell {
    width: 100% !important;
    max-width: none !important;
  }

  body.craftart-storefront-child .casf-search-hero,
  body.craftart-storefront-child .casf-404-hero,
  body.error404.craftart-storefront-child .casf-404-hero {
    width: 100% !important;
    max-width: none !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}

/* --------------------------------------------------------------------------
 * v1.1.29 — final WooCommerce width/overflow polish, scoped away from header
 * -------------------------------------------------------------------------- */
body.craftart-storefront-child:not(.ast-header-break-point) main,
body.craftart-storefront-child main,
body.craftart-storefront-child .site-main,
body.craftart-storefront-child .entry-content,
body.craftart-storefront-child .woocommerce {
  box-sizing: border-box !important;
}

body.craftart-storefront-child .woocommerce table,
body.craftart-storefront-child .woocommerce form,
body.craftart-storefront-child .woocommerce fieldset,
body.craftart-storefront-child .woocommerce .shop_table,
body.craftart-storefront-child .woocommerce .cart_totals,
body.craftart-storefront-child .woocommerce .cross-sells,
body.craftart-storefront-child .woocommerce .woocommerce-order,
body.craftart-storefront-child .woocommerce .woocommerce-customer-details,
body.craftart-storefront-child .woocommerce .woocommerce-order-details,
body.craftart-storefront-child .woocommerce .woocommerce-billing-fields,
body.craftart-storefront-child .woocommerce .woocommerce-shipping-fields,
body.craftart-storefront-child .woocommerce .woocommerce-additional-fields {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

body.craftart-storefront-child .woocommerce form.login,
body.craftart-storefront-child .woocommerce form.checkout_coupon,
body.craftart-storefront-child .woocommerce .woocommerce-form-login,
body.craftart-storefront-child .woocommerce .woocommerce-form-coupon {
  border: 1px solid var(--casf-border, #E5E7EB) !important;
  border-radius: var(--casf-radius-lg, 24px) !important;
  background: #FFFFFF !important;
  box-shadow: 0 14px 30px rgba(15, 23, 42, .06) !important;
  padding: 20px !important;
  color: var(--casf-text, #111827) !important;
}

body.craftart-storefront-child .woocommerce form.login input.input-text,
body.craftart-storefront-child .woocommerce form.checkout_coupon input.input-text,
body.craftart-storefront-child .woocommerce .woocommerce-form-login input.input-text,
body.craftart-storefront-child .woocommerce .woocommerce-form-coupon input.input-text {
  min-height: 46px !important;
  border-radius: 14px !important;
  border: 1px solid var(--casf-border, #E5E7EB) !important;
  background: #FFFFFF !important;
  color: var(--casf-text, #111827) !important;
  box-shadow: none !important;
}

body.craftart-storefront-child .woocommerce form.login .button,
body.craftart-storefront-child .woocommerce form.checkout_coupon .button,
body.craftart-storefront-child .woocommerce .woocommerce-form-login .button,
body.craftart-storefront-child .woocommerce .woocommerce-form-coupon .button {
  min-height: 44px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: linear-gradient(135deg, var(--casf-primary, #1B9C85), var(--casf-primary-dark, #147A69)) !important;
  color: #FFFFFF !important;
  font-weight: 900 !important;
  box-shadow: 0 12px 24px rgba(27, 156, 133, .18) !important;
}

body.craftart-storefront-child .woocommerce-breadcrumb,
body.craftart-storefront-child nav.woocommerce-breadcrumb {
  max-width: 1240px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  color: var(--casf-muted, #6B7280) !important;
  font-size: 13px !important;
  font-weight: 750 !important;
}

body.craftart-storefront-child .woocommerce-breadcrumb a,
body.craftart-storefront-child nav.woocommerce-breadcrumb a {
  color: var(--casf-primary-deep, #0F5F53) !important;
  text-decoration: none !important;
  font-weight: 900 !important;
}

body.craftart-storefront-child .woocommerce-pagination ul.page-numbers,
body.craftart-storefront-child nav.woocommerce-pagination ul,
body.craftart-storefront-child .woocommerce nav.woocommerce-pagination ul {
  border: 0 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: 8px !important;
  margin-top: 26px !important;
}

body.craftart-storefront-child .woocommerce-pagination ul.page-numbers li,
body.craftart-storefront-child nav.woocommerce-pagination ul li,
body.craftart-storefront-child .woocommerce nav.woocommerce-pagination ul li {
  border: 0 !important;
  float: none !important;
}

body.craftart-storefront-child .woocommerce-pagination a.page-numbers,
body.craftart-storefront-child .woocommerce-pagination span.page-numbers,
body.craftart-storefront-child nav.woocommerce-pagination ul li a,
body.craftart-storefront-child nav.woocommerce-pagination ul li span,
body.craftart-storefront-child .woocommerce nav.woocommerce-pagination ul li a,
body.craftart-storefront-child .woocommerce nav.woocommerce-pagination ul li span {
  min-width: 40px !important;
  min-height: 40px !important;
  border-radius: 999px !important;
  border: 1px solid var(--casf-border, #E5E7EB) !important;
  background: #FFFFFF !important;
  color: var(--casf-text, #111827) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  text-decoration: none !important;
}

body.craftart-storefront-child .woocommerce-pagination span.current,
body.craftart-storefront-child nav.woocommerce-pagination ul li span.current,
body.craftart-storefront-child .woocommerce nav.woocommerce-pagination ul li span.current {
  border-color: var(--casf-primary, #1B9C85) !important;
  background: var(--casf-primary, #1B9C85) !important;
  color: #FFFFFF !important;
}

body.craftart-storefront-child .woocommerce-result-count,
body.craftart-storefront-child .woocommerce-ordering {
  max-width: 100% !important;
}

body.craftart-storefront-child .woocommerce-ordering select,
body.craftart-storefront-child select.orderby {
  min-height: 42px !important;
  max-width: 100% !important;
  border-radius: 999px !important;
  border: 1px solid var(--casf-border, #E5E7EB) !important;
  background-color: #FFFFFF !important;
  color: var(--casf-text, #111827) !important;
  font-size: 13px !important;
  font-weight: 850 !important;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .04) !important;
}

@media (max-width: 680px) {
  body.craftart-storefront-child .woocommerce form.login,
  body.craftart-storefront-child .woocommerce form.checkout_coupon,
  body.craftart-storefront-child .woocommerce .woocommerce-form-login,
  body.craftart-storefront-child .woocommerce .woocommerce-form-coupon {
    padding: 16px !important;
    border-radius: 20px !important;
  }

  body.craftart-storefront-child .woocommerce form.checkout_coupon,
  body.craftart-storefront-child .woocommerce .woocommerce-form-coupon {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  body.craftart-storefront-child .woocommerce form.checkout_coupon .form-row,
  body.craftart-storefront-child .woocommerce .woocommerce-form-coupon .form-row,
  body.craftart-storefront-child .woocommerce form.checkout_coupon input.input-text,
  body.craftart-storefront-child .woocommerce .woocommerce-form-coupon input.input-text,
  body.craftart-storefront-child .woocommerce form.checkout_coupon .button,
  body.craftart-storefront-child .woocommerce .woocommerce-form-coupon .button {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
  }

  body.craftart-storefront-child .woocommerce-result-count,
  body.craftart-storefront-child .woocommerce-ordering {
    width: 100% !important;
    float: none !important;
    clear: both !important;
    text-align: left !important;
  }

  body.craftart-storefront-child .woocommerce-ordering select,
  body.craftart-storefront-child select.orderby {
    width: 100% !important;
  }
}
