/* =========================================================
   SELECT SEVEN · MOBILE COMMERCE 1.3
   Mobile is a deliberate interface, not a scaled desktop layout.
   Loaded after the main WooCommerce stylesheet.
   ========================================================= */

@media (max-width: 900px) {
  :root{--s7-shell:min(calc(100% - 28px),1280px)}

  /* Header: compact but touch-friendly. */
  #masthead.site-header::after{height:3px}
  .s7-header-shell{min-height:64px;grid-template-columns:auto auto 1fr;gap:8px}
  .s7-brand__mark{width:58px;height:40px}
  .s7-mobile-toggle{width:40px;height:40px;border-radius:11px}
  .s7-header-tools{gap:2px}
  .s7-header-tools .s7-tool-button{width:40px;min-width:40px;height:40px;padding:0;border-radius:11px}
  .s7-header-tools .s7-tool-button[aria-label="Mi cuenta"]{display:none}
  .s7-cart-price{display:none!important}
  .main-navigation{inset:64px 0 0}
  body.admin-bar .main-navigation{inset:110px 0 0}

  /* Breadcrumbs are useful on desktop but steal the first mobile screen. */
  .woocommerce .woocommerce-breadcrumb{display:none}

  /* ---------- Single product ---------- */
  .single-product .woocommerce{padding:10px 0 48px}
  .single-product div.product{
    width:min(calc(100% - 20px),720px)!important;
    margin:8px auto 0!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap:14px!important;
  }

  /* Gallery: never consumes the whole first screen. */
  .single-product div.product .woocommerce-product-gallery{
    position:relative!important;
    top:auto!important;
    width:100%!important;
    max-width:100%!important;
    margin:0!important;
  }
  .single-product div.product .woocommerce-product-gallery__wrapper,
  .single-product div.product .woocommerce-product-gallery .flex-viewport{
    width:100%!important;
    height:min(76vw,50svh)!important;
    min-height:280px!important;
    max-height:470px!important;
    border:1px solid var(--s7-line)!important;
    border-radius:18px!important;
    background:linear-gradient(145deg,#fff,#f8f7fb)!important;
    overflow:hidden!important;
  }
  .single-product div.product .woocommerce-product-gallery .flex-viewport .woocommerce-product-gallery__wrapper{
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    border:0!important;
    border-radius:0!important;
    background:transparent!important;
  }
  .single-product div.product .woocommerce-product-gallery__image,
  .single-product div.product .woocommerce-product-gallery__image a{
    height:100%!important;
    min-height:0!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
  }
  .single-product div.product .woocommerce-product-gallery__image img{
    display:block!important;
    width:100%!important;
    height:100%!important;
    max-height:100%!important;
    padding:8px!important;
    object-fit:contain!important;
  }
  .single-product .woocommerce-product-gallery__trigger{
    top:12px!important;right:12px!important;
    width:40px!important;height:40px!important;
    display:grid!important;place-items:center!important;
    border:1px solid rgba(17,17,36,.08)!important;
    border-radius:50%!important;
    background:rgba(255,255,255,.92)!important;
    box-shadow:0 8px 24px rgba(25,20,55,.08)!important;
  }
  .single-product .flex-control-thumbs{
    display:flex!important;
    gap:8px!important;
    margin:9px 0 0!important;
    padding:0 1px 2px!important;
    overflow-x:auto!important;
    scroll-snap-type:x proximity;
    scrollbar-width:none;
  }
  .single-product .flex-control-thumbs::-webkit-scrollbar{display:none}
  .single-product .flex-control-thumbs li{
    flex:0 0 62px!important;
    width:62px!important;
    scroll-snap-align:start;
  }
  .single-product .flex-control-thumbs img{
    width:62px!important;height:62px!important;
    padding:3px!important;object-fit:contain!important;
    border-radius:10px!important;
  }

  /* Product information: readable hierarchy and no desktop card scaling. */
  .single-product div.product .summary{
    width:100%!important;
    margin:0!important;
    padding:18px 14px 16px!important;
    border:1px solid var(--s7-line)!important;
    border-radius:18px!important;
    box-shadow:0 12px 34px rgba(35,30,70,.055)!important;
  }
  .single-product .product_title{
    margin:0 0 10px!important;
    font-size:clamp(1.35rem,6vw,1.65rem)!important;
    line-height:1.12!important;
    letter-spacing:-.03em!important;
    text-wrap:balance;
  }
  .single-product .summary .price{
    margin:0 0 12px!important;
    font-size:1.35rem!important;
    line-height:1.15!important;
    font-weight:850!important;
  }
  .single-product .woocommerce-product-details__short-description{
    margin:0 0 14px!important;
    font-size:.94rem!important;
    line-height:1.55!important;
    color:#626072!important;
  }
  .single-product .woocommerce-product-details__short-description p{margin:.45rem 0!important}

  /* Variations become full-width touch controls. */
  .single-product .summary form.cart,
  .single-product .summary form.variations_form{
    display:block!important;
    width:100%!important;
    padding:8px 0 0!important;
  }
  .single-product table.variations,
  .single-product table.variations tbody,
  .single-product table.variations tr,
  .single-product table.variations th,
  .single-product table.variations td{
    display:block!important;
    width:100%!important;
  }
  .single-product table.variations tr{margin:0 0 12px!important}
  .single-product table.variations th{padding:0 0 6px!important;text-align:left!important}
  .single-product table.variations td{padding:0!important}
  .single-product .variations label{
    display:block!important;
    font-size:.76rem!important;
    font-weight:800!important;
    letter-spacing:.04em!important;
    text-transform:uppercase;
  }
  .single-product .variations select{
    width:100%!important;
    min-height:48px!important;
    padding:0 40px 0 12px!important;
    border-radius:12px!important;
    font-size:16px!important; /* prevents iOS auto-zoom */
  }
  .single-product .reset_variations{margin:7px 0 0!important;font-size:.78rem!important}
  .single-product .single_variation_wrap{width:100%!important}
  .single-product .woocommerce-variation-description{font-size:.88rem!important;line-height:1.5!important}
  .single-product .woocommerce-variation-price{margin:10px 0!important}

  .single-product .woocommerce-variation-add-to-cart,
  .single-product .summary form.cart:not(.variations_form){
    display:grid!important;
    grid-template-columns:76px minmax(0,1fr)!important;
    gap:9px!important;
    align-items:stretch!important;
  }
  .single-product .summary .quantity{width:76px!important;margin:0!important}
  .single-product .summary .quantity .qty{
    width:100%!important;
    height:50px!important;
    min-height:50px!important;
    padding:0 6px!important;
    font-size:16px!important;
    border-radius:12px!important;
  }
  .single-product .summary .single_add_to_cart_button{
    width:100%!important;
    min-height:50px!important;
    padding:0 14px!important;
    border-radius:12px!important;
    font-size:.94rem!important;
    line-height:1.1!important;
    white-space:normal!important;
  }
  .single-product .summary .single_add_to_cart_button.disabled{opacity:.55!important}
  .single-product .product_meta{
    margin-top:14px!important;
    padding-top:13px!important;
    gap:5px!important;
    font-size:.76rem!important;
    line-height:1.45!important;
  }

  /* Apple Pay / payment request buttons must not compress the cart row. */
  .single-product .summary [class*="apple-pay"],
  .single-product .summary [class*="payment-request"],
  .single-product .summary [id*="payment-request"]{
    max-width:100%!important;
  }

  /* Tabs as a calm stacked section. */
  .single-product .woocommerce-tabs,
  .single-product .related,
  .single-product .upsells{grid-column:1!important;width:100%!important;margin-top:4px!important}
  .single-product .woocommerce-tabs ul.tabs{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:0!important;
    margin:0!important;
    padding:0!important;
    border:1px solid var(--s7-line)!important;
    border-radius:14px!important;
    overflow:hidden!important;
  }
  .single-product .woocommerce-tabs ul.tabs::before{display:none!important}
  .single-product .woocommerce-tabs ul.tabs li{
    width:100%!important;
    margin:0!important;
    border:0!important;
    border-bottom:1px solid var(--s7-line)!important;
    border-radius:0!important;
    background:#fff!important;
  }
  .single-product .woocommerce-tabs ul.tabs li:last-child{border-bottom:0!important}
  .single-product .woocommerce-tabs ul.tabs li::before,
  .single-product .woocommerce-tabs ul.tabs li::after{display:none!important}
  .single-product .woocommerce-tabs ul.tabs li a{
    display:block!important;
    width:100%!important;
    padding:13px 14px!important;
    font-size:.84rem!important;
  }
  .single-product .woocommerce-tabs ul.tabs li.active a{color:var(--s7-violet)!important;background:rgba(119,105,255,.055)!important}
  .single-product .woocommerce-tabs .panel{
    margin:10px 0 0!important;
    padding:16px 14px!important;
    border:1px solid var(--s7-line)!important;
    border-radius:14px!important;
    font-size:.9rem!important;
    line-height:1.55!important;
  }
  .single-product .woocommerce-tabs .panel h2{font-size:1.2rem!important}
  .single-product .related>h2,.single-product .upsells>h2{margin:30px 0 14px!important;font-size:1.45rem!important}

  /* ---------- Shop ---------- */
  .woocommerce .woocommerce-products-header{padding:22px 0 8px!important}
  .woocommerce .woocommerce-products-header__title.page-title{font-size:2.15rem!important;line-height:1!important}
  .woocommerce .term-description{font-size:.9rem!important;line-height:1.5!important}
  .s7-shop-layout{width:var(--s7-shell)!important}
  .s7-shop-toolbar{top:64px!important;min-height:50px!important;border-radius:12px!important}
  body.admin-bar .s7-shop-toolbar{top:110px!important}
  .s7-shop-toolbar .woocommerce-ordering select{font-size:16px!important;max-width:170px!important}
  .s7-shop-chips{margin-bottom:10px!important}
  .s7-chip{min-height:36px!important;font-size:.76rem!important}
  .woocommerce .s7-shop-products ul.products{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:9px!important;
  }
  .woocommerce .s7-shop-products ul.products li.product{
    padding:8px 8px 11px!important;
    border-radius:14px!important;
  }
  .woocommerce .s7-shop-products ul.products li.product .woocommerce-loop-product__title{
    font-size:.82rem!important;line-height:1.28!important;
  }
  .woocommerce .s7-shop-products ul.products li.product .price{font-size:.9rem!important}
  .woocommerce .s7-shop-products ul.products li.product .button{min-height:40px!important;font-size:.74rem!important}
  .woocommerce ul.products li.product .s7-product-media{aspect-ratio:1/1!important;max-height:none!important}

  /* ---------- Cart / checkout / account ---------- */
  .woocommerce-cart .woocommerce,
  .woocommerce-checkout .woocommerce,
  .woocommerce-account .woocommerce,
  .wc-block-cart,.wc-block-checkout,.wp-block-woocommerce-cart,.wp-block-woocommerce-checkout{
    width:var(--s7-shell)!important;
    max-width:none!important;
    padding:24px 0 56px!important;
  }
  .woocommerce-cart table.shop_table{font-size:.9rem!important;border-radius:14px!important}
  .woocommerce-cart table.shop_table_responsive tr,
  .woocommerce-page table.shop_table_responsive tr{padding:9px 0!important;border-bottom:1px solid var(--s7-line)!important}
  .woocommerce-cart table.shop_table_responsive tr td,
  .woocommerce-page table.shop_table_responsive tr td{padding:10px 12px!important;font-size:.9rem!important}
  .woocommerce-cart table.shop_table_responsive tr td::before,
  .woocommerce-page table.shop_table_responsive tr td::before{font-size:.78rem!important;color:#767385!important}
  .woocommerce-cart .cart-collaterals,
  .woocommerce-cart .cart-collaterals .cart_totals{
    float:none!important;
    width:100%!important;
  }
  .woocommerce-cart .cart-collaterals .cart_totals{padding:17px!important;border-radius:14px!important}
  .woocommerce-cart .cart-collaterals .cart_totals h2{font-size:1.35rem!important}
  .woocommerce .cart .button,
  .woocommerce .checkout-button,
  .woocommerce #payment #place_order{min-height:50px!important;font-size:.94rem!important}
  .woocommerce-checkout .col2-set,
  .woocommerce-checkout .col2-set .col-1,
  .woocommerce-checkout .col2-set .col-2,
  .woocommerce-checkout #order_review,
  .woocommerce-checkout #order_review_heading{
    float:none!important;width:100%!important;
  }
  .woocommerce-checkout h3{font-size:1.25rem!important}
  .woocommerce form .form-row input.input-text,
  .woocommerce form .form-row textarea,
  .select2-container--default .select2-selection--single{font-size:16px!important}
  .woocommerce-account .woocommerce{display:block!important}
  .woocommerce-account .woocommerce-MyAccount-navigation{margin-bottom:14px!important}
  .woocommerce-account .woocommerce-MyAccount-content{padding:16px!important;border-radius:14px!important}

  /* Avoid horizontal overflow from third-party widgets. */
  .single-product div.product *,
  .woocommerce-cart .woocommerce *,
  .woocommerce-checkout .woocommerce *{max-width:100%}
}

@media (max-width: 430px) {
  :root{--s7-shell:min(calc(100% - 20px),1280px)}
  .single-product div.product{width:calc(100% - 12px)!important}
  .single-product div.product .woocommerce-product-gallery__wrapper,
  .single-product div.product .woocommerce-product-gallery .flex-viewport{
    height:min(82vw,48svh)!important;
    min-height:255px!important;
    border-radius:14px!important;
  }
  .single-product div.product .summary{padding:16px 12px 14px!important;border-radius:14px!important}
  .single-product .product_title{font-size:1.32rem!important}
  .single-product .summary .price{font-size:1.22rem!important}
  .single-product .woocommerce-product-details__short-description{font-size:.9rem!important}
  .single-product .woocommerce-variation-add-to-cart,
  .single-product .summary form.cart:not(.variations_form){grid-template-columns:70px minmax(0,1fr)!important}
  .woocommerce .woocommerce-products-header__title.page-title{font-size:1.9rem!important}
}

/* Coarse-pointer safety net: some iOS/Android browsers expose a wider CSS
   viewport than expected. Keep mobile commerce touch-scaled on those devices. */
@media (hover:none) and (pointer:coarse) and (max-width:1100px) {
  .single-product .product_title{font-size:clamp(1.35rem,4.8vw,1.75rem)!important}
  .single-product .summary .price{font-size:1.35rem!important}
  .single-product .variations select,
  .single-product .summary .quantity .qty,
  .woocommerce form .form-row input.input-text,
  .woocommerce form .form-row textarea{font-size:16px!important}
  .single-product div.product .woocommerce-product-gallery__image img{object-fit:contain!important}
}
