/* Trast Shop: the desktop product-card component, scaled for tablets and phones.
   This file intentionally loads AFTER store-polish-v1594.css: that stylesheet
   changed the home product cards into a different, boxed mobile design. */
@media (max-width: 1100px) {
  /* A responsive width is the only structural difference from the desktop card. */
  body.trast-modern .product-card--modern {
    display: flex !important;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    gap: 0;
    overflow: visible !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transform: none !important;
  }
  body.trast-modern .home-discovery .home-product-rail > .product-card--modern {
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    overflow: visible !important;
    box-shadow: none !important;
    scroll-snap-align: start;
  }

  /* Keep the desktop's softly rounded, square product image at every width. */
  body.trast-modern .product-card--modern .product-card__visual,
  body.trast-modern .home-discovery .product-card--modern .product-card__visual {
    display: block !important;
    position: relative;
    width: 100%;
    min-width: 0;
    height: auto;
    aspect-ratio: 1 / 1.03 !important;
    border: 1px solid #f0e9ec !important;
    border-radius: 18px !important;
    background: #f9f8f9;
    overflow: hidden !important;
    box-shadow: none !important;
  }
  body.trast-modern .product-card--modern .product-image,
  body.trast-modern .home-discovery .product-card--modern .product-image {
    position: absolute !important;
    inset: 0 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    height: 100% !important;
    min-width: 0;
    min-height: 0;
    aspect-ratio: auto !important;
    padding: 10px 12px 48px !important;
    background: transparent !important;
    border-radius: inherit;
    overflow: hidden;
  }
  body.trast-modern .product-card--modern .product-image img,
  body.trast-modern .home-discovery .product-card--modern .product-image img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    min-width: 0;
    min-height: 0 !important;
    max-width: 100% !important;
    max-height: 100% !important;
    aspect-ratio: auto !important;
    object-fit: contain !important;
    object-position: center;
    mix-blend-mode: normal;
    background: transparent;
  }

  /* On touch screens the desktop bottom purchase overlay stays accessible. */
  body.trast-modern .product-card--modern .product-card__quick-buy,
  body.trast-modern .home-discovery .product-card--modern .product-card__quick-buy {
    display: block;
    position: absolute !important;
    inset: auto 0 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 3;
    transform: none !important;
    border-radius: 0 0 17px 17px !important;
    overflow: hidden;
  }
  body.trast-modern .product-card--modern .product-card__quick-buy button,
  body.trast-modern .home-discovery .product-card--modern .product-card__quick-buy button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    height: 40px;
    min-height: 40px;
    padding: 4px 6px;
    font-size: 11px;
    line-height: 1.4;
    font-weight: 800;
    white-space: nowrap;
    color: #fff !important;
    background: #d82d68 !important;
    border: 0 !important;
    border-radius: 0 0 17px 17px !important;
    box-shadow: none;
    transform: none !important;
  }
  body.trast-modern .product-card--modern .product-card__quick-buy svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
  }

  /* Match the desktop information block: centered title + pink price. */
  body.trast-modern .product-card--modern .product-meta,
  body.trast-modern .home-discovery .product-card--modern .product-card__info {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: 6px;
    min-width: 0;
    min-height: 0 !important;
    padding: 11px 5px 4px !important;
    margin: 0 !important;
    text-align: center !important;
    border-radius: 0;
  }
  body.trast-modern .product-card--modern .product-meta h3,
  body.trast-modern .home-discovery .product-card--modern h3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    margin: 0 !important;
    min-height: 0 !important;
    font-size: clamp(11px, 1.55vw, 13px) !important;
    font-weight: 750;
    line-height: 1.75 !important;
    text-align: center;
  }
  body.trast-modern .product-card--modern .product-card__price,
  body.trast-modern .home-discovery .product-card--modern .product-card__price {
    display: flex;
    flex-direction: row !important;
    flex-wrap: wrap;
    align-items: baseline !important;
    justify-content: center !important;
    gap: 3px 7px;
    min-height: 0 !important;
    margin-top: auto;
    text-align: center;
  }
  body.trast-modern .product-card--modern .product-card__price strong,
  body.trast-modern .home-discovery .product-card--modern .product-card__price strong {
    font-size: clamp(12px, 1.65vw, 14px);
    font-weight: 850;
    line-height: 1.55;
    color: #d72d65;
  }
  body.trast-modern .product-card--modern .product-card__price del,
  body.trast-modern .home-discovery .product-card--modern .product-card__price del {
    font-size: 11px;
    color: #afa4a8;
  }
  body.trast-modern .product-card--modern .product-card__discount,
  body.trast-modern .home-discovery .product-card--modern .product-card__discount {
    inset: auto !important;
    inset-block-start: 9px !important;
    inset-inline-start: 9px !important;
    max-width: calc(100% - 56px);
    font-size: 10px;
    padding: 3px 7px;
    border-radius: 999px;
  }
  body.trast-modern .product-card--modern .product-card__unavailable,
  body.trast-modern .home-discovery .product-card--modern .product-card__unavailable {
    position: absolute !important;
    inset: auto auto 9px 9px !important;
    display: block;
    width: auto;
    margin: 0 !important;
    padding: 5px 9px;
    border-radius: 8px;
    font-size: 11px;
  }

  /* Leave controls in the image corner, not inside a separate card column. */
  body.trast-modern .product-card--modern .product-card__tools,
  body.trast-modern .home-discovery .product-card--modern .product-card__tools {
    position: absolute !important;
    inset: auto !important;
    inset-block-start: 7px !important;
    inset-inline-end: 7px !important;
    display: grid !important;
    width: auto !important;
    gap: 0;
    padding: 3px !important;
    border: 1px solid #f0eaed;
    border-radius: 12px;
    background: rgba(255,255,255,.95);
    box-shadow: none;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    z-index: 4;
  }
  /* Prevent narrow phone cards from hiding the product behind three icons. */
  body.trast-modern .product-card__tools .product-card__compare,
  body.trast-modern .product-card__tools [data-quick-view] {
    display: none !important;
  }
  body.trast-modern .product-card--modern .product-card__tools [data-heart-form],
  body.trast-modern .product-card--modern .product-card__tools .heart-container {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 9px !important;
    background: transparent !important;
  }
  body.trast-modern .product-card--modern .product-card__tools .heart-container svg {
    width: 21px;
    height: 21px;
  }
}

/* Small-screen product cards have the same geometry, with smaller type. */
@media (max-width: 400px) {
  body.trast-modern .product-card--modern .product-image,
  body.trast-modern .home-discovery .product-card--modern .product-image {
    padding: 9px 9px 43px !important;
  }
  body.trast-modern .product-card--modern .product-card__quick-buy button,
  body.trast-modern .home-discovery .product-card--modern .product-card__quick-buy button {
    height: 36px;
    min-height: 36px;
    gap: 3px;
    padding-inline: 3px;
    font-size: 10px;
  }
  body.trast-modern .product-card--modern .product-meta h3,
  body.trast-modern .home-discovery .product-card--modern h3 {
    font-size: 11px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.trast-modern .product-card--modern .product-card__visual,
  body.trast-modern .product-card--modern .product-image img { transition: none !important; }
}
