/* Coffee Rock :D — paleta cálida de café */
:root {
  --espresso: #2b1a12;
  --espresso-soft: #4a2e1c;
  --caramel: #c9862f;
  --caramel-light: #e0a85c;
  --cream: #faf5ec;
  --cream-dark: #f1e7d3;
  --text: #3a2417;
  --white: #ffffff;
  --whatsapp: #25d366;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  color: var(--text);
  background: var(--cream);
  line-height: 1.6;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }
.smile { color: var(--caramel); }

img { max-width: 100%; display: block; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--espresso);
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.header-inner {
  max-width: 1100px; margin: 0 auto; padding: .6rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.brand-logo { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--cream); }
.brand-name { color: var(--cream); font-weight: 800; font-size: 1.25rem; }

.main-nav { display: flex; gap: 1.25rem; align-items: center; }
.main-nav a { color: var(--cream); text-decoration: none; font-weight: 600; font-size: .95rem; }
.main-nav a:hover { color: var(--caramel-light); }
.nav-cta {
  background: var(--caramel); color: var(--espresso) !important;
  padding: .45rem 1rem; border-radius: 999px;
}
.nav-cta:hover { background: var(--caramel-light); }

.nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  flex-direction: column; gap: 5px; padding: .5rem;
}
.nav-toggle span { width: 26px; height: 3px; background: var(--cream); border-radius: 2px; display: block; }

/* ---------- Ad banner (compacto) ---------- */
.ad-banner {
  position: relative; background: #1a0f08;
  display: flex; align-items: center; justify-content: center;
  height: 120px; overflow: hidden;
}
.ad-banner[hidden] { display: none; }
.ad-stage { width: 100%; max-width: 1100px; height: 120px; }
.ad-stage a { display: block; height: 100%; }
.ad-stage video, .ad-stage img {
  width: 100%; height: 120px; object-fit: cover; display: block;
}
.ad-caption {
  position: absolute; left: 1rem; bottom: .6rem;
  background: rgba(0,0,0,.55); color: #fff;
  font-size: .8rem; padding: .25rem .7rem; border-radius: 999px;
}
.ad-close, .ad-mute {
  position: absolute; top: .5rem;
  width: 32px; height: 32px; border-radius: 50%;
  border: none; cursor: pointer; font-size: 1.1rem;
  background: rgba(0,0,0,.55); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.ad-close { right: .6rem; }
.ad-mute { right: 3rem; }

/* Pestaña para traer de vuelta los anuncios cuando están ocultos */
.ads-restore {
  position: fixed; top: 74px; right: 12px; z-index: 150;
  background: var(--caramel); color: var(--espresso);
  border: none; border-radius: 999px; padding: .5rem 1.1rem;
  font-weight: 800; font-size: .92rem; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.3);
  display: flex; align-items: center; gap: .4rem;
}
.ads-restore[hidden] { display: none; }
.ads-restore:hover { background: var(--caramel-light); }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 88vh; display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden; }
.hero-bg {
  position: absolute; inset: 0;
  background: url("assets/hero-coffee.webp") center/cover no-repeat;
}
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(rgba(43,26,18,.55), rgba(43,26,18,.75)); }
.hero-content { position: relative; z-index: 1; padding: 3rem 1.25rem; max-width: 800px; }
.hero-logo { width: 150px; height: 150px; border-radius: 50%; object-fit: cover; margin: 0 auto 1.25rem; border: 4px solid var(--caramel); background: var(--cream); }
.hero h1 { color: var(--cream); font-size: 3rem; margin-bottom: .5rem; }
.lema { color: var(--caramel-light); font-size: 1.5rem; font-weight: 700; margin-bottom: .75rem; }
.subtitulo { color: var(--cream); font-size: 1.1rem; margin-bottom: 1.75rem; opacity: .95; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-block; padding: .8rem 1.6rem; border-radius: 999px;
  text-decoration: none; font-weight: 700; font-size: 1rem;
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--caramel); color: var(--espresso); }
.btn-primary:hover { background: var(--caramel-light); }
.btn-whatsapp { background: var(--whatsapp); color: #fff; }
.btn-whatsapp:hover { background: #1fb857; }
.btn-small { padding: .55rem 1.1rem; font-size: .9rem; background: var(--espresso); color: var(--cream); }
.btn-small:hover { background: var(--espresso-soft); }

/* ---------- Brand story ---------- */
.brand-story { background: var(--espresso); color: var(--cream); text-align: center; padding: 3rem 0; }
.brand-story h2 { font-size: 1.9rem; margin-bottom: 1rem; }
.brand-story p { max-width: 700px; margin: 0 auto 1rem; font-size: 1.1rem; }
.story-tag { color: var(--caramel-light); font-style: italic; font-weight: 600; }

/* ---------- Sections ---------- */
.section { padding: 4rem 0; }
.section-alt { background: var(--cream-dark); }
.section h2 { text-align: center; font-size: 2.1rem; margin-bottom: 1rem; color: var(--espresso); }
.section-intro { text-align: center; max-width: 650px; margin: 0 auto 2.5rem; }

/* ---------- Product cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; }
.card {
  background: var(--white); border-radius: 14px; overflow: hidden;
  box-shadow: 0 4px 14px rgba(43,26,18,.12);
  display: flex; flex-direction: column;
  transition: transform .15s ease;
}
.card:hover { transform: translateY(-4px); }
.card img { width: 100%; height: 200px; object-fit: cover; }
.card-body { padding: 1.25rem; display: flex; flex-direction: column; gap: .75rem; flex: 1; }
.card-body h3 { color: var(--espresso); font-size: 1.2rem; }
.card-body p { font-size: .95rem; flex: 1; }
.card-body .btn { align-self: flex-start; }

/* ---------- Services ---------- */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; }
.service {
  background: var(--white); border-radius: 14px; padding: 1.75rem 1.25rem; text-align: center;
  box-shadow: 0 4px 14px rgba(43,26,18,.1);
}
.service-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.service h3 { color: var(--espresso); margin-bottom: .5rem; }
.service p { font-size: .95rem; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: center; }
.about-img img { border-radius: 16px; box-shadow: 0 6px 20px rgba(43,26,18,.2); }
.about-text h2 { text-align: left; margin-bottom: 1.25rem; }
.about-text p { margin-bottom: 1rem; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; margin-bottom: 2.5rem; }
.contact-card {
  background: var(--white); border-radius: 14px; padding: 1.75rem 1.25rem; text-align: center;
  box-shadow: 0 4px 14px rgba(43,26,18,.1);
}
.contact-icon { font-size: 2.2rem; margin-bottom: .5rem; }
.contact-card h3 { color: var(--espresso); margin-bottom: .4rem; }
.contact-card a { color: var(--caramel); font-weight: 600; }
.contact-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.site-footer { background: var(--espresso); color: var(--cream); padding: 2.5rem 0; text-align: center; }
.footer-logo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; margin: 0 auto 1rem; background: var(--cream); }
.footer-small { font-size: .85rem; opacity: .8; margin-top: .5rem; }
.footer-small a { color: var(--caramel-light); }

/* ---------- Header extras ---------- */
.header-actions { display: flex; align-items: center; gap: .6rem; margin-left: .75rem; }
.lang-toggle {
  background: transparent; border: 2px solid var(--caramel); color: var(--cream);
  font-weight: 800; font-size: .85rem; border-radius: 8px; padding: .3rem .6rem;
  cursor: pointer;
}
.lang-toggle:hover { background: var(--caramel); color: var(--espresso); }
.social-link { font-size: 1.35rem; text-decoration: none; line-height: 1; }
.social-link:hover { transform: scale(1.15); }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .main-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--espresso); flex-direction: column;
    padding: 1rem 1.25rem 1.5rem; gap: 1rem; align-items: stretch;
    box-shadow: 0 8px 16px rgba(0,0,0,.3);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: .5rem 0; border-bottom: 1px solid rgba(255,255,255,.1); }
  .nav-cta { text-align: center; border-bottom: none !important; }

  .hero h1 { font-size: 2.2rem; }
  .lema { font-size: 1.2rem; }
  .hero-logo { width: 120px; height: 120px; }

  .about { grid-template-columns: 1fr; }
  .about-text h2 { text-align: center; }

  .section { padding: 3rem 0; }
  .ad-banner, .ad-stage { height: 84px; }
  .ad-stage video, .ad-stage img { height: 84px; }
  .ads-restore { top: 68px; right: 10px; padding: .4rem .9rem; font-size: .85rem; }

  .header-actions { margin-left: .4rem; }
  .ai-panel { right: .75rem; left: .75rem; bottom: 6rem; width: auto; }
  .float-wa { left: .75rem; bottom: 1.25rem; }
  .float-ai { right: .75rem; bottom: 1.25rem; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Galería ---------- */
.gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.gallery-item {
  border: none; padding: 0; cursor: zoom-in; border-radius: 14px; overflow: hidden;
  background: var(--cream-dark); box-shadow: 0 4px 14px rgba(43,26,18,.12);
}
.gallery-item img { width: 100%; height: 220px; object-fit: cover; transition: transform .2s ease; }
.gallery-item:hover img { transform: scale(1.04); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(20,10,5,.92);
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 92vw; max-height: 86vh; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.lightbox-close {
  position: absolute; top: 1rem; right: 1.25rem;
  width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer;
  font-size: 1.6rem; background: rgba(255,255,255,.15); color: #fff;
}

/* ---------- Mapa ---------- */
.map-wrap {
  margin: 0 auto 2.5rem; max-width: 900px; border-radius: 16px; overflow: hidden;
  box-shadow: 0 6px 20px rgba(43,26,18,.18); border: 3px solid var(--cream-dark);
}
.map-wrap iframe { width: 100%; height: 340px; border: 0; display: block; }

/* ---------- Botones flotantes ---------- */
.float-btn {
  position: fixed; z-index: 200; width: 58px; height: 58px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 1.7rem;
  text-decoration: none; border: none; cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,.3); transition: transform .15s ease;
}
.float-btn:hover { transform: scale(1.08); }
.float-wa { left: 1.25rem; bottom: 1.5rem; background: #25d366; }
.float-ai { right: 1.25rem; bottom: 1.5rem; background: var(--espresso); border: 2px solid var(--caramel); }

/* ---------- Panel del asistente IA ---------- */
.ai-panel {
  position: fixed; z-index: 250; right: 1.25rem; bottom: 6.25rem;
  width: 340px; max-height: 480px; display: flex; flex-direction: column;
  background: var(--cream); border-radius: 18px; overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,.35); border: 1px solid var(--cream-dark);
}
.ai-panel[hidden] { display: none; }
.ai-header {
  background: var(--espresso); color: var(--cream);
  display: flex; align-items: center; gap: .7rem; padding: .8rem 1rem;
}
.ai-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--cream); }
.ai-header > div { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.ai-status { font-size: .75rem; color: #7ee2a0; }
.ai-close {
  background: none; border: none; color: var(--cream); font-size: 1.5rem;
  cursor: pointer; padding: .25rem .5rem;
}
.ai-messages {
  flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .6rem;
  min-height: 180px; max-height: 300px; background: var(--cream);
}
.ai-msg {
  max-width: 85%; padding: .6rem .9rem; border-radius: 14px; font-size: .92rem; line-height: 1.45;
}
.ai-msg a { color: var(--caramel); font-weight: 600; }
.ai-bot { background: #fff; border: 1px solid var(--cream-dark); align-self: flex-start; border-bottom-left-radius: 4px; }
.ai-user { background: var(--espresso); color: var(--cream); align-self: flex-end; border-bottom-right-radius: 4px; }
.ai-quick { display: flex; gap: .5rem; flex-wrap: wrap; padding: .5rem 1rem; background: var(--cream); }
.ai-chip {
  background: var(--cream-dark); border: 1px solid var(--caramel); color: var(--text);
  border-radius: 999px; padding: .35rem .85rem; font-size: .82rem; font-weight: 600; cursor: pointer;
}
.ai-chip:hover { background: var(--caramel-light); }
.ai-form { display: flex; border-top: 1px solid var(--cream-dark); background: #fff; }
.ai-form input {
  flex: 1; border: none; padding: .85rem 1rem; font-size: .95rem; background: transparent; outline: none;
}
.ai-form button {
  background: var(--caramel); border: none; color: var(--espresso);
  font-size: 1.2rem; padding: 0 1.1rem; cursor: pointer; font-weight: 800;
}
.ai-form button:hover { background: var(--caramel-light); }

.btn-insta { background: linear-gradient(45deg, #f09433, #dc2743, #bc1888); color: #fff; }
.btn-insta:hover { filter: brightness(1.1); }
