/* Tenute Oliveto — Carrello mobile 2026
   Desktop invariato: gli interventi principali partono sotto i 767.98px.
*/

@media (max-width: 767.98px) {
  .to-commerce-page {
    padding-top: 1.25rem;
    padding-bottom: 2rem;
  }

  .to-commerce-page .container-xxl {
    padding-left: 14px;
    padding-right: 14px;
  }

  .to-commerce-page .row {
    --bs-gutter-x: 0;
    --bs-gutter-y: 1rem;
  }

  .to-commerce-card,
  .to-summary-card {
    border-radius: 18px;
    overflow: hidden;
  }

  .to-commerce-card__body {
    padding: 16px;
  }

  .to-commerce-section-title {
    margin-bottom: 14px;
  }

  .to-commerce-section-title span {
    font-size: .72rem;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .to-commerce-section-title h2 {
    margin: 3px 0 0;
    font-size: 1.35rem;
    line-height: 1.15;
  }

  /* Riga desktop -> card prodotto mobile */
  .to-cart-row {
    position: relative;
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr) auto;
    grid-template-areas:
      "image product delete"
      "image price delete"
      "qty qty total";
    gap: 8px 12px;
    align-items: start;
    padding: 16px 0;
    border-bottom: 1px solid rgba(32, 52, 39, .11);
  }

  .to-cart-row:first-of-type {
    padding-top: 6px;
  }

  .to-cart-row:last-of-type {
    border-bottom: 0;
  }

  .to-cart-image {
    grid-area: image;
    width: 84px;
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border: 1px solid rgba(32, 52, 39, .10);
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
  }

  .to-cart-image a {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
  }

  .to-cart-image img,
  .to-cart-image .img-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .to-cart-product {
    grid-area: product;
    min-width: 0;
    padding-right: 4px;
  }

  .to-cart-product > a {
    text-decoration: none;
  }

  .to-cart-name {
    margin: 0 0 5px;
    font-size: 1rem;
    line-height: 1.28;
    font-weight: 650;
  }

  .to-cart-meta {
    font-size: .78rem;
    line-height: 1.45;
    opacity: .68;
  }

  .to-cart-price {
    grid-area: price;
    align-self: end;
  }

  .to-cart-price h3 {
    margin: 0;
    font-size: .92rem;
    font-weight: 600;
  }

  .to-cart-price h3 span {
    display: inline-block;
    margin-left: 3px;
    font-size: .66rem !important;
    opacity: .62;
  }

  .to-cart-qty-wrap {
    grid-area: qty;
    display: flex;
    align-items: center;
    gap: 9px;
    padding-top: 6px;
  }

  .to-cart-qty-wrap::before {
    content: "Quantità";
    flex: 0 0 auto;
    font-size: .78rem;
    font-weight: 600;
    opacity: .72;
  }

  .to-cart-qty {
    width: 78px;
    min-height: 42px;
    padding: 6px 8px;
    text-align: center;
    border-radius: 10px;
    font-weight: 650;
    position: sticky;
  }

  .to-cart-total {
    grid-area: total;
    align-self: end;
    text-align: right;
    padding-top: 6px;
  }

  .to-cart-total::before {
    content: "Totale";
    display: block;
    margin-bottom: 1px;
    font-size: .68rem;
    line-height: 1;
    opacity: .58;
  }

  .to-cart-total h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 750;
  }

  .to-cart-delete-wrap {
    grid-area: delete;
    justify-self: end;
  }

  .to-cart-delete {
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(120, 36, 36, .06);
    color: #7c2525;
    font-size: 1rem;
    text-decoration: none;
  }

  .to-cart-note {
    margin-top: 12px;
    padding: 14px;
    border-radius: 14px;
    font-size: .82rem;
    line-height: 1.55;
  }

  .to-cart-free-shipping {
    margin-bottom: 8px;
    font-weight: 700;
  }

  /* Riepilogo */
  .to-summary-card {
    margin-top: 0;
    padding: 18px 16px;
  }

  .to-summary-card h2 {
    font-size: 1.25rem;
    margin-bottom: 14px;
  }

  .to-summary-line {
    padding: 8px 0;
    font-size: .92rem;
  }

  .to-summary-line--total {
    margin-top: 5px;
    padding-top: 13px;
    font-size: 1.05rem;
  }

  .to-summary-actions {
    display: grid;
    gap: 9px;
    margin-top: 14px;
  }

  .to-summary-actions .to-btn-primary,
  .to-summary-actions .to-btn-secondary {
    display: flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 14px;
    border-radius: 12px;
    text-align: center;
  }

  /* Hero più compatta sul telefono */
  .to-commerce-hero {
    min-height: 190px;
  }

  .to-commerce-hero__content {
    padding-left: 18px;
    padding-right: 18px;
  }

  .to-commerce-hero h1 {
    font-size: clamp(1.85rem, 9vw, 2.5rem);
    line-height: 1.05;
  }

  .to-commerce-breadcrumb {
    font-size: .78rem;
    flex-wrap: wrap;
  }
}

@media (max-width: 380px) {
  .to-cart-row {
    grid-template-columns: 72px minmax(0, 1fr) auto;
    gap: 8px 9px;
  }

  .to-cart-image {
    width: 72px;
    height: 86px;
  }

  .to-cart-name {
    font-size: .94rem;
  }
}
