/* Shop card (motion kit). Morph adapted from Alvaro Montoro's "User Card" (Morphing Profile Card Interaction).
   At rest: tall photo with the name on a blurred band. On hover/focus: the photo becomes a wide 5:4, the second
   photo cross-fades in, and the description, price and Add to cart slide up.
   Touch screens: shopcard.js opens the card nearest the middle of the screen (class m-sc-on); a tap toggles it.
   Works on plain markup (library page) and on an Elementor Loop Item (containers + widgets carrying the classes). */

.m-shopcard {
  --sc-bg: #FFFFFF;
  --sc-title-rest: #FFFFFF;
  --sc-title: #F3763A;
  --sc-price: #F3763A;    /* orange like the shop grid (2026-10-14); was retired navy */
  --sc-text: #6B6560;
  --sc-ease: cubic-bezier(.22, 1, .36, 1);
  --sc-time: .45s;
  position: relative;
  width: 100%;
  max-width: 20rem;               /* shrinks with a narrow grid column instead of forcing it wider */
  height: auto;
  aspect-ratio: 2 / 3;            /* 20rem x 30rem; narrower grid cells keep the same proportions */
  min-height: 0;                  /* otherwise the hidden body text stretches the box past 2:3 */
  padding: .5rem;
  border-radius: 2rem;
  background: var(--sc-bg);
  overflow: clip;
  font-family: Montserrat, sans-serif;
  text-align: left;
}

/* blurred band behind the name while it sits on the photo
   (class doubled so it beats Elementor's own .e-con::before background-overlay rules) */
.m-shopcard.m-shopcard::before {
  content: "";
  display: block;
  position: absolute; z-index: 2;
  top: auto; right: auto; left: .5rem; bottom: .5rem;
  width: calc(100% - 1rem); height: 30%;
  opacity: 1; mix-blend-mode: normal; background: none; border: 0;
  border-radius: 0 0 1.5rem 1.5rem;
  -webkit-mask: linear-gradient(#0000, #000f 80%);
  mask: linear-gradient(#0000, #000f 80%);
  -webkit-backdrop-filter: blur(1rem);
  backdrop-filter: blur(1rem);
  transition: translate .3s var(--sc-ease);
  pointer-events: none;
}

.m-sc-media {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 1.5rem;
  overflow: hidden;
  transition: aspect-ratio var(--sc-time) var(--sc-ease);
}
.m-sc-media > img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; display: block; }
.m-sc-media > img.m-sc-hover, .m-sc-gallery { display: none !important; }   /* second photo source for the blob reveal */
.m-shopcard .m-sc-media img.m-sc-second {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 50%;
  display: block; opacity: 0; pointer-events: none; transition: opacity .5s ease;
}

.m-sc-body {
  position: relative; z-index: 3;
  margin: 1rem;
  height: calc(45% - 1rem);       /* room for a two-line name, two lines of description and the price row */
  display: flex; flex-direction: column;
}
.m-sc-title {
  margin: 0 0 1rem;
  font: 400 1.5rem/1 Synthmesc, sans-serif;   /* display font like every other title (2026-10-12) */
  text-transform: uppercase;
  letter-spacing: .02em;
  color: var(--sc-title-rest);
  translate: 0 -220%;
  transition: color .5s, margin-block-end var(--sc-time) var(--sc-ease), translate var(--sc-time) var(--sc-ease);
}
.m-sc-desc {
  margin: 0;
  font-size: .9rem; line-height: 1.35;
  color: var(--sc-text);
  opacity: 0;
  translate: 0 100%;
  transition: opacity .8s .15s, translate var(--sc-time) .15s var(--sc-ease);
}
.m-sc-row {
  flex: 1;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  opacity: 0;
  pointer-events: none;           /* the hidden Add to cart can't be tapped by accident */
  transition: opacity .6s;
}
.m-sc-price { align-self: center; font: 400 1.6rem/1 Synthmesc, sans-serif; color: var(--sc-price); }
.m-sc-row .elementor-button { font-size: 15px !important; padding: .85em 1.4em !important; }

/* open state: m-sc-on (touch, set by shopcard.js), keyboard focus (not a tap), or hover on hover devices */
.m-shopcard.m-shopcard:is(.m-sc-on, :focus-visible, :has(:focus-visible))::before { translate: 0 100%; }
.m-shopcard:is(.m-sc-on, :focus-visible, :has(:focus-visible)) .m-sc-media { aspect-ratio: 5 / 4; }
.m-shopcard:is(.m-sc-on, :focus-visible, :has(:focus-visible)) :is(.m-sc-title, .m-sc-desc) { translate: 0 0; margin-block-end: .5rem; opacity: 1; }
.m-shopcard:is(.m-sc-on, :focus-visible, :has(:focus-visible)) .m-sc-title { color: var(--sc-title); }
.m-shopcard:is(.m-sc-on, :focus-visible, :has(:focus-visible)) .m-sc-row { opacity: 1; pointer-events: auto; transition: opacity .5s .25s; }
.m-shopcard:is(.m-sc-on, :focus-visible, :has(:focus-visible)) .m-sc-media img.m-sc-second { opacity: 1; }
@media (hover: hover) {
  .m-shopcard.m-shopcard:hover::before { translate: 0 100%; }
  .m-shopcard:hover .m-sc-media { aspect-ratio: 5 / 4; }
  .m-shopcard:hover :is(.m-sc-title, .m-sc-desc) { translate: 0 0; margin-block-end: .5rem; opacity: 1; }
  .m-shopcard:hover .m-sc-title { color: var(--sc-title); }
  .m-shopcard:hover .m-sc-row { opacity: 1; pointer-events: auto; transition: opacity .5s .25s; }
  .m-shopcard:hover .m-sc-media img.m-sc-second { opacity: 1; }
}

/* ---------- Elementor Loop Item version ----------
   card container m-shopcard > container m-sc-media (Image widget: featured image; Basic Gallery widget m-sc-gallery:
   product gallery, hidden, its first image is the second photo) + container m-sc-body (Heading m-sc-title,
   Text Editor m-sc-desc, container m-sc-row with Heading m-sc-price and Button m-goo). The component owns the look,
   so Elementor's container padding, gaps and widget typography are overridden here. */
.e-con.m-shopcard { --padding-top: .5rem; --padding-right: .5rem; --padding-bottom: .5rem; --padding-left: .5rem;
  display: block; margin-inline: auto; }
.e-con.m-shopcard > .e-con { flex-shrink: 0; }
.e-con.m-sc-media { --padding-top: 0; --padding-right: 0; --padding-bottom: 0; --padding-left: 0; display: block; }
.m-sc-media .elementor-widget-image, .m-sc-media .elementor-widget-image .elementor-widget-container,
.m-sc-media .elementor-widget-image a { position: absolute; inset: 0; display: block; }
.m-sc-media .elementor-widget-image img { width: 100% !important; height: 100% !important; max-width: none; object-fit: cover; object-position: 50% 50%; display: block; border-radius: 0; }
.e-con.m-sc-body { --padding-top: 0; --padding-right: 0; --padding-bottom: 0; --padding-left: 0; --gap: 0; gap: 0;
  --width: auto; width: auto; --flex-wrap: nowrap; flex-wrap: nowrap; }
/* a two-line product name takes its room from the description, never from the price row */
.m-sc-body > .m-sc-title, .m-sc-body > .m-sc-row { flex-shrink: 0; }
.m-sc-body > .m-sc-desc { flex: 0 1 auto; min-height: 0; overflow: hidden; }
.m-sc-body > .elementor-widget { width: 100%; }
.m-sc-title .elementor-heading-title { font: inherit; color: inherit; margin: 0; }
.m-sc-title .elementor-heading-title a { color: inherit; }
.m-sc-desc .elementor-widget-container { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.m-sc-desc .elementor-widget-container > * { margin: 0; }
.m-sc-desc .elementor-widget-container > :not(:first-child) { display: none; }
.e-con.m-sc-row { --padding-top: 0; --padding-right: 0; --padding-bottom: 0; --padding-left: 0; flex-direction: row; flex-wrap: nowrap; }
.m-sc-row > .elementor-widget { width: auto; }
.m-sc-price .elementor-heading-title { font: inherit; color: inherit; margin: 0; }
.m-sc-price del { font-size: .6em; opacity: .6; }
.m-sc-price ins { text-decoration: none; }
.m-sc-price .woocommerce-price-suffix { display: block; margin-top: .3em; font: 500 .7rem/1 Montserrat, sans-serif; text-transform: none; color: var(--sc-text); }

@media (prefers-reduced-motion: reduce) {
  .m-shopcard *, .m-shopcard::before { transition-duration: .01s !important; transition-delay: 0s !important; }
}

/* Elementor's ":is(.elementor-section-wrap, [data-elementor-id]) > .e-con { max-width: min(100%, var(--width)) }"
   (specificity 0,2,0) beats the single class above, and the grid then stretched to 4 x 673px (2026-10-12). */
.m-shopcard.m-shopcard.m-shopcard { max-width: 20rem; }

/* phones: as wide as the column (same width as the gift card), and no live blur behind the name, which made
   scrolling stutter on an iPhone 12 Pro (2026-10-12); a brown gradient does the same job */
@media (max-width: 767px) {
  .m-shopcard.m-shopcard.m-shopcard { max-width: none; }
  /* the full-width card has room for more of the description than the 2 lines a desktop card shows */
  .m-sc-desc .elementor-widget-container { -webkit-line-clamp: 4; }
}
@media (hover: none) {
  .m-shopcard.m-shopcard::before {
    -webkit-backdrop-filter: none; backdrop-filter: none;
    background: linear-gradient(rgba(43, 26, 18, 0), rgba(43, 26, 18, .55));
  }
}

/* price + Add to cart sit at the bottom of the card, not straight under the description (wide phone cards left
   a big gap below them, 2026-10-12). Elementor sets container margins through its own variables, hence the weight. */
.m-shopcard .m-sc-body > .m-sc-row.m-sc-row { margin-top: auto !important; }

/* phones: two cards, then "Visit the shop" (four full-height cards were ~2,300px of scrolling), and a 44px
   Add to cart (Apple's minimum tap target). Design audit 2026-10-12. */
@media (max-width: 767px) {
  .m-shop-grid .e-loop-item:nth-of-type(n+3) { display: none; }   /* of-type: Elementor puts <style> tags between the items */
  .m-sc-row .elementor-button { min-height: 47px; display: inline-flex !important; align-items: center; }   /* 47 x 0.95 resting scale = 44.6 */
}

/* touch screens: the open layout, fixed (shopcard.js adds m-sc-static); nothing animates */
.m-shopcard.m-sc-static, .m-shopcard.m-sc-static *, .m-shopcard.m-sc-static::before { transition: none !important; }

/* ---- cards in the drifting strip (2026-10-12, Majd's screenshots) ----
   Title: smaller, at most 2 lines, and always 2 lines tall with the text at the bottom, so the closed card's title
   sits at the same place on every card (it used to move with the number of lines). Lifted onto the photo by a fixed
   amount instead of a percentage of its own height. */
.m-drift .m-sc-title { font-size: 1.15rem; line-height: 1.05; min-height: 2.1em; display: flex; align-items: flex-end;
  translate: 0 calc(-100% - 1.5rem); }
.m-drift .m-sc-title .elementor-heading-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.m-drift .m-shopcard:is(.m-sc-on, :focus-visible, :has(:focus-visible)) .m-sc-title { translate: 0 0; }
@media (hover: hover) { .m-drift .m-shopcard:hover .m-sc-title { translate: 0 0; } }
@media (max-width: 767px) {
  .m-drift .m-sc-title { font-size: 1rem; }
  .m-drift .m-sc-desc .elementor-widget-container { -webkit-line-clamp: 2; }
}

/* the band behind the closed card's title: a plain brown fade everywhere (the live blur read as frost) */
.m-shopcard.m-shopcard::before {
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  -webkit-mask: none; mask: none;
  background: linear-gradient(rgba(43, 26, 18, 0), rgba(43, 26, 18, .6)) !important;
}
