/* #hero section (app/views/home/_hero.html.erb), design D. */
@layer sections {
  /* Light green, flowing on from the header, with round bottom corners. */
  .hero {
    background: var(--pl-green-100);
    color: var(--pl-ink);
    border-radius: 0 0 var(--pl-r-hero) var(--pl-r-hero);
    overflow: hidden;
  }

  .hero__inner {
    min-height: 800px;
    display: flex;
    align-items: center;
    padding-top: clamp(36px, 5.4vw, 72px);
    padding-bottom: clamp(48px, 6.2vw, 84px);
  }

  /* Copy column + art column; wraps to one column when both no longer fit. */
  .hero__layout {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: clamp(40px, 5vw, 72px);
  }

  /* Left column: title, lead, picker card, delivery note */
  .hero__copy {
    flex: 1.25 1 min(520px, 100%);
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .hero__title {
    margin: 0;
    font-size: clamp(36px, 4.05vw, 58px);
    font-weight: 800;
    line-height: 1.06;
    letter-spacing: -0.022em;
  }

  /* English: "with the taste you know" is 11.8em wide, more than the copy
     column (611px) at 58px. 51px keeps the title in two lines up to the
     design's 1440px, as in Georgian (phones: the rule at the end). */
  @media (min-width: 481px) {
    .hero__title:lang(en) {
      font-size: clamp(36px, 4.05vw, 51px);
    }
  }

  .hero__title-line {
    display: block;
  }

  .hero__title-line--accent {
    color: var(--pl-green-800);
  }

  .hero__lead {
    margin: 0;
    max-width: 30em;
    font-size: clamp(16.5px, 1.45vw, 18.5px);
    line-height: 1.6;
    color: var(--pl-muted);
  }

  /* White picker card: a row per product, the total row, Continue */
  .hero__card {
    width: 100%;
    max-width: 500px;
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    border-radius: var(--pl-r-card-sm);
    background: var(--pl-paper);
    color: var(--pl-ink);
    box-shadow: var(--pl-shadow-card);
  }

  .hero__row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 68px;
    padding: 10px 10px 10px 12px;
    border-radius: var(--pl-r-control);
    background: var(--pl-sand-50);
  }

  .hero__row--total {
    padding: 10px 18px 10px 14px;
  }

  /* The product's drawing on a dark tile (hidden ≤480px by .pl-hide-sm). */
  .hero__row-art {
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--pl-green-950);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .hero__row-drawing {
    display: block;
    width: 28px;
    height: auto;
    fill: var(--pl-paper);
  }

  .hero__row-icon {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: var(--pl-r-pill);
    background: var(--pl-paper);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .hero__row-text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.3;
  }

  /* Name + "New" pill; the pill drops under the name when the row is narrow. */
  .hero__row-name {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 6px;
    font-size: 16px;
    font-weight: 700;
  }

  .hero__row-sub {
    font-size: 14px;
    color: var(--pl-muted);
  }

  .hero__total {
    flex: none;
    font-size: 19px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.01em;
  }

  .hero__continue {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 58px;
    /* 10px only matters when a long label (ordering paused) wraps. */
    padding: 10px 24px;
    border-radius: var(--pl-r-control);
    background: var(--pl-green-800);
    color: var(--pl-paper);
    font-size: 17.5px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
  }

  .hero__continue svg {
    flex: none;
  }

  /* "Minimum order 19 ₾ before delivery. Add 9.50 ₾ more.": between the total and Continue
     while the products cost less than the minimum order (basket controller). */
  .hero__minimum {
    margin: 0;
    text-wrap: balance;
    padding: 2px 8px 4px 14px;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--pl-ink);
  }

  /* An empty basket or one below the minimum order (basket controller):
     still a working link to the form. */
  .hero__continue.is-dimmed {
    opacity: 0.45;
  }

  /* "Delivery: Tbilisi · today or tomorrow · free from 50 ₾ · pay on delivery" */
  .hero__note {
    margin: 0;
    font-size: 14.5px;
    color: var(--pl-muted);
    text-wrap: balance;
  }

  /* The fee part ("50 ₾-დან უფასო") and the last part ("pay on delivery")
     never split: no lone suffix or word at the start of a line. */
  .hero__note-keep {
    white-space: nowrap;
  }

  /* Right column: the green art card with its two stickers */
  .hero__visual {
    flex: 1 1 min(380px, 100%);
    min-width: 0;
    display: flex;
    justify-content: center;
  }

  .hero__art {
    position: relative;
    width: min(100%, 440px);
  }

  .hero__art-tile {
    position: relative;
    aspect-ratio: 1 / 1.08;
    border-radius: var(--pl-r-card);
    background: var(--pl-green-800);
    overflow: hidden;
  }

  .hero__drawing {
    position: absolute;
    height: auto;
    fill: var(--pl-paper);
  }

  .hero__drawing--main {
    left: 9%;
    top: 10%;
    width: 62%;
  }

  .hero__drawing--side {
    right: 6%;
    bottom: 7%;
    width: 46%;
    transform: rotate(6deg);
  }

  /* Stickers overhang the card by 14px (inside the page gutter). */
  .hero__sticker {
    position: absolute;
    border-radius: var(--pl-r-tile-sm);
    color: var(--pl-ink);
    box-shadow: var(--pl-shadow-sticker);
  }

  /* A corner tag: a long name wraps inside it instead of covering the card. */
  .hero__sticker--new {
    right: -14px;
    top: 26px;
    max-width: min(210px, 66%);
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 18px 16px;
    background: var(--pl-cream);
    transform: rotate(3deg);
  }

  .hero__sticker-label {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.3;
  }

  .hero__sticker-name {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    overflow-wrap: break-word;
  }

  /* The design's 26px holds a name of up to 8 characters inside the tag
     (home/_hero); 9 or 10 characters get 21px, still on one line. */
  .hero__sticker-name--mid {
    font-size: 21px;
  }

  /* A longer name: two lines of smaller type, three at most (the full name
     of a product without a short name ends in "…"). */
  .hero__sticker-name--long {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    font-size: 17px;
    line-height: 1.2;
    letter-spacing: -0.01em;
    text-wrap: balance;
  }

  .hero__sticker--plant {
    left: -14px;
    bottom: 26px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px 14px 16px;
    background: var(--pl-yellow);
    transform: rotate(-3deg);
  }

  .hero__sticker-icon {
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: var(--pl-r-pill);
    background: var(--pl-ink);
    color: var(--pl-yellow);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .hero__sticker-text {
    display: flex;
    flex-direction: column;
    font-size: 15px;
    line-height: 1.3;
  }

  .hero__sticker-title {
    font-weight: 800;
  }

  .hero__sticker-sub {
    font-weight: 600;
  }

  /*
   * Small phones. The title, the rows and the stepper equal the normal values
   * from 390px up and only shrink below it. "18.99 ₾ · 10 ცალი" stays on one
   * line beside the stepper at 360px (the 44px drawing tile is already gone:
   * .pl-hide-sm).
   */
  @media (max-width: 480px) {
    /* 36px from 390px up; below, just small enough for "ვეგანური კერძები"
       to stay on one line (the title in two lines, not four, at 360px). */
    .hero__title {
      font-size: clamp(30px, (100vw - 40px) * 0.103, 36px);
    }

    .hero__row {
      gap: clamp(8px, 10vw - 24px, 12px);
    }

    .hero .pl-stepper__count {
      min-width: clamp(28px, 15vw - 20px, 34px);
    }

    /*
     * The art card is narrower than the design's 440px here, but the plant
     * sticker's text is not: at its place it would cover the left half of the
     * second drawing. So the sticker slides down over the card's bottom edge
     * (26px inside at 480px, 18px outside at 360px, within the hero's bottom
     * padding), gets a little smaller, and the second drawing moves up, clear
     * of it.
     */
    .hero__drawing--side {
      bottom: 12%;
    }

    .hero__sticker--plant {
      bottom: clamp(-18px, 36.67vw - 150px, 26px);
      gap: clamp(10px, 2.8vw, 12px);
      padding: clamp(10px, 3vw, 14px) clamp(14px, 4vw, 18px) clamp(10px, 3vw, 14px) clamp(12px, 3.5vw, 16px);
    }

    .hero__sticker-icon {
      width: clamp(32px, 8.9vw, 38px);
      height: clamp(32px, 8.9vw, 38px);
    }

    .hero__sticker-text {
      font-size: clamp(13.5px, 3.75vw, 15px);
    }
  }
}
