/* =====================================================================
   Forma Fabrications: phone UI kit (screens up to 760px wide)
   Loaded after site.css, theme-light.css and mobile.css on every page.
   - Militaristic buttons: square plates, L-shaped corner guards, rivets
   - Square cards and panels
   - ON SALE: no floating sticker; sale strip, stencilled tags
   Desktop is handled separately (see the project doc
   claude/desktop-handoff-buttons-and-sale.md). Only the was/now price
   styling at the bottom applies to every screen size, because the
   Space Marine sale price shows everywhere.
   ===================================================================== */

@media (max-width: 760px) {

  /* ---------- 1. Square, riveted, edge-guarded buttons ---------- */
  .btn, .fin-grid button, .tabs button, .seg button, .viewer-head .ctl button {
    border-radius: 0 !important;
    --g: #23272F; --gl: 15px; --gw: 3px;                   /* guard colour, length, thickness */
    --rv: #F4E6DA; --rr: #3A2A1E;                          /* rivet head, rivet ring */
    --plate: var(--accent); --shade: linear-gradient(180deg, rgba(255,255,255,.18), rgba(0,0,0,.14));
    background:
      radial-gradient(circle, var(--rv) 0 1.1px, var(--rr) 1.5px 2.5px, transparent 2.9px) left 5px top 5px / 8px 8px no-repeat,
      radial-gradient(circle, var(--rv) 0 1.1px, var(--rr) 1.5px 2.5px, transparent 2.9px) right 5px top 5px / 8px 8px no-repeat,
      radial-gradient(circle, var(--rv) 0 1.1px, var(--rr) 1.5px 2.5px, transparent 2.9px) left 5px bottom 5px / 8px 8px no-repeat,
      radial-gradient(circle, var(--rv) 0 1.1px, var(--rr) 1.5px 2.5px, transparent 2.9px) right 5px bottom 5px / 8px 8px no-repeat,
      linear-gradient(var(--g), var(--g)) left top / var(--gl) var(--gw) no-repeat,
      linear-gradient(var(--g), var(--g)) left top / var(--gw) var(--gl) no-repeat,
      linear-gradient(var(--g), var(--g)) right top / var(--gl) var(--gw) no-repeat,
      linear-gradient(var(--g), var(--g)) right top / var(--gw) var(--gl) no-repeat,
      linear-gradient(var(--g), var(--g)) left bottom / var(--gl) var(--gw) no-repeat,
      linear-gradient(var(--g), var(--g)) left bottom / var(--gw) var(--gl) no-repeat,
      linear-gradient(var(--g), var(--g)) right bottom / var(--gl) var(--gw) no-repeat,
      linear-gradient(var(--g), var(--g)) right bottom / var(--gw) var(--gl) no-repeat,
      var(--shade), var(--plate) !important;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.35), 0 6px 18px -8px rgba(245,138,75,.6);
    letter-spacing: .04em;
  }
  /* larger buttons get longer guards */
  .shop-btn, .buy #order-link, .form .btn, .formbox button[type="submit"], .inline-form .btn, #cart-checkout { --gl: 20px; --gw: 4px; }
  .btn.blue { --plate: var(--blue); box-shadow: inset 0 0 0 1px rgba(0,0,0,.35), 0 6px 18px -8px rgba(91,155,255,.6); }

  /* outlined buttons: dark plate, orange edge, orange guards, steel rivets */
  .btn.ghost {
    --plate: rgba(245,138,75,.10); --shade: linear-gradient(transparent, transparent);
    --g: var(--accent); --rv: #C9D1DC; --rr: #4A5261;
    border: 2px solid rgba(245,138,75,.55) !important; color: var(--head) !important; box-shadow: none;
  }
  /* small secondary controls (3D viewer Pause/Reset, segmented toggles): steel plates */
  .seg button, .viewer-head .ctl button {
    --plate: var(--panel2); --shade: linear-gradient(transparent, transparent); --g: #3A414E; --rv: #AEB7C4; --rr: #3A414E; --gl: 10px;
    box-shadow: none;
  }
  /* finish choices: steel plates; the chosen one gets orange guards and edge */
  .fin-grid button, .tabs button {
    --plate: var(--panel2); --shade: linear-gradient(transparent, transparent); --g: #3A414E; --rv: #AEB7C4; --rr: #3A414E; --gl: 12px;
    box-shadow: none;
  }
  .fin-grid button[aria-pressed="true"], .tabs button[aria-selected="true"] {
    --plate: rgba(245,138,75,.14); --g: var(--accent); --rv: #FFE3CF; --rr: #8A4A22;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 1px var(--accent), 0 6px 18px -8px rgba(245,138,75,.7);
  }
  .fin-grid button[aria-pressed="true"]::after { border-radius: 0 !important; }
  .theme-light .fin-grid button, .theme-light .tabs button, .theme-light .seg button, .theme-light .viewer-head .ctl button { --plate: #fff; --g: #9AA3B0; --rv: #fff; --rr: #8A93A0; }
  .theme-light .fin-grid button[aria-pressed="true"], .theme-light .tabs button[aria-selected="true"] { --plate: rgba(245,138,75,.12); --g: var(--accent); }

  /* ---------- 2. Square cards, panels, fields ---------- */
  .card, .card .ph, .card .ph img, .step img, .shot, .shot img, .formbox, .tile, .biz-item, .faq, .fact, .stage,
  .custom-cta, .tactile, .filters a, .filters button, select, input, textarea, .drop, .desc-box, .chip { border-radius: 0 !important; }

  /* ---------- 3. ON SALE ---------- */
  /* no floating sticker on the home hero: the On sale section below it is where the sale lives */
  .hero .hero-sticker { display: none !important; }

  /* shop page: the sticker becomes its own full-width On sale strip under the heading */
  .shop-head .sale-sticker {
    position: relative !important; inset: auto !important; transform: none !important; width: 100% !important; height: auto !important;
    grid-column: 1 / -1; order: 99; display: flex !important; align-items: center; gap: 14px; min-height: 60px; padding: 10px 18px 10px 24px;
    animation: none !important; filter: none !important; color: var(--head) !important;
    background:
      repeating-linear-gradient(-45deg, var(--sale-yellow) 0 6px, #0B0B0C 6px 12px) left top / 8px 100% no-repeat,
      linear-gradient(90deg, rgba(255,210,63,.10), rgba(255,210,63,.02)), var(--panel2);
    border: 2px solid rgba(255,210,63,.55);
  }
  .shop-head .sale-sticker:hover, .shop-head .sale-sticker:focus-visible { border-color: var(--sale-yellow); transform: none !important; }
  .shop-head .sale-sticker .ss-frame, .shop-head .sale-sticker .ss-dots, .shop-head .sale-sticker .ss-slab::after { display: none !important; }
  .shop-head .sale-sticker .ss-slab {
    position: static !important; width: auto !important; height: auto !important; padding: 0 !important; background: none !important;
    clip-path: none !important; box-shadow: none !important; transform: none !important; display: flex !important; flex-direction: column; gap: 4px !important;
  }
  .shop-head .sale-sticker .ss-main { font-size: 19px !important; letter-spacing: .14em !important; color: var(--sale-yellow); line-height: 1 !important; }
  .shop-head .sale-sticker .ss-sub { font-size: 11px !important; color: var(--muted); letter-spacing: .12em; }
  .shop-head .sale-sticker .ss-arrow { position: static !important; margin-left: auto; flex-direction: row !important; gap: 0 !important; }
  .shop-head .sale-sticker .ss-arrow i { width: 12px !important; height: 12px !important; border-width: 0 3px 3px 0 !important; border-color: var(--sale-yellow) !important; transform: rotate(-45deg) !important; box-shadow: none !important; filter: none !important; }
  .theme-light .shop-head .sale-sticker { --panel2: #fff; }

  /* sale section heading: a straight stencilled label instead of a tilted sticker */
  .sale-h-tag {
    display: inline-block; transform: none !important; box-shadow: none !important; border-radius: 0 !important; clip-path: none !important;
    padding: 6px 12px 5px 18px !important; font-family: var(--mono) !important; font-size: 12px !important; letter-spacing: .2em !important; vertical-align: middle;
    background: repeating-linear-gradient(-45deg, #0B0B0C 0 4px, var(--sale-yellow) 4px 8px) left top / 7px 100% no-repeat, var(--sale-yellow) !important;
  }

  /* ON SALE tag on every sale item: product cards (bottom-left of the photo, clear of the franchise label) */
  .card .sale-flag {
    display: inline-flex !important; align-items: center; transform: none !important;
    top: auto !important; bottom: 10px !important; left: 10px !important; right: auto !important;
    font-size: 0 !important; padding: 0 !important; clip-path: none !important; box-shadow: 0 0 0 2px #0B0B0C, 0 4px 12px rgba(0,0,0,.5) !important;
  }
  .card .sale-flag::before {
    content: "ON SALE"; display: block; padding: 5px 9px 4px 15px; font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .16em; color: #0B0B0C;
    background: repeating-linear-gradient(-45deg, #0B0B0C 0 3px, var(--sale-yellow) 3px 6px) left top / 7px 100% no-repeat, var(--sale-yellow);
  }
  /* product page: same tag under the name */
  .sale-inline {
    transform: none !important; clip-path: none !important; border-radius: 0 !important; margin: -2px 0 0 !important;
    padding: 5px 10px 4px 17px !important; font-family: var(--mono) !important; font-size: 12px !important; letter-spacing: .18em !important;
    background: repeating-linear-gradient(-45deg, #0B0B0C 0 3px, var(--sale-yellow) 3px 6px) left top / 7px 100% no-repeat, var(--sale-yellow) !important;
    box-shadow: 0 0 0 2px #0B0B0C !important;
  }
  /* home hero: when the 3D model on display is on sale, its name gets the tag */
  .hero.is-sale .display-bar .name::after {
    content: "ON SALE"; display: inline-block; vertical-align: middle; margin-left: 10px; padding: 4px 8px 3px 14px;
    font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .16em; color: #0B0B0C;
    background: repeating-linear-gradient(-45deg, #0B0B0C 0 3px, var(--sale-yellow) 3px 6px) left top / 6px 100% no-repeat, var(--sale-yellow);
  }
}

/* ---------- 4. Phones: links that act as buttons get the same riveted plates ---------- */
@media (max-width: 760px) {
  .card .foot .go, .sale-head .go, .armory-card .foot .go {
    border-radius: 0 !important;
    --g: #23272F; --gl: 15px; --gw: 3px; --rv: #F4E6DA; --rr: #3A2A1E;
    --plate: var(--accent); --shade: linear-gradient(180deg, rgba(255,255,255,.18), rgba(0,0,0,.14));
    background:
      radial-gradient(circle, var(--rv) 0 1.1px, var(--rr) 1.5px 2.5px, transparent 2.9px) left 5px top 5px / 8px 8px no-repeat,
      radial-gradient(circle, var(--rv) 0 1.1px, var(--rr) 1.5px 2.5px, transparent 2.9px) right 5px top 5px / 8px 8px no-repeat,
      radial-gradient(circle, var(--rv) 0 1.1px, var(--rr) 1.5px 2.5px, transparent 2.9px) left 5px bottom 5px / 8px 8px no-repeat,
      radial-gradient(circle, var(--rv) 0 1.1px, var(--rr) 1.5px 2.5px, transparent 2.9px) right 5px bottom 5px / 8px 8px no-repeat,
      linear-gradient(var(--g), var(--g)) left top / var(--gl) var(--gw) no-repeat,
      linear-gradient(var(--g), var(--g)) left top / var(--gw) var(--gl) no-repeat,
      linear-gradient(var(--g), var(--g)) right top / var(--gl) var(--gw) no-repeat,
      linear-gradient(var(--g), var(--g)) right top / var(--gw) var(--gl) no-repeat,
      linear-gradient(var(--g), var(--g)) left bottom / var(--gl) var(--gw) no-repeat,
      linear-gradient(var(--g), var(--g)) left bottom / var(--gw) var(--gl) no-repeat,
      linear-gradient(var(--g), var(--g)) right bottom / var(--gl) var(--gw) no-repeat,
      linear-gradient(var(--g), var(--g)) right bottom / var(--gw) var(--gl) no-repeat,
      var(--shade), var(--plate) !important;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.35), 0 6px 18px -8px rgba(245,138,75,.6);
    color: #111214 !important; border: 0; letter-spacing: .04em;
  }
  .armory-card .foot .go { --gl: 20px; --gw: 4px; }
  /* outlined versions: "Details" next to Add to cart, and "See all on sale" */
  .card .foot .go, .sale-head .go {
    --plate: rgba(245,138,75,.10); --shade: linear-gradient(transparent, transparent);
    --g: var(--accent); --rv: #C9D1DC; --rr: #4A5261;
    border: 2px solid rgba(245,138,75,.55) !important; color: var(--head) !important; box-shadow: none;
  }
  /* shop grid: Details is the only button, so it's solid orange */
  .shop-sec .card .foot .go {
    --plate: var(--accent); --shade: linear-gradient(180deg, rgba(255,255,255,.18), rgba(0,0,0,.14));
    --g: #23272F; --rv: #F4E6DA; --rr: #3A2A1E; border: 0 !important; color: #111214 !important;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.35), 0 6px 16px -8px rgba(245,138,75,.6);
  }
  .shop-sec .card.is-na .foot .go {
    --plate: transparent; --shade: linear-gradient(transparent, transparent); --g: #4A5261; --rv: #C9D1DC; --rr: #4A5261;
    border: 2px solid var(--line2) !important; color: var(--head) !important; box-shadow: none;
  }
  /* desktop's marching caution-tape edge, shown while a button is pressed on touch */
  .btn:active::before, .fin-grid button:active::before, .tabs button:active::before { opacity: 1 !important; }
  .shop-head .sale-sticker { min-height: 58px; padding: 10px 16px 10px 22px; }
  .shop-head .sale-sticker .ss-main { font-size: 18px !important; }
}

/* ---------- 5. Phones: red starburst SALE sticker on sale photos (replaces the swinging arrows) ---------- */
@media (max-width: 760px) {
  .sale-arrows.sa-card .sa { display: none !important; }
  .sale-arrows.sa-hero { display: none !important; }   /* hero: the name already gets the ON SALE tag */
  .sale-arrows.sa-card {
    opacity: 1 !important; pointer-events: none; inset: auto !important; top: 8px !important; right: 8px !important; left: auto !important; bottom: auto !important;
    width: 108px; height: 108px; filter: drop-shadow(4px 5px 0 rgba(90,8,14,.95)) drop-shadow(0 6px 10px rgba(0,0,0,.5));
    animation: sfx-burst-pop 1.8s ease-in-out infinite; transform-origin: 50% 50%;
  }
  /* cards: smaller, top-right just under the franchise label */
  .card .sale-arrows.sa-card { width: 62px; height: 62px; top: 34px !important; right: 4px !important; }
  .sale-arrows.sa-card::before, .sale-arrows.sa-card::after {
    position: absolute; display: flex; align-items: center; justify-content: center; text-align: center; white-space: pre;
    clip-path: polygon(50.0% 0.0%, 57.1% 14.5%, 67.1% 3.0%, 70.5% 18.8%, 82.1% 11.7%, 81.4% 26.9%, 93.3% 25.0%, 88.5% 37.7%, 99.2% 41.3%, 91.0% 50.0%, 99.2% 58.7%, 88.5% 62.3%, 93.3% 75.0%, 81.4% 73.1%, 82.1% 88.3%, 70.5% 81.2%, 67.1% 97.0%, 57.1% 85.5%, 50.0% 100.0%, 42.9% 85.5%, 32.9% 97.0%, 29.5% 81.2%, 17.9% 88.3%, 18.6% 73.1%, 6.7% 75.0%, 11.5% 62.3%, 0.8% 58.7%, 9.0% 50.0%, 0.8% 41.3%, 11.5% 37.7%, 6.7% 25.0%, 18.6% 26.9%, 17.9% 11.7%, 29.5% 18.8%, 32.9% 3.0%, 42.9% 14.5%);
  }
  .sale-arrows.sa-card::before { content: ""; inset: 0; background: #FFFFFF; }
  .sale-arrows.sa-card::after {
    content: "SALE!\A 20% OFF"; inset: 3px; background: radial-gradient(circle at 40% 35%, #FF3B45, #D9121F 70%);
    font-family: var(--head-font); font-weight: 700; font-size: 17px; line-height: .95; letter-spacing: .01em; color: #fff;
    transform: rotate(-12deg); text-shadow: 0 2px 0 rgba(90,8,14,.6);
  }
  .card .sale-arrows.sa-card::after { content: "SALE!\A -20%"; font-size: 13px; }
  /* product page: shows the price of the finish you picked (set by product.js) */
  .shot .sale-arrows.sa-card[data-now]::after { content: "SALE!\A NOW\A " attr(data-now); font-size: 15px; line-height: 1; }

  /* the burst already says SALE on cards, so the yellow ON SALE tag stays only on the product page */
  .card .sale-flag { display: none !important; }
}
@keyframes sfx-burst-pop { 0%, 100% { transform: rotate(0deg) scale(1); } 50% { transform: rotate(6deg) scale(1.08); } }
.reduce-motion .sale-arrows.sa-card { animation: none !important; }
@media (prefers-reduced-motion: reduce) { html:not(.js) .sale-arrows.sa-card { animation: none !important; } }

/* ---------- 6. Phones: "Rotate in 3D" button on the product photo (top-left) (added by product.js on pages with a 3D model) ---------- */
.rotate-3d { display: none; }
@media (max-width: 760px) {
  .shot .rotate-3d {
    display: inline-flex; position: absolute; left: 10px; top: 10px; z-index: 6; width: auto;   /* top-left: clear of the caption and the SALE burst */
    min-height: 38px; padding: 0 14px 0 12px; gap: 7px; font-size: 13px; letter-spacing: .04em;
    --gl: 10px; --gw: 2px; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  }
  .shot .rotate-3d.btn.ghost { --plate: rgba(11,11,12,.72); }
  .viewer-sec { scroll-margin-top: 84px; }   /* land below the fixed menu bar */
  .rotate-3d .r3-ico { font-size: 17px; line-height: 1; display: inline-block; animation: r3-spin 3.2s linear infinite; }
}
@keyframes r3-spin { to { transform: rotate(360deg); } }
.reduce-motion .rotate-3d .r3-ico { animation: none; }

/* ---------- All screen sizes: sale price display (old price crossed out, new price, % saved) ---------- */
/* card footer: let a long sale price wrap, but keep "Details →" on one line */
.card .foot { flex-wrap: wrap; row-gap: 6px; }
.card .foot .go { white-space: nowrap; }

/* was / now prices on sale items */
.price-was { color: var(--faint); font-weight: 500; text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: rgba(229,72,77,.8); margin-right: 6px; }
.price-now { color: var(--sale-yellow); }
.theme-light .price-now { color: #B25B00; }
.save-tag {
  display: inline-block; margin-left: 8px; padding: 3px 7px 2px; vertical-align: middle; transform: translateY(-1px);
  font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .12em; color: #0B0B0C; background: var(--sale-yellow);
}
.buy .price .save-tag { font-size: 12px; }
.buy .price .price-was { font-size: .7em; }

