/* ============================================================
   components.css — Shared UI components
   Header · Announcement bar · Footer
   (More components — buttons, cards, forms — will be added here
   as we build each section.)
   ============================================================ */

@import "./base.css";


/* ============================================================
   ANNOUNCEMENT BAR
   The thin black ribbon at the very top of every page.
   Toggle visibility with the .is-hidden modifier.
   ============================================================ */

.announcement-bar {
  background: var(--mili-shocking-black);
  color: var(--mili-fashion-white);
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-5);       /* 24px */
  padding: 10px var(--space-5);
}

.announcement-bar.is-hidden {
  display: none;
}

.announcement-bar__text {
  opacity: 0.85;
}

.announcement-bar__text--italic {
  font-family: var(--font-serif);
  font-style: italic;
  opacity: 0.85;
}

.announcement-bar__dot {
  opacity: 0.4;
  user-select: none;
}

/* Currency toggle — dark version (lives inside the announcement bar) */
.currency-switch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.currency-switch__btn {
  background: transparent;
  border: none;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: var(--tracking-button);
  text-transform: uppercase;
  padding: 2px 4px;
  cursor: pointer;
  transition: color var(--dur-quick) var(--ease-soft);
  color: rgba(250, 244, 231, 0.4);  /* dim by default */
}

.currency-switch__btn.is-active {
  color: var(--mili-fashion-white);
}

.currency-switch__sep {
  color: rgba(250, 244, 231, 0.4);
  font-size: 12px;
  user-select: none;
}

/* Light version of currency switch — used inside the header */
.currency-switch--light .currency-switch__btn {
  color: var(--fg3);
}

.currency-switch--light .currency-switch__btn.is-active {
  color: var(--fg1);
}

.currency-switch--light .currency-switch__sep {
  color: var(--fg3);
}


/* ============================================================
   SITE HEADER
   Sticky top bar: nav left, logo center, actions right.
   Gains a frosted-glass blur after the user scrolls 12px.
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--mili-fashion-white);
  border-bottom: 1px solid transparent;
  transition:
    background var(--dur-base) var(--ease-soft),
    border-color var(--dur-base) var(--ease-soft),
    backdrop-filter var(--dur-base) var(--ease-soft);
}

/* After scrolling 12px — JS adds this class via main.js */
.site-header.is-scrolled {
  background: rgba(250, 244, 231, 0.82);
  backdrop-filter: blur(14px) saturate(110%);
  -webkit-backdrop-filter: blur(14px) saturate(110%);
  border-bottom-color: var(--border);
}

/* Also show border when search is open */
.site-header.search-open {
  border-bottom-color: var(--border);
}

/* ── Header inner grid ──────────────────────────────────── */
/* Three-column: [nav] [logo] [actions]                      */

.header-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  padding: 20px var(--gutter);
  max-width: 1400px;
  margin-inline: auto;
  gap: 24px;
}

/* ── Logo ─────────────────────────────────────────────────── */

.site-logo {
  justify-self: center;
  grid-column: 2;
  font-family: var(--font-display);
  font-size: 38px;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--mili-shocking-black);
  text-decoration: none;
  display: inline-block;
  transition: opacity var(--dur-quick) var(--ease-soft);
}

.site-logo:hover {
  opacity: 0.75;
  text-decoration: none;
}

/* ── Nav (left column) ────────────────────────────────────── */

.site-nav {
  grid-column: 1;
  display: flex;
  gap: var(--space-5);  /* 24px */
  align-items: center;
  min-width: 0;
  overflow: hidden;
}

.nav-link {
  position: relative;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: var(--tracking-button);
  text-transform: uppercase;
  color: var(--fg2);
  background: transparent;
  border: none;
  padding: 8px 0;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--dur-quick) var(--ease-soft);
}

.nav-link:hover {
  color: var(--fg1);
  text-decoration: none;
}

/* Active page — full black + underline indicator */
.nav-link.is-active {
  color: var(--mili-shocking-black);
}

.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 1px;
  background: var(--mili-shocking-black);
}

/* ── Header actions (right column) ───────────────────────── */

.header-actions {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: var(--space-5);  /* 24px */
  min-width: 0;
}

/* Thin divider between currency switch and icon buttons */
.header-divider {
  width: 1px;
  height: 14px;
  background: var(--border);
  flex-shrink: 0;
}

/* Icon buttons (search, cart) */
.header-icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--fg1);
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
  transition: opacity var(--dur-quick) var(--ease-soft);
}

.header-icon-btn:hover {
  opacity: 1;
}

/* Cart badge — the little count bubble */
.header-icon-btn--cart {
  position: relative;
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  background: var(--mili-french-puce);
  color: var(--mili-fashion-white);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  min-width: 16px;
  text-align: center;
  line-height: 1.4;
  pointer-events: none;
}

/* Hidden when cart is empty — JS adds/removes this */
.cart-badge[hidden] {
  display: none;
}


/* ── Search panel ─────────────────────────────────────────── */
/* Hidden by default. JS removes [hidden] to show it.         */

.search-panel {
  border-top: 1px solid var(--border);
  background: var(--mili-fashion-white);
  padding: 20px var(--gutter) 24px;
  animation: mili-fade 200ms var(--ease-soft) both;
}

.search-panel[hidden] {
  display: none;
}

.search-panel__inner {
  max-width: 720px;
  margin-inline: auto;
}

.search-input-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 12px var(--space-4);
  background: var(--mili-canvas-100);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.search-input-row__icon {
  color: var(--fg2);
  flex-shrink: 0;
  display: inline-flex;
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--fg1);
}

.search-input::placeholder {
  color: var(--fg3);
}

.search-clear-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--fg2);
  padding: 4px;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

/* Search results list */
.search-results {
  margin-top: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.search-result-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: var(--space-4);
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background var(--dur-quick) var(--ease-soft);
}

.search-result-item:hover {
  background: var(--mili-canvas-200);
}

.search-result-item__thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
}

.search-result-item__name {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--fg1);
}

.search-result-item__desc {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13px;
  color: var(--fg2);
  margin-top: 2px;
}

.search-no-results {
  padding: 16px 14px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15px;
  color: var(--fg2);
}


/* ============================================================
   SITE FOOTER
   French Puce background, Fashion White text.
   Four-column grid: [brand + newsletter] [Shop] [Mili] [Care]
   ============================================================ */

.site-footer {
  background: var(--mili-french-puce);
  color: var(--mili-fashion-white);
  padding: var(--space-9) var(--gutter) var(--space-7);
  /* space-9 = 96px top, space-7 = 48px bottom */
}

.footer-inner {
  max-width: 1280px;
  margin-inline: auto;
}

/* ── Four-column grid ─────────────────────────────────────── */

.footer-cols {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: var(--space-8);   /* 64px */
  align-items: start;
}

/* ── Brand column (left) ──────────────────────────────────── */

.footer-logo {
  font-family: var(--font-display);
  font-size: 64px;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--mili-fashion-white);
}

.footer-establish {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 16px;
  color: rgba(250, 244, 231, 0.7);
  margin-top: var(--space-2);
}

/* ── Newsletter block ─────────────────────────────────────── */

.footer-newsletter {
  margin-top: var(--space-8);  /* 64px — generous space below logo */
  max-width: 360px;
}

.footer-newsletter__label {
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow);
  color: rgba(250, 244, 231, 0.6);
}

.footer-newsletter__pitch {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 18px;
  line-height: 1.5;
  color: rgba(250, 244, 231, 0.9);
  margin-top: var(--space-3);
}

/* Underline-style email input + submit */
.footer-newsletter__form {
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(250, 244, 231, 0.32);
  margin-top: 22px;
}

.footer-newsletter__input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--mili-fashion-white);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 10px 0;
}

.footer-newsletter__input::placeholder {
  color: rgba(250, 244, 231, 0.45);
}

.footer-newsletter__submit {
  background: transparent;
  border: none;
  color: var(--mili-fashion-white);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 10px 0;
  transition: opacity var(--dur-quick) var(--ease-soft);
}

.footer-newsletter__submit:hover {
  opacity: 0.7;
}

/* ── Link columns (right three) ───────────────────────────── */

.footer-col__title {
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow);
  color: rgba(250, 244, 231, 0.6);
  margin-bottom: 22px;
}

.footer-col__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col__link {
  font-family: var(--font-body);
  font-size: var(--fs-small);
  color: var(--mili-fashion-white);
  text-decoration: none;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  transition: opacity var(--dur-quick) var(--ease-soft);
}

.footer-col__link:hover {
  opacity: 0.65;
  text-decoration: none;
}

/* ── Footer bottom bar ────────────────────────────────────── */

.footer-bottom {
  margin-top: var(--space-9);      /* 96px space above the bar */
  padding-top: 28px;
  border-top: 1px solid rgba(250, 244, 231, 0.16);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-copyright {
  font-family: var(--font-body);
  font-size: 12px;
  color: rgba(250, 244, 231, 0.6);
}

.footer-socials {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.footer-social-link {
  color: rgba(250, 244, 231, 0.6);
  display: inline-flex;
  align-items: center;
  transition: color var(--dur-quick) var(--ease-soft);
}

.footer-social-link:hover {
  color: var(--mili-fashion-white);
  text-decoration: none;
}


/* ============================================================
   SHARED FORM STYLES
   Used by cart.html, contact.html, submit.html
   ============================================================ */

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: var(--tracking-button);
  text-transform: uppercase;
  color: var(--fg3);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--fg1);
  transition: border-color var(--dur-quick) var(--ease-soft);
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--mili-shocking-black);
}

.form-textarea {
  resize: vertical;
  min-height: 88px;
  line-height: 1.6;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B6461' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.submit-btn {
  width: 100%;
  background: var(--mili-shocking-black);
  color: var(--mili-fashion-white);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: var(--tracking-button);
  text-transform: uppercase;
  padding: 16px;
  cursor: pointer;
  margin-top: 8px;
  transition: opacity var(--dur-quick) var(--ease-soft);
}

.submit-btn:hover {
  opacity: 0.88;
}

.submit-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}


/* ============================================================
   RESPONSIVE — Mobile / tablet adjustments
   ============================================================ */

@media (max-width: 768px) {

  /* Header: logo left, actions right on mobile; nav below */
  .header-inner {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: var(--space-3);
    padding: 14px var(--gutter);
  }

  .site-logo {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    font-size: 28px;
  }

  .header-actions {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  /* Hide currency switch in the actions column on mobile (it's in the announcement bar) */
  .header-actions .currency-switch--light {
    display: none;
  }

  .header-actions .header-divider {
    display: none;
  }

  .site-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
    gap: var(--space-4);
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  /* Announcement bar: allow wrapping on very small screens */
  .announcement-bar {
    flex-wrap: wrap;
    gap: var(--space-2);
    text-align: center;
    padding: 8px var(--space-4);
  }

  /* Footer: single column stack */
  .footer-cols {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .footer-newsletter {
    max-width: 100%;
    margin-top: var(--space-6);
  }

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
  }

}

@media (max-width: 480px) {

  .site-logo {
    font-size: 26px;
  }

  .announcement-bar {
    font-size: 11px;
  }

  /* Hide the hand-stretched line on very small screens to save space */
  .announcement-bar__text--italic {
    display: none;
  }

  .announcement-bar__dot:nth-child(3) {
    display: none;
  }

}
