/*
Theme Name: AG Design
Theme URI: https://agdesign.cl
Author: AG Design
Description: Theme de catálogo de merchandising corporativo para AG Design, compatible con WooCommerce. Catálogo con botón "Cotizar" vía WhatsApp, sidebar de categorías y hero editable desde el Personalizador.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: agdesign
*/

/* ==========================================================================
   1. Tokens
   ========================================================================== */
:root{
  --ag-bg:            #e9e6e1;
  --ag-bg-card:       #ffffff;
  --ag-dark:          #1b1b1a;
  --ag-dark-2:        #262625;
  --ag-text:          #1c1c1a;
  --ag-muted:         #79766f;
  --ag-line:          #d9d5cd;
  --ag-white:         #ffffff;

  --ag-font-display:  'Poppins', 'Helvetica Neue', Arial, sans-serif;
  --ag-font-body:     'Inter', 'Helvetica Neue', Arial, sans-serif;

  --ag-radius-sm:      4px;
  --ag-radius-md:      6px;
  --ag-radius-pill:     999px;

  --ag-container:     1240px;
}

/* ==========================================================================
   2. Reset & base
   ========================================================================== */
*, *::before, *::after{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  background:var(--ag-bg);
  color:var(--ag-text);
  font-family:var(--ag-font-body);
  font-size:16px;
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
}
img{ max-width:100%; display:block; }
a{ color:inherit; text-decoration:none; }
ul{ margin:0; padding:0; list-style:none; }
h1,h2,h3,h4{ font-family:var(--ag-font-display); margin:0; font-weight:600; }
button, input{ font-family:inherit; }
:focus-visible{ outline:2px solid var(--ag-dark); outline-offset:2px; }

.ag-container{
  max-width:var(--ag-container);
  margin:0 auto;
  padding:0 24px;
}

.screen-reader-text{
  position:absolute !important;
  clip:rect(1px,1px,1px,1px);
  overflow:hidden;
  height:1px; width:1px;
}

/* ==========================================================================
   3. Header
   ========================================================================== */
.ag-topbar{
  background:var(--ag-dark);
  padding:28px 0;
}
.ag-topbar .ag-container{ display:flex; justify-content:center; }
.ag-logo{ display:flex; flex-direction:column; align-items:center; text-align:center; }
.ag-logo img{ max-height:56px; width:auto; }
.ag-logo .ag-logo-text{
  font-family:var(--ag-font-display);
  color:var(--ag-white);
  font-weight:700;
  font-size:28px;
  letter-spacing:6px;
}
.ag-logo .ag-logo-sub{
  color:#c9c6bf;
  font-size:11px;
  letter-spacing:4px;
  margin-top:2px;
}

.ag-navbar{
  background:var(--ag-bg);
  border-bottom:1px solid var(--ag-line);
}
.ag-navbar .ag-container{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  padding-top:16px;
  padding-bottom:16px;
}
.ag-nav-menu{ display:flex; gap:36px; }
.ag-nav-menu a{
  font-size:14px;
  letter-spacing:1px;
  font-weight:500;
  text-transform:uppercase;
  color:var(--ag-text);
  transition:opacity .15s ease;
}
.ag-nav-menu a:hover{ opacity:.6; }

.ag-search-form{
  display:flex;
  align-items:center;
  gap:8px;
  background:var(--ag-white);
  border:1px solid var(--ag-line);
  border-radius:var(--ag-radius-pill);
  padding:9px 16px;
  min-width:260px;
}
.ag-search-form input{
  border:0; background:transparent; flex:1; font-size:14px; color:var(--ag-text);
}
.ag-search-form input::placeholder{ color:var(--ag-muted); }
.ag-search-form button{ background:none; border:0; cursor:pointer; display:flex; }
.ag-search-form svg{ width:16px; height:16px; stroke:var(--ag-muted); }

.ag-nav-toggle{
  display:none;
  background:none; border:0; cursor:pointer;
}

@media (max-width:880px){
  .ag-nav-menu{
    position:absolute; left:0; right:0; top:100%;
    background:var(--ag-bg);
    flex-direction:column;
    gap:0;
    border-bottom:1px solid var(--ag-line);
    display:none;
  }
  .ag-nav-menu.is-open{ display:flex; }
  .ag-nav-menu a{ padding:14px 24px; border-top:1px solid var(--ag-line); }
  .ag-navbar .ag-container{ position:relative; flex-wrap:wrap; }
  .ag-search-form{ order:3; width:100%; min-width:0; margin-top:12px; }
  .ag-nav-toggle{ display:block; }
}

/* ==========================================================================
   4. Hero
   ========================================================================== */
.ag-hero{
  padding:40px 0 56px;
}
.ag-hero-inner{
  position:relative;
  border-radius:8px;
  overflow:hidden;
  min-height:400px;
  display:flex;
  align-items:center;
  background:var(--ag-dark) center/cover no-repeat;
}
.ag-hero-inner::before{
  content:"";
  position:absolute; inset:0;
  background:linear-gradient(90deg, rgba(20,20,20,.72) 0%, rgba(20,20,20,.35) 55%, rgba(20,20,20,.05) 100%);
}
.ag-hero-content{
  position:relative;
  z-index:1;
  color:var(--ag-white);
  padding:56px 64px;
  max-width:520px;
}
.ag-hero-content h1{
  font-size:34px;
  line-height:1.22;
  margin-bottom:18px;
}
.ag-hero-content p{
  color:#e7e5e0;
  font-size:15px;
  margin-bottom:28px;
}
.ag-btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:12px 26px;
  border-radius:var(--ag-radius-pill);
  font-size:13px;
  letter-spacing:1px;
  text-transform:uppercase;
  font-weight:600;
  cursor:pointer;
  border:1px solid transparent;
  transition:transform .15s ease, opacity .15s ease;
}
.ag-btn:hover{ opacity:.85; }
.ag-btn svg{ width:16px; height:16px; fill:currentColor; }
.ag-btn-outline{
  border-color:rgba(255,255,255,.6);
  color:var(--ag-white);
  background:transparent;
}
.ag-btn-dark{
  background:var(--ag-dark);
  color:var(--ag-white);
}
.ag-btn-dark:hover{ opacity:.88; }

@media (max-width:640px){
  .ag-hero-content{ padding:36px 28px; max-width:100%; }
  .ag-hero-content h1{ font-size:26px; }
}

/* ==========================================================================
   5. Promo blocks (two dark tiles)
   ========================================================================== */
.ag-promo-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:24px;
  padding-bottom:56px;
}
.ag-promo-tile{
  background:var(--ag-dark-2) center/cover no-repeat;
  border-radius:8px;
  min-height:220px;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  padding:28px;
  color:var(--ag-white);
  position:relative;
  overflow:hidden;
}
.ag-promo-tile::before{
  content:"";
  position:absolute; inset:0;
  background:linear-gradient(0deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.05) 60%);
}
.ag-promo-tile > *{ position:relative; z-index:1; }
.ag-promo-tile h3{ font-size:20px; margin-bottom:6px; }
.ag-promo-tile p{ font-size:13px; color:#dedcd6; margin-bottom:0; }

@media (max-width:720px){
  .ag-promo-grid{ grid-template-columns:1fr; }
}

/* ==========================================================================
   6. Section heading
   ========================================================================== */
.ag-section-title{
  text-align:center;
  text-transform:uppercase;
  letter-spacing:3px;
  font-size:15px;
  font-weight:600;
  color:var(--ag-text);
  margin-bottom:32px;
}

/* ==========================================================================
   7. Shop layout: sidebar + grid
   ========================================================================== */
.ag-shop{
  padding:40px 0 80px;
}
.ag-shop-layout{
  display:grid;
  grid-template-columns:260px 1fr;
  gap:32px;
  align-items:start;
}
.ag-sidebar{
  background:transparent;
}
.ag-sidebar h4{
  text-transform:uppercase;
  font-size:13px;
  letter-spacing:2px;
  margin-bottom:16px;
  color:var(--ag-text);
}
.ag-cat-list li a{
  display:flex;
  justify-content:space-between;
  gap:8px;
  padding:11px 16px;
  border-radius:var(--ag-radius-sm);
  font-size:14px;
  color:var(--ag-text);
}
.ag-cat-list li a:hover{ background:rgba(0,0,0,.04); }
.ag-cat-list li a .count{ color:var(--ag-muted); font-size:12px; }
.ag-cat-list li.is-active a,
.ag-cat-list li a.is-active{
  background:var(--ag-dark);
  color:var(--ag-white);
}
.ag-cat-list li.is-active a .count{ color:#c9c6bf; }

.ag-product-grid{
  display:grid;
  grid-template-columns:repeat(4, 1fr);
  gap:24px;
}
@media (max-width:1080px){ .ag-product-grid{ grid-template-columns:repeat(3, 1fr);} }
@media (max-width:820px){
  .ag-shop-layout{ grid-template-columns:1fr; }
  .ag-sidebar{ order:2; }
}
@media (max-width:560px){ .ag-product-grid{ grid-template-columns:repeat(2, 1fr);} }

/* Featured products (home) share the same grid module */
.ag-featured .ag-product-grid{ grid-template-columns:repeat(7, 1fr); }
@media (max-width:1080px){ .ag-featured .ag-product-grid{ grid-template-columns:repeat(4, 1fr);} }
@media (max-width:560px){ .ag-featured .ag-product-grid{ grid-template-columns:repeat(2, 1fr);} }

/* ==========================================================================
   8. Product card
   ========================================================================== */
.ag-card{
  background:var(--ag-bg-card);
  border-radius:var(--ag-radius-md);
  overflow:hidden;
  border:1px solid var(--ag-line);
  display:flex;
  flex-direction:column;
}
.ag-card-media{
  aspect-ratio:1/1;
  background:#efece7;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
.ag-card-media img{ width:100%; height:100%; object-fit:cover; }
.ag-card-body{ padding:16px; display:flex; flex-direction:column; gap:8px; flex:1; }
.ag-card-eyebrow{
  text-transform:uppercase;
  font-size:10.5px;
  letter-spacing:1.5px;
  color:var(--ag-muted);
  text-align:center;
}
.ag-card-title{
  font-family:var(--ag-font-body);
  font-weight:600;
  font-size:13.5px;
  text-align:center;
  line-height:1.35;
  color:var(--ag-text);
  min-height:36px;
}
.ag-card-swatches{
  display:flex;
  justify-content:center;
  gap:6px;
  flex-wrap:wrap;
}
.ag-swatch{
  width:14px; height:14px; border-radius:50%;
  border:1px solid rgba(0,0,0,.15);
}
.ag-card-cta{
  margin-top:auto;
  background:var(--ag-dark);
  color:var(--ag-white);
  text-align:center;
  padding:11px 12px;
  font-size:12px;
  font-weight:600;
  letter-spacing:1.5px;
  text-transform:uppercase;
  border:0;
  border-radius:var(--ag-radius-sm);
  cursor:pointer;
  width:100%;
  display:block;
}
.ag-card-cta:hover{ opacity:.88; }

/* ==========================================================================
   9. Single product / quote form
      (styles WooCommerce's default single-product markup directly)
   ========================================================================== */
.single-product .ag-shop{ padding-top:48px; }
.single-product div.product{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:48px;
  align-items:flex-start;
}
@media (max-width:820px){ .single-product div.product{ grid-template-columns:1fr; } }
.single-product .woocommerce-product-gallery img{
  border-radius:8px;
  border:1px solid var(--ag-line);
}
.single-product .summary.entry-summary{ max-width:520px; }
.single-product .product_title{ font-size:26px; margin:8px 0 16px; }
.single-product .sku_wrapper{ font-size:13px; color:var(--ag-muted); }
.single-product .woocommerce-product-details__short-description{
  margin-bottom:24px; font-size:14.5px; color:#3d3b37;
}
.single-product .product_meta{ font-size:12.5px; color:var(--ag-muted); margin-top:20px; }
.ag-single-meta{ font-size:13px; color:var(--ag-muted); margin-bottom:0; }

.ag-quote-box{
  border:1px solid var(--ag-line);
  border-radius:8px;
  padding:24px;
  background:var(--ag-bg-card);
}
.ag-quote-box h3{ font-size:15px; margin-bottom:6px; }
.ag-quote-box p{ font-size:13px; color:var(--ag-muted); margin-bottom:18px; }

/* ==========================================================================
   10. Footer
   ========================================================================== */
.ag-footer{
  background:var(--ag-dark);
  color:#cfcdc7;
  padding:32px 0;
  text-align:center;
}
.ag-footer p{ font-size:13.5px; margin:0 0 16px; }
.ag-footer a{ color:#e9e6e1; }
.ag-social{ display:flex; justify-content:center; gap:16px; }
.ag-social a{
  width:34px; height:34px;
  border-radius:50%;
  border:1px solid #45443f;
  display:flex; align-items:center; justify-content:center;
}
.ag-social svg{ width:16px; height:16px; }

/* ==========================================================================
   11. WooCommerce notices / misc
   ========================================================================== */
.woocommerce-notices-wrapper{ max-width:var(--ag-container); margin:16px auto 0; padding:0 24px; }
.ag-empty{ text-align:center; padding:60px 0; color:var(--ag-muted); }
