/*
Theme Name: Su Majestad El Piano
Theme URI: https://sumajestadelpiano.com.mx
Author: Guidev Studios
Description: Tema a medida, sin builder, construido para velocidad en móvil.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.1
Text Domain: su-majestad
*/

/* ==========================================================================
   Tokens
   ========================================================================== */
:root{
  --ink:#211d18;
  --ink-soft:#5b5245;
  --paper:#ffffff;
  --paper-alt:#faf7f2;
  --line:#e7ddd0;
  --gold:#b8860b;
  --gold-deep:#8c6a1f;
  --black:#161310;
  --green:#2f6b3f;
  --red:#a13324;
  --radius:10px;
  --gutter:20px;
  --maxw:1280px;
  --font-display:"Fraunces", Georgia, serif;
  --font-body:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ==========================================================================
   Reset minimo
   ========================================================================== */
*, *::before, *::after{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; }
body{
  margin:0;
  font-family:var(--font-body);
  color:var(--ink);
  background:var(--paper);
  line-height:1.55;
  font-size:16px;
}
img{ max-width:100%; height:auto; display:block; }
a{ color:inherit; text-decoration:none; }
button, input, select, textarea{ font:inherit; color:inherit; }
ul{ margin:0; padding:0; list-style:none; }
h1,h2,h3,h4{ margin:0 0 .5em; font-family:var(--font-display); line-height:1.15; }
p{ margin:0 0 1em; }
.container{ max-width:var(--maxw); margin:0 auto; padding:0 var(--gutter); }
.sr-only{
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}
.skip-link{
  position:absolute; left:-999px; top:0; background:var(--black); color:#fff;
  padding:10px 16px; z-index:1000;
}
.skip-link:focus{ left:8px; top:8px; }

/* ==========================================================================
   Barra superior
   ========================================================================== */
.top-bar{
  background:var(--gold);
  color:#fff;
  font-size:.8rem;
  overflow:hidden;
}
.top-bar .container{
  display:flex; flex-wrap:wrap; gap:6px 24px; align-items:center;
  padding-top:8px; padding-bottom:8px;
}
.top-bar a{ opacity:.95; }
.top-bar a:hover{ opacity:1; text-decoration:underline; }

/* ==========================================================================
   Header / nav
   ========================================================================== */
.site-header{
  border-bottom:1px solid var(--line);
  background:var(--paper);
}
.site-header .container{
  display:flex; align-items:center; justify-content:space-between;
  gap:24px; padding-top:14px; padding-bottom:14px;
}
.site-logo img{ max-height:56px; width:auto; }
.site-logo{ font-family:var(--font-display); font-size:1.4rem; }

.main-nav{ display:none; }
.main-nav ul{ display:flex; gap:28px; }
.main-nav a{ font-weight:600; font-size:.95rem; }
.main-nav a:hover{ color:var(--gold-deep); }

.header-actions{ display:flex; align-items:center; gap:16px; }
.header-actions a{ display:inline-flex; align-items:center; gap:6px; }
.cart-count{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:18px; height:18px; padding:0 4px; border-radius:999px;
  background:var(--black); color:#fff; font-size:.68rem; font-weight:700;
}
.menu-toggle{
  display:inline-flex; background:none; border:none; padding:6px; cursor:pointer;
}
.menu-toggle svg{ width:24px; height:24px; }

@media (min-width:900px){
  .main-nav{ display:block; }
  .menu-toggle{ display:none; }
}

/* menu movil */
.mobile-nav{
  display:none;
  border-top:1px solid var(--line);
  background:var(--paper);
}
.mobile-nav.is-open{ display:block; }
.mobile-nav ul{ padding:8px var(--gutter) 16px; display:flex; flex-direction:column; gap:2px; }
.mobile-nav a{ display:block; padding:10px 0; font-weight:600; border-bottom:1px solid var(--line); }
@media (min-width:900px){ .mobile-nav{ display:none !important; } }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero{
  position:relative;
  color:#fff;
  min-height:320px;
  display:flex; align-items:flex-end;
  background-size:cover; background-position:center;
  margin-bottom:48px;
}
.hero::before{
  content:''; position:absolute; inset:0;
  background:linear-gradient(0deg, rgba(0,0,0,.65), rgba(0,0,0,.15));
}
.hero .container{ position:relative; padding-top:60px; padding-bottom:36px; }
.hero h1{ font-size:clamp(1.8rem, 4vw, 2.8rem); text-wrap:balance; margin-bottom:.3em; }
.hero p{ max-width:52ch; opacity:.92; margin:0; }

/* ==========================================================================
   Secciones / titulos
   ========================================================================== */
.section{ margin-bottom:56px; }
.section-title{ text-align:center; font-size:1.7rem; margin-bottom:28px; }

/* ==========================================================================
   Grid de productos
   ========================================================================== */
.product-grid{
  display:grid;
  grid-template-columns:repeat(2, 1fr);
  gap:16px 14px;
}
@media (min-width:700px){ .product-grid{ grid-template-columns:repeat(3, 1fr); gap:24px; } }
@media (min-width:1100px){ .product-grid{ grid-template-columns:repeat(4, 1fr); } }

.product-card{
  position:relative;
  min-width:0; /* misma protección que en la ficha de producto, ver ahí */
  border:1px solid var(--line);
  border-radius:var(--radius);
  overflow:hidden;
  background:var(--paper);
  display:flex; flex-direction:column;
  transition:box-shadow .15s ease, transform .15s ease;
}
.product-card:hover{ box-shadow:0 8px 24px -12px rgba(0,0,0,.25); }
.product-card .thumb{
  aspect-ratio:1/1;
  overflow:hidden;
  background:var(--paper-alt);
}
.product-card .thumb img{ width:100%; height:100%; object-fit:cover; }
.product-card .badge{
  position:absolute; top:10px; left:10px; z-index:2;
  background:var(--gold); color:#fff; font-size:.72rem; font-weight:700;
  padding:3px 8px; border-radius:6px;
}
.product-card .badge.hot{ background:var(--red); top:10px; }
.product-card .badge + .badge{ top:38px; }
.product-card .body{ padding:12px 14px 16px; display:flex; flex-direction:column; gap:6px; flex:1; }
.product-card .cat{ font-size:.7rem; letter-spacing:.04em; text-transform:uppercase; color:var(--ink-soft); }
.product-card .name{
  font-family:var(--font-body); font-weight:600; font-size:.92rem; line-height:1.35;
  margin:0; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.product-card .price{ margin-top:auto; font-weight:700; }
.product-card .price del{ color:var(--ink-soft); font-weight:400; margin-right:6px; opacity:.7; }
.product-card .price ins{ text-decoration:none; }

/* ==========================================================================
   Marcas
   ========================================================================== */
.brands-grid{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:24px;
  text-align:center;
}
@media (min-width:700px){ .brands-grid{ grid-template-columns:repeat(5, 1fr); } }
.brand-item a{ display:block; }
.brand-logo{
  width:88px; height:88px; margin:0 auto 10px;
  border:1px solid var(--line); border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  overflow:hidden; background:var(--paper);
}
.brand-logo img{ width:70%; height:70%; object-fit:contain; }
.brand-name{ font-size:.78rem; font-weight:700; letter-spacing:.02em; }

/* ==========================================================================
   Botones
   ========================================================================== */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:12px 20px; border-radius:8px; font-weight:700; font-size:.92rem;
  border:1px solid transparent; cursor:pointer; transition:opacity .15s ease;
}
.btn:hover{ opacity:.88; }
.btn-primary{ background:var(--black); color:#fff; }
.btn-secondary{ background:var(--paper); color:var(--ink); border-color:var(--ink); }
.btn-block{ width:100%; }

/* ==========================================================================
   Ficha de producto
   ========================================================================== */
.product-page{
  display:grid; grid-template-columns:1fr; gap:32px;
  margin-bottom:56px;
}
@media (min-width:960px){ .product-page{ grid-template-columns:1.1fr 1fr; } }
/* Sin esto, una imagen fuente sin redimensionar (pasa con fotos subidas a
   resolución completa) fuerza el track del grid a su tamaño intrínseco y
   revienta el layout entero — es el comportamiento por defecto de Grid/Flex. */
.product-gallery, .product-summary{ min-width:0; }

.gallery-main{
  aspect-ratio:1/1; border-radius:var(--radius); overflow:hidden;
  background:var(--paper-alt); margin-bottom:10px;
  max-width:100%;
}
.gallery-main img{ width:100%; height:100%; object-fit:cover; max-width:100%; }
.gallery-thumbs{ display:flex; gap:8px; overflow-x:auto; }
.gallery-thumbs img{
  width:64px; height:64px; object-fit:cover; border-radius:6px;
  border:1px solid var(--line); cursor:pointer; flex-shrink:0;
}
.gallery-thumbs img.is-active{ border-color:var(--gold); border-width:2px; }

.product-summary .eyebrow{ color:var(--gold-deep); font-weight:700; font-size:.78rem; text-transform:uppercase; letter-spacing:.05em; }
.product-summary h1{ font-size:1.7rem; margin:.2em 0 .5em; }
.price-box{ font-size:1.7rem; font-weight:700; margin-bottom:16px; }
.price-box del{ font-size:1.1rem; color:var(--ink-soft); font-weight:400; margin-right:10px; }

.spec-list{ margin:0 0 20px; border-top:1px solid var(--line); }
.spec-list li{
  display:flex; justify-content:space-between; gap:12px;
  padding:9px 0; border-bottom:1px solid var(--line); font-size:.92rem;
}
.spec-list b{ color:var(--ink-soft); font-weight:500; }

.trust-badges{ display:flex; gap:16px; flex-wrap:wrap; margin:18px 0; font-size:.82rem; color:var(--ink-soft); }
.trust-badges span{ display:flex; align-items:center; gap:6px; }

.cta-row{ display:flex; flex-direction:column; gap:10px; margin-bottom:20px; }
@media (min-width:480px){ .cta-row{ flex-direction:row; } }

.reviews-block{ margin-top:32px; padding-top:24px; border-top:1px solid var(--line); }

/* Botones nativos de WooCommerce (add to cart, checkout) heredan la misma
   paleta del tema en vez del morado por defecto. */
.single_add_to_cart_button,
a.button.product_type_simple,
.woocommerce #respond input#submit,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.wc-block-components-button:not(.is-link){
  background:var(--black) !important;
  border:1px solid var(--black) !important;
  color:#fff !important;
  border-radius:8px !important;
  font-weight:700 !important;
  padding:12px 20px !important;
}
.single_add_to_cart_button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover{
  background:var(--gold-deep) !important;
  border-color:var(--gold-deep) !important;
  opacity:1 !important;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer{ background:var(--black); color:#cfc7ba; padding:40px 0 24px; margin-top:64px; }
.footer-cols{ display:grid; grid-template-columns:1fr; gap:28px; margin-bottom:28px; }
@media (min-width:700px){ .footer-cols{ grid-template-columns:repeat(3, 1fr); } }
.footer-cols h4{ color:#fff; font-family:var(--font-body); font-size:.85rem; text-transform:uppercase; letter-spacing:.05em; }
.footer-cols a{ opacity:.85; display:block; padding:4px 0; font-size:.9rem; }
.footer-legal{ border-top:1px solid rgba(255,255,255,.12); padding-top:18px; font-size:.78rem; text-align:center; opacity:.7; }

/* ==========================================================================
   Utilidades responsive generales
   ========================================================================== */
.only-mobile{ display:block; }
.only-desktop{ display:none; }
@media (min-width:900px){
  .only-mobile{ display:none; }
  .only-desktop{ display:block; }
}
