/**
 * Delivery promise — default presentation.
 *
 * THEMING CONTRACT
 * ----------------
 * Self-contained with neutral defaults. Themes restyle by setting the --ksh-*
 * custom properties below, never by overriding selectors.
 *
 * Layered on purpose: layered CSS always loses to unlayered CSS, so a host
 * theme's ordinary stylesheet wins without matching load order or specificity.
 *
 * @copyright Kicked SRL
 * @license   AFL-3.0
 */

@layer kicked-shipping {
  .kicked-shipping-promise,
  .kicked-delivery,
  .kicked-progress {
    --ksh-ink: #18181b;
    --ksh-muted: #71717a;
    --ksh-accent: #b91c1c;
    --ksh-success: #15803d;
    /* Wording *on* the success tint, which needs more contrast than the glyph
       that sits on the card. Its own property because a single --ksh-success
       cannot be both the icon on white and the text on a pale green fill. */
    --ksh-success-ink: #166534;
    --ksh-success-tint: #f0fdf4;
    --ksh-surface: #fff;
    --ksh-border: #e4e4e7;
    --ksh-track: #f4f4f5;
    --ksh-radius: 0.875rem;
  }

  /* --- Utility-bar promise ------------------------------------------------ */

  .kicked-shipping-promise {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin: 0;
  }

  .kicked-shipping-promise__icon {
    flex: none;
    color: var(--ksh-accent);
  }

  /* --- Product-page delivery card ----------------------------------------- */

  .kicked-delivery {
    padding: 1rem;
    background: var(--ksh-surface);
    border: 1px solid var(--ksh-border);
    border-radius: var(--ksh-radius);
  }

  .kicked-delivery__row {
    display: flex;
    gap: 0.6875rem;
    align-items: flex-start;
  }

  .kicked-delivery__icon {
    flex: none;
    color: var(--ksh-success);
  }

  .kicked-delivery__date {
    margin: 0;
    font-size: 0.84375rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--ksh-ink);
  }

  .kicked-delivery__countdown {
    margin: 0.125rem 0 0;
    font-size: 0.75rem;
    line-height: normal;
    color: var(--ksh-muted);
  }

  .kicked-delivery__free {
    line-height: normal; /* the icon governs the bar, not the text */
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.5625rem 0.6875rem;
    margin: 0.75rem 0 0;
    font-size: 0.78125rem;
    font-weight: 600;
    color: var(--ksh-success-ink);
    background: var(--ksh-success-tint);
    border-radius: 0.5625rem;
  }

  /* --- Cart progress ------------------------------------------------------ */

  .kicked-progress {
    padding: 1rem 1.125rem;
    background: var(--ksh-surface);
    border: 1px solid var(--ksh-border);
    border-radius: var(--ksh-radius);
  }

  .kicked-progress__message {
    display: flex;
    gap: 0.5625rem;
    align-items: center;
    margin: 0 0 0.6875rem;
    font-size: 0.84375rem;
    color: var(--ksh-ink);
  }

  .kicked-progress__icon {
    flex: none;
    color: var(--ksh-accent);
  }

  .kicked-progress--reached .kicked-progress__icon {
    color: var(--ksh-success);
  }

  .kicked-progress__track {
    height: 0.5rem;
    overflow: hidden;
    background: var(--ksh-track);
    border-radius: 0.3125rem;
  }

  .kicked-progress__fill {
    height: 100%;
    background: var(--ksh-accent);
    border-radius: 0.3125rem;
    transition: width 0.3s ease;
  }

  .kicked-progress--reached .kicked-progress__fill {
    background: var(--ksh-success);
  }

  /* The bar still moves to its new width — that IS the information — but it
     arrives rather than travels. */
  @media (prefers-reduced-motion: reduce) {
    .kicked-progress__fill {
      transition: none;
    }
  }

  /* The persistent announcement node beside the bar (see cart-progress.tpl).
     Its own class rather than a host theme's .visually-hidden, for the same
     reason the other kicked modules carry one: the module cannot know what a
     theme ships. position:absolute keeps it out of flow, so it cannot disturb
     whatever layout the hook container uses. */
  .kicked-shipping-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
}
