/* ============================================================
   BARRIO CAFÉ · Shared design system
   Translates the Barrio.com promo aesthetic to the
   coffee-launch wireframes. Used across all 8 pages.
   ============================================================ */

/* ---------- 1. Reset ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }

/* ---------- 2. Design tokens ---------- */
:root {
  /* Brand colors */
  --sky: #4fc3e8;
  --sky-light: #B8E0F0;          /* soft baby blue for tinted sections */
  --sky-soft: rgba(79, 195, 232, 0.10);
  --sky-edge: rgba(79, 195, 232, 0.25);

  --ink: #111111;
  --ink-warm: #2A1F18;          /* coffee-brown alt dark surface */
  --ink-2: rgba(17, 17, 17, 0.65);
  --ink-3: rgba(17, 17, 17, 0.45);

  --paper: #EDF3F6;             /* cool cream from promo */
  --paper-warm: #F5F1E8;        /* warm cream for editorial sections */
  --paper-2: #E5E0D2;           /* deeper warm cream */
  --paper-3: #1A1612;           /* off-black for dark surfaces */

  --mute: rgba(255, 255, 255, 0.55);
  --mute-warm: #8B7E6A;

  --line: rgba(17, 17, 17, 0.12);
  --line-2: rgba(17, 17, 17, 0.06);
  --line-light: rgba(237, 243, 246, 0.15);

  /* Typography */
  --font-display: 'Bebas Neue', 'Impact', sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;

  /* Layout */
  --max-w: 1320px;
  --gutter: clamp(20px, 4vw, 48px);
  --section-py: clamp(64px, 9vw, 120px);
}

/* ---------- 3. Base ---------- */
html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- 4. Typography utilities ---------- */
.eyebrow {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.eyebrow-light { color: rgba(237, 243, 246, 0.55); }
.eyebrow-sky   { color: var(--sky); }

.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 0.98;
}

.serif {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.01em;
  line-height: 1.18;
}

.body-prose {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-2);
}

/* ---------- 5. Language bar ---------- */
.lang-bar {
  background: var(--ink);
  padding: 8px var(--gutter);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 60;
}
.lang-bar .label {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}
.lang-btn {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 4px 12px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}
.lang-btn.active   { color: var(--sky); border-color: var(--sky); }
.lang-btn.inactive { color: rgba(255, 255, 255, 0.75); }
.lang-btn.inactive:hover { color: #fff; border-color: rgba(255, 255, 255, 0.55); }

/* ---------- 6. Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 18px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-logo { display: flex; align-items: center; }
.nav-logo img { height: 54px; }
.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}
.nav-links a {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-2);
  transition: color 0.2s ease;
  position: relative;
  padding-bottom: 4px;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background: var(--sky);
  transition: width 0.25s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }
.nav-links a.active { color: var(--ink); }
.nav-utils {
  display: flex;
  gap: 18px;
  align-items: center;
}
.nav-utils a {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.nav-utils a:hover { color: var(--ink); }
.nav-utils .cart-count {
  background: var(--ink);
  color: var(--paper);
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
}
.nav-burger {
  display: none;
  width: 32px;
  height: 32px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}
.nav-burger span {
  display: block;
  height: 1.5px;
  background: var(--ink);
  width: 100%;
  transform-origin: center;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

/* Mobile nav open state */
.nav.open .nav-burger span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav.open .nav-burger span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav.open .nav-burger span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ---- Dropdown nav ---- */
.nav-item {
  position: relative;
}
.nav-item > a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.nav-chevron {
  width: 9px;
  height: 6px;
  flex-shrink: 0;
  transition: transform 0.22s ease;
  opacity: 0.7;
}
.has-dropdown:hover .nav-chevron {
  transform: rotate(180deg);
  opacity: 1;
}
.nav-dropdown {
  position: absolute;
  top: calc(100% + 16px);
  left: -16px;
  min-width: 210px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 0;
  box-shadow: 0 8px 32px rgba(17,17,17,0.10);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
  z-index: 100;
}
.has-dropdown:hover .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.nav-dropdown a {
  display: block;
  padding: 10px 20px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  transition: color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
  position: static;
}
.nav-dropdown a::after { display: none; }
.nav-dropdown a:hover {
  color: var(--ink);
  background: rgba(79, 195, 232, 0.07);
}

/* ---- Submenu (flyout) ---- */
.nav-sub-item {
  position: relative;
}
.nav-sub-item > a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.nav-sub-chevron {
  width: 6px;
  height: 9px;
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity 0.15s ease;
}
.nav-sub-item:hover .nav-sub-chevron { opacity: 1; }
.nav-subdropdown {
  position: absolute;
  top: -7px;
  left: calc(100% + 4px);
  min-width: 210px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 0;
  box-shadow: 0 8px 32px rgba(17,17,17,0.10);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
  z-index: 101;
}
.nav-sub-item:hover .nav-subdropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

@media (max-width: 820px) {
  .nav { position: relative; }
  .nav-dropdown { display: none; }
  .nav-subdropdown { display: none; }
  .nav.open .nav-links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 20px;
    gap: 0;
    z-index: 49;
    box-shadow: 0 8px 24px rgba(17,17,17,0.08);
  }
  .nav.open .nav-links a {
    padding: 14px 0;
    border-bottom: 1px solid var(--line-2);
    font-size: 13px;
    letter-spacing: 0.18em;
  }
  .nav.open .nav-links > a:last-child { border-bottom: none; }
  .nav.open .nav-dropdown {
    display: block;
    position: static;
    visibility: visible;
    opacity: 1;
    transform: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 0;
    background: transparent;
    min-width: 0;
  }
  .nav.open .nav-dropdown a {
    padding-left: 18px;
    background: transparent;
    font-size: 12px;
  }
  .nav.open .nav-dropdown a:last-child { border-bottom: 1px solid var(--line-2); }
  .nav.open .nav-dropdown a:hover { background: transparent; }
  .nav.open .nav-subdropdown {
    display: block;
    position: static;
    visibility: visible;
    opacity: 1;
    transform: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 0;
    background: transparent;
    min-width: 0;
  }
  .nav.open .nav-subdropdown a {
    padding-left: 32px;
    font-size: 11px;
  }
  .nav.open .nav-sub-chevron { display: none; }
}

/* ---- Product share row ---- */
.pd-share-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 16px;
  margin-top: 8px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.pd-share-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-right: 2px;
  flex-shrink: 0;
}
.pd-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--line);
  padding: 7px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.pd-share-btn:hover { border-color: var(--ink); color: var(--ink); }
.pd-share-btn.copied { border-color: var(--sky); color: var(--sky); }

/* ---------- 7. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 32px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  transition: all 0.25s ease;
  border: 1.5px solid transparent;
  cursor: pointer;
}
.btn-primary {
  background: var(--sky);
  color: var(--ink);
  border-color: var(--sky);
}
.btn-primary:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(79, 195, 232, 0.30);
}
.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: rgba(17, 17, 17, 0.20);
}
.btn-outline:hover {
  border-color: var(--sky);
  color: var(--sky);
  transform: translateY(-2px);
}
.btn-on-dark {
  background: var(--sky);
  color: var(--ink);
}
.btn-on-dark:hover {
  background: var(--paper);
  color: var(--ink);
  transform: translateY(-2px);
}
.btn-ghost {
  background: transparent;
  color: var(--paper);
  border-color: rgba(237, 243, 246, 0.75);
}
.btn-ghost:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.btn-block { width: 100%; }
.btn-sm { padding: 10px 18px; font-size: 10px; }
.btn-lg { padding: 20px 40px; font-size: 13px; }

/* Quiet link with arrow */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--ink-2);
  transition: gap 0.25s ease, color 0.2s ease;
  border-bottom: 1px solid currentColor;
  padding-bottom: 3px;
}
.link-arrow:hover { color: var(--sky); gap: 14px; }
.link-arrow.on-dark { color: rgba(237, 243, 246, 0.7); }
.link-arrow.on-dark:hover { color: var(--sky); }

/* ---------- 8. Marquee band ---------- */
.marquee {
  background: var(--sky);
  padding: 16px 0;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}
.marquee::before, .marquee::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 60px;
  z-index: 2;
  pointer-events: none;
}
.marquee::before { left: 0;  background: linear-gradient(to right, var(--sky), transparent); }
.marquee::after  { right: 0; background: linear-gradient(to left,  var(--sky), transparent); }
.marquee-track {
  display: inline-block;
  animation: marquee 32s linear infinite;
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.32em;
  color: var(--ink);
}
.marquee-track span { margin: 0 32px; }
.marquee-track .dot { opacity: 0.4; margin: 0 18px; }

/* ---------- 9. Placeholder treatments ----------
   Used wherever real photography will sit later.
   Polished gradients + grain + small mono label.
   ============================================== */
.ph {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--paper-2) 0%, #C9BFA8 60%, #8B7E6A 100%);
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  isolation: isolate;
}
.ph::before {
  /* SVG noise grain overlay */
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.30 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/></svg>");
  opacity: 0.5;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 1;
}
.ph::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.10);
  pointer-events: none;
  z-index: 2;
}
.ph-label {
  position: relative;
  z-index: 3;
  margin: 18px;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(17, 17, 17, 0.55);
  padding: 6px 10px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Variants */
.ph-bean {
  background: linear-gradient(140deg, #C7A580 0%, #8B5E3C 45%, #3D2817 100%);
}
.ph-farm {
  background: linear-gradient(160deg, #D4C9A8 0%, #8B7E5C 55%, #3F4A2E 100%);
}
.ph-portrait {
  background: linear-gradient(135deg, #E6D5C0 0%, #B5896A 50%, #5C3D28 100%);
}
.ph-editorial {
  background: linear-gradient(155deg, #2A1F18 0%, #1A1612 100%);
}
.ph-editorial .ph-label { color: rgba(255, 255, 255, 0.85); }

/* Aspect ratios */
.ph-1x1 { aspect-ratio: 1 / 1; }
.ph-4x3 { aspect-ratio: 4 / 3; }
.ph-3x4 { aspect-ratio: 3 / 4; }
.ph-4x5 { aspect-ratio: 4 / 5; }
.ph-5x4 { aspect-ratio: 5 / 4; }
.ph-3x2 { aspect-ratio: 3 / 2; }
.ph-fill { width: 100%; height: 100%; }

/* ---------- 10. Section primitives ---------- */
.section {
  padding: var(--section-py) var(--gutter);
}
.section-tight { padding: clamp(40px, 6vw, 72px) var(--gutter); }
.section-dark {
  background: var(--paper-3);
  color: var(--paper);
}
.section-cream {
  background: var(--paper-warm);
}
.section-paper-2 {
  background: var(--paper-2);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: clamp(28px, 4vw, 44px);
  gap: 24px;
  flex-wrap: wrap;
}
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(34px, 5vw, 56px);
  letter-spacing: 0.02em;
  line-height: 1;
}

/* ---------- 11. Product card (bean cards) ---------- */
.bean-card {
  display: flex;
  flex-direction: column;
  background: transparent;
  transition: transform 0.3s ease;
}
.bean-card:hover { transform: translateY(-4px); }
.bean-card .ph { aspect-ratio: 4/5; }
.bean-card .meta {
  padding: 18px 2px 6px;
}
.bean-card .region {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.bean-card .name {
  font-family: var(--font-serif);
  font-size: 26px;
  letter-spacing: -0.01em;
  margin-top: 6px;
  color: var(--ink);
}
.bean-card .notes-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 10px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 300;
}
.bean-card .price {
  font-family: var(--font-serif);
  font-style: normal;
  font-size: 18px;
  color: var(--ink);
}
.bean-card .price small { color: var(--ink-3); font-size: 11px; margin-left: 4px; }

/* ---------- 12. Footer ---------- */
.footer {
  background: var(--ink);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 48px var(--gutter) 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 40px;
  align-items: start;
  max-width: var(--max-w);
  margin: 0 auto;
}
.footer-brand img { height: 40px; margin-bottom: 18px; }
.footer-brand p {
  font-size: 13px;
  font-weight: 300;
  color: rgba(237, 243, 246, 0.55);
  line-height: 1.7;
  max-width: 36ch;
}
.footer h5 {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(237, 243, 246, 0.35);
  margin-bottom: 16px;
}
.footer ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer ul a {
  font-size: 14px;
  font-weight: 300;
  color: rgba(237, 243, 246, 0.75);
  transition: color 0.2s ease;
}
.footer ul a:hover { color: var(--sky); }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 40px;
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(237, 243, 246, 0.35);
  max-width: var(--max-w);
  margin-left: auto;
  margin-right: auto;
}
.footer-bottom .sky { color: var(--sky); }

/* ---------- 13. Animations ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-22px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 var(--sky-edge); }
  50%      { box-shadow: 0 0 0 14px transparent; }
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- 14. Form primitives (used by later pages) ---------- */
.field {
  display: block;
  width: 100%;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
  transition: border-color 0.2s ease;
}
.field:focus { outline: none; border-color: var(--sky); }
.field-label {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 400;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s ease;
}
.chip:hover { border-color: var(--ink); }
.chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- 15. Layout helpers ---------- */
.container { max-width: var(--max-w); margin: 0 auto; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gutter); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gutter); }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* ---------- 16. Mobile responsive ---------- */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 820px) {
  .nav-links { display: none; }
  .nav-burger { display: flex; }
  .nav-utils a span:not(.cart-count) { display: none; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .marquee-track { font-size: 14px; }
}
@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr; }
  .btn { padding: 14px 24px; font-size: 11px; }
  .lang-bar { padding: 8px 16px; }
}
