/* =========================================================
   GLIFO EDIZIONI — user.css
   Design token + shell del sito (header, nav, banner, footer)
   Gli stili specifici di prodotto/carrello/checkout vivono in
   file separati caricati solo nelle relative viste HikaShop
   (product.css, cart.css, checkout.css) per tenere questo
   foglio leggero su tutte le pagine.
   ========================================================= */

:root {
  /* Palette di marca */
  --g-blu: #0083c7;
  --g-blu-dark: #005f91;
  --g-blu-light: #e6f4fc;
  --g-rust: #C04A1F;
  --g-rust-dark: #a03d18;

  /* Neutri */
  --g-ink: #1a1a1a;
  --g-ink-2: #2a2a2a;
  --g-mid: #555555;
  --g-text-secondary: #777777;
  --g-text-muted: #999999;

  /* Superfici */
  --g-bg: #ffffff;
  --g-card-bg: #f8f6f3;
  --g-menu-bg: #f0ede8;
  --g-border: #e0dbd4;

  /* Tipografia */
  --g-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --g-font-serif: Georgia, "Times New Roman", serif;

  /* Radius */
  --g-radius-sm: 4px;
  --g-radius-md: 6px;
  --g-radius-lg: 8px;
  --g-radius-xl: 12px;
}

* { box-sizing: border-box; }

body.site-glifo {
  margin: 0;
  font-family: var(--g-font);
  font-size: 14px;
  color: var(--g-ink);
  background: var(--g-bg);
}

.glifo-wrapper { display: flex; flex-direction: column; min-height: 100vh; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* =========================================================
   TOPBAR
   ========================================================= */
.topbar {
  background: #fff;
  border-bottom: 0.5px solid var(--g-border);
  padding: 0 0 0 28px;
  height: 56px;
  display: flex;
  align-items: center;
}

.topbar-logo { flex-shrink: 0; display: flex; align-items: center; }
.topbar-logo img { height: 40px; width: auto; }

.mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  margin-left: auto;
  margin-right: 8px;
  background: none;
  border: none;
  cursor: pointer;
}
.mobile-toggle span { display: block; height: 2px; background: var(--g-ink); border-radius: 1px; }

.topbar-right { display: flex; align-items: center; height: 100%; margin-left: auto; }

.search-zone {
  height: 100%;
  display: flex;
  align-items: center;
  border-left: 0.5px solid var(--g-border);
  padding: 0 12px;
}
.search-field {
  display: flex; align-items: center; gap: 8px;
  height: 36px; width: 200px;
  background: var(--g-card-bg);
  border: 0.5px solid var(--g-border);
  border-radius: var(--g-radius-md);
  padding: 0 12px;
}
.search-field i { font-size: 17px; color: #999; flex-shrink: 0; }
.search-field input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 13px; color: var(--g-ink); font-family: inherit; min-width: 0;
}
.search-field input::placeholder { color: #aaa; }

.tu {
  display: flex; align-items: center; gap: 6px;
  padding: 0 13px; height: 100%;
  font-size: 12px; color: #777;
  cursor: pointer;
  border-left: 0.5px solid var(--g-border);
  background: #fff;
  white-space: nowrap;
  flex-shrink: 0;
}
.tu i { font-size: 19px; }
.tu:hover { color: var(--g-ink); }
.tu.cart { background: var(--g-rust); color: #fff; font-weight: 500; }
.tu.cart:hover { background: var(--g-rust-dark); }
.cart-badge {
  background: #fff; color: var(--g-rust);
  border-radius: 50%; width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}

/* =========================================================
   NAVBAR (menu principale)
   ========================================================= */
.navbar {
  background: var(--g-menu-bg);
  padding: 0 28px;
  display: flex;
  align-items: stretch;
  justify-content: center;
}
.navbar ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: stretch; justify-content: center;
  flex-wrap: wrap;
}
.navbar li { display: flex; }
.navbar a {
  font-size: 13px; font-weight: 700; color: var(--g-mid);
  padding: 12px 17px;
  display: flex; align-items: center;
  border-bottom: 2px solid transparent;
}
.navbar a:hover { color: var(--g-ink); }
.navbar li.active > a,
.navbar li.current > a {
  color: var(--g-ink);
  border-bottom-color: var(--g-rust);
}

/* --- Dropdown sottomenu (es. Shop con voci figlie) --- */
.navbar li { position: relative; }

.navbar li > ul {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: #fff;
  border: 0.5px solid var(--g-border);
  border-radius: 0 0 var(--g-radius-md) var(--g-radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  z-index: 50;
  display: none;
  flex-direction: column;
}

.navbar li > ul a {
  padding: 9px 16px;
  border-bottom: none;
  font-weight: 500;
  color: var(--g-mid);
  white-space: nowrap;
}
.navbar li:has(> ul) > a { cursor: pointer; }
.navbar li > ul a:hover { color: var(--g-rust); background: var(--g-card-bg); }

/* desktop: apertura al passaggio del mouse o focus tastiera */
@media (min-width: 769px) {
  .navbar li:hover > ul,
  .navbar li:focus-within > ul,
  .navbar li.dropdown-open > ul {
    display: flex;
  }

  /* piccola freccina per segnalare che la voce ha sottomenu */
  .navbar li:has(> ul) > a::after {
    content: '';
    display: inline-block;
    width: 6px; height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    margin-left: 6px;
    margin-bottom: 2px;
    opacity: 0.6;
  }
}

/* =========================================================
   BANNER HERO
   ========================================================= */
.banner-box {
  background: var(--g-blu);
  color: #fff;
  overflow: hidden;
}
.banner-box .banner-text { padding: 24px 28px; max-width: 600px; }
.banner-box .banner-eyebrow {
  font-size: 10px; letter-spacing: 2.5px; text-transform: uppercase;
  color: rgba(255,255,255,0.7); margin-bottom: 8px;
}
.banner-box .banner-title { font-size: 21px; font-weight: 500; line-height: 1.2; margin-bottom: 7px; }
.banner-box .banner-title em { font-style: italic; color: #b8dff5; }
.banner-box .banner-sub { font-size: 12px; color: rgba(255,255,255,0.85); line-height: 1.5; margin-bottom: 16px; }
.banner-box .banner-cta {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; color: var(--g-blu);
  font-size: 12px; font-weight: 500;
  padding: 8px 17px; border-radius: var(--g-radius-md); border: none; cursor: pointer;
}

/* =========================================================
   BODY / HOME BLOCKS
   ========================================================= */
.main-body { flex: 1; }
.home-blocks { padding: 20px 28px; display: flex; flex-direction: column; gap: 16px; }

.slider-block { border: 0.5px solid var(--g-border); border-radius: var(--g-radius-lg); overflow: hidden; }
.tabs { display: flex; background: #fff; border-bottom: 0.5px solid var(--g-border); }
.tab {
  flex: 1; padding: 12px 0;
  font-size: 13px; font-weight: 700; text-align: center;
  cursor: pointer; color: var(--g-mid);
  border: none; border-right: 0.5px solid var(--g-border);
  background: #fff;
  border-bottom: 2px solid transparent;
}
.tab:last-child { border-right: none; }
.tab:hover { color: var(--g-ink); }
.tab.active { color: var(--g-ink); border-bottom-color: var(--g-rust); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.two-col-modules { display: grid; grid-template-columns: 7fr 5fr; gap: 16px; }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--g-rust); color: #fff;
  border: none; border-radius: var(--g-radius-md);
  font-size: 13px; font-weight: 600;
  padding: 11px 20px; cursor: pointer;
}
.btn-primary:hover { background: var(--g-rust-dark); }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer { background: var(--g-menu-bg); border-top: 0.5px solid var(--g-border); margin-top: auto; }
.footer-grid {
  padding: 24px 28px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}

/* =========================================================
   ERROR PAGE
   ========================================================= */
.error-wrap { max-width: 480px; margin: 80px auto; text-align: center; padding: 0 24px; }
.error-code { font-size: 64px; font-weight: 700; color: var(--g-border); }
.error-title { font-size: 20px; margin: 8px 0 12px; }
.error-message { color: var(--g-text-secondary); margin-bottom: 24px; }

/* =========================================================
   RESPONSIVE — sotto i 960px il menu collassa
   ========================================================= */
@media (max-width: 960px) {
  .two-col-modules { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .mobile-toggle { display: flex; }

  .search-zone { display: none; }

  .navbar { display: none; flex-direction: column; padding: 0; }
  .navbar.is-open { display: flex; }
  .navbar ul { flex-direction: column; width: 100%; }
  .navbar a { padding: 14px 20px; border-bottom: 0.5px solid var(--g-border); border-left: 3px solid transparent; }
  .navbar li.active > a { border-left-color: var(--g-rust); border-bottom-color: var(--g-border); }

  /* sottomenu mobile: niente posizionamento assoluto, si apre in linea */
  .navbar li > ul {
    position: static;
    display: none;
    border: none;
    box-shadow: none;
    border-radius: 0;
    background: var(--g-card-bg);
    padding: 0;
  }
  .navbar li.dropdown-open > ul { display: flex; }
  .navbar li > ul a { padding-left: 36px; border-bottom: 0.5px solid var(--g-border); }

  /* freccina sulla voce stessa, ruota quando il sottomenu è aperto */
  .navbar li:has(> ul) > a { justify-content: space-between; }
  .navbar li:has(> ul) > a::after {
    content: '';
    width: 7px; height: 7px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.15s ease;
    margin-left: 8px;
    flex-shrink: 0;
  }
  .navbar li.dropdown-open > a::after { transform: rotate(-135deg); }


  .topbar { padding-left: 16px; }
  .topbar-right .tu span:not(.cart-badge) { display: none; } /* nasconde testo extra nei pulsanti topbar su mobile */

  .footer-grid { grid-template-columns: 1fr; }
}
