/*
Theme Name: Protienda Catálogo
Description: Template de catálogo del plan Free de Protienda: header con logo y menú, banner, grilla de productos de WooCommerce y venta por WhatsApp (sin checkout). 100% código, sin editor de bloques.
Version: 1.0.0
Requires at least: 6.0
*/

:root {
  --ink: #14151a;
  --muted: #6b7280;
  --line: #e6e7eb;
  --soft: #f6f6f4;
  --accent: #ff5a1f;
  --accent-ink: #ffffff;
  --ok: #16a34a;
  --radius: 14px;
  --container: 1160px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
.container { width: min(var(--container), 100% - 40px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Header */
.pt-header { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.pt-header-inner { display: flex; align-items: center; gap: 24px; min-height: 66px; }
.pt-logo { font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.pt-logo b { color: var(--accent); }
.pt-nav { display: flex; gap: 22px; font-size: 14px; font-weight: 600; color: #40434c; }
.pt-nav a:hover { color: var(--accent); }
.pt-header-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.pt-cart-btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: 8px 16px; font-weight: 700; font-size: 14px; }
.pt-cart-btn:hover { border-color: var(--ink); }
.pt-cart-ico { color: #111; }
.pt-cart-count { min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; background: var(--accent); color: #fff; border-radius: 999px; font-size: 12px; font-weight: 700; }
/* Mobile: solo el icono del carrito. */
@media (max-width: 560px) {
  .pt-cart-label { display: none; }
  .pt-cart-btn { padding: 8px 12px; gap: 6px; }
}

/* Banner */
.pt-banner { background: linear-gradient(135deg, #14151a, #24262f); color: #fff; }
.pt-banner-inner { padding: 72px 0; max-width: 680px; }
.pt-banner .eyebrow { display: inline-block; color: var(--accent); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.pt-banner h1 { margin: 0 0 14px; font-size: 46px; line-height: 1.08; letter-spacing: -.03em; }
.pt-banner p { margin: 0 0 24px; font-size: 18px; color: #c7c9d1; }
.pt-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 12px; padding: 14px 24px; font-weight: 800; font-size: 15px; transition: background .18s ease, transform .18s ease, box-shadow .18s ease; }
/* Hover: mismo acento un poco más oscuro + slide-up mínimo. */
.pt-btn:hover { background: var(--accent-dark, #e64d15); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.14); }
.pt-btn:active { transform: translateY(-1px); }
/* Banner con alto fijo: el contenedor ocupa todo el ancho igual. */
.pt-banner[style*="display:flex"] > .container { width: min(var(--container), 100% - 48px); }

/* Secciones */
.pt-section { padding: 56px 0; }
.pt-section h2 { margin: 0 0 6px; font-size: 28px; letter-spacing: -.02em; }
.pt-section .sub { margin: 0 0 28px; color: var(--muted); }

/* Grilla de productos */
.pt-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
@media (max-width: 960px) { .pt-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .pt-grid { grid-template-columns: 1fr; } }
.pt-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; display: flex; flex-direction: column; transition: box-shadow .2s ease, transform .2s ease; }
.pt-card:hover { box-shadow: 0 12px 30px rgba(20,21,26,.10); transform: translateY(-2px); }
.pt-card-img { aspect-ratio: 1; background: var(--soft); position: relative; overflow: hidden; }
.pt-card-img img { width: 100%; height: 100%; object-fit: cover; }
.pt-card-img .ph { width: 100%; height: 100%; display: grid; place-items: center; color: #b7bac2; font-size: 13px; }
.pt-badge { position: absolute; top: 10px; left: 10px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 999px; }
.pt-card-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pt-card-title { font-weight: 700; font-size: 15px; }
.pt-price { display: flex; align-items: baseline; gap: 8px; }
.pt-price .now { font-weight: 800; font-size: 17px; }
.pt-price .was { color: var(--muted); text-decoration: line-through; font-size: 14px; }
.pt-card .pt-btn { width: 100%; justify-content: center; margin-top: auto; padding: 11px; font-size: 14px; }
.pt-card .pt-btn.out { background: #e9e9ec; color: #8b8e97; pointer-events: none; }

/* Bandas / beneficios */
.pt-benefits { background: var(--soft); }
.pt-benefits .pt-grid { grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 720px) { .pt-benefits .pt-grid { grid-template-columns: repeat(2, 1fr); } }
.pt-benefit { text-align: center; }
.pt-benefit .ico { font-size: 22px; }
.pt-benefit b { display: block; margin-top: 6px; }
.pt-benefit span { color: var(--muted); font-size: 14px; }

/* Footer */
.pt-footer { border-top: 1px solid var(--line); padding: 32px 0; color: var(--muted); font-size: 14px; text-align: center; }

/* Carrito (drawer) */
.pt-cart-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 60; }
.pt-cart-overlay.open { opacity: 1; pointer-events: auto; }
.pt-cart-drawer { position: fixed; top: 0; right: 0; height: 100%; width: min(400px, 100%); background: #fff; transform: translateX(100%); transition: transform .25s ease; z-index: 61; display: flex; flex-direction: column; box-shadow: -10px 0 40px rgba(0,0,0,.15); }
.pt-cart-drawer.open { transform: translateX(0); }
.pt-cart-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.pt-cart-head b { font-size: 16px; }
.pt-cart-close { border: 0; background: none; font-size: 22px; color: var(--muted); }
.pt-cart-items { flex: 1; overflow-y: auto; padding: 12px 20px; }
.pt-cart-empty { color: var(--muted); text-align: center; padding: 40px 0; }
.pt-cart-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.pt-cart-item .thumb { width: 54px; height: 54px; border-radius: 8px; background: var(--soft); object-fit: cover; flex: 0 0 auto; }
.pt-cart-item .info { flex: 1; min-width: 0; }
.pt-cart-item .info .name { font-weight: 600; font-size: 14px; }
.pt-cart-item .info .price { color: var(--muted); font-size: 13px; }
.pt-qty { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; }
.pt-qty button { width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 6px; background: #fff; line-height: 1; }
.pt-cart-remove { border: 0; background: none; color: var(--muted); font-size: 12px; text-decoration: underline; }
.pt-cart-foot { border-top: 1px solid var(--line); padding: 16px 20px; }
.pt-cart-total { display: flex; justify-content: space-between; font-weight: 800; font-size: 16px; margin-bottom: 12px; }
.pt-wa { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; background: #25d366; color: #fff; border: 0; border-radius: 12px; padding: 14px; font-weight: 800; font-size: 15px; }
.pt-wa:hover { background: #1fbe59; }
.pt-wa[disabled] { background: #cfe9d6; pointer-events: none; }

/* Popup de producto */
.pt-card-img.pt-view, .pt-card-title.pt-view { cursor: pointer; }
.pt-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: none; z-index: 70; padding: 20px; }
.pt-modal-overlay.open { display: grid; place-items: center; }
.pt-modal { position: relative; width: min(720px, 100%); max-height: 90vh; overflow: hidden; background: #fff; border-radius: 16px; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.pt-modal-close { position: absolute; top: 10px; right: 12px; z-index: 2; border: 0; background: rgba(255,255,255,.85); width: 32px; height: 32px; border-radius: 999px; font-size: 20px; color: var(--muted); }
.pt-modal-grid { display: grid; grid-template-columns: 44% 56%; align-items: stretch; }
.pt-modal-media { min-height: 220px; background: var(--soft); border-radius: 16px 0 0 16px; overflow: hidden; }
.pt-modal-media img { width: 100%; height: 100%; object-fit: cover; }
.pt-modal-media .ph { width: 100%; height: 100%; display: grid; place-items: center; color: #b7bac2; font-size: 13px; }
.pt-modal-info { padding: 22px 22px; display: flex; flex-direction: column; gap: 10px; }
.pt-modal-info h3 { margin: 0; font-size: 20px; line-height: 1.2; letter-spacing: -.02em; }
.pt-modal-price { display: flex; align-items: baseline; gap: 10px; }
.pt-modal-price .now { font-weight: 800; font-size: 19px; }
.pt-modal-price .was { color: var(--muted); text-decoration: line-through; font-size: 14px; }
/* Descripción acotada: entra sin scroll (trunca si es muy larga). */
.pt-modal-desc { color: var(--muted); font-size: 13.5px; line-height: 1.5; white-space: pre-line; margin: 0; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.pt-modal-add { align-self: flex-start; margin-top: 6px; padding: 11px 22px; font-size: 14px; }
.pt-modal-add.out { background: #e9e9ec; color: #8b8e97; pointer-events: none; }
/* Mobile: imagen arriba, más chica; todo compacto para que entre sin scroll. */
@media (max-width: 620px) {
  .pt-modal-grid { grid-template-columns: 1fr; }
  .pt-modal-media { min-height: 0; height: 180px; border-radius: 16px 16px 0 0; }
  .pt-modal-info { padding: 18px 18px; gap: 8px; }
  .pt-modal-info h3 { font-size: 18px; }
  .pt-modal-desc { -webkit-line-clamp: 4; font-size: 13px; }
}
