/*
 Theme Name:   Cestini Barbagia
 Theme URI:    https://cestini.dev-sun.xyz
 Description:  Tema custom per ecommerce cesti e prodotti tipici della Barbagia. Integrazione OpenAI per raccomandazioni.
 Author:       Cestini Barbagia
 Author URI:   https://cestini.dev-sun.xyz
 Version:      1.0.0
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 Text Domain: cestini-barbagia
*/

/* ==========================================================================
   Base & variabili
   ========================================================================== */
:root {
  --cb-color-primary: #2d5016;
  --cb-color-primary-light: #4a7c2a;
  --cb-color-accent: #c9a227;
  --cb-color-bg: #faf8f5;
  --cb-color-text: #2c2c2c;
  --cb-color-muted: #6b6b6b;
  --cb-font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --cb-font-serif: Georgia, "Times New Roman", serif;
  --cb-radius: 8px;
  --cb-shadow: 0 2px 12px rgba(0,0,0,.08);
  --cb-max-width: 1200px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--cb-font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--cb-color-text);
  background: var(--cb-color-bg);
}

a {
  color: var(--cb-color-primary);
  text-decoration: none;
}
a:hover {
  color: var(--cb-color-primary-light);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ==========================================================================
   Layout
   ========================================================================== */
.cb-wrap {
  max-width: var(--cb-max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.cb-section {
  padding: 2.5rem 0;
}

.cb-section--alt {
  background: #fff;
  box-shadow: var(--cb-shadow);
}

/* ==========================================================================
   Header
   ========================================================================== */
.cb-header {
  background: #fff;
  box-shadow: var(--cb-shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.cb-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 1rem;
}

.cb-logo {
  font-family: var(--cb-font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--cb-color-primary);
}
.cb-logo:hover {
  text-decoration: none;
  color: var(--cb-color-primary-light);
}

.cb-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.cb-nav a {
  color: var(--cb-color-text);
  font-weight: 500;
}
.cb-nav a:hover {
  color: var(--cb-color-primary);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.cb-footer {
  margin-top: 3rem;
  padding: 2rem 0;
  background: #fff;
  border-top: 1px solid #eee;
  color: var(--cb-color-muted);
  font-size: 0.9rem;
}

.cb-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

/* ==========================================================================
   Bottoni
   ========================================================================== */
.cb-btn {
  display: inline-block;
  padding: 0.65rem 1.25rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  border: none;
  border-radius: var(--cb-radius);
  cursor: pointer;
  transition: background .2s, color .2s;
}

.cb-btn--primary {
  background: var(--cb-color-primary);
  color: #fff;
}
.cb-btn--primary:hover {
  background: var(--cb-color-primary-light);
  color: #fff;
  text-decoration: none;
}

.cb-btn--outline {
  background: transparent;
  color: var(--cb-color-primary);
  border: 2px solid var(--cb-color-primary);
}
.cb-btn--outline:hover {
  background: var(--cb-color-primary);
  color: #fff;
  text-decoration: none;
}

/* ==========================================================================
   Hero / CTA
   ========================================================================== */
.cb-hero {
  text-align: center;
  padding: 3rem 1rem;
  background: linear-gradient(180deg, rgba(45,80,22,.06) 0%, transparent 100%);
}

.cb-hero__title {
  font-family: var(--cb-font-serif);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--cb-color-primary);
  margin: 0 0 .5rem;
}

.cb-hero__subtitle {
  font-size: 1.1rem;
  color: var(--cb-color-muted);
  margin: 0 0 1.5rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.cb-hero .cb-btn {
  margin: 0 .5rem .5rem 0;
}

/* ==========================================================================
   Griglia prodotti
   ========================================================================== */
.cb-prodotti-grid .cb-loading {
  color: var(--cb-color-muted);
  text-align: center;
  padding: 2rem;
}

.cb-prodotto-card a {
  color: inherit;
}
.cb-prodotto-card a:hover {
  text-decoration: none;
  color: var(--cb-color-primary);
}

/* ==========================================================================
   Wizard Trova il tuo cesto
   ========================================================================== */
.cb-wizard {
  max-width: 560px;
  margin: 0 auto;
}

.cb-wizard__step {
  background: #fff;
  padding: 1.5rem;
  border-radius: var(--cb-radius);
  box-shadow: var(--cb-shadow);
  margin-bottom: 1.5rem;
}

.cb-wizard__step h2 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  color: var(--cb-color-primary);
}

.cb-wizard label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.cb-wizard input[type="number"],
.cb-wizard select,
.cb-wizard textarea {
  width: 100%;
  padding: 0.6rem;
  font-family: inherit;
  font-size: 1rem;
  border: 1px solid #ddd;
  border-radius: var(--cb-radius);
  margin-bottom: 1rem;
}

.cb-wizard textarea {
  min-height: 80px;
  resize: vertical;
}

.cb-wizard .cb-btn {
  margin-top: 0.5rem;
}

.cb-wizard__options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.cb-wizard__options .cb-wizard-option {
  margin: 0;
}

.cb-cesto-result {
  margin-top: 2rem;
  padding: 1.5rem 0;
}

.cb-raccomandazione {
  background: #fff;
  padding: 1.5rem;
  border-radius: var(--cb-radius);
  box-shadow: var(--cb-shadow);
  margin-top: 1.5rem;
  white-space: pre-wrap;
  line-height: 1.7;
}

.cb-raccomandazione__loading {
  color: var(--cb-color-muted);
}

.cb-raccomandazione__error {
  color: #b32d2e;
}
