/*
Theme Name:   MarkMarket
Theme URI:    https://markmarket.io
Author:       MarkMarket
Description:  Tema oficial para el plugin MarkMarket. Diseñado para tiendas pequeñas de ropa, alimentos y artesanías. Moderno, minimalista y optimizado para móvil.
Version:      1.0.0
Requires PHP: 7.4
License:      GNU General Public License v2 or later
Text Domain:  markmarket-theme
Tags:         e-commerce, minimal, mobile-first, markmarket
*/

/* ═══════════════════════════════════════════════════════
   TOKENS DE DISEÑO
═══════════════════════════════════════════════════════ */
:root {
  /* Paleta */
  --c-bg:        #FAFAF8;
  --c-surface:   #FFFFFF;
  --c-ink:       #1A1A18;
  --c-ink-muted: #6B6B65;
  --c-border:    #E8E8E4;
  --c-accent:    #C8A882;       /* tierra cálido */
  --c-accent-dk: #A8845E;
  --c-tag:       #F0EDE8;

  /* Tipografía */
  --f-display: 'Cormorant Garamond', Georgia, serif;
  --f-body:    'DM Sans', system-ui, sans-serif;

  /* Espaciado */
  --sp-xs:  4px;
  --sp-sm:  8px;
  --sp-md:  16px;
  --sp-lg:  24px;
  --sp-xl:  40px;
  --sp-2xl: 64px;
  --sp-3xl: 96px;

  /* Radio */
  --r-sm:  4px;
  --r-md:  8px;
  --r-lg:  16px;
  --r-pill: 999px;

  /* Sombras */
  --shadow-card: 0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
  --shadow-hover: 0 4px 20px rgba(0,0,0,.10);

  /* Transición */
  --ease: cubic-bezier(.4,0,.2,1);
  --dur:  220ms;

  /* Layout */
  --max-w: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
}

/* ═══════════════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.65;
  color: var(--c-ink);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul, ol { list-style: none; }

/* Contenedor */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Tipografía */
h1,h2,h3,h4,h5,h6 {
  font-family: var(--f-display);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.4rem); }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.5rem); }

p { max-width: 68ch; }

/* Utilidades */
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }
.text-muted { color: var(--c-ink-muted); }
.text-center { text-align: center; }

/* ═══════════════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════════════ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250,250,248,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-border);
  transition: box-shadow var(--dur) var(--ease);
}

.site-header.scrolled { box-shadow: 0 2px 20px rgba(0,0,0,.06); }

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--sp-lg);
  height: 64px;
}

/* Logo */
.site-branding { flex-shrink: 0; }

.site-title {
  font-family: var(--f-display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--c-ink);
  line-height: 1;
}

.site-title span {
  color: var(--c-accent);
}

.site-logo img { height: 36px; width: auto; }

/* Nav principal */
.site-nav { flex: 1; display: flex; justify-content: center; }

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--sp-xl);
}

.nav-menu a {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--c-ink-muted);
  position: relative;
  padding-bottom: 2px;
  transition: color var(--dur) var(--ease);
}

.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 1px;
  background: var(--c-accent);
  transition: width var(--dur) var(--ease);
}

.nav-menu a:hover,
.nav-menu .current-menu-item a { color: var(--c-ink); }
.nav-menu a:hover::after,
.nav-menu .current-menu-item a::after { width: 100%; }

/* Acciones del header */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  flex-shrink: 0;
}

/* Icono del carrito */
.cart-icon {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 8px 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-pill);
  transition: all var(--dur) var(--ease);
  color: var(--c-ink);
}

.cart-icon:hover {
  border-color: var(--c-ink);
  background: var(--c-ink);
  color: var(--c-bg);
}

.cart-icon svg { width: 16px; height: 16px; }

.cart-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--c-accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--r-pill);
  font-family: var(--f-body);
}

/* Menú hamburguesa (móvil) */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--c-ink);
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

/* ═══════════════════════════════════════════════════════
   HERO
═══════════════════════════════════════════════════════ */
.hero {
  padding: var(--sp-3xl) 0;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2xl);
  align-items: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-accent-dk);
  margin-bottom: var(--sp-lg);
}

.hero-eyebrow::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--c-accent);
}

.hero-title {
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  font-weight: 400;
  margin-bottom: var(--sp-lg);
  line-height: 1.08;
}

.hero-title em {
  font-style: italic;
  color: var(--c-accent-dk);
}

.hero-desc {
  font-size: 16px;
  color: var(--c-ink-muted);
  margin-bottom: var(--sp-xl);
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-md);
}

.hero-image {
  aspect-ratio: 4/5;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--c-tag);
  position: relative;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s var(--ease);
}

.hero-image:hover img { transform: scale(1.03); }

/* Decoración */
.hero-deco {
  position: absolute;
  bottom: -20px;
  left: -20px;
  width: 120px;
  height: 120px;
  border: 1px solid var(--c-accent);
  border-radius: 50%;
  opacity: .3;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════
   BOTONES
═══════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  font-family: var(--f-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  border-radius: var(--r-pill);
  border: 1.5px solid transparent;
  transition: all var(--dur) var(--ease);
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: var(--c-ink);
  color: var(--c-bg);
  border-color: var(--c-ink);
}

.btn-primary:hover {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(200,168,130,.35);
}

.btn-outline {
  background: transparent;
  color: var(--c-ink);
  border-color: var(--c-border);
}

.btn-outline:hover {
  border-color: var(--c-ink);
  background: var(--c-ink);
  color: var(--c-bg);
}

.btn-accent {
  background: var(--c-accent);
  color: white;
  border-color: var(--c-accent);
}

.btn-accent:hover {
  background: var(--c-accent-dk);
  border-color: var(--c-accent-dk);
  transform: translateY(-1px);
}

.btn-sm { padding: 8px 18px; font-size: 12px; }
.btn-lg { padding: 16px 36px; font-size: 14px; }
.btn-full { width: 100%; }

/* ═══════════════════════════════════════════════════════
   SECCIONES GENERALES
═══════════════════════════════════════════════════════ */
.section { padding: var(--sp-2xl) 0; }
.section-lg { padding: var(--sp-3xl) 0; }

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-lg);
  margin-bottom: var(--sp-xl);
  flex-wrap: wrap;
}

.section-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-accent-dk);
  margin-bottom: var(--sp-sm);
}

.divider {
  border: none;
  border-top: 1px solid var(--c-border);
  margin: var(--sp-xl) 0;
}

/* ═══════════════════════════════════════════════════════
   PRODUCTOS (sobrescribe estilos del plugin con más carácter)
═══════════════════════════════════════════════════════ */

/* Sobreescribir variables del plugin */
.mm-shop, .mm-product-card,
.mm-cart-wrapper, .mm-checkout-wrapper,
.mm-thankyou {
  --mm-primary:   #1A1A18;
  --mm-accent:    #C8A882;
  --mm-green:     #5A8A6A;
  --mm-text:      #1A1A18;
  --mm-muted:     #6B6B65;
  --mm-border:    #E8E8E4;
  --mm-bg:        #F5F4F0;
  --mm-white:     #FFFFFF;
  --mm-radius:    8px;
  --mm-shadow:    0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
}

/* Tarjeta de producto: estilo editorial */
.mm-product-card {
  background: var(--c-surface);
  border-radius: 0;
  box-shadow: none;
  border: none;
  transition: none;
}

.mm-product-card:hover { transform: none; box-shadow: none; }

.mm-product-image {
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--c-tag);
}

.mm-product-image img { transition: transform .5s var(--ease); }
.mm-product-card:hover .mm-product-image img { transform: scale(1.04); }

.mm-product-info {
  padding: 14px 4px 0;
}

.mm-product-title {
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  margin-bottom: 6px;
}

.mm-product-title a { color: var(--c-ink); }
.mm-product-title a:hover { color: var(--c-accent-dk); }

.mm-price { font-size: 15px; font-weight: 600; color: var(--c-ink); }
.mm-price-sale { font-size: 15px; font-weight: 600; color: var(--c-accent-dk); }
.mm-price-old { font-size: 13px; color: var(--c-ink-muted); }

/* Botón en tarjeta */
.mm-add-to-cart {
  margin-top: 12px;
  background: transparent;
  color: var(--c-ink);
  border: 1px solid var(--c-border);
  border-radius: var(--r-pill);
  font-size: 12px;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 9px 18px;
  font-weight: 600;
  width: 100%;
  transition: all var(--dur) var(--ease);
}

.mm-add-to-cart:hover {
  background: var(--c-ink);
  border-color: var(--c-ink);
  color: var(--c-bg);
}

/* Badge oferta */
.mm-badge-sale {
  background: var(--c-accent);
  font-size: 10px;
  letter-spacing: .06em;
}

/* Filtro de categorías */
.mm-category-filter { gap: 8px; margin-bottom: 32px; }

.mm-cat-btn {
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--c-border);
  background: transparent;
  color: var(--c-ink-muted);
  transition: all var(--dur) var(--ease);
}

.mm-cat-btn.active,
.mm-cat-btn:hover {
  background: var(--c-ink);
  border-color: var(--c-ink);
  color: var(--c-bg);
}

/* Botones del plugin heredan btn-primary */
.mm-btn { border-radius: var(--r-pill); font-family: var(--f-body); }
.mm-btn-primary { background: var(--c-ink); }
.mm-btn-primary:hover { background: var(--c-accent-dk); }

/* ═══════════════════════════════════════════════════════
   BANNER DE CATEGORÍAS (homepage)
═══════════════════════════════════════════════════════ */
.category-banner-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-md);
}

.category-card {
  position: relative;
  aspect-ratio: 3/4;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--c-tag);
  cursor: pointer;
}

.category-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease);
}

.category-card:hover img { transform: scale(1.05); }

.category-card-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: var(--sp-xl) var(--sp-lg) var(--sp-lg);
  background: linear-gradient(to top, rgba(26,26,24,.7) 0%, transparent 100%);
  color: white;
}

.category-card-label h3 {
  font-family: var(--f-display);
  font-size: 1.4rem;
  font-weight: 400;
  color: white;
}

.category-card-label span {
  font-size: 12px;
  opacity: .75;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════════
   STRIP DE CARACTERÍSTICAS
═══════════════════════════════════════════════════════ */
.features-strip {
  border-top: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
  padding: var(--sp-xl) 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-lg);
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-md);
}

.feature-icon {
  font-size: 20px;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 2px;
}

.feature-item h4 {
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.feature-item p {
  font-size: 13px;
  color: var(--c-ink-muted);
  line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════
   NEWSLETTER STRIP
═══════════════════════════════════════════════════════ */
.newsletter-section {
  background: var(--c-ink);
  color: var(--c-bg);
  padding: var(--sp-2xl) 0;
  text-align: center;
}

.newsletter-section h2 { color: var(--c-bg); margin-bottom: var(--sp-sm); }
.newsletter-section p { color: rgba(250,250,248,.65); margin-inline: auto; margin-bottom: var(--sp-xl); }

.newsletter-form {
  display: flex;
  gap: var(--sp-sm);
  max-width: 440px;
  margin-inline: auto;
}

.newsletter-form input {
  flex: 1;
  padding: 13px 18px;
  border-radius: var(--r-pill);
  border: 1.5px solid rgba(250,250,248,.2);
  background: rgba(250,250,248,.08);
  color: var(--c-bg);
  font-family: var(--f-body);
  font-size: 14px;
  outline: none;
  transition: border-color var(--dur) var(--ease);
}

.newsletter-form input::placeholder { color: rgba(250,250,248,.4); }
.newsletter-form input:focus { border-color: var(--c-accent); }

/* ═══════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════ */
.site-footer {
  border-top: 1px solid var(--c-border);
  padding: var(--sp-2xl) 0 var(--sp-lg);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: var(--sp-2xl);
  margin-bottom: var(--sp-2xl);
}

.footer-brand .site-title { font-size: 1.3rem; margin-bottom: var(--sp-md); }
.footer-brand p { font-size: 14px; color: var(--c-ink-muted); line-height: 1.6; }

.footer-col h4 {
  font-family: var(--f-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-ink-muted);
  margin-bottom: var(--sp-md);
}

.footer-col ul { display: flex; flex-direction: column; gap: var(--sp-sm); }
.footer-col ul a { font-size: 14px; color: var(--c-ink-muted); transition: color var(--dur) var(--ease); }
.footer-col ul a:hover { color: var(--c-ink); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-md);
  padding-top: var(--sp-lg);
  border-top: 1px solid var(--c-border);
  font-size: 13px;
  color: var(--c-ink-muted);
  flex-wrap: wrap;
}

.footer-powered {
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-powered strong {
  color: var(--c-ink);
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════
   PÁGINA DE PRODUCTO INDIVIDUAL
═══════════════════════════════════════════════════════ */
.single-product-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2xl);
  align-items: start;
  padding: var(--sp-2xl) 0;
}

.product-gallery {
  position: sticky;
  top: 80px;
}

.product-main-image {
  aspect-ratio: 1/1;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--c-tag);
  margin-bottom: var(--sp-sm);
}

.product-main-image img { width: 100%; height: 100%; object-fit: cover; }

.product-info { padding-top: var(--sp-sm); }
.product-category { font-size: 12px; color: var(--c-accent-dk); letter-spacing: .08em; text-transform: uppercase; font-weight: 600; margin-bottom: var(--sp-md); }
.product-title { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: var(--sp-md); }
.product-price-block { display: flex; align-items: baseline; gap: var(--sp-sm); margin-bottom: var(--sp-xl); }
.product-price-current { font-size: 1.6rem; font-weight: 700; color: var(--c-ink); }
.product-price-old { font-size: 1rem; text-decoration: line-through; color: var(--c-ink-muted); }
.product-price-sale { font-size: 1.6rem; font-weight: 700; color: var(--c-accent-dk); }

.product-desc { font-size: 15px; color: var(--c-ink-muted); line-height: 1.7; margin-bottom: var(--sp-xl); }

.product-add-form { display: flex; gap: var(--sp-sm); align-items: center; margin-bottom: var(--sp-lg); }

.qty-control {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-pill);
  overflow: hidden;
}

.qty-control button {
  width: 38px; height: 44px;
  background: none; border: none;
  font-size: 18px; color: var(--c-ink);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--dur) var(--ease);
}

.qty-control button:hover { background: var(--c-tag); }
.qty-control input { width: 40px; text-align: center; border: none; font-family: var(--f-body); font-size: 15px; font-weight: 600; background: none; outline: none; }

/* ═══════════════════════════════════════════════════════
   BREADCRUMBS
═══════════════════════════════════════════════════════ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--c-ink-muted);
  padding: var(--sp-md) 0;
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--c-ink-muted); transition: color var(--dur) var(--ease); }
.breadcrumb a:hover { color: var(--c-ink); }
.breadcrumb-sep { opacity: .4; }

/* ═══════════════════════════════════════════════════════
   PÁGINA (page.php / singular)
═══════════════════════════════════════════════════════ */
.entry-content {
  max-width: 72ch;
  font-size: 16px;
  line-height: 1.8;
}

.entry-content h2, .entry-content h3 { margin: 2em 0 .6em; }
.entry-content p, .entry-content ul, .entry-content ol { margin-bottom: 1.2em; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; list-style: initial; }
.entry-content a { color: var(--c-accent-dk); text-decoration: underline; }
.entry-content img { border-radius: var(--r-md); margin: var(--sp-lg) 0; }

/* ═══════════════════════════════════════════════════════
   RESPONSIVE — Mobile first
═══════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  /* Header */
  .site-nav { display: none; position: fixed; top: 64px; left: 0; right: 0; bottom: 0; background: var(--c-surface); padding: var(--sp-xl) var(--gutter); flex-direction: column; justify-content: flex-start; }
  .site-nav.open { display: flex; }
  .nav-menu { flex-direction: column; align-items: flex-start; gap: var(--sp-lg); }
  .nav-menu a { font-size: 1.4rem; font-family: var(--f-display); text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--c-ink); }
  .menu-toggle { display: flex; }

  /* Hero */
  .hero-grid { grid-template-columns: 1fr; }
  .hero-image { aspect-ratio: 4/3; order: -1; }

  /* Categorías */
  .category-banner-grid { grid-template-columns: 1fr; }
  .category-card { aspect-ratio: 16/9; }

  /* Producto individual */
  .single-product-layout { grid-template-columns: 1fr; }
  .product-gallery { position: static; }

  /* Features */
  .features-grid { grid-template-columns: 1fr 1fr; gap: var(--sp-lg); }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--sp-xl); }
  .footer-brand { grid-column: 1 / -1; }

  /* Newsletter */
  .newsletter-form { flex-direction: column; }
}

@media (max-width: 480px) {
  .features-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-cta { flex-direction: column; }
  .product-add-form { flex-direction: column; align-items: stretch; }
  .mm-checkout-wrapper { grid-template-columns: 1fr; }
}
