/*
Theme Name: Impasto Italian Bakery
Theme URI: https://impastoitalianbakery.com
Author: Impasto Italian Bakery
Description: Premium artisan Italian bakery theme. Elegant Playfair Display typography, rich brown and caramel palette. Includes front-page, products grid, about, contact templates. WooCommerce ready — no style overrides, uses WooCommerce defaults.
Version: 3.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
WC tested up to: 9.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: impasto
Tags: woocommerce, food, bakery, custom-logo, custom-menu, featured-images
*/

/* ═══════════════════════════════════════════════════════════
   VARIABLES
   ═══════════════════════════════════════════════════════════ */
:root {
  --br: #3B1F0E;
  --bm: #6B3A1F;
  --ca: #C8813A;
  --cr: #F5EFE4;
  --cl: #FBF8F3;
  --td: #2A1506;
  --tm: #5C3317;
  --bd: #E8DDD0;
  --fh: 'Playfair Display', Georgia, serif;
  --fb: 'Cormorant Garamond', Georgia, serif;
  --fu: 'Montserrat', Arial, sans-serif;
}

/* ═══════════════════════════════════════════════════════════
   RESET
   ═══════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--fu); background: #fff; color: var(--td); -webkit-font-smoothing: antialiased; }
img  { max-width: 100%; height: auto; display: block; }
a    { text-decoration: none; color: inherit; transition: color .3s; }
ul   { list-style: none; }
h1, h2, h3, h4 { font-family: var(--fh); color: var(--br); line-height: 1.15; }
h1 { font-size: clamp(32px, 5vw, 72px); }
h2 { font-size: clamp(26px, 3.5vw, 48px); }
h3 { font-size: clamp(16px, 2.2vw, 24px); }
p  { font-family: var(--fb); font-size: 18px; line-height: 1.8; color: var(--tm); }

/* ═══════════════════════════════════════════════════════════
   LAYOUT UTILITIES
   ═══════════════════════════════════════════════════════════ */
.container  { max-width: 1280px; margin: 0 auto; padding: 0 60px; }
.section    { padding: 88px 0; }
.sec-dark   { background: var(--br); }
.sec-sand   { background: var(--cr); }
.sec-cream  { background: var(--cl); }
.label-tag  { display: block; font-size: 10px; font-weight: 600; letter-spacing: .35em; text-transform: uppercase; color: var(--ca); margin-bottom: 14px; }
.grid-2     { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; }
.sec-header { text-align: center; margin-bottom: 56px; }
.sec-header h2 { margin-top: 8px; }
.sec-header > p { font-family: var(--fb); font-size: 18px; color: var(--tm); max-width: 520px; margin: 14px auto 0; line-height: 1.7; }

/* ═══════════════════════════════════════════════════════════
   BUTTONS  (solo tema — NON sovrascrivono WooCommerce)
   ═══════════════════════════════════════════════════════════ */
.btn {
  display: inline-block; padding: 13px 32px;
  font-family: var(--fu); font-size: 11px; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase;
  background: var(--ca); color: #fff; border: 1.5px solid var(--ca);
  cursor: pointer; transition: background .3s, transform .2s;
}
.btn:hover    { background: var(--bm); border-color: var(--bm); transform: translateY(-2px); color: #fff; }
.btn-outline  { background: transparent; color: var(--ca); border-color: var(--ca); }
.btn-outline:hover { background: var(--ca); color: #fff; }
.btn-ghost    { background: transparent; color: rgba(245,239,228,.9); border: 1.5px solid rgba(245,239,228,.45); }
.btn-ghost:hover  { background: var(--ca); border-color: var(--ca); color: #fff; }
.btn-light    { background: #fff; border-color: #fff; color: var(--br); }
.btn-light:hover  { background: var(--ca); border-color: var(--ca); color: #fff; }

/* ═══════════════════════════════════════════════════════════
   TOPBAR
   ═══════════════════════════════════════════════════════════ */
.topbar {
  background: var(--br); padding: 9px 60px;
  display: flex; justify-content: flex-end; gap: 32px;
}
.topbar a { font-size: 11px; letter-spacing: .08em; color: rgba(245,239,228,.85); }
.topbar a:hover { color: var(--ca); }

/* ═══════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════ */
#masthead {
  background: #fff;
  position: sticky; top: 0; z-index: 1000;
  box-shadow: 0 2px 20px rgba(59,31,14,.1);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 52px; height: 90px;
  max-width: 1400px; margin: 0 auto; position: relative;
}
.site-branding a { display: flex; align-items: center; }
.custom-logo, .site-logo-fallback { height: 72px; width: auto; }

/* ═══════════════════════════════════════════════════════════
   NAVIGATION — DESKTOP
   ═══════════════════════════════════════════════════════════ */
.primary-nav { display: flex; align-items: center; }
.primary-nav .menu { display: flex; gap: 26px; align-items: center; }
.primary-nav .menu > li { position: relative; }
.primary-nav .menu > li > a {
  font-family: var(--fu); font-size: 11px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--tm); padding-bottom: 2px;
  position: relative; transition: color .3s; white-space: nowrap;
}
.primary-nav .menu > li > a::after {
  content: ''; position: absolute; bottom: 0; left: 0;
  width: 0; height: 1.5px; background: var(--ca); transition: width .3s;
}
.primary-nav .menu > li > a:hover,
.primary-nav .menu > li.current-menu-item > a,
.primary-nav .menu > li.current-menu-parent > a,
.primary-nav .menu > li.current-menu-ancestor > a { color: var(--ca); }
.primary-nav .menu > li > a:hover::after,
.primary-nav .menu > li.current-menu-item > a::after,
.primary-nav .menu > li.current-menu-parent > a::after,
.primary-nav .menu > li.current-menu-ancestor > a::after { width: 100%; }

/* ═══════════════════════════════════════════════════════════
   MOBILE BURGER
   ═══════════════════════════════════════════════════════════ */
.menu-toggle {
  display: none; flex-direction: column; gap: 5px;
  padding: 6px; background: none; border: none; cursor: pointer;
}
.menu-toggle span { display: block; width: 24px; height: 2px; background: var(--br); transition: .3s; }

#mobile-nav {
  display: none; position: absolute; top: 90px; left: 0; right: 0;
  background: #fff; border-top: 1px solid var(--bd);
  box-shadow: 0 8px 24px rgba(59,31,14,.1);
  z-index: 999; padding: 16px 24px; flex-direction: column;
}
#mobile-nav.open { display: flex; }
#mobile-nav a {
  font-family: var(--fu); font-size: 11px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--tm); padding: 12px 0; border-bottom: 1px solid var(--bd); display: block;
}
#mobile-nav a:hover { color: var(--ca); }
.mobile-cat-label {
  font-size: 10px; font-weight: 600; letter-spacing: .3em;
  color: var(--ca); padding: 14px 0 4px; display: block;
}
.mobile-sub a { padding-left: 16px !important; }

/* ═══════════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════════ */
.hero-section {
  position: relative; height: 92vh; min-height: 560px;
  overflow: hidden; display: flex; align-items: center;
}
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .65; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(105deg, rgba(59,31,14,.88) 36%, rgba(59,31,14,.05) 100%); }
.hero-content { position: relative; padding: 0 80px; max-width: 680px; }
.hero-tagline { font-size: 11px; font-weight: 600; letter-spacing: .35em; text-transform: uppercase; color: var(--ca); margin-bottom: 18px; }
.hero-title { font-family: var(--fh); font-size: clamp(52px,7vw,96px); color: #fff; line-height: .95; margin-bottom: 22px; }
.hero-title em { font-style: italic; color: var(--ca); }
.hero-desc { font-family: var(--fb); font-size: 20px; color: rgba(245,239,228,.9); max-width: 460px; line-height: 1.75; margin-bottom: 36px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

/* ═══════════════════════════════════════════════════════════
   FRAMED IMAGE & PRO LIST (home sections)
   ═══════════════════════════════════════════════════════════ */
.framed-img { position: relative; }
.framed-img img { width: 100%; height: 500px; object-fit: cover; }
.framed-img::before {
  content: ''; position: absolute; top: -14px; right: -14px;
  width: 100%; height: 100%; border: 2px solid var(--ca); z-index: -1;
}
.pro-list { margin: 16px 0 28px; }
.pro-list li {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--fu); font-size: 13px; color: var(--tm);
  padding: 9px 0; border-bottom: 1px solid var(--bd);
}
.pro-list li::before { content: '—'; color: var(--ca); font-weight: 700; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════
   CATEGORY GRID  (homepage + products page)
   ═══════════════════════════════════════════════════════════ */
.cat-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.cat-card {
  position: relative; overflow: hidden;
  background: var(--br); aspect-ratio: 4/3;
  display: block; text-decoration: none;
}
.cat-card img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s, opacity .4s; opacity: .78;
}
.cat-card:hover img { transform: scale(1.06); opacity: .55; }
.cat-card-info {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 22px 20px;
  background: linear-gradient(to top, rgba(59,31,14,.95), transparent);
}
.cat-card-info h3 { color: #fff; font-size: 21px; margin-bottom: 4px; }
.cat-card-info span { font-family: var(--fu); font-size: 11px; color: rgba(245,239,228,.7); }

/* ═══════════════════════════════════════════════════════════
   CATEGORY BANNER  (archive pages — banner only, no product grid override)
   ═══════════════════════════════════════════════════════════ */
.cat-banner {
  position: relative; min-height: 220px;
  background: var(--br); display: flex; align-items: center; overflow: hidden;
  padding: 60px 0;
}
.cat-banner-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .4; }
.cat-banner-content { position: relative; padding: 0 80px; }
.cat-banner-content h1 { color: #fff; font-size: clamp(28px,4vw,58px); }
.cat-banner-desc { color: rgba(245,239,228,.8); font-size: 17px; margin-top: 10px; font-family: var(--fb); max-width: 560px; }
.woocommerce-breadcrumb {
  font-family: var(--fu); font-size: 11px; letter-spacing: .1em;
  color: rgba(245,239,228,.6); margin-bottom: 10px;
}
.woocommerce-breadcrumb a { color: var(--ca); }
.woocommerce-breadcrumb a:hover { text-decoration: underline; }

/* WooCommerce main content area padding */
.woo-content-wrap { padding: 60px 0; }
.woo-content-wrap .container { max-width: 1280px; margin: 0 auto; padding: 0 60px; }

/* ═══════════════════════════════════════════════════════════
   ABOUT — VALUES & VISION GRID
   ═══════════════════════════════════════════════════════════ */
.val-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 26px; margin-top: 50px; }
.val-card { padding: 34px 28px; background: #fff; border: 1px solid var(--bd); transition: box-shadow .3s, transform .3s; }
.val-card:hover { box-shadow: 0 8px 32px rgba(59,31,14,.1); transform: translateY(-4px); }
.val-icon { width: 46px; height: 46px; background: var(--ca); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.val-icon svg { width: 22px; height: 22px; fill: #fff; }
.val-card p { font-size: 16px; }
.vis-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.vis-grid img { width: 100%; height: 250px; object-fit: cover; }

/* ═══════════════════════════════════════════════════════════
   CONTACT PAGE
   ═══════════════════════════════════════════════════════════ */
.contact-layout { display: grid; grid-template-columns: 1fr 1.4fr; gap: 80px; align-items: start; }
.contact-box { background: var(--cl); padding: 40px; border: 1px solid var(--bd); }
.c-item { display: flex; gap: 16px; margin-bottom: 22px; align-items: flex-start; }
.c-icon { width: 44px; height: 44px; background: var(--ca); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.c-icon svg { width: 20px; height: 20px; fill: #fff; }
.c-text strong { display: block; font-family: var(--fu); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--td); margin-bottom: 4px; }
.c-text a, .c-text span { font-family: var(--fb); font-size: 17px; color: var(--tm); }
.c-text a:hover { color: var(--ca); }

/* Contact Form 7 / fallback form */
.contact-form-wrap input[type="text"],
.contact-form-wrap input[type="email"],
.contact-form-wrap input[type="tel"],
.contact-form-wrap select,
.contact-form-wrap textarea,
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 select,
.wpcf7 textarea {
  width: 100%; padding: 13px 15px;
  border: 1px solid var(--bd);
  font-family: var(--fb); font-size: 17px; color: var(--td);
  background: #fff; outline: none;
  transition: border-color .2s;
  -webkit-appearance: none; appearance: none;
}
.contact-form-wrap input:focus,
.contact-form-wrap textarea:focus,
.wpcf7 input:focus,
.wpcf7 textarea:focus { border-color: var(--ca); }
.contact-form-wrap textarea,
.wpcf7 textarea { height: 130px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-family: var(--fu); font-size: 10px;
  font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
  color: var(--tm); margin-bottom: 7px;
}

/* ═══════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════ */
#colophon { background: var(--br); padding: 68px 0 28px; }
.footer-grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 56px; margin-bottom: 52px;
}
.footer-logo-wrap { display: inline-block; margin-bottom: 18px; }
.footer-logo {
  height: 62px; width: auto; display: block; opacity: .82;
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 50%, black 50%, transparent 100%);
  mask-image: radial-gradient(ellipse 90% 80% at 50% 50%, black 50%, transparent 100%);
  mix-blend-mode: screen; filter: brightness(1.3) contrast(0.95);
}
.footer-about p { font-size: 14px; color: rgba(245,239,228,.6); max-width: 280px; line-height: 1.75; font-family: var(--fu); }
.footer-col h4 { font-family: var(--fu); font-size: 10px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: var(--ca); margin-bottom: 20px; }
.footer-col li { margin-bottom: 9px; }
.footer-col li a { font-family: var(--fu); font-size: 13px; color: rgba(245,239,228,.6); transition: color .3s; }
.footer-col li a:hover { color: var(--ca); }
.footer-ci { display: flex; align-items: center; gap: 10px; font-family: var(--fu); font-size: 13px; color: rgba(245,239,228,.6); margin-bottom: 11px; }
.footer-ci svg { width: 14px; height: 14px; stroke: var(--ca); flex-shrink: 0; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.footer-ci a { color: rgba(245,239,228,.6); }
.footer-ci a:hover { color: var(--ca); }
.footer-bottom {
  border-top: 1px solid rgba(245,239,228,.1); padding-top: 26px;
  display: flex; justify-content: space-between;
  font-family: var(--fu); font-size: 11px; color: rgba(245,239,228,.3);
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — TABLET  (≤ 960px)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 960px) {
  .topbar   { display: none; }
  .header-inner { padding: 0 20px; height: 72px; }
  .custom-logo, .site-logo-fallback { height: 58px; }
  .container { padding: 0 20px; }
  .section   { padding: 56px 0; }
  .grid-2    { grid-template-columns: 1fr; gap: 32px; }
  .primary-nav { display: none; }
  .menu-toggle { display: flex; }
  #mobile-nav  { top: 72px; }
  .cat-grid  { grid-template-columns: 1fr 1fr; gap: 12px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .contact-layout, .val-grid { grid-template-columns: 1fr; }
  .hero-content { padding: 0 24px; max-width: 100%; }
  .cat-banner-content { padding: 0 24px; }
  .hero-section  { height: 80vh; min-height: 480px; }
  .framed-img::before { display: none; }
  .framed-img img { height: 340px; }
  .vis-grid img   { height: 160px; }
  .form-row { grid-template-columns: 1fr; }
  .woo-content-wrap .container { padding: 0 20px; }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE  (≤ 560px)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 560px) {
  .header-inner { padding: 0 16px; height: 64px; }
  .custom-logo, .site-logo-fallback { height: 50px; }
  .container  { padding: 0 16px; }
  .section    { padding: 40px 0; }
  .hero-section { height: 100svh; min-height: 420px; }
  .hero-content { padding: 0 18px; }
  .hero-title   { font-size: clamp(34px,11vw,56px); line-height: 1; }
  .hero-desc    { font-size: 16px; margin-bottom: 24px; }
  .hero-cta     { flex-direction: column; gap: 10px; }
  .hero-cta .btn { text-align: center; width: 100%; max-width: 320px; }
  .cat-banner-content { padding: 0 18px; }
  .cat-banner-content h1 { font-size: clamp(24px,8vw,40px); }
  .cat-banner   { padding: 40px 0; }
  .cat-grid     { grid-template-columns: 1fr; gap: 10px; }
  .cat-card     { aspect-ratio: 16/9; }
  .footer-grid  { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; gap: 6px; text-align: center; }
  .vis-grid     { grid-template-columns: 1fr; }
  .vis-grid img { height: 200px; }
  h2 { font-size: clamp(22px,7vw,40px); }
  p  { font-size: 16px; }
  .woo-content-wrap .container { padding: 0 16px; }
}
