/* ==========================================================================
   TIENDY — store.css
   Componentes de tienda, blog y documentación que no forman parte del
   diseño de marketing: prosa, listados, ficha de producto, carrito,
   búsqueda, cuenta, paginación y estados de formularios.
   ========================================================================== */

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---------- Planes: cinco tarjetas reales ---------- */
.plans-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
}
.plans-grid .plan {
  flex: 0 1 calc((100% - 48px) / 3);
  min-width: 250px;
}
@media (max-width: 900px) {
  .plans-grid .plan { flex-basis: calc((100% - 24px) / 2); }
}
@media (max-width: 640px) {
  .plans-grid .plan { flex-basis: 100%; max-width: 460px; margin-inline: auto; }
}

/* ---------- Ejemplos reales ---------- */
.store-card .browser { overflow: hidden; }
.store-shot {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--bg-soft);
}
.store-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 10px 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-600);
}
.store-link:hover { color: var(--brand-700); }
.store-link svg { width: 15px; height: 15px; }
.stores-empty {
  text-align: center;
  padding: 50px 20px;
  color: var(--muted);
  background: var(--bg-soft);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

/* ---------- Prosa (páginas, artículos y documentación) ---------- */
.prose {
  color: var(--text);
  font-size: 16.5px;
  line-height: 1.75;
}
.prose > * + * { margin-top: 1.05em; }
.prose h1, .prose h2, .prose h3, .prose h4 {
  color: var(--ink);
  line-height: 1.22;
  margin-top: 1.5em;
  margin-bottom: .5em;
}
.prose h1 { font-size: clamp(28px, 3.4vw, 38px); }
.prose h2 { font-size: clamp(23px, 2.8vw, 30px); }
.prose h3 { font-size: 20px; }
.prose h4 { font-size: 17px; }
.prose a { color: var(--brand-600); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--brand-700); }
.prose strong { color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.35em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: .35em; }
.prose blockquote {
  margin: 1.4em 0;
  padding: 18px 22px;
  border-left: 4px solid var(--brand-400);
  background: var(--bg-brand);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink);
  font-weight: 600;
}
.prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.prose figure { margin: 1.4em 0; }
.prose figcaption { margin-top: 8px; font-size: 13.5px; color: var(--faint); text-align: center; }
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  margin: 1.2em 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
}
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 13px; text-align: left; }
.prose th { background: var(--bg-soft); color: var(--ink); }
.prose code {
  font-size: .92em;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
}
.prose pre {
  overflow-x: auto;
  background: #0F172A;
  color: #E2E8F0;
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  font-size: 14px;
  line-height: 1.6;
}
.prose pre code { background: none; border: 0; padding: 0; color: inherit; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

/* ---------- Cabeceras de página interior ---------- */
.page-body { max-width: 860px; margin: 0 auto; padding: 56px 24px 96px; }
.page-body .page-title { font-size: clamp(30px, 4vw, 44px); margin-bottom: 10px; text-align: center; }
.page-body .page-intro { color: var(--muted); font-size: 18px; text-align: center; max-width: 620px; margin: 0 auto 40px; }
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 26px 0 0;
  font-size: 13.5px;
  color: var(--faint);
}
.breadcrumbs a { color: var(--muted); font-weight: 600; }
.breadcrumbs a:hover { color: var(--brand-600); }
.breadcrumbs .sep { color: var(--faint); }

/* ==========================================================================
   BLOG — portada, tarjetas de artículo y página de artículo
   Reutiliza los tokens del sistema (índigo / teal / púrpura de marca).
   ========================================================================== */

/* ---------- Etiquetas de categoría ---------- */
.post-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  padding: 5px 13px; border-radius: 999px; white-space: nowrap;
}
.pt-emprender  { background: var(--brand-100); color: var(--brand-700); }
.pt-marketing  { background: var(--accent-100); color: var(--accent-700); }
.pt-diseno     { background: #FEF3C7; color: #92400E; }
.pt-tutoriales { background: #F1F5F9; color: #334155; }

/* ---------- Portadas generadas con CSS/SVG ---------- */
.post-cover {
  position: relative; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--pc1, #4F46E5) 0%, var(--pc2, #7C3AED) 100%);
}
.post-cover::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .09) 1px, transparent 1px);
  background-size: 44px 44px;
}
.post-cover::after {
  content: ""; position: absolute; width: 340px; height: 340px; border-radius: 50%;
  background: rgba(255, 255, 255, .14); filter: blur(46px);
  top: -110px; right: -70px; pointer-events: none;
}
.post-cover .pc-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0;
}
.post-cover.has-image::before { display: none; }
.post-cover.has-image::after {
  content: ""; position: absolute; inset: 0; width: auto; height: auto;
  border-radius: 0; background: linear-gradient(180deg, rgba(15, 23, 42, .18), rgba(15, 23, 42, .58));
  filter: none; top: 0; right: 0; z-index: 1;
}
.post-cover .pc-icon {
  position: relative; z-index: 1;
  width: 74px; height: 74px; border-radius: 20px;
  background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .35);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 18px 34px -14px rgba(15, 23, 42, .45);
}
.post-cover .pc-icon svg { width: 36px; height: 36px; }
.post-cover .pc-chip {
  position: absolute; z-index: 1;
  display: inline-flex; align-items: center; gap: 7px;
  background: #fff; color: var(--ink); font-size: 12.5px; font-weight: 800;
  padding: 8px 14px; border-radius: 999px;
  box-shadow: 0 12px 26px -12px rgba(15, 23, 42, .5);
}
.post-cover .pc-chip svg { width: 14px; height: 14px; flex: 0 0 auto; }
.post-cover .pc-chip .up { color: var(--accent-600); }
.pc-chip-a { top: 18%; left: 10%; }
.pc-chip-b { bottom: 16%; right: 9%; }
.pc-chip-a { animation: floatY 5s ease-in-out infinite; }
.pc-chip-b { animation: floatY 5s ease-in-out 1.2s infinite; }
.post-cover .pc-icon, .post-cover .pc-chip { z-index: 2; }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

/* ---------- Destacado ---------- */
.featured-post {
  display: grid; grid-template-columns: 1.05fr 1fr; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.featured-post:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--brand-200); }
.featured-post .post-cover { min-height: 340px; }
.featured-body { padding: 44px 42px; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.featured-body h2 { font-size: clamp(24px, 2.6vw, 31px); line-height: 1.25; }
.featured-body h2 a { color: var(--ink); }
.featured-body h2 a:hover { color: var(--brand-700); }
.featured-body .post-excerpt { font-size: 16.5px; }
.featured-body .post-meta { margin-top: auto; padding-top: 12px; }

/* ---------- Rejilla de posts ---------- */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.post-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease,
              opacity .22s ease;
}
.post-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: var(--brand-200); }
.post-card.fade-out { opacity: 0; transform: scale(.96); }
.post-card.hidden { display: none; }
.post-card .post-cover { aspect-ratio: 16 / 9.4; }
.post-card .pc-icon { width: 58px; height: 58px; border-radius: 16px; }
.post-card .pc-icon svg { width: 27px; height: 27px; }
.post-body { padding: 22px 24px 24px; display: flex; flex-direction: column; align-items: flex-start; gap: 11px; flex: 1; }
.post-body h3 { font-size: 18.5px; line-height: 1.35; }
.post-body h3 a { color: var(--ink); }
.post-card:hover .post-body h3 a { color: var(--brand-700); }
.post-excerpt { font-size: 15px; color: var(--muted); line-height: 1.6; }
.post-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: auto; font-size: 13.5px; font-weight: 600; color: var(--faint); }
.post-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff;
  background: var(--grad-brand);
}
.post-avatar.alt { background: linear-gradient(135deg, #0D9488, #2DD4BF); }
.post-avatar.warm { background: linear-gradient(135deg, #7C3AED, #A78BFA); }
.post-author b { color: var(--ink); font-weight: 700; }
.post-meta .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--faint); }

/* ---------- Artículo ---------- */
.article-top { max-width: 780px; margin: 0 auto; padding: 34px 0 1em; }
.article-head { max-width: 780px; margin: 0 auto 36px; text-align: left; }
.article-head h1 { font-size: clamp(30px, 4vw, 44px); margin: 16px 0 14px; }
.article-lead { font-size: 19px; color: var(--muted); line-height: 1.6; }
.article-meta-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 24px; font-size: 14.5px; font-weight: 600; color: var(--muted); }
.article-meta-row .post-avatar { width: 40px; height: 40px; font-size: 13.5px; }
.article-meta-row b { color: var(--ink); }
.article-cover { border-radius: var(--radius-lg); min-height: 300px; box-shadow: var(--shadow-md); margin-bottom: 8px; }
.article-cover .pc-icon { width: 88px; height: 88px; border-radius: 24px; }
.article-cover .pc-icon svg { width: 42px; height: 42px; }
.article-cover-lg { height: 380px; }

.article-body { max-width: 740px; margin: 44px auto 0; }
.article-body > p { font-size: 17px; line-height: 1.78; color: var(--text); margin-bottom: 20px; }
.article-body > p a { font-weight: 600; }
.article-body h2 { font-size: 26px; margin: 46px 0 16px; }
.article-body h3 { font-size: 20px; margin: 34px 0 12px; }
.article-body ul { margin: 0 0 22px; display: grid; gap: 12px; }
.article-body ul li { position: relative; padding-left: 34px; font-size: 16.5px; line-height: 1.65; }
.article-body ul li::before {
  content: ""; position: absolute; left: 0; top: 4px; width: 21px; height: 21px; border-radius: 7px;
  background: var(--brand-50) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234F46E5' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'><path d='M4 12.5l5 5L20 6.5'/></svg>") center/12px no-repeat;
  box-shadow: inset 0 0 0 1.5px var(--brand-200);
}
.article-body ol { margin: 0 0 22px; counter-reset: paso; display: grid; gap: 14px; }
.article-body ol li { position: relative; padding-left: 46px; font-size: 16.5px; line-height: 1.65; counter-increment: paso; }
.article-body ol li::before {
  content: counter(paso); position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 10px;
  background: var(--brand-600); color: #fff; font-weight: 800; font-size: 14.5px;
  display: grid; place-items: center; box-shadow: 0 6px 14px -6px rgba(79, 70, 229, .6);
}
.article-body blockquote {
  margin: 30px 0; padding: 22px 26px; border-left: 4px solid var(--brand-500);
  background: var(--bg-brand); border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 17.5px; font-weight: 600; color: var(--ink); line-height: 1.65; font-style: italic;
}
.article-body blockquote cite { display: block; margin-top: 10px; font-size: 14px; font-style: normal; color: var(--muted); font-weight: 700; }
.article-body strong { color: var(--ink); font-weight: 700; }
.article-body .tip-box {
  display: flex; gap: 15px; align-items: flex-start;
  margin: 30px 0; padding: 20px 22px;
  background: var(--accent-50); border: 1px solid var(--accent-100); border-radius: var(--radius);
}
.article-body .tip-box.brand { background: var(--brand-50); border-color: var(--brand-100); }
.tip-icon {
  width: 38px; height: 38px; border-radius: 11px; flex: 0 0 auto;
  background: #fff; color: var(--accent-600); display: grid; place-items: center;
  box-shadow: var(--shadow-sm);
}
.tip-box.brand .tip-icon { color: var(--brand-600); }
.tip-icon svg { width: 19px; height: 19px; }
.tip-box p { font-size: 15.5px; line-height: 1.6; color: var(--text); margin: 0 !important; }
.tip-box b { color: var(--ink); }

.article-divider { display: flex; align-items: center; gap: 14px; margin: 42px 0; color: var(--faint); font-size: 12.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.article-divider::before, .article-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.article-foot { max-width: 740px; margin: 50px auto 0; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding-top: 26px; border-top: 1px solid var(--line); }
.article-foot .post-meta { margin: 0; }

/* ---------- Relacionados ---------- */
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }

/* ---------- Responsive del blog ---------- */
@media (max-width: 1060px) {
  .post-grid, .related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .featured-post { grid-template-columns: 1fr; }
  .featured-post .post-cover { min-height: 240px; }
  .featured-body { padding: 30px 26px 34px; }
  .article-cover-lg { height: 300px; }
}
@media (max-width: 640px) {
  .post-grid, .related-grid { grid-template-columns: 1fr; }
  .post-cover .pc-chip { font-size: 11.5px; padding: 7px 11px; }
  .pc-chip-a { left: 6%; }
  .pc-chip-b { right: 5%; }
  .article-top { padding-top: 22px; }
  .article-cover-lg { height: 230px; }
  .article-body > p, .article-body ul li, .article-body ol li { font-size: 15.5px; }
  .article-body h2 { font-size: 22px; }
  .article-body h3 { font-size: 18px; }
  .article-foot { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .pc-chip-a, .pc-chip-b { animation: none; }
  .featured-post, .post-card { transition: none; }
}

/* Ajustes de prosa dentro del artículo */
.article-body.prose > * + * { margin-top: 0; }
.article-body.prose ul, .article-body.prose ol { padding-left: 0; list-style: none; }
.article-body.prose li + li { margin-top: 0; }

/* ---------- Artículo de documentación (compatibilidad) ---------- */
.article-hero { padding: 42px 0 22px; background: linear-gradient(180deg, var(--bg-brand) 0%, #fff 100%); }
.article-hero .container { max-width: 900px; }
.article-hero .article-title { font-size: clamp(30px, 4.4vw, 48px); margin: 12px 0 16px; }
.article-hero .article-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 14px; }
.article-footer { max-width: 780px; margin: 0 auto; padding: 0 24px 72px; }
.article-share { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding-top: 22px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
article > .article-body.prose { padding: 0 24px 64px; }

/* Comentarios */
.comments { max-width: 780px; margin: 0 auto; padding: 0 24px 80px; }
.comments h2 { font-size: 24px; margin-bottom: 22px; }
.comment-list { display: grid; gap: 16px; margin-bottom: 32px; }
.comment {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.comment .comment-head { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; margin-bottom: 8px; }
.comment .comment-author { font-weight: 800; color: var(--ink); }
.comment .comment-date { font-size: 12.5px; color: var(--faint); }
.comment .comment-body { color: var(--text); font-size: 15.5px; }
.comment-form { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.comment-form h3 { font-size: 19px; margin-bottom: 16px; }

/* ---------- Categoría y producto ---------- */
.collection-head { padding: 42px 0 12px; text-align: center; }
.collection-head h1 { font-size: clamp(30px, 4vw, 44px); margin-bottom: 10px; }
.collection-head p { color: var(--muted); max-width: 660px; margin: 0 auto; }
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.product-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--brand-200); }
.product-card .product-media { display: block; aspect-ratio: 1 / 1; background: var(--bg-soft); overflow: hidden; }
.product-card .product-media img { width: 100%; height: 100%; object-fit: cover; }
.product-card .product-body { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-card .product-title { font-size: 15.5px; font-weight: 800; color: var(--ink); line-height: 1.35; }
.product-card .product-title a { color: inherit; }
.product-card .product-title a:hover { color: var(--brand-600); }
.product-card .product-price { font-size: 15px; font-weight: 800; color: var(--brand-600); }
.product-card .product-price s { color: var(--faint); font-weight: 600; margin-left: 7px; }
.product-card .product-tag { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-600); }

.product-page { padding: 40px 0 88px; }
.product-layout { display: grid; grid-template-columns: 1.05fr .95fr; gap: 52px; align-items: start; }
.product-gallery { display: grid; gap: 14px; }
.product-main-image { overflow: hidden; border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--bg-soft); }
.product-main-image img { width: 100%; height: auto; display: block; }
.product-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.product-thumbs button {
  padding: 0; border: 2px solid transparent; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-soft); cursor: pointer;
}
.product-thumbs button.active { border-color: var(--brand-500); }
.product-thumbs img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; }
.product-info h1 { font-size: clamp(28px, 3.5vw, 40px); margin: 8px 0 12px; }
.product-price { font-size: 24px; font-weight: 800; color: var(--brand-600); margin-bottom: 18px; }
.product-price s { font-size: 17px; color: var(--faint); font-weight: 600; margin-left: 10px; }
.product-description { margin: 22px 0; color: var(--text); font-size: 16px; }
.product-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 24px 0; }
.product-variants { margin: 18px 0; }
.product-variants label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 7px; }
.product-variants select {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  font: inherit;
}
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; }
.qty button { width: 38px; height: 44px; border: 0; background: transparent; font-weight: 800; color: var(--muted); cursor: pointer; }
.qty input { width: 52px; height: 44px; border: 0; text-align: center; font: inherit; font-weight: 700; color: var(--ink); background: transparent; }
.product-meta { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); display: grid; gap: 8px; font-size: 14px; color: var(--muted); }
.product-meta b { color: var(--ink); }
.product-trust { display: grid; gap: 10px; margin-top: 22px; }
.product-trust span { display: flex; gap: 9px; align-items: center; font-size: 14px; color: var(--muted); }
.product-trust svg { width: 17px; height: 17px; color: var(--accent-600); flex: 0 0 auto; }
.product-example { margin-top: 22px; padding: 18px 20px; border-radius: var(--radius); background: var(--bg-brand); border: 1px solid var(--brand-100); }
.product-example p { font-size: 14.5px; color: var(--muted); margin-bottom: 12px; }

/* ---------- Carrito ---------- */
.cart-page { padding: 40px 0 96px; }
.cart-layout { display: grid; grid-template-columns: 1.35fr .65fr; gap: 38px; align-items: start; }
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 0 12px 12px; }
.cart-table td { border-top: 1px solid var(--line); padding: 18px 12px; vertical-align: middle; }
.cart-item { display: flex; gap: 16px; align-items: center; }
.cart-item img { width: 74px; height: 92px; object-fit: cover; border-radius: var(--radius-sm); background: var(--bg-soft); }
.cart-item .cart-name { font-weight: 800; color: var(--ink); }
.cart-item .cart-variant { font-size: 13px; color: var(--faint); margin-top: 3px; }
.cart-remove { font-size: 13px; color: var(--muted); text-decoration: underline; cursor: pointer; background: none; border: 0; }
.cart-remove:hover { color: #E11D48; }
.cart-summary { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px; }
.cart-summary h2 { font-size: 20px; margin-bottom: 18px; }
.cart-summary .sum-row { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; font-size: 15px; }
.cart-summary .sum-row.total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 16px; font-weight: 800; color: var(--ink); font-size: 18px; }
.cart-summary .sum-note { font-size: 12.5px; color: var(--faint); margin: 14px 0 18px; }
.cart-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.cart-empty { text-align: center; padding: 70px 20px; }
.cart-empty svg { width: 48px; height: 48px; color: var(--faint); margin: 0 auto 18px; }
.cart-empty p { color: var(--muted); margin-bottom: 22px; }

/* ---------- Búsqueda ---------- */
.search-page { padding: 40px 0 96px; }
.search-form { display: flex; gap: 10px; max-width: 640px; margin: 0 auto 40px; }
.search-form input {
  flex: 1;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 13px 20px;
  font: inherit;
  font-size: 15px;
  background: #fff;
}
.search-form input:focus { outline: none; border-color: var(--brand-400); box-shadow: 0 0 0 4px rgba(99, 102, 241, .16); }
.search-count { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 28px; }
.search-empty { text-align: center; color: var(--muted); padding: 50px 20px; }

/* ---------- Cuenta ---------- */
.account-page { padding: 40px 0 96px; }
.account-layout { display: grid; grid-template-columns: 230px 1fr; gap: 36px; align-items: start; }
.account-nav { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.account-nav a { display: block; padding: 10px 14px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 600; font-size: 14.5px; }
.account-nav a:hover, .account-nav a.active { background: var(--bg-brand); color: var(--brand-700); }
.account-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 30px; }
.account-panel h1 { font-size: 28px; margin-bottom: 8px; }
.account-panel .account-lead { color: var(--muted); margin-bottom: 24px; }
.account-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.account-table th { text-align: left; color: var(--faint); font-size: 12px; text-transform: uppercase; letter-spacing: .07em; padding: 0 10px 10px; }
.account-table td { border-top: 1px solid var(--line); padding: 13px 10px; }
.account-table a { color: var(--brand-600); font-weight: 700; }
.auth-page { padding: 56px 0 96px; }
.auth-card { max-width: 460px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 38px; }
.auth-card h1 { font-size: 28px; margin-bottom: 6px; }
.auth-card .auth-lead { color: var(--muted); margin-bottom: 24px; }
.auth-card .auth-alt { text-align: center; font-size: 14px; color: var(--muted); margin-top: 20px; }
.auth-card .auth-alt a { color: var(--brand-600); font-weight: 700; }
.form-alert { background: #FFF1F2; border: 1px solid #FECDD3; color: #BE123C; border-radius: var(--radius-sm); padding: 12px 16px; font-size: 14px; margin-bottom: 18px; }
.form-alert.ok { background: #ECFDF5; border-color: #A7F3D0; color: #047857; }

/* ---------- Paginación ---------- */
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 40px 0 0; }
.pagination a, .pagination span {
  min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--line);
  background: #fff; color: var(--muted); font-weight: 700; font-size: 14px;
}
.pagination a:hover { border-color: var(--brand-400); color: var(--brand-700); }
.pagination .current { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.pagination .gap { border: 0; background: none; color: var(--faint); }

/* ---------- Newsletter: aviso ---------- */
.news-note.is-ok { color: #6EE7B7; }
.news-note.is-error { color: #FCA5A5; }

/* ---------- Password ---------- */
.password-page { min-height: 70vh; display: grid; place-items: center; padding: 60px 24px; }
.password-card { width: 100%; max-width: 440px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 38px; text-align: center; }
.password-card h1 { font-size: 26px; margin-bottom: 8px; }
.password-card p { color: var(--muted); margin-bottom: 24px; }
.password-card form { display: grid; gap: 12px; }
.password-card input {
  border: 1.5px solid var(--line); border-radius: 12px; padding: 13px 16px; font: inherit; width: 100%;
}
.password-card input:focus { outline: none; border-color: var(--brand-400); box-shadow: 0 0 0 4px rgba(99, 102, 241, .16); }

/* ---------- Responsive ---------- */
@media (max-width: 1060px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .product-layout, .cart-layout, .account-layout { grid-template-columns: 1fr; }
  .product-thumbs { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 640px) {
  .product-grid { grid-template-columns: 1fr; }
  .page-body { padding: 36px 20px 72px; }
  .comments { padding-left: 20px; padding-right: 20px; }
  .cart-table th { display: none; }
  .cart-table tr { display: grid; grid-template-columns: 1fr; gap: 10px; padding: 16px 0; border-top: 1px solid var(--line); }
  .cart-table td { border: 0; padding: 0; }
  .product-thumbs { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Documentación ---------- */
.docs-search {
  display: flex;
  gap: 10px;
  max-width: 660px;
  margin: 26px auto 0;
}
.docs-search input {
  flex: 1;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 14px 20px;
  font: inherit;
  font-size: 15px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.docs-search input:focus { outline: none; border-color: var(--brand-400); box-shadow: 0 0 0 4px rgba(99, 102, 241, .16); }
.docs-search button {
  border: 0;
  border-radius: 999px;
  padding: 12px 22px;
  background: var(--brand-600);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}
.docs-search button:hover { background: var(--brand-700); }
.docs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.docs-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 26px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.docs-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--brand-200); }
.docs-card .icon-wrap { margin-bottom: 16px; }
.docs-card h3 { font-size: 19px; margin-bottom: 8px; }
.docs-card p { color: var(--muted); font-size: 14.5px; margin-bottom: 14px; }
.docs-card ul { display: grid; gap: 7px; font-size: 13.5px; color: var(--muted); }
.docs-card li { display: flex; gap: 8px; align-items: flex-start; }
.docs-card li::before { content: "•"; color: var(--brand-400); font-weight: 800; }
.docs-list {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.docs-list a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 17px 22px;
  border-top: 1px solid var(--line);
  transition: background .15s ease;
}
.docs-list a:first-child { border-top: 0; }
.docs-list a:hover { background: var(--bg-soft); }
.docs-list .docs-icon {
  width: 40px; height: 40px; flex: 0 0 auto;
  border-radius: 11px; background: var(--brand-100); color: var(--brand-600);
  display: grid; place-items: center;
}
.docs-list .docs-icon svg { width: 19px; height: 19px; }
.docs-list .docs-title { display: block; font-weight: 800; color: var(--ink); font-size: 15px; }
.docs-list .docs-sub { display: block; font-size: 13px; color: var(--faint); margin-top: 2px; }
.docs-list .docs-arrow { margin-left: auto; color: var(--faint); width: 18px; height: 18px; }
.docs-related { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.docs-related a {
  display: flex; gap: 10px; align-items: center;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px 16px; font-size: 14px; font-weight: 700; color: var(--ink);
}
.docs-related a:hover { border-color: var(--brand-200); color: var(--brand-700); }
@media (max-width: 900px) {
  .docs-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .docs-grid, .docs-related { grid-template-columns: 1fr; }
}

/* ---------- CTA compacta ---------- */
.cta-compact { padding-top: 0; }

/* ==========================================================================
   AYUDA — centro de ayuda y documentación
   Buscador, categorías, guías filtrables y FAQ por temas.
   Reutiliza los tokens del sistema (índigo / teal / púrpura de marca).
   ========================================================================== */

/* ---------- Buscador del hero ---------- */
.help-search { position: relative; max-width: 620px; margin: 34px auto 0; }
.help-search input {
  width: 100%; height: 60px; padding: 0 56px 0 56px;
  background: #fff; border: 1.5px solid var(--line); border-radius: 999px;
  font-size: 16px; color: var(--ink); box-shadow: var(--shadow-md);
  transition: border-color .15s ease, box-shadow .15s ease;
  -webkit-appearance: none; appearance: none;
}
.help-search input::-webkit-search-cancel-button { display: none; -webkit-appearance: none; }
.help-search input::placeholder { color: var(--faint); }
.help-search input:focus {
  outline: none; border-color: var(--brand-400);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, .16);
}
.help-search .hs-icon {
  position: absolute; left: 22px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; color: var(--faint); pointer-events: none;
}
.help-search .hs-clear {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 50%;
  display: none; place-items: center;
  background: var(--bg-soft); color: var(--muted);
  transition: background .15s ease, color .15s ease;
}
.help-search .hs-clear:hover { background: var(--brand-100); color: var(--brand-700); }
.help-search .hs-clear svg { width: 16px; height: 16px; }
.help-search.has-value .hs-clear { display: grid; }

.help-quick {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 9px; margin-top: 18px; font-size: 13.5px; font-weight: 600; color: var(--faint);
}
.quick-chip {
  padding: 7px 15px; border-radius: 999px; background: #fff;
  border: 1px solid var(--line); font-weight: 700; font-size: 13px; color: var(--muted);
  transition: border-color .15s ease, color .15s ease, transform .15s ease;
}
.quick-chip:hover { border-color: var(--brand-400); color: var(--brand-700); transform: translateY(-1px); }

.help-results {
  max-width: 620px; margin: 14px auto 0; min-height: 0;
  font-size: 14px; font-weight: 700; color: var(--brand-700);
  display: none;
}
.help-results.show { display: block; }

/* ---------- Tarjetas de categorías ---------- */
.help-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.help-card {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 26px 22px;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.help-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: var(--brand-200); }
.help-card.hidden { display: none; }
.help-card .icon-wrap { margin-bottom: 16px; }
.help-card h3 { font-size: 18.5px; margin-bottom: 7px; }
.help-card > p { font-size: 14.5px; color: var(--muted); margin-bottom: 16px; }
.help-links { display: grid; margin-bottom: 18px; }
.help-links a {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 10px 0; border-top: 1px dashed var(--line);
  font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.45;
}
.help-links a:hover { color: var(--brand-700); }
.help-links a svg {
  width: 15px; height: 15px; color: var(--brand-400); flex: 0 0 auto; margin-top: 3px;
  transition: transform .15s ease;
}
.help-links a:hover svg { transform: translateX(3px); }
.help-more {
  margin-top: auto; align-self: flex-start;
  display: inline-flex; align-items: center; gap: 7px;
  font-weight: 700; font-size: 14.5px; color: var(--brand-600);
  padding: 4px 0;
}
.help-more svg { width: 16px; height: 16px; transition: transform .15s ease; }
.help-more:hover { color: var(--brand-700); }
.help-more:hover svg { transform: translateX(4px); }

/* ---------- Filtros de tema (buscador desactivado en main.js: otra clase contenedora) ---------- */
.topic-bar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 40px; }

/* ---------- Tarjetas de guías ---------- */
.doc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.doc-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 24px 22px;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease,
              opacity .22s ease;
}
.doc-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: var(--brand-200); }
.doc-card.hidden { display: none; }
.doc-card.fade-out { opacity: 0; transform: scale(.96); }
.doc-card h3 { font-size: 17px; line-height: 1.42; }
.doc-card h3 a { color: var(--ink); }
.doc-card:hover h3 a { color: var(--brand-700); }
.doc-excerpt { font-size: 14.5px; color: var(--muted); line-height: 1.6; }
.doc-meta {
  display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 4px;
  font-size: 13px; font-weight: 700; color: var(--faint);
}
.doc-meta svg { width: 15px; height: 15px; color: var(--brand-400); flex: 0 0 auto; }
.doc-meta .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--faint); }

.help-more-link { text-align: center; margin-top: 40px; }
.help-more-link .link-arrow { font-size: 16px; }

/* ---------- FAQ por temas ---------- */
.faq-group { max-width: 760px; margin: 0 auto 36px; }
.faq-group:last-of-type { margin-bottom: 0; }
.faq-group.hidden { display: none; }
.faq-group > h3 {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--brand-700); margin-bottom: 14px;
}
.faq-group > h3::before {
  content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--brand-500);
  flex: 0 0 auto;
}
.faq-group .faq-list { max-width: none; }

/* ---------- Estados vacíos ---------- */
.help-empty {
  display: none; max-width: 560px; margin: 36px auto 0; text-align: center;
  background: #fff; border: 1.5px dashed var(--brand-200); border-radius: var(--radius);
  padding: 38px 28px 34px;
}
.help-empty.show { display: block; }
.help-empty .he-icon {
  width: 54px; height: 54px; border-radius: 16px; margin: 0 auto 16px;
  background: var(--brand-50); color: var(--brand-400);
  display: grid; place-items: center;
}
.help-empty .he-icon svg { width: 26px; height: 26px; }
.help-empty h3 { font-size: 19px; margin-bottom: 8px; }
.help-empty p { font-size: 15px; color: var(--muted); margin-bottom: 20px; }

/* ---------- Banda de soporte ---------- */
.support-band {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 44px; align-items: center;
  background: var(--bg-brand); border: 1px solid var(--brand-100);
  border-radius: var(--radius-lg); padding: 52px 56px;
}
.support-copy h2 { font-size: clamp(26px, 3vw, 34px); margin-bottom: 12px; }
.support-copy p { font-size: 16.5px; color: var(--muted); }
.support-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--brand-200);
  color: var(--brand-700); font-weight: 700; font-size: 13.5px;
  padding: 7px 14px; border-radius: 999px; margin-bottom: 18px;
}
.support-badge svg { width: 15px; height: 15px; color: var(--brand-500); }
.support-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.support-mail { font-size: 15px; font-weight: 700; color: var(--muted); }

/* ---------- Estados ocultos reutilizables ---------- */
.faq-item.hidden { display: none; }

/* ---------- Responsive del centro de ayuda ---------- */
@media (max-width: 1060px) {
  .help-grid, .doc-grid { grid-template-columns: repeat(2, 1fr); }
  .support-band { padding: 44px 40px; }
}
@media (max-width: 900px) {
  .support-band { grid-template-columns: 1fr; gap: 28px; }
  .support-actions { flex-direction: row; flex-wrap: wrap; align-items: center; }
}
@media (max-width: 640px) {
  .help-grid, .doc-grid { grid-template-columns: 1fr; }
  .help-search { margin-top: 26px; }
  .help-search input { height: 54px; font-size: 15px; padding-left: 48px; }
  .help-search .hs-icon { left: 18px; width: 18px; height: 18px; }
  .help-quick { font-size: 13px; }
  .topic-bar { justify-content: flex-start; margin-bottom: 32px; }
  .help-card { padding: 22px 20px 20px; }
  .support-band { padding: 34px 24px; }
  .support-actions { flex-direction: column; align-items: stretch; }
  .support-actions .btn { width: 100%; }
  .help-empty { padding: 30px 20px 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .help-card, .doc-card { transition: none; }
}

/* ==========================================================================
   PLANTILLAS — galería de themes disponibles
   Tarjetas con preview de tienda generado en CSS (reutiliza .browser y
   .mini-store de ejemplos) + badges + preview en modo oscuro.
   ========================================================================== */

.themes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }

.theme-card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease,
              opacity .22s ease;
}
.theme-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: var(--brand-200); }
.theme-card.fade-out { opacity: 0; transform: scale(.96); }
.theme-card.hidden { display: none; }

/* El preview ocupa el ancho completo de la tarjeta, sin borde propio */
.theme-card .browser {
  box-shadow: none; border: 0; border-bottom: 1px solid var(--line);
  border-radius: 0;
}

/* Badge sobre el preview */
.tpl-badge {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  background: var(--brand-600); color: #fff;
  font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: 6px 13px; border-radius: 999px;
  box-shadow: 0 8px 18px -6px rgba(79, 70, 229, .55);
}
.tpl-badge--teal { background: var(--accent-600); box-shadow: 0 8px 18px -6px rgba(13, 148, 136, .55); }

/* Cuerpo de la tarjeta */
.theme-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.theme-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.theme-name { font-weight: 800; font-size: 17.5px; color: var(--ink); letter-spacing: -.01em; }
.theme-top .store-cat { padding: 4px 12px; }
.theme-desc { font-size: 14.5px; color: var(--muted); line-height: 1.6; }
.theme-foot { margin-top: auto; padding-top: 8px; }
.theme-foot .btn { padding: 11px 18px; font-size: 14px; }
.theme-card:hover .theme-name { color: var(--brand-700); }

/* ---------- Preview en modo oscuro (theme Volt) ---------- */
.theme-dark { background: #0F172A; border-color: #1E293B; }
.theme-dark .browser-bar { background: #1E293B; border-bottom-color: #334155; }
.theme-dark .url-pill { background: #0F172A; border-color: #334155; color: #94A3B8; }
.theme-dark .url-pill svg { color: #60A5FA; }
.theme-dark .mini-nav .mn-logo { color: #F1F5F9; }
.theme-dark .mini-nav .mn-links i { background: #334155; }
.theme-dark .mini-nav .mn-cart { background: rgba(79, 70, 229, .28); color: #A5B4FC; }
.theme-dark .mini-product { background: #1E293B; border-color: #334155; }
.theme-dark .p-line { background: #334155; }
.theme-dark .p-price { color: #7DD3FC; }
.theme-dark .p-add { background: rgba(20, 184, 166, .22); color: #5EEAD4; }

/* ---------- Responsive de la galería ---------- */
@media (max-width: 1060px) {
  .themes-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .themes-grid { grid-template-columns: 1fr; gap: 20px; }
  .theme-body { padding: 16px 16px 18px; }
  .tpl-badge { top: 12px; left: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .theme-card { transition: none; }
}

/* Imagen dentro del marco del navegador */
.theme-card .theme-shot {
  display: block; width: 100%; aspect-ratio: 16 / 10;
  object-fit: cover; background: var(--bg-soft);
}
.theme-card .theme-shot--empty {
  display: grid; place-items: center;
  color: var(--faint); font-weight: 700; font-size: 14px;
  background: linear-gradient(135deg, var(--brand-50), var(--bg-soft));
}
