/* ───────────────────────────────────────────────────────────────────────────
   Corplus motion & polish layer. Loads AFTER main.css (see base.html).
   Rollback = delete the <link> to this file in base.html; nothing else
   depends on it.

   Rules this file follows:
   - only opacity / transform / box-shadow are animated (no layout work)
   - every animation sits inside prefers-reduced-motion: no-preference
   - nothing here touches ids, data-* attributes or JS hooks; it only
     adds visual rules to classes that already exist
   - animations start when an element is inserted into the page, so they
     also run after hx-boost / HTMX swaps with no JavaScript
   ─────────────────────────────────────────────────────────────────────── */

/* 1. Headline polish: slightly tighter tracking, balanced line breaks */
h1,
.hero-slide-title,
.section-head h2 {
  letter-spacing: -0.02em;
  text-wrap: balance;
}

/* 2. Press feedback on buttons and icon buttons */
.btn:not(:disabled):active,
.pc-hover-quote-btn:active,
.wishlist-btn:active,
.header-action-btn:active {
  transform: scale(0.97);
}

/* 3. Cards: rounder corners and softer, layered shadows */
.product-card {
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 2px 8px rgba(15, 23, 42, 0.04);
}
.product-card:hover {
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.05), 0 18px 40px -10px rgba(15, 23, 42, 0.18);
}

/* 3b. Hero banner: larger, bolder, Kasb-style (video background comes from the
       portal's Promo Card slide; see motion.js for play/pause rules) */
.hero .promo-card--hero {
  min-height: clamp(310px, 33vw, 420px);
  background: #070C2E;
}
.hero .promo-card--hero::after {
  background: linear-gradient(to top right, rgba(5, 9, 34, 0.9) 0%, rgba(5, 9, 34, 0.66) 40%, rgba(5, 9, 34, 0.2) 68%, rgba(5, 9, 34, 0) 100%);
}
.hero .promo-card--hero .promo-card-content {
  max-width: 720px;
  padding: clamp(18px, 3.4vw, 52px) clamp(18px, 4vw, 60px);
}
.hero .promo-card--hero .promo-card-headline {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 3.6rem);
  line-height: 1.04;
  letter-spacing: -0.028em;
  font-weight: 700;
  margin-bottom: 14px;
  text-wrap: balance;
}
.hero .promo-card--hero .promo-card-sub {
  font-size: clamp(0.92rem, 1.2vw, 1.12rem);
  max-width: 560px;
  margin-bottom: 18px;
  color: rgba(255, 255, 255, 0.86);
}
.hero .promo-card--hero .promo-card-sub strong { color: #fff; font-weight: 700; }
.hero .promo-card--hero .promo-card-btn,
.hero .promo-card--hero .promo-card-cta {
  padding: 13px 24px;
  font-size: 0.96rem;
  font-weight: 700;
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.2s, background-color 0.2s, color 0.2s, border-color 0.2s;
}
.hero .promo-card--hero .promo-card-btn:hover,
.hero .promo-card--hero .promo-card-cta:hover { transform: translateY(-2px); }
/* gold primary button + quiet outline secondary */
.hero .promo-card--hero .promo-card-cta--gold {
  background: linear-gradient(135deg, #F3DC9C 0%, #D9B25F 100%);
  color: #1B1405;
  border: 0;
  box-shadow: 0 12px 28px -12px rgba(217, 178, 95, 0.8);
}
.hero .promo-card--hero .promo-card-cta--gold:hover { color: #1B1405; box-shadow: 0 16px 34px -12px rgba(217, 178, 95, 0.95); }
.hero .promo-card--hero .promo-card-btn--ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.34);
}
.hero .promo-card--hero .promo-card-btn--ghost:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.6); color: #fff; }
.hero-accent {
  background: linear-gradient(90deg, #F6E3A8 0%, #D9B25F 55%, #EBCB7E 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
@media (max-width: 575.98px) {
  .hero .promo-card--hero { min-height: 230px; }
  .hero .promo-card--hero .promo-card-eyebrow,
  .hero .promo-card--hero .promo-card-sub { display: none; }
  .hero .promo-card--hero .promo-card-btn,
  .hero .promo-card--hero .promo-card-cta { padding: 10px 14px; font-size: 0.84rem; }
}

/* 3b-hand. Hero signature "Customised as yours": Alex Brush outlines written stroke by stroke
       in gold, a swoosh underline, then a dotted arrow toward the video (inline SVG, no font file). */
.hero-handwrite { position: relative; display: block; height: 82px; margin: 0 0 6px; }
.hw-text { position: absolute; left: -4px; top: 0; height: 78px; width: auto; overflow: visible; }
.hw-text path[pathLength] {
  fill: url(#hwg);
  stroke: url(#hwg);
  stroke-width: 0.9;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 10px rgba(232, 200, 117, 0.28));
}
.hw-swoosh { fill: none; stroke: url(#hwf); stroke-width: 2.6; stroke-linecap: round; }
.hw-arrow { position: absolute; overflow: visible; pointer-events: none; }
.hw-arrow--wide { left: calc(var(--tw) * var(--k) - 4px); top: -10px; height: 86px; width: auto; }
.hw-arrow--up { display: none; }
.hw-dots { fill: none; stroke: #F1D88F; stroke-width: 4.2; stroke-linecap: round; stroke-dasharray: 0.1 11; }
.hw-head { fill: none; stroke: #F1D88F; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.hw-reveal { fill: none; stroke: #fff; stroke-width: 20; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
@media (max-width: 767.98px) {
  .hero-handwrite { height: 56px; margin-bottom: 2px; }
  .hw-text { height: 54px; }
  .hw-arrow--wide { display: none; }
  .hw-arrow--up { display: block; right: 4px; top: -58px; height: 66px; width: auto; }
}
@media (prefers-reduced-motion: no-preference) {
  @keyframes hw-draw { to { stroke-dashoffset: 0; } }
  @keyframes hw-fill { to { fill-opacity: 1; } }
  @keyframes hw-show { to { opacity: 1; } }
  .hw-text path[pathLength]:not(.hw-reveal) {
    fill-opacity: 0;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: hw-draw 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards, hw-fill 0.5s ease-out forwards;
    animation-delay: calc(var(--i) * 85ms + 0.3s), calc(var(--i) * 85ms + 0.85s);
  }
  .hw-reveal { stroke-dashoffset: 1; animation: hw-draw 1s ease-in-out 3s forwards; }
  .hw-reveal--swoosh { animation: hw-draw 0.9s ease-in-out 2.15s forwards; }
  .hw-head { opacity: 0; animation: hw-show 0.3s ease-out 3.95s forwards; }
}

/* 3b-stats. "4,000+ Quality products / 1,000+ Trusted clients" cards on the right of the banner */
.hero-stats {
  position: absolute;
  z-index: 2;
  right: clamp(14px, 2vw, 28px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hero-stat {
  min-width: 142px;
  padding: 11px 16px 12px;
  background: rgba(7, 12, 46, 0.66);
  border: 1px solid rgba(232, 200, 117, 0.22);
  border-radius: 16px;
  box-shadow: 0 14px 30px -16px rgba(0, 0, 0, 0.8);
}
.hero-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.3vw, 2.05rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #E8C875;
  font-variant-numeric: tabular-nums;
}
.hero-stat span {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.86);
}
@media (prefers-reduced-motion: no-preference) {
  .hero-stat { animation: cg-rise 0.7s cubic-bezier(0, 0, 0.2, 1) backwards; }
  .hero-stat:nth-child(1) { animation-delay: 0.9s; }
  .hero-stat:nth-child(2) { animation-delay: 1.05s; }
}
@media (max-width: 991.98px) {
  .hero-stat { min-width: 120px; padding: 9px 13px 10px; }
}

/* 3b-mobile. Phones: the wide video cannot sit behind the text without hiding the
       product, so stack it: video on top (product kept in view), text below. */
@media (max-width: 767.98px) {
  .hero .promo-card--hero {
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    background: #070C2E;
  }
  .hero .promo-card--hero::after { display: none; }
  .hero .promo-card--hero .promo-card-image {
    position: relative;
    inset: auto;
    flex: none;
    order: -1;
    height: clamp(190px, 54vw, 270px);
  }
  .hero .promo-card--hero .promo-card-image::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 60px;
    background: linear-gradient(to bottom, rgba(5, 9, 34, 0), #070C2E);
    z-index: 2;
    pointer-events: none;
  }
  .hero .promo-img-swiper .swiper-slide img,
  .hero .promo-img-swiper .swiper-slide video { object-position: 76% center; }
  .hero .promo-card--hero .promo-card-content { padding: 2px 18px 20px; max-width: none; }
  .hero .promo-card--hero .promo-card-eyebrow { display: none; }
  .hero .promo-card--hero .promo-card-headline { font-size: clamp(1.55rem, 7vw, 2.05rem); margin-bottom: 12px; }
  .hero .promo-card--hero .promo-card-sub { display: none; }
  .hero .promo-card--hero .promo-card-btn-row { gap: 10px; flex-wrap: wrap; }
  .hero-stats {
    position: static;
    transform: none;
    flex-direction: row;
    gap: 10px;
    padding: 0 18px 18px;
  }
  .hero-stat { flex: 1 1 0; min-width: 0; padding: 9px 12px 10px; }
  .hero-stat strong { font-size: 1.45rem; }
  .hero-stat span { font-size: 11.5px; }
}

/* 3c. "Shop by category": a dark navy stage with richer, more readable tiles.
       (.section-stage is added to that one <section> in home.html) */
.section-stage {
  background:
    radial-gradient(760px 300px at 88% 0%, rgba(217, 178, 95, 0.12), transparent 62%),
    radial-gradient(520px 240px at 4% 100%, rgba(255, 255, 255, 0.05), transparent 70%),
    linear-gradient(180deg, #16191E 0%, #0C0E11 100%);
  padding: clamp(30px, 4vw, 60px) 0;
  margin-top: var(--space-2);
}
.section-stage .section-head h2 {
  color: #fff;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  letter-spacing: -0.025em;
}
.section-stage .eyebrow {
  background: rgba(217, 178, 95, 0.14);
  color: #E8C875;
}
.section-stage .eyebrow::before { background: #E8C875; }
.section-stage .section-head-link {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.section-stage .section-head-link:hover { background: #E8C875; border-color: #E8C875; color: #1B1405; }

.category-grid .category-tile {
  box-shadow: 0 10px 28px -14px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.07);
}
.category-grid .category-tile:hover {
  box-shadow: 0 0 0 2px rgba(232, 200, 117, 0.8), 0 26px 46px -16px rgba(0, 0, 0, 0.7);
}
.category-grid .category-tile-media img {
  /* full colour; a touch more punch so the artwork reads on the dark band */
  filter: saturate(1.12) contrast(1.06);
}
/* delivery strip under the category band: charcoal to match */
.logistics-strip { background: #0C0E11; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.category-grid .category-tile-media::after {
  background: linear-gradient(to top, rgba(10, 12, 15, 0.95) 0%, rgba(10, 12, 15, 0.66) 32%, rgba(10, 12, 15, 0.12) 62%, transparent 100%);
}
.category-grid .category-tile-overlay { padding: 12px 14px 14px; }
.category-grid .category-tile-name {
  font-size: clamp(13px, 1.1vw, 16px);
  letter-spacing: -0.01em;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}
.category-grid .category-tile-meta {
  font-size: clamp(10px, 0.8vw, 12px);
  color: rgba(255, 255, 255, 0.84);
}
@media (hover: none) { .category-grid .category-tile-arrow { opacity: 1; transform: none; } }

/* 3c-compact. Smaller category cards: wider-than-tall tiles, tighter band. */
.section-stage { padding: clamp(22px, 3vw, 38px) 0; }
.section-stage .section-head { margin-bottom: var(--space-4); }
.section-stage .section-head h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
.category-grid { gap: 10px; }
.category-grid .category-tile-media { aspect-ratio: 2 / 1; }
.category-grid .category-tile-media img { object-position: center 40%; }
.category-grid .category-tile-overlay { padding: 8px 12px 10px; }
.category-grid .category-tile-name { font-size: clamp(12.5px, 1vw, 14.5px); }
.category-grid .category-tile-meta { font-size: clamp(10px, 0.75vw, 11.5px); }
@media (max-width: 991.98px) {
  .category-grid .category-tile { flex-basis: min(40%, 165px); }
  .category-grid .category-tile-media { aspect-ratio: 16 / 10; }
}

/* 3d. Category pill bar (desktop): tidy equal-width pills instead of a ragged
       two-row wrap, round photo thumbnails, soft depth, navy "open" state.
       The links, ids and the sub-category ribbon JS are untouched. */
@media (min-width: 992px) {
  .category-nav {
    background: linear-gradient(180deg, #F4F7FE 0%, #FFFFFF 100%);
    border-bottom: 1px solid #E3E8F2;
    box-shadow: 0 8px 20px -18px rgba(11, 31, 69, 0.45);
  }
  .category-nav-row { max-height: 124px; }
  .category-nav-list { gap: 8px; padding: 8px 4px 10px; }
  .category-nav-link {
    min-height: 40px;
    padding: 4px 8px 4px 5px;
    gap: 5px;
    font-size: 13px;
    font-weight: 650;
    color: #14171B;
    background: #fff;
    border: 1px solid #E3E8F2;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.2s, border-color 0.2s, background-color 0.2s, color 0.2s;
  }
  .category-nav-link:hover {
    background: #fff;
    border-color: rgba(26, 86, 219, 0.45);
    box-shadow: 0 10px 22px -12px rgba(26, 86, 219, 0.5);
    transform: translateY(-2px);
    color: #14171B;
  }
  .category-nav-link:focus-visible { outline: 2px solid var(--color-primary, #1A56DB); outline-offset: 2px; }
  .cat-icon-wrap {
    width: 28px;
    height: 28px;
    box-shadow: 0 0 0 2px #fff, 0 3px 8px -2px rgba(15, 23, 42, 0.28);
  }
  .cat-icon-wrap img { filter: saturate(1.15) contrast(1.05); }
  .cat-ribbon-caret { color: #6B7A99; }

  /* the open / selected category turns navy */
  .category-nav-link.active,
  .category-nav-item.active > .category-nav-link,
  .category-nav-link.active-ribbon {
    background: linear-gradient(135deg, #14171B 0%, #2A2F36 100%);
    border-color: #14171B;
    color: #fff;
    box-shadow: 0 10px 22px -12px rgba(10, 12, 15, 0.6);
  }
  .category-nav-link.active .cat-icon-wrap,
  .category-nav-item.active > .category-nav-link .cat-icon-wrap,
  .category-nav-link.active-ribbon .cat-icon-wrap { box-shadow: 0 0 0 2px #E8C875; }
  .category-nav-link.active .cat-ribbon-caret,
  .category-nav-link.active-ribbon .cat-ribbon-caret { color: #E8C875; }
}
@media (min-width: 1200px) {
  /* six equal pills per row; the last row centres itself */
  .category-nav-item { flex: 0 0 calc((100% - 40px) / 6); }
  .category-nav-link { width: 100%; justify-content: flex-start; }
  .cat-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; letter-spacing: -0.005em; }
}

@media (prefers-reduced-motion: no-preference) {

  /* Hero text rises in one piece after another */
  @keyframes cg-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5); }
    100% { box-shadow: 0 0 0 16px rgba(217, 178, 95, 0); }
  }
  .hero .promo-card-content > * { animation: cg-rise 0.6s cubic-bezier(0, 0, 0.2, 1) backwards; }
  .hero .promo-card-content > :nth-child(1) { animation-delay: 0.05s; }
  .hero .promo-card-content > :nth-child(2) { animation-delay: 0.12s; }
  .hero .promo-card-content > :nth-child(3) { animation-delay: 0.20s; }
  .hero .promo-card-content > :nth-child(4) { animation-delay: 0.28s; }
  .hero .promo-card-content > :nth-child(5) { animation-delay: 0.36s; }
  @keyframes cg-shimmer { to { transform: translateX(120%); } }
  .hero .promo-card--hero .promo-card-eyebrow::after { animation: cg-shimmer 1.1s 1.0s ease-out 1 forwards; }
  /* the WhatsApp quote button pulses three times to draw the eye, then stops */
  .hero .promo-card-cta { animation: cg-pulse 2.4s 1.4s 3 cubic-bezier(0, 0, 0.2, 1); }

  /* 4. Staggered rise-in for product cards and category tiles.
        Only the first 8 in a grid are staggered; the rest appear together. */
  @keyframes cg-rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
  }
  .product-grid > .product-card,
  .category-grid > .category-tile {
    animation: cg-rise 0.45s cubic-bezier(0, 0, 0.2, 1) backwards;
  }
  .product-grid > :nth-child(2), .category-grid > :nth-child(2) { animation-delay: 50ms; }
  .product-grid > :nth-child(3), .category-grid > :nth-child(3) { animation-delay: 100ms; }
  .product-grid > :nth-child(4), .category-grid > :nth-child(4) { animation-delay: 150ms; }
  .product-grid > :nth-child(5), .category-grid > :nth-child(5) { animation-delay: 200ms; }
  .product-grid > :nth-child(6), .category-grid > :nth-child(6) { animation-delay: 250ms; }
  .product-grid > :nth-child(7), .category-grid > :nth-child(7) { animation-delay: 300ms; }
  .product-grid > :nth-child(n+8), .category-grid > :nth-child(n+8) { animation-delay: 350ms; }

  /* 5. Soft fade when a boosted link swaps #main-content. htmx puts
        .htmx-added on the new element for a moment, then removes it, so the
        opacity eases from 0 to 1. First page load has no .htmx-added and is
        untouched. */
  #main-content { transition: opacity 0.18s cubic-bezier(0, 0, 0.2, 1); }
  #main-content.htmx-added { opacity: 0; }
}
