:root {
  --navy-950: #0a1628;
  --navy-900: #0f1f3d;
  --navy-800: #16294f;
  --cyan-400: #3ecfe8;
  --cyan-500: #23b8d6;
  --cyan-600: #1a94ac;
  --white: #ffffff;
  --gray-100: #f4f7fa;
  --gray-300: #d7dee6;
  --gray-500: #7c8aa0;
  --gray-700: #3a465c;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(10, 22, 40, 0.10);
  --font-display: 'Poppins', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--navy-900);
  background: var(--white);
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--navy-950);
  line-height: 1.2;
  margin: 0 0 0.5em;
}

a { color: var(--cyan-600); text-decoration: none; }
a:hover { color: var(--navy-900); }

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--navy-950);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  padding-bottom: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-logo-plate {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--white);
  padding: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}
.brand-logo-plate img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--white);
}
.brand-text span { color: var(--cyan-400); }

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 26px;
  margin: 0;
  padding: 0;
}
.main-nav a {
  color: var(--gray-300);
  font-weight: 500;
  font-size: 0.95rem;
}
.main-nav a:hover, .main-nav a.active { color: var(--cyan-400); }

.nav-toggle { display: none; }

@media (max-width: 780px) {
  .site-header .container { flex-wrap: wrap; row-gap: 4px; }
  .main-nav {
    display: block;
    width: 100%;
    order: 3;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav ul {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 22px;
    padding-bottom: 10px;
  }
  .main-nav li { border-top: none; flex-shrink: 0; }
  .main-nav a { display: block; padding: 8px 0; white-space: nowrap; }
}

/* ---------- Hero ---------- */
.hero {
  background: radial-gradient(circle at 80% 20%, var(--navy-800), var(--navy-950) 60%);
  color: var(--white);
  padding: 70px 0 60px;
}
.hero h1 {
  color: var(--white);
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  max-width: 720px;
}
.hero p.lead {
  color: var(--gray-300);
  font-size: 1.15rem;
  max-width: 640px;
}
.hero .cta-row { margin-top: 26px; display: flex; gap: 16px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary {
  background: var(--cyan-400);
  color: var(--navy-950);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(62,207,232,0.35); color: var(--navy-950); }
.btn-outline {
  border: 1.5px solid var(--gray-300);
  color: var(--white);
}
.btn-outline:hover { border-color: var(--cyan-400); color: var(--cyan-400); }

/* ---------- Sections ---------- */
.section { padding: 60px 0; }
.section-alt { background: var(--gray-100); }
.section-title {
  font-size: 1.8rem;
  margin-bottom: 6px;
}
.section-kicker {
  color: var(--cyan-600);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}
.section-sub { color: var(--gray-500); margin-bottom: 34px; max-width: 640px; }
.section-cta { margin-top: 8px; }

.dev-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--cyan-600);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.dev-icon svg { width: 22px; height: 22px; }

/* ---------- Cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 26px;
}
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--gray-300);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(10, 22, 40, 0.16); }
.card-body .btn { align-self: flex-start; margin-top: 12px; }
.card img { width: 100%; height: 170px; object-fit: contain; background: var(--gray-100); }

/* ---------- Media cuadrada 1:1 (catálogo de productos) ----------
   object-fit: contain (no cover) para que la foto del producto se vea
   siempre completa, sin recortar bordes cuando no es perfectamente cuadrada. */
.card-media-square { width: 100%; aspect-ratio: 1 / 1; height: auto; object-fit: contain; display: block; background: var(--gray-100); }
.card-photo-placeholder {
  width: 100%;
  height: 170px;
  background: var(--gray-100);
  color: var(--gray-500);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
  font-size: 0.85rem;
  font-weight: 600;
}
.card-photo-placeholder--square { height: auto; aspect-ratio: 1 / 1; }
.card--static { cursor: default; }
.badge-soon { background: var(--gray-100); color: var(--gray-500); margin-top: 12px; }

/* ---------- Tarjeta con varias fotos/videos: una a la vez + flecha ---------- */
.card-media-carousel { position: relative; width: 100%; aspect-ratio: 1 / 1; overflow: hidden; background: var(--gray-100); }
.card-media-carousel__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.card-media-carousel__slide.is-active { opacity: 1; pointer-events: auto; }
/* especificidad (0,2,0): debe ganarle a la regla base .card-media-wrap (0,1,0)
   para que la foto llene el slide completo en vez de quedar cuadrada de más. */
.card-media-carousel__slide .card-media-wrap,
.card-media-carousel__slide .card-photo-placeholder { width: 100%; height: 100%; aspect-ratio: auto; }
.card-media-carousel__next {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(10, 22, 40, 0.72);
  color: var(--white);
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.card-media-carousel__next:hover { background: rgba(10, 22, 40, 0.9); }
.card-media-carousel__next svg { width: 16px; height: 16px; }
.card-media-carousel__counter {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 2;
  background: rgba(10, 22, 40, 0.72);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}

/* ---------- Tarjeta con foto + video (toque para reproducir) ---------- */
.card-media-wrap { position: relative; width: 100%; aspect-ratio: 1 / 1; overflow: hidden; background: var(--gray-100); }
/* height explícito: sin esto, la regla más específica ".card img { height:170px }"
   le ganaba en especificidad a la altura y la foto quedaba chica con espacio vacío debajo. */
.card-media-wrap .card-media-square { position: absolute; inset: 0; height: 100%; }
.card-media-wrap video.card-media-square { opacity: 0; transition: opacity 0.2s ease; }
.card-media-wrap.is-playing video.card-media-square { opacity: 1; }
.card-media-wrap.is-playing img.card-media-square { opacity: 0; }
.card-media-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(10, 22, 40, 0.72);
  color: var(--white);
  border: 2px solid rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.15s ease;
  z-index: 1;
}
.card-media-play svg { width: 18px; height: 18px; margin-left: 2px; }
.card-media-wrap:hover .card-media-play { transform: scale(1.08); }
.card-media-wrap.is-playing .card-media-play { opacity: 0; pointer-events: none; }

/* ---------- Botones de WhatsApp en el catálogo ---------- */
.card-cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 9px 14px;
  border-radius: 999px;
  background: #25d366;
  color: var(--white);
  font-weight: 600;
  font-size: 0.85rem;
  align-self: flex-start;
}
.card-cart-btn:hover { background: #1ebe5b; color: var(--white); }
.card-cart-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.card-qty-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.card-qty-btn {
  padding: 8px 14px;
  border-radius: 999px;
  background: #25d366;
  color: var(--white);
  font-weight: 700;
  font-size: 0.85rem;
}
.card-qty-btn:hover { background: #1ebe5b; color: var(--white); }
.card-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.card-meta { font-size: 0.8rem; color: var(--gray-500); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.card p { color: var(--gray-700); font-size: 0.95rem; flex: 1; }
.card .read-more { margin-top: 12px; font-weight: 600; color: var(--cyan-600); }

/* ---------- Article page ---------- */
.article-header { padding: 50px 0 20px; background: var(--navy-950); color: var(--white); }
.article-header .breadcrumb { color: var(--gray-300); font-size: 0.85rem; margin-bottom: 14px; }
.article-header .breadcrumb a { color: var(--cyan-400); }
.article-header h1 { color: var(--white); max-width: 780px; }
.article-cover { width: 100%; max-height: 420px; object-fit: cover; border-radius: var(--radius); margin: 26px 0; }
.article-body { max-width: 760px; margin: 0 auto; font-size: 1.05rem; color: var(--navy-900); }
.article-body h2 { margin-top: 1.6em; font-size: 1.5rem; }
.article-body h3 { margin-top: 1.3em; font-size: 1.2rem; }
.article-body img { max-width: 100%; border-radius: 10px; }
.article-body p { margin: 0 0 1.1em; }
.article-meta-bar { display: flex; gap: 18px; color: var(--gray-500); font-size: 0.88rem; flex-wrap: wrap; }

/* ---------- Reel de Instagram al final del artículo ---------- */
.article-instagram { max-width: 760px; margin: 40px auto 0; text-align: center; }
.article-instagram__label {
  color: var(--cyan-600);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.8rem;
  margin-bottom: 14px;
}
.article-instagram__frame {
  max-width: 400px;
  width: 100%;
  height: 680px;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--gray-100);
}
.article-instagram__frame iframe { width: 100%; height: 100%; border: 0; }
@media (max-width: 480px) { .article-instagram__frame { height: 620px; } }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-950);
  color: var(--gray-300);
  padding: 46px 0 24px;
  margin-top: 60px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px; }
.footer-grid h4 { color: var(--white); font-size: 1rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { color: var(--gray-300); }
.footer-social { display: flex; gap: 12px; margin-top: 14px; }
.footer-social a {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-300);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.footer-social svg { width: 17px; height: 17px; }
.footer-social a:hover { border-color: var(--cyan-400); color: var(--cyan-400); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 30px;
  padding-top: 18px;
  font-size: 0.82rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Botón flotante de WhatsApp (todo el sitio) ---------- */
.whatsapp-float {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 250;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25d366;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(10, 22, 40, 0.35);
  animation: whatsappPulse 2.4s ease-in-out infinite;
  transition: transform 0.15s ease;
}
.whatsapp-float:hover { transform: scale(1.08); color: var(--white); }
.whatsapp-float svg { width: 30px; height: 30px; }
@keyframes whatsappPulse {
  0%, 100% { box-shadow: 0 6px 18px rgba(10, 22, 40, 0.35), 0 0 0 0 rgba(37, 211, 102, 0.5); }
  50% { box-shadow: 0 6px 18px rgba(10, 22, 40, 0.35), 0 0 0 10px rgba(37, 211, 102, 0); }
}
@media (max-width: 600px) { .whatsapp-float { right: 14px; bottom: 14px; width: 52px; height: 52px; } .whatsapp-float svg { width: 26px; height: 26px; } }
@media (prefers-reduced-motion: reduce) { .whatsapp-float { animation: none; } }

/* ---------- Admin ---------- */
.admin-body { background: var(--gray-100); min-height: 100vh; }
.admin-topbar { background: var(--navy-950); color: var(--white); padding: 14px 0; }
.admin-topbar .container { display: flex; justify-content: space-between; align-items: center; }
.admin-topbar a { color: var(--gray-300); margin-left: 18px; }
.admin-wrap { max-width: 900px; margin: 30px auto; padding: 0 20px; }
.admin-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; margin-bottom: 24px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }
.form-group input[type=text],
.form-group input[type=password],
.form-group input[type=file],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--gray-300);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: var(--font-body);
}
.form-group textarea { min-height: 260px; font-family: monospace; }
.hint { color: var(--gray-500); font-size: 0.82rem; margin-top: 4px; }
table.admin-table { width: 100%; border-collapse: collapse; }
table.admin-table th, table.admin-table td {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--gray-300); font-size: 0.9rem;
}
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge-published { background: #e0f7ee; color: #0b8a52; }
.badge-draft { background: #fdeaea; color: #c0392b; }
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 0.9rem; }
.alert-error { background: #fdeaea; color: #c0392b; }
.alert-ok { background: #e0f7ee; color: #0b8a52; }
