/* ============================================================
   TICO PLUNGE · COMPONENT LIBRARY
   Cross-page, reusable UI. Page-specific components (product cards,
   calculator, etc.) live in their own page stylesheet.

   Interaction polish follows Emil Kowalski's design-engineering
   principles: strong custom easing, scale-on-press feedback,
   hover gated behind real pointers, origin-aware popovers.
   ============================================================ */

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color 200ms var(--ease-out),
    color 200ms var(--ease-out),
    border-color 200ms var(--ease-out);
}
.btn:active { opacity: 0.7; }

.btn .arrow {
  display: inline-block;
  transition: transform 200ms var(--ease-out);
}
.btn-primary  { background: var(--ice); color: white; }
.btn-secondary{ background: transparent; color: var(--ice); border-color: var(--line-strong); }
.btn-ice      { background: var(--ice); color: white; }
.btn-ink      { background: var(--paper-warm); color: var(--ink); }
.btn-ghost    { background: transparent; color: var(--ink); }
.btn-block    { display: flex; width: 100%; }
.btn-lg       { padding: 16px 32px; font-size: var(--fs-body); }

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover   { background: var(--ice-light); }
  .btn-secondary:hover { background: var(--paper-warm); }
  .btn-ice:hover       { background: var(--ice-light); }
  .btn-ink:hover       { background: #EBEBEB; }
  .btn-ghost:hover     { background: var(--paper-warm); }
  .btn:hover .arrow    { transform: translateX(2px); }
}

/* ============================================================
   TOP NAVIGATION  (rendered by <site-nav>)
   ============================================================ */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: var(--z-nav);
  background: rgba(245, 242, 235, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
  transition:
    padding var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out),
    background-color var(--dur-base) var(--ease-out);
}
/* Subtle condense once the user scrolls (set by lib/reveal.js) */
.nav.is-scrolled {
  border-bottom-color: var(--line);
  background: rgba(245, 242, 235, 0.92);
}
.nav.is-scrolled .nav-inner { padding-block: 10px; }

.nav-inner {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 16px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: padding var(--dur-base) var(--ease-out);
}

.nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.nav-logo img { height: 30px; width: auto; }
.nav-logo-text { font-weight: 800; font-size: 17px; letter-spacing: 0.02em; text-transform: lowercase; }
.nav-logo-text span { font-weight: 300; }

.nav-links { display: flex; gap: 32px; align-items: center; }
.nav-links a {
  text-decoration: none;
  color: var(--ink);
  font-size: var(--fs-sm);
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color var(--dur-base) var(--ease-out);
}
.nav-links a.is-active { color: var(--ice); }
@media (hover: hover) and (pointer: fine) {
  .nav-links a:hover { color: var(--ice); }
}

.nav-cta {
  background: var(--ink);
  color: var(--paper) !important;
  padding: 11px 22px;
  border-radius: var(--r-pill);
  font-weight: 600 !important;
  letter-spacing: 0.04em !important;
  transition:
    background-color var(--dur-base) var(--ease-out),
    transform var(--dur-press) var(--ease-out) !important;
}
.nav-cta:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .nav-cta:hover { background: var(--ice); transform: translateY(-1px); }
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  width: 24px; height: 1.5px;
  background: var(--ink);
  transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav-links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding: 24px var(--gutter) 28px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    /* Slide/fade open — exits faster than it enters elsewhere; here
       transitions keep it interruptible */
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
  }
  .nav-links.is-open { opacity: 1; transform: none; pointer-events: auto; }
  .nav-toggle { display: flex; }
}

/* ============================================================
   FOOTER  (rendered by <site-footer>)
   ============================================================ */
.footer {
  background: var(--ink);
  color: var(--paper);
  padding-block: var(--space-9) var(--space-6);
}
.footer-grid {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--space-7);
}
.footer-brand-logo {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 22px;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}
.footer-brand-logo span { font-weight: 300; }
.footer-tagline {
  margin-top: var(--space-4);
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--fs-lead);
  color: rgba(245, 242, 235, 0.7);
  max-width: 26ch;
}
.footer-col h4 {
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ice-light);
  margin-bottom: var(--space-4);
}
.footer-col ul { display: flex; flex-direction: column; gap: var(--space-3); }
.footer-col a {
  text-decoration: none;
  color: rgba(245, 242, 235, 0.75);
  font-size: var(--fs-sm);
  transition: color var(--dur-base) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .footer-col a:hover { color: var(--paper); }
}
.footer-bottom {
  max-width: var(--maxw);
  margin: var(--space-7) auto 0;
  padding: var(--space-5) var(--gutter) 0;
  border-top: 1px solid var(--on-dark-line);
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  font-size: var(--fs-sm);
  color: rgba(245, 242, 235, 0.55);
}
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-6); }
  .footer-bottom { flex-direction: column; }
}

/* ============================================================
   WHATSAPP FLOATING BUTTON  (rendered by <wa-float>)
   ============================================================ */
.wa-float {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: var(--z-float);
  width: 58px; height: 58px;
  display: flex; align-items: center; justify-content: center;
  background: var(--green);
  color: #fff;
  border-radius: var(--r-round);
  box-shadow: 0 10px 28px -6px rgba(37, 211, 102, 0.5);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.wa-float:active { transform: scale(0.94); }
.wa-float svg { width: 30px; height: 30px; }
@media (hover: hover) and (pointer: fine) {
  .wa-float:hover { transform: scale(1.08); box-shadow: 0 14px 34px -6px rgba(37, 211, 102, 0.55); }
}

/* ============================================================
   BADGES / PILLS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.badge-ice   { background: var(--ice); color: var(--paper); }
.badge-soft  { background: var(--paper-warm); color: var(--ink); }
.badge-amber { background: rgba(230, 126, 34, 0.15); color: var(--amber); }
.badge-green { background: rgba(37, 211, 102, 0.15); color: #1a8f47; }
.badge-red   { background: rgba(192, 57, 43, 0.12); color: var(--red); }

/* ============================================================
   FORM FIELDS (shared input look)
   ============================================================ */
.field-label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--ink);
}
.field {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: #fff;
  font-family: inherit;
  font-size: var(--fs-body);
  color: var(--ink);
  transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.field::placeholder { color: rgba(29, 29, 27, 0.4); }
.field:focus {
  outline: none;
  border-color: var(--ice);
  box-shadow: 0 0 0 3px rgba(36, 94, 135, 0.14);
}
textarea.field { resize: vertical; min-height: 90px; }

/* ============================================================
   MODAL / DIALOG
   Modals stay centered (transform-origin: center) — they are not
   anchored to a trigger, unlike popovers.
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  background: rgba(16, 55, 83, 0.45);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-slow) var(--ease-out);
}
.modal-overlay.is-open { opacity: 1; pointer-events: auto; }
.modal-card {
  width: 100%;
  max-width: 440px;
  background: var(--paper);
  border-radius: var(--r-lg);
  padding: var(--space-7);
  box-shadow: var(--shadow-lg);
  /* Never animate from scale(0) — start barely-shrunk + faded */
  transform: scale(0.95);
  opacity: 0;
  transition: transform var(--dur-slow) var(--ease-out), opacity var(--dur-slow) var(--ease-out);
}
.modal-overlay.is-open .modal-card { transform: none; opacity: 1; }
