/* ═══════════════════════════════════════════════════
   ICONIC EVENTS — Brand Identity CSS v4
   Palette: Parchment Beige · Espresso · Champagne Gold · Rose Accent
   ═══════════════════════════════════════════════════ */

:root {
  /* ── Core Palette ────────────────────────────── */
  --bg:         #FFFFFF;   /* Parchment Beige — main background */
  --card:       #FFFFFF;   /* Pure white cards */
  --card-soft:  #FAF7F2;   /* Warm cream — soft section backgrounds */
  --border:     #DDD0C0;   /* Warm taupe borders */

  /* ── Brand Colors ────────────────────────────── */
  --gold:       #C9A84C;   /* Champagne Gold — PRIMARY accent */
  --gold2:      #B8922A;   /* Deep Gold — hover / pressed */
  --gold-light: rgba(201,168,76,.10); /* subtle gold tint */
  --pink:       #C9848E;   /* Dusty Rose — subtle accent only */
  --pink-light: rgba(201,132,142,.08); /* barely-there rose tint */

  /* ── Neutrals ────────────────────────────────── */
  --espresso:   #3A1F0D;   /* Deep Espresso — headings & dark text */
  --text:       #3A1F0D;   /* Primary body text */
  --brown:      #6B4233;   /* Mid brown — labels, icons */
  --muted:      #5C3820;   /* Warm taupe — secondary / placeholder */

  /* ── Legacy aliases (backwards compat) ───────── */
  --sage:       #8FAD90;
  --taupe:      #5C3820;
  --orange:     #C9A84C;
  --yellow:     #C9A84C;
  --purple:     #8FAD90;
  --teal:       #C9A84C;

  --header-h: 56px;
  --bnav-h: 62px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ════════════════════════════════
   HEADER UNIFICADO
   ════════════════════════════════ */
.ate-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: calc(var(--header-h) + var(--safe-top));
  padding-top: var(--safe-top);
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid rgba(201,168,76,.18);
}
.ate-header-inner {
  height: var(--header-h);
  max-width: 1100px; margin: 0 auto;
  padding: 0 16px;
  display: flex; align-items: center; gap: 12px;
}

/* LOGO */
.ate-logo {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; flex-shrink: 0;
}
.ate-logo-icon { font-size: 1.3rem; line-height: 1; }
.ate-logo-text {
  font-size: 1rem; font-weight: 600; letter-spacing: .08em;
  font-family: 'Cormorant Garamond', Georgia, serif;
  color: var(--espresso);
  -webkit-text-fill-color: var(--espresso);
}
.ate-logo-text span {
  background: linear-gradient(90deg, var(--gold), var(--gold2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* SEARCH PILL */
.ate-header-search {
  flex: 1; max-width: 340px;
  display: flex; align-items: center; gap: 8px;
  background: rgba(201,168,76,.07); border: 1px solid rgba(201,168,76,.2);
  border-radius: 24px; padding: 8px 14px; cursor: pointer;
  color: var(--muted); font-size: .82rem;
  transition: border-color .2s, background .2s;
}
.ate-header-search:hover { border-color: rgba(201,168,76,.4); background: rgba(201,168,76,.12); }

/* RIGHT BUTTONS */
.ate-header-right {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
}
.ate-hbtn {
  height: 34px; border-radius: 20px; font-size: .8rem; font-weight: 600;
  padding: 0 14px; cursor: pointer; transition: all .2s; border: none;
  text-decoration: none; display: flex; align-items: center; white-space: nowrap;
}
.ate-hbtn-ghost {
  background: rgba(201,168,76,.08); border: 1px solid rgba(201,168,76,.22);
  color: var(--text);
}
.ate-hbtn-ghost:hover { background: rgba(201,168,76,.15); }
.ate-hbtn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: #fff; box-shadow: 0 2px 12px rgba(201,168,76,.35);
}
.ate-hbtn-primary:hover { box-shadow: 0 4px 18px rgba(201,168,76,.5); transform: translateY(-1px); }

/* AVATAR BUTTON */
.ate-avatar-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: #fff; font-weight: 700; font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(201,168,76,.3);
  transition: transform .2s;
}
.ate-avatar-btn:hover { transform: scale(1.08); }

/* BACK BUTTON */
.ate-back-btn {
  width: 36px; height: 36px; border-radius: 12px;
  background: rgba(201,168,76,.10); border: 1px solid rgba(201,168,76,.18);
  color: var(--text); cursor: pointer; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; transition: background .2s;
}
.ate-back-btn:hover { background: rgba(201,168,76,.18); }

/* BODY OFFSET */
body.has-ate-header { padding-top: calc(var(--header-h) + var(--safe-top)) !important; }
body.has-bnav { padding-bottom: calc(var(--bnav-h) + var(--safe-bottom) + 4px) !important; }

/* ════════════════════════════════
   BOTTOM NAVIGATION BAR
   ════════════════════════════════ */
#mobileNav {
  display: none;
  position: fixed !important;
  bottom: 0 !important; top: auto !important;
  left: 0 !important; right: 0 !important;
  height: auto !important;
  z-index: 9999 !important;
  transform: none !important;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-top: 1px solid rgba(201,168,76,.18);
  padding-bottom: max(var(--safe-bottom), env(safe-area-inset-bottom, 0px));
}
.bnav-inner {
  height: var(--bnav-h);
  display: flex; align-items: stretch;
  max-width: 500px; margin: 0 auto;
}

/* ITEM */
.bnav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--muted);
  font-size: .6rem; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
  position: relative; transition: color .18s;
  -webkit-tap-highlight-color: transparent;
  padding-top: 6px;
}
.bnav-item.active { color: var(--gold2); }

.bnav-icon-wrap {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  position: relative; transition: transform .2s cubic-bezier(.34,1.56,.64,1);
}
.bnav-icon-wrap svg { width: 22px; height: 22px; }
.bnav-item.active .bnav-icon-wrap { transform: scale(1.08); }
.bnav-label { font-size: .59rem; }

/* ACTIVE pill background */
.bnav-item.active .bnav-icon-wrap::before {
  content: '';
  position: absolute; inset: -6px -10px;
  background: rgba(201,168,76,.12);
  border-radius: 14px;
  z-index: -1;
}

/* CENTER ITEM */
.bnav-center { position: relative; z-index: 2; }
.bnav-center .bnav-icon-wrap {
  width: 46px; height: 46px; margin-top: -14px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  box-shadow: 0 4px 20px rgba(201,168,76,.45);
  color: #fff !important;
}
.bnav-center .bnav-icon-wrap svg { width: 22px; height: 22px; }
.bnav-center.active .bnav-icon-wrap { transform: scale(1.05); }
.bnav-center.active .bnav-icon-wrap::before { display: none; }
.bnav-center { color: var(--muted) !important; }
.bnav-center.active { color: var(--brown) !important; }

@media (max-width: 768px) { #mobileNav { display: block !important; } }

/* ════════════════════════════════
   INSTALL BANNER
   ════════════════════════════════ */
#installBanner {
  position: fixed;
  bottom: calc(var(--bnav-h) + var(--safe-bottom) + 12px); left: 12px; right: 12px;
  z-index: 500;
  background: rgba(255,255,255,.97);
  border: 1px solid rgba(201,168,76,.25);
  border-radius: 20px; padding: 14px 16px;
  box-shadow: 0 8px 40px rgba(58,31,13,.18), inset 0 1px 0 rgba(201,168,76,.15);
  display: flex; align-items: center; gap: 12px;
  transform: translateY(20px); opacity: 0; transition: all .3s cubic-bezier(.34,1.56,.64,1);
}
#installBanner.visible { transform: translateY(0); opacity: 1; }
.ib-icon { font-size: 1.8rem; flex-shrink: 0; }
.ib-text { flex: 1; min-width: 0; }
.ib-title { font-weight: 700; font-size: .88rem; color: var(--text); }
.ib-sub { font-size: .72rem; color: var(--muted); margin-top: 1px; }
.ib-install {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: #fff; border: none; border-radius: 20px;
  padding: 8px 16px; font-size: .78rem; font-weight: 700; cursor: pointer;
  flex-shrink: 0; white-space: nowrap;
}
.ib-close {
  background: rgba(201,168,76,.10); border: none; width: 24px; height: 24px;
  border-radius: 50%; color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ════════════════════════════════
   TOUCH RIPPLE
   ════════════════════════════════ */
.ripple-host { position: relative; overflow: hidden; }
.ripple-wave {
  position: absolute; border-radius: 50%;
  background: rgba(201,168,76,.18);
  transform: scale(0); opacity: 1;
  animation: ripple .5s ease-out forwards;
  pointer-events: none;
}
@keyframes ripple { to { transform: scale(2.5); opacity: 0; } }

/* ════════════════════════════════
   ADS
   ════════════════════════════════ */
.ate-ad {
  border-radius: 16px; overflow: hidden;
  border: 1px solid var(--border); cursor: pointer;
  transition: opacity .2s; margin: 10px 0;
}
.ate-ad img { width: 100%; display: block; }
.ate-ad:active { opacity: .85; }
.ate-ad-text {
  background: rgba(201,168,76,.06);
  padding: 16px; text-align: center; color: var(--muted); font-size: .8rem;
}

/* ════════════════════════════════
   MOBILE RESPONSIVE OVERRIDES
   ════════════════════════════════ */
@media (max-width: 768px) {

  .ate-hbtn-ghost { display: none; }
  .ate-header-search { display: none; }

  /* HERO */
  .hero {
    min-height: calc(100svh - var(--header-h));
    display: flex; flex-direction: column; justify-content: center;
    padding: 32px 20px 48px !important;
    background:
      radial-gradient(ellipse at 20% 30%, rgba(201,168,76,.10) 0%, transparent 55%),
      radial-gradient(ellipse at 80% 75%, rgba(201,132,142,.07) 0%, transparent 50%),
      linear-gradient(160deg, #FFFFFF 0%, #FAF7F2 50%, #FFFFFF 100%) !important;
  }
  .hero h1 { font-size: 2.2rem !important; line-height: 1.1 !important; }
  .hero p  { font-size: .92rem !important; }
  .hero-btns { flex-direction: column !important; gap: 10px !important; }
  .hero-btns a, .hero-btns button {
    width: 100% !important; padding: 16px !important;
    font-size: .98rem !important; border-radius: 16px !important;
    min-height: 52px;
  }
  .hero-stats { gap: 24px !important; }
  .hero-stats .stat-num { font-size: 1.6rem !important; }

  .sec-title { font-size: 1.25rem !important; }

  .prov-card { border-radius: 18px !important; }
  .prov-card:active { transform: scale(.975); transition: transform .1s; }

  .cat-card { border-radius: 14px !important; }
  .cat-card:active { transform: scale(.93); }

  /* DIRECTORIO filters bottom sheet */
  .filters.dir-sidebar {
    display: block !important;
    position: fixed !important;
    left: 0; right: 0; bottom: 0; top: auto !important;
    transform: translateY(105%) !important;
    transition: transform .32s cubic-bezier(.32,0,.67,0);
    border-radius: 24px 24px 0 0;
    border-top: 1px solid var(--border);
    z-index: 300 !important;
    max-height: 80dvh; overflow-y: auto;
    padding: 24px 16px calc(var(--bnav-h) + var(--safe-bottom) + 20px) !important;
    background: var(--card);
    box-shadow: 0 -8px 40px rgba(58,31,13,.18);
    --handle-h: 4px;
  }
  .filters.dir-sidebar::before {
    content: '';
    display: block;
    width: 40px; height: var(--handle-h);
    background: var(--border);
    border-radius: 2px;
    margin: -8px auto 16px;
  }
  .filters.dir-sidebar.open { transform: translateY(0) !important; }
  .dir-backdrop {
    display: none; position: fixed; inset: 0; z-index: 299;
    background: rgba(58,31,13,.35);
    backdrop-filter: blur(2px);
  }
  .dir-backdrop.open { display: block; }

  /* FAB FILTROS */
  #filterToggleBtn {
    display: flex !important;
    position: fixed;
    bottom: calc(var(--bnav-h) + var(--safe-bottom) + 14px); right: 16px;
    z-index: 200;
    width: 50px; height: 50px; border-radius: 16px; border: none;
    background: linear-gradient(135deg, var(--gold), var(--gold2));
    color: #fff; font-size: 1.1rem; cursor: pointer;
    box-shadow: 0 4px 20px rgba(201,168,76,.45);
    align-items: center; justify-content: center;
  }
  #filterToggleBtn svg { width: 22px; height: 22px; }

  /* PERFIL PROVEEDOR mobile */
  .hero-cover { height: 200px !important; }
  .profile-header { margin-top: -52px !important; }
  .logo-wrap { width: 74px !important; height: 74px !important; border-radius: 18px !important; }
  .profile-info h1 { font-size: 1.15rem !important; }
  .main-wrap { grid-template-columns: 1fr !important; gap: 14px !important; padding-bottom: 16px; }
  .side-col { display: none !important; }
  .float-cta { display: block !important; }

  /* MI CUENTA */
  .tab-btn { padding: 12px 14px !important; font-size: .8rem !important; }
  .favs-grid { grid-template-columns: repeat(2,1fr) !important; }
  .dash-header { padding: 16px 16px !important; }

  button, a.btn-cta, a.ate-hbtn { min-height: 44px; }
}

#filterToggleBtn { display: none; }

/* ════════════════════════════════
   GLOBAL FONT SCALE
   ════════════════════════════════ */
html { font-size: 17px; }           /* escala todos los rem ~6% arriba */
@media (min-width: 768px)  { html { font-size: 18px; } }
@media (min-width: 1200px) { html { font-size: 19px; } }

/* ════════════════════════════════
   PAGE ENTRANCE ANIMATION
   ════════════════════════════════ */
body { animation: pageIn .28s ease both; }
@keyframes pageIn { from { opacity: 0 } to { opacity: 1 } }
