/* =========================================================
   Instituto Brasbol — v4.23.0
   CAPA FINAL: Carrito, Checkout y Mi Cuenta en celular y tablet
   ---------------------------------------------------------
   - Se carga DESPUÉS de brasbol.css, brasbol-ui-v411.css y
     brasbol-ui-v414.css, solo en /carrito/, /finalizar-compra/
     y /mi-cuenta/. No modifica precios, stock, lógica de
     WooCommerce, Mercado Pago ni Tutor LMS: solo presentación.
   - Breakpoints unificados para estas 3 páginas:
       1024px = tablet horizontal
        768px = tablet vertical / celular grande
        480px = celular angosto
   - Si algo no se ve bien, esta hoja se puede desactivar sola
     quitando su wp_enqueue_style() sin afectar el resto del kit.
   ========================================================= */

/* ---------------------------------------------------------
   1) BASE: que nada se salga del ancho de pantalla
   --------------------------------------------------------- */
body.woocommerce-cart,
body.woocommerce-checkout,
body.woocommerce-account{
  overflow-x:hidden;
}
body.woocommerce-cart img,
body.woocommerce-checkout img,
body.woocommerce-account img{
  max-width:100%;
  height:auto;
}

/* ---------------------------------------------------------
   2) TABLET (≤1024px) — ajustes comunes a las 3 páginas
   --------------------------------------------------------- */
@media (max-width:1024px){
  body.woocommerce-cart .site-main,
  body.woocommerce-checkout .site-main,
  body.woocommerce-account .site-main{
    padding-left:14px!important;
    padding-right:14px!important;
  }

  /* Mi Cuenta: navegación como pestañas de una sola fila con scroll,
     igual en tablet y celular, para no cambiar de patrón al re-tamañar. */
  body.woocommerce-account .woocommerce-MyAccount-navigation{
    width:100%!important;
    padding:6px!important;
  }
  body.woocommerce-account .woocommerce-MyAccount-navigation ul{
    display:flex!important;
    flex-wrap:nowrap!important;
    gap:6px!important;
    overflow-x:auto!important;
    -webkit-overflow-scrolling:touch;
    scroll-snap-type:x proximity;
    scrollbar-width:thin;
  }
  body.woocommerce-account .woocommerce-MyAccount-navigation li{
    flex:0 0 auto!important;
    margin:0!important;
    scroll-snap-align:start;
  }
  body.woocommerce-account .woocommerce-MyAccount-navigation li a{
    white-space:nowrap!important;
    padding:12px 16px!important;
    min-height:44px!important;
    display:flex!important;
    align-items:center!important;
  }
  body.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a{
    scroll-margin-inline:12px;
  }
}

/* ---------------------------------------------------------
   3) CARRITO — tabla de productos convertida en tarjetas
   --------------------------------------------------------- */
@media (max-width:768px){
  body.woocommerce-cart table.shop_table{
    border:0!important;
    box-shadow:none!important;
    background:transparent!important;
  }
  body.woocommerce-cart table.shop_table thead{
    display:none!important; /* los nombres de columna se repiten en cada tarjeta */
  }
  body.woocommerce-cart table.shop_table tbody,
  body.woocommerce-cart table.shop_table tr.cart_item{
    display:block!important;
    width:100%!important;
  }
  body.woocommerce-cart table.shop_table tr.cart_item{
    margin:0 0 12px!important;
    padding:12px!important;
    border:1px solid #d8ebdc!important;
    border-radius:16px!important;
    background:#fff!important;
    box-shadow:0 8px 22px rgba(7,61,25,.06)!important;
    display:grid!important;
    grid-template-columns:64px 1fr 34px!important;
    grid-template-areas:
      "thumb name remove"
      "thumb price qty"
      "subtotal subtotal subtotal"!important;
    column-gap:10px!important;
    row-gap:8px!important;
    align-items:center!important;
  }
  body.woocommerce-cart table.shop_table td{
    border:0!important;
    padding:0!important;
  }
  body.woocommerce-cart td.product-remove{
    grid-area:remove!important;
    justify-self:end!important;
  }
  body.woocommerce-cart td.product-remove a.remove{
    width:32px!important;
    height:32px!important;
  }
  body.woocommerce-cart td.product-thumbnail{
    grid-area:thumb!important;
  }
  body.woocommerce-cart td.product-thumbnail img{
    width:64px!important;
    height:64px!important;
    object-fit:cover!important;
    border-radius:10px!important;
  }
  body.woocommerce-cart td.product-name{
    grid-area:name!important;
    font-size:14px!important;
    line-height:1.35!important;
  }
  body.woocommerce-cart td.product-name a{
    font-weight:800!important;
  }
  body.woocommerce-cart td.product-name .variation{
    margin-top:4px!important;
    font-size:12px!important;
  }
  body.woocommerce-cart td.product-price{
    grid-area:price!important;
    font-size:13px!important;
    color:#55705c!important;
  }
  body.woocommerce-cart td.product-quantity{
    grid-area:qty!important;
    justify-self:end!important;
  }
  body.woocommerce-cart td.product-quantity .qty{
    width:64px!important;
    min-height:40px!important;
    text-align:center!important;
  }
  body.woocommerce-cart td.product-subtotal{
    grid-area:subtotal!important;
    margin-top:6px!important;
    padding-top:8px!important;
    border-top:1px dashed #e2efe5!important;
    display:flex!important;
    justify-content:space-between!important;
    align-items:center!important;
    font-weight:900!important;
    color:#073d19!important;
  }
  body.woocommerce-cart td.product-subtotal:before{
    content:"Subtotal";
    font-size:11px;
    font-weight:800;
    color:#607166;
    text-transform:uppercase;
    letter-spacing:.05em;
  }

  /* Fila del cupón + botón "Actualizar carrito": apilados y a ancho completo */
  body.woocommerce-cart .woocommerce-cart-form .coupon{
    display:flex!important;
    flex-direction:column!important;
    gap:10px!important;
    margin-top:14px!important;
  }
  body.woocommerce-cart .woocommerce-cart-form .coupon #coupon_code{
    width:100%!important;
    min-height:46px!important;
  }
  body.woocommerce-cart .woocommerce-cart-form .coupon button,
  body.woocommerce-cart .woocommerce-cart-form>button[name="update_cart"]{
    width:100%!important;
    min-height:48px!important;
  }

  /* Total del carrito: tarjeta a todo el ancho, botón grande y fácil de tocar */
  body.woocommerce-cart .cart-collaterals .cart_totals{
    max-width:none!important;
    width:100%!important;
    margin-top:18px!important;
    padding:18px!important;
  }
  body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button{
    width:100%!important;
    min-height:52px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    font-size:16px!important;
  }
}

/* ---------------------------------------------------------
   4) CELULAR ANGOSTO (≤480px) — remates finos
   --------------------------------------------------------- */
@media (max-width:480px){
  body.woocommerce-cart table.shop_table tr.cart_item{
    grid-template-columns:56px 1fr 30px!important;
    padding:10px!important;
  }
  body.woocommerce-cart td.product-thumbnail img{
    width:56px!important;
    height:56px!important;
  }
  body.woocommerce-cart td.product-name{
    font-size:13px!important;
  }

  body.woocommerce-checkout .form-row label{
    font-size:12px!important;
  }
  body.woocommerce-checkout .form-row input.input-text,
  body.woocommerce-checkout .form-row select,
  body.woocommerce-checkout .form-row textarea{
    font-size:16px!important; /* evita el zoom automático de iOS al enfocar */
  }

  body.woocommerce-account .woocommerce-MyAccount-content{
    padding:16px!important;
  }
  body.woocommerce-account .woocommerce-MyAccount-content table.shop_table{
    display:block!important;
    overflow-x:auto!important;
    -webkit-overflow-scrolling:touch;
  }
}
