/* ============================================
   Tortillería La Maseca — Guadalajara
   Tema: Tierra, maíz, comal
   Mobile-first · Sidebar nav desktop
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Source+Sans+3:wght@300;400;600;700&display=swap');

:root{
  --gold:#D4A017;
  --cream:#F5E6CA;
  --brown:#5D4037;
  --brown-light:#795548;
  --brown-dark:#3E2723;
  --bg:#FFFDF8;
  --bg-alt:#F5F0E8;
  --text:#3E2723;
  --text-light:#6D4C41;
  --white:#fff;
  --radius:6px;
  --shadow:0 2px 12px rgba(93,64,55,.10);
  --sidebar-w:260px;
  --container:1120px;
  --font-head:'Playfair Display',Georgia,'Times New Roman',serif;
  --font-body:'Source Sans 3','Segoe UI',Arial,sans-serif;
  --transition:.25s ease;
}

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{font-family:var(--font-body);font-size:16px;line-height:1.7;color:var(--text);background:var(--bg);overflow-x:hidden}

a{color:var(--brown);text-decoration:none;transition:color var(--transition)}
a:hover,a:focus{color:var(--gold)}

img{max-width:100%;height:auto;display:block}

h1,h2,h3,h4{font-family:var(--font-head);color:var(--brown-dark);line-height:1.25;font-weight:700}

.container{max-width:var(--container);margin:0 auto;padding:0 20px}

/* ── IMAGE PLACEHOLDERS ─────────────── */
.img-placeholder{
  display:flex;align-items:center;justify-content:center;
  background:linear-gradient(135deg,#D4A017 0%,#F5E6CA 50%,#5D4037 100%);
  color:var(--white);font-family:var(--font-body);font-size:.9rem;
  font-weight:600;text-align:center;padding:1.5rem;min-height:200px;
  border-radius:var(--radius);text-shadow:0 1px 4px rgba(0,0,0,.35);
  position:relative;overflow:hidden;
}
.img-placeholder--tall{min-height:340px}
.img-placeholder--hero{min-height:420px;font-size:1.1rem}
.img-placeholder--small{min-height:140px;font-size:.8rem}
.img-placeholder::before{
  content:'';position:absolute;inset:0;
  background:repeating-linear-gradient(45deg,transparent,transparent 20px,rgba(255,255,255,.04) 20px,rgba(255,255,255,.04) 40px);
}

/* ── SIDEBAR (desktop) ──────────────── */
.sidebar{
  display:none;position:fixed;top:0;left:0;bottom:0;width:var(--sidebar-w);
  background:var(--brown-dark);color:var(--cream);z-index:100;
  padding:2rem 1.5rem;overflow-y:auto;
  flex-direction:column;
}
.sidebar__logo{margin-bottom:2rem}
.sidebar__logo a{display:block}
.sidebar__logo svg{width:100%;height:auto}
.sidebar__logo svg .tl-name{fill:var(--cream)}
.sidebar__logo svg .tl-tortilla{stroke:var(--cream)}
.sidebar__logo svg .tl-sub{fill:var(--gold)}
.sidebar__nav{display:flex;flex-direction:column;gap:.25rem;margin-bottom:2rem}
.sidebar__nav a{
  display:block;padding:.6rem .8rem;border-radius:var(--radius);
  color:var(--cream);font-size:.95rem;font-weight:400;
  transition:background var(--transition),color var(--transition);
}
.sidebar__nav a:hover,.sidebar__nav a:focus,.sidebar__nav a.active{
  background:rgba(212,160,23,.15);color:var(--gold);
}
.sidebar__contact{
  margin-top:auto;padding-top:1.5rem;border-top:1px solid rgba(245,230,202,.15);
  font-size:.85rem;line-height:1.8;
}
.sidebar__contact a{color:var(--gold)}

/* ── MOBILE BAR ─────────────────────── */
.mobile-bar{
  position:fixed;top:0;left:0;right:0;height:60px;z-index:110;
  background:var(--brown-dark);display:flex;align-items:center;
  padding:0 1rem;
}
.mobile-bar svg{width:140px;height:auto}
.mobile-bar svg .tl-name{fill:var(--cream)}
.mobile-bar svg .tl-tortilla{stroke:var(--cream)}
.mobile-bar svg .tl-sub{fill:var(--gold)}

.hamburger{
  position:fixed;top:14px;right:16px;z-index:120;
  width:36px;height:36px;background:none;border:none;cursor:pointer;
  display:flex;flex-direction:column;justify-content:center;gap:5px;
  padding:4px;
}
.hamburger span{display:block;height:2px;width:100%;background:var(--cream);border-radius:2px;transition:var(--transition)}
.hamburger.open span:nth-child(1){transform:rotate(45deg) translate(5px,5px)}
.hamburger.open span:nth-child(2){opacity:0}
.hamburger.open span:nth-child(3){transform:rotate(-45deg) translate(5px,-5px)}

/* Mobile overlay menu */
.mobile-menu{
  position:fixed;top:0;left:0;right:0;bottom:0;z-index:105;
  background:var(--brown-dark);display:flex;flex-direction:column;
  align-items:center;justify-content:center;gap:.5rem;
  transform:translateX(100%);transition:transform .3s ease;
}
.mobile-menu.open{transform:translateX(0)}
.mobile-menu a{
  color:var(--cream);font-size:1.2rem;font-family:var(--font-head);
  padding:.6rem 1.5rem;border-radius:var(--radius);
  transition:background var(--transition);
}
.mobile-menu a:hover,.mobile-menu a:focus{background:rgba(212,160,23,.15);color:var(--gold)}

/* ── MAIN CONTENT ───────────────────── */
.main-content{padding-top:60px}

/* ── HERO ────────────────────────────── */
.hero{
  display:grid;grid-template-columns:1fr;gap:0;
  min-height:70vh;position:relative;
}
.hero__visual{
  position:relative;overflow:hidden;
}
.hero__visual .img-placeholder{
  min-height:50vh;border-radius:0;
  background:linear-gradient(160deg,#3E2723 0%,#D4A017 40%,#F5E6CA 100%);
  font-size:1.2rem;
}
.hero__content{
  padding:2.5rem 1.5rem;display:flex;flex-direction:column;
  justify-content:center;background:var(--bg);
}
.hero__tag{
  font-family:var(--font-body);font-size:.8rem;font-weight:600;
  text-transform:uppercase;letter-spacing:.14em;color:var(--gold);
  margin-bottom:.5rem;
}
.hero__title{font-size:clamp(2rem,6vw,3.2rem);margin-bottom:.75rem;color:var(--brown-dark)}
.hero__accent{width:60px;height:3px;background:var(--gold);margin-bottom:1rem;border-radius:2px}
.hero__subtitle{
  font-size:1.1rem;color:var(--text-light);max-width:480px;
  margin-bottom:1.5rem;line-height:1.7;
}
.hero__cta{
  display:inline-block;padding:.8rem 1.8rem;background:var(--gold);
  color:var(--white);font-weight:600;border-radius:var(--radius);
  font-size:.95rem;transition:background var(--transition),transform var(--transition);
}
.hero__cta:hover,.hero__cta:focus{background:var(--brown);color:var(--white);transform:translateY(-2px)}

/* ── SECTIONS ────────────────────────── */
.section{padding:4rem 0}
.section--alt{background:var(--bg-alt)}
.section--brown{background:var(--brown-dark);color:var(--cream)}
.section--brown .section__title{color:var(--cream)}
.section--brown .section__tag{color:var(--gold)}
.section--brown a{color:var(--gold)}
.section__tag{
  font-size:.75rem;font-weight:600;text-transform:uppercase;
  letter-spacing:.16em;color:var(--gold);margin-bottom:.35rem;
}
.section__title{font-size:clamp(1.6rem,4vw,2.2rem);margin-bottom:.75rem}
.section__lead{font-size:1.05rem;color:var(--text-light);max-width:640px;margin-bottom:1.5rem}

/* Grain divider */
.grain-divider{
  display:flex;align-items:center;justify-content:center;gap:.5rem;
  margin:1.5rem 0;
}
.grain-divider::before,.grain-divider::after{
  content:'';flex:1;max-width:80px;height:1px;background:var(--gold);opacity:.4;
}
.grain-dot{width:8px;height:8px;background:var(--gold);border-radius:50%;opacity:.6}

/* ── PRODUCT CARDS ───────────────────── */
.products-strip{
  display:grid;grid-template-columns:1fr;gap:1.5rem;margin-top:1.5rem;
}
.product-tile{
  background:var(--white);border-radius:var(--radius);overflow:hidden;
  box-shadow:var(--shadow);transition:transform var(--transition),box-shadow var(--transition);
}
.product-tile:hover{transform:translateY(-4px);box-shadow:0 6px 24px rgba(93,64,55,.15)}
.product-tile__img .img-placeholder{border-radius:0;min-height:180px}
.product-tile__body{padding:1.25rem}
.product-tile__cat{
  font-size:.7rem;font-weight:600;text-transform:uppercase;
  letter-spacing:.12em;color:var(--gold);margin-bottom:.25rem;
}
.product-tile__name{font-family:var(--font-head);font-size:1.15rem;margin-bottom:.35rem;color:var(--brown-dark)}
.product-tile__desc{font-size:.9rem;color:var(--text-light);margin-bottom:.5rem}
.product-tile__price{font-size:1.1rem;font-weight:700;color:var(--gold)}
.product-tile__price small{font-weight:400;font-size:.8rem;color:var(--text-light)}
.product-tile__cta{
  display:inline-block;margin-top:.75rem;padding:.45rem 1rem;
  border:1.5px solid var(--gold);color:var(--gold);border-radius:var(--radius);
  font-size:.85rem;font-weight:600;transition:all var(--transition);
}
.product-tile__cta:hover{background:var(--gold);color:var(--white)}

/* ── PRICE TABLE (pizarra estilo comal) ── */
.comal-prices{
  background:var(--brown-dark);border-radius:var(--radius);padding:2rem;
  color:var(--cream);position:relative;overflow:hidden;
}
.comal-prices::before{
  content:'';position:absolute;inset:8px;border:1px solid rgba(212,160,23,.2);
  border-radius:4px;pointer-events:none;
}
.comal-prices__title{
  text-align:center;font-family:var(--font-head);font-size:1.3rem;
  color:var(--gold);margin-bottom:1.5rem;
}
.comal-prices__row{
  display:flex;justify-content:space-between;align-items:baseline;
  padding:.5rem 0;border-bottom:1px dotted rgba(245,230,202,.15);
}
.comal-prices__row:last-child{border-bottom:none}
.comal-prices__name{font-size:.95rem}
.comal-prices__val{font-weight:700;color:var(--gold);font-size:1rem;white-space:nowrap}
.comal-prices__note{text-align:center;margin-top:1.25rem;font-size:.8rem;opacity:.5}

/* ── SPLIT LAYOUT ────────────────────── */
.split{display:grid;grid-template-columns:1fr;gap:2rem;align-items:start}
.split--center{align-items:center}

/* ── FAQ ──────────────────────────────── */
.faq-item{border-bottom:1px solid rgba(93,64,55,.1);margin-bottom:0}
.faq-question{
  display:flex;align-items:center;justify-content:space-between;width:100%;
  padding:1rem 0;background:none;border:none;cursor:pointer;
  font-family:var(--font-body);font-size:1rem;font-weight:600;color:var(--brown-dark);
  text-align:left;
}
.faq-question::after{content:'+';font-size:1.4rem;color:var(--gold);transition:transform var(--transition)}
.faq-question[aria-expanded="true"]::after{content:'−'}
.faq-answer{max-height:0;overflow:hidden;transition:max-height .3s ease}
.faq-answer.open{max-height:600px}
.faq-answer p{padding:0 0 1rem;color:var(--text-light);font-size:.95rem}

/* ── BLOG CARDS ──────────────────────── */
.blog-grid{display:grid;grid-template-columns:1fr;gap:1.5rem}
.blog-card{background:var(--white);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow)}
.blog-card__img .img-placeholder{border-radius:0;min-height:180px}
.blog-card__body{padding:1.25rem}
.blog-card__date{font-size:.75rem;color:var(--text-light);text-transform:uppercase;letter-spacing:.08em}
.blog-card__title{font-family:var(--font-head);font-size:1.1rem;margin:.35rem 0 .5rem;color:var(--brown-dark)}
.blog-card__excerpt{font-size:.9rem;color:var(--text-light);margin-bottom:.75rem}
.blog-card__link{font-size:.85rem;font-weight:600;color:var(--gold)}

/* ── ARTICLE ─────────────────────────── */
.article{max-width:760px;margin:0 auto}
.article h1{font-size:clamp(1.6rem,4vw,2.4rem);margin-bottom:.5rem}
.article .article__meta{font-size:.85rem;color:var(--text-light);margin-bottom:1.5rem}
.article p{margin-bottom:1.25rem}
.article h2{font-size:1.4rem;margin:2rem 0 .75rem}
.article h3{font-size:1.15rem;margin:1.5rem 0 .5rem}
.article ul,.article ol{margin:0 0 1.25rem 1.5rem}
.article li{margin-bottom:.35rem}
.article a{color:var(--gold);font-weight:600}

/* ── GALLERY GRID ────────────────────── */
.gallery-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:1rem}
.gallery-item{border-radius:var(--radius);overflow:hidden;cursor:pointer;position:relative}
.gallery-item .img-placeholder{min-height:200px;transition:transform var(--transition)}
.gallery-item:hover .img-placeholder{transform:scale(1.03)}
.gallery-caption{
  position:absolute;bottom:0;left:0;right:0;padding:.6rem .8rem;
  background:linear-gradient(transparent,rgba(62,39,35,.7));
  color:var(--white);font-size:.8rem;
}

/* ── CONTACT FORM ────────────────────── */
.form-group{margin-bottom:1.25rem}
.form-group label{display:block;font-weight:600;font-size:.9rem;margin-bottom:.35rem;color:var(--brown-dark)}
.form-group input,.form-group textarea,.form-group select{
  width:100%;padding:.7rem .9rem;border:1.5px solid rgba(93,64,55,.2);
  border-radius:var(--radius);font-family:var(--font-body);font-size:.95rem;
  background:var(--white);color:var(--text);transition:border-color var(--transition);
}
.form-group input:focus,.form-group textarea:focus{outline:none;border-color:var(--gold)}
.form-group textarea{min-height:120px;resize:vertical}
.form-submit{
  display:inline-block;padding:.8rem 2rem;background:var(--gold);
  color:var(--white);border:none;border-radius:var(--radius);
  font-family:var(--font-body);font-size:1rem;font-weight:600;cursor:pointer;
  transition:background var(--transition),transform var(--transition);
}
.form-submit:hover{background:var(--brown);transform:translateY(-2px)}
.form-notice{font-size:.8rem;color:var(--text-light);margin-top:.75rem}
.form-notice a{color:var(--gold);font-weight:600}

/* ── FOOTER ──────────────────────────── */
.footer{background:var(--brown-dark);color:var(--cream);padding:3rem 0 0}
.footer__grid{
  display:grid;grid-template-columns:1fr;gap:2rem;
  padding-bottom:2rem;
}
.footer__heading{font-family:var(--font-head);font-size:1rem;color:var(--gold);margin-bottom:.75rem}
.footer a{color:var(--cream);transition:color var(--transition)}
.footer a:hover{color:var(--gold)}
.footer p{font-size:.9rem;line-height:1.7;margin-bottom:.25rem}
.footer__social{display:flex;gap:.75rem;margin-top:.75rem}
.footer__social a{display:flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:50%;background:rgba(212,160,23,.15);transition:background var(--transition)}
.footer__social a:hover{background:var(--gold)}
.footer__social svg{width:18px;height:18px;fill:var(--cream)}
.footer__bottom{
  border-top:1px solid rgba(245,230,202,.1);padding:1.25rem 0;
  display:flex;flex-direction:column;gap:.5rem;
  font-size:.8rem;opacity:.7;
}
.footer__legal{display:flex;flex-wrap:wrap;gap:1rem}
.footer__legal a{font-size:.8rem}

/* ── FLOATING BUTTONS ────────────────── */
.floating-btns{position:fixed;bottom:90px;right:16px;z-index:90;display:flex;flex-direction:column;gap:.75rem}
.floating-btn{
  display:flex;align-items:center;justify-content:center;
  width:52px;height:52px;border-radius:50%;color:var(--white);
  box-shadow:0 4px 16px rgba(0,0,0,.2);transition:transform var(--transition);
}
.floating-btn:hover{transform:scale(1.1);color:var(--white)}
.floating-btn--wa{background:#25D366}
.floating-btn--phone{background:var(--gold)}
.floating-btn svg{width:24px;height:24px;fill:currentColor}

/* ── CHATBOT ─────────────────────────── */
.chatbot-toggle{
  position:fixed;bottom:24px;right:16px;z-index:95;
  width:56px;height:56px;border-radius:50%;border:none;
  background:var(--brown);color:var(--white);font-size:1.5rem;
  cursor:pointer;box-shadow:0 4px 16px rgba(0,0,0,.2);
  transition:background var(--transition),transform var(--transition);
}
.chatbot-toggle:hover{background:var(--gold);transform:scale(1.08)}

.chatbot-panel{
  position:fixed;bottom:90px;right:16px;z-index:95;
  width:340px;max-width:calc(100vw - 32px);max-height:480px;
  background:var(--white);border-radius:12px;box-shadow:0 8px 40px rgba(0,0,0,.18);
  display:none;flex-direction:column;overflow:hidden;
}
.chatbot-panel.open{display:flex}

.chatbot-header{
  display:flex;align-items:center;justify-content:space-between;
  padding:.85rem 1rem;background:var(--brown-dark);color:var(--cream);
  font-weight:600;font-size:.95rem;
}
.chatbot-header button{background:none;border:none;color:var(--cream);font-size:1.2rem;cursor:pointer;padding:4px}

.chatbot-messages{
  flex:1;overflow-y:auto;padding:1rem;display:flex;flex-direction:column;gap:.6rem;
  min-height:200px;max-height:280px;
}
.chat-msg{padding:.6rem .9rem;border-radius:12px;font-size:.9rem;max-width:85%;line-height:1.5}
.chat-msg--bot{background:var(--bg-alt);color:var(--text);align-self:flex-start;border-bottom-left-radius:4px}
.chat-msg--user{background:var(--gold);color:var(--white);align-self:flex-end;border-bottom-right-radius:4px}
.chat-msg a{color:var(--brown);font-weight:600;text-decoration:underline}

.chatbot-quick{
  display:flex;flex-wrap:wrap;gap:.4rem;padding:.5rem 1rem;border-top:1px solid rgba(93,64,55,.08);
}
.chatbot-quick button{
  padding:.35rem .7rem;border:1.5px solid var(--gold);background:none;
  color:var(--gold);border-radius:20px;font-size:.8rem;font-weight:600;
  cursor:pointer;transition:all var(--transition);font-family:var(--font-body);
}
.chatbot-quick button:hover{background:var(--gold);color:var(--white)}

.chatbot-input{
  display:flex;gap:.5rem;padding:.6rem .8rem;border-top:1px solid rgba(93,64,55,.08);
}
.chatbot-input input{
  flex:1;padding:.5rem .7rem;border:1.5px solid rgba(93,64,55,.15);
  border-radius:20px;font-size:.9rem;font-family:var(--font-body);
  outline:none;
}
.chatbot-input input:focus{border-color:var(--gold)}
.chatbot-input button{
  padding:.5rem 1rem;background:var(--gold);color:var(--white);
  border:none;border-radius:20px;font-weight:600;font-size:.85rem;
  cursor:pointer;font-family:var(--font-body);transition:background var(--transition);
}
.chatbot-input button:hover{background:var(--brown)}

/* ── COOKIE BANNER ───────────────────── */
.cookie-banner{
  position:fixed;bottom:0;left:0;right:0;z-index:200;
  background:var(--brown-dark);color:var(--cream);
  padding:1rem 1.5rem;display:none;align-items:center;
  flex-wrap:wrap;gap:.75rem;font-size:.88rem;
}
.cookie-banner.show{display:flex}
.cookie-banner p{flex:1;min-width:200px}
.cookie-banner a{color:var(--gold);text-decoration:underline}
.cookie-btn{
  padding:.5rem 1.2rem;border:none;border-radius:var(--radius);
  font-weight:600;font-size:.85rem;cursor:pointer;font-family:var(--font-body);
  transition:background var(--transition);
}
.cookie-btn--accept{background:var(--gold);color:var(--white)}
.cookie-btn--accept:hover{background:#c49015}
.cookie-btn--reject{background:transparent;color:var(--cream);border:1.5px solid var(--cream)}
.cookie-btn--reject:hover{background:rgba(255,255,255,.1)}

/* ── SEARCH BAR (catálogo) ───────────── */
.search-bar{
  display:flex;gap:.5rem;margin-bottom:2rem;max-width:480px;
}
.search-bar input{
  flex:1;padding:.65rem 1rem;border:1.5px solid rgba(93,64,55,.2);
  border-radius:var(--radius);font-size:.95rem;font-family:var(--font-body);
}
.search-bar input:focus{outline:none;border-color:var(--gold)}
.search-bar button{
  padding:.65rem 1.2rem;background:var(--gold);color:var(--white);
  border:none;border-radius:var(--radius);font-weight:600;cursor:pointer;
  font-family:var(--font-body);
}

/* ── LEGAL PAGES ─────────────────────── */
.legal{max-width:760px;margin:0 auto}
.legal h1{font-size:clamp(1.5rem,3.5vw,2rem);margin-bottom:1rem}
.legal h2{font-size:1.2rem;margin:2rem 0 .5rem;color:var(--brown)}
.legal h3{font-size:1.05rem;margin:1.5rem 0 .5rem}
.legal p,.legal li{font-size:.95rem;margin-bottom:.75rem}
.legal ul,.legal ol{margin:0 0 1rem 1.5rem}
.legal a{color:var(--gold);font-weight:600}

/* ── 404 ─────────────────────────────── */
.page-404{
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  min-height:60vh;text-align:center;padding:2rem;
}
.page-404 h1{font-size:clamp(4rem,12vw,8rem);color:var(--gold);line-height:1;margin-bottom:.5rem}
.page-404 p{font-size:1.1rem;color:var(--text-light);margin-bottom:1.5rem;max-width:400px}

/* ── BREADCRUMB ──────────────────────── */
.breadcrumb{
  font-size:.8rem;color:var(--text-light);padding:1rem 0;
}
.breadcrumb a{color:var(--gold)}
.breadcrumb span{margin:0 .35rem;opacity:.5}

/* ── RESPONSIVE ──────────────────────── */

/* Tablet */
@media(min-width:640px){
  .products-strip{grid-template-columns:repeat(2,1fr)}
  .blog-grid{grid-template-columns:repeat(2,1fr)}
  .gallery-grid{grid-template-columns:repeat(3,1fr)}
  .split{grid-template-columns:1fr 1fr}
  .footer__grid{grid-template-columns:repeat(2,1fr)}
  .hero{grid-template-columns:1fr 1fr}
  .hero__content{padding:3rem 2rem}
}

/* Desktop */
@media(min-width:960px){
  .sidebar{display:flex}
  .mobile-bar{display:none}
  .hamburger{display:none}
  .main-content{margin-left:var(--sidebar-w);padding-top:0}
  .products-strip{grid-template-columns:repeat(3,1fr)}
  .gallery-grid{grid-template-columns:repeat(4,1fr)}
  .footer__grid{grid-template-columns:repeat(4,1fr)}
  .hero{grid-template-columns:1.1fr .9fr;min-height:80vh}
  .hero__content{padding:4rem 3rem}
  .floating-btns{bottom:100px;right:24px}
  .chatbot-toggle{bottom:28px;right:24px}
  .chatbot-panel{bottom:96px;right:24px}
  .container{padding:0 40px}
}

/* Large desktop */
@media(min-width:1280px){
  .hero__title{font-size:3.4rem}
  .products-strip{grid-template-columns:repeat(4,1fr)}
}

/* Reduced motion */
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}
  html{scroll-behavior:auto}
}
