/* =====================================================
   PONZIANE THEME  –  CSS principale
   ===================================================== */

/* --- Variabili & Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --dark:      #2c2c2c;
  --darker:    #1a1a1a;
  --accent:    #8B6D1F;
  --accent-h:  #a07d24;
  --light:     #f8f6f0;
  --white:     #ffffff;
  --border:    #ddd;
  --text:      #333;
  --muted:     #666;
  --link:      #8B6D1F;
  --sans:      'Open Sans', 'Helvetica Neue', Arial, sans-serif;
  --serif:     'Merriweather', Georgia, 'Times New Roman', serif;
  --max:       1200px;
  --hh:        76px;
}

html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--sans); color: var(--text); background: var(--white); line-height: 1.6; display: flex; flex-direction: column; min-height: 100vh; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--accent-h); text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* --- Top bar --- */
.top-bar { background: var(--darker); color: #aaa; font-size: 12px; padding: 5px 0; }
.top-bar .container { display: flex; justify-content: space-between; align-items: center; }
.top-bar a { color: #bbb; }
.top-bar a:hover { color: #fff; text-decoration: none; }

/* --- Header --- */
.site-header { background: var(--dark); position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--hh); max-width: var(--max); margin: 0 auto; padding: 0 20px; gap: 16px; }
.site-logo a { display: flex; align-items: center; gap: 10px; }
.site-logo img { height: 52px; width: auto; }
.logo-text { color: #fff; font-family: var(--serif); font-size: 20px; font-weight: 700; white-space: nowrap; }

/* --- Nav --- */
.main-nav ul { list-style: none; display: flex; }
.main-nav > ul > li { position: relative; }
.main-nav > ul > li > a { display: block; color: #e8e8e8; padding: 0 16px; height: var(--hh); line-height: var(--hh); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; transition: color .2s, background .2s; white-space: nowrap; }
.main-nav > ul > li > a:hover,
.main-nav > ul > li.active > a { color: var(--accent); background: rgba(255,255,255,.05); text-decoration: none; }

/* Dropdown – primo livello */
.main-nav ul ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--darker);
  min-width: 230px;
  box-shadow: 0 6px 16px rgba(0,0,0,.4);
  z-index: 200;
  flex-direction: column;
}
.main-nav ul li:hover > ul { display: flex; }
.main-nav ul ul li { position: relative; }
.main-nav ul ul li a {
  display: block;
  color: #ccc;
  padding: 10px 18px;
  font-size: 13px;
  white-space: nowrap;
  transition: color .2s, background .2s;
}
.main-nav ul ul li a:hover {
  color: var(--accent);
  background: rgba(255,255,255,.05);
  text-decoration: none;
}

/* Dropdown – secondo livello (flyout a destra) */
.main-nav ul ul ul {
  top: 0;
  left: 100%;
  box-shadow: 4px 4px 16px rgba(0,0,0,.4);
}
.main-nav ul ul li:hover > a::after {
  content: ' ›';
  float: right;
  color: var(--accent);
}

/* Search in header */
.header-search form { display: flex; }
.header-search input[type="text"] { padding: 6px 11px; border: 1px solid #555; background: #3a3a3a; color: #eee; border-radius: 3px 0 0 3px; font-size: 13px; width: 150px; outline: none; }
.header-search input::placeholder { color: #999; }
.header-search button { padding: 6px 11px; background: var(--accent); color: #fff; border: none; border-radius: 0 3px 3px 0; cursor: pointer; font-size: 13px; transition: background .2s; }
.header-search button:hover { background: var(--accent-h); }

/* Mobile toggle */
.nav-toggle { display: none; background: none; border: none; color: #eee; font-size: 26px; cursor: pointer; padding: 6px; line-height: 1; }

/* --- Container --- */
.container { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* --- Slider --- */
.hero-slider { position: relative; overflow: hidden; background: #111; max-height: 390px; }
.slider-track { display: flex; transition: transform .55s ease; }
.slide { min-width: 100%; position: relative; }
.slide img { width: 100%; max-height: 390px; object-fit: cover; opacity: .72; }
.slide-caption { position: absolute; bottom: 28px; left: 55px; color: #fff; text-shadow: 0 1px 5px rgba(0,0,0,.85); }
.slide-caption h2 { font-size: 28px; font-family: var(--serif); margin-bottom: 6px; }
.slide-caption p { font-size: 15px; margin-bottom: 12px; }
.btn-slide { display: inline-block; padding: 8px 20px; background: var(--accent); color: #fff !important; border-radius: 3px; font-size: 13px; font-weight: 700; transition: background .2s; }
.btn-slide:hover { background: var(--accent-h); text-decoration: none !important; }
.slider-arrow { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,.45); color: #fff; border: none; width: 38px; height: 38px; font-size: 22px; cursor: pointer; border-radius: 3px; z-index: 10; transition: background .2s; display: flex; align-items: center; justify-content: center; }
.slider-arrow:hover { background: rgba(0,0,0,.75); }
.slider-arrow.prev { left: 14px; }
.slider-arrow.next { right: 14px; }
.slider-dots { position: absolute; bottom: 10px; right: 18px; display: flex; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.45); cursor: pointer; transition: background .2s; }
.dot.active { background: #fff; }

/* --- Cat tiles (homepage) --- */
.cat-tiles { background: var(--light); padding: 24px 0; border-bottom: 1px solid var(--border); }
.cat-tiles-inner { display: flex; gap: 14px; flex-wrap: wrap; }
.cat-tile { flex: 1; min-width: 170px; display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: #fff; border: 1px solid var(--border); border-radius: 5px; color: var(--text) !important; transition: border-color .2s, box-shadow .2s; }
.cat-tile:hover { border-color: var(--accent); box-shadow: 0 2px 10px rgba(0,0,0,.09); text-decoration: none !important; }
.cat-tile-icon { font-size: 28px; flex-shrink: 0; }
.cat-tile-name { font-weight: 700; font-size: 14px; color: var(--dark); }
.cat-tile-count { font-size: 12px; color: var(--muted); }

/* --- Layout --- */
.page-main { padding: 28px 0 50px; flex: 1; }
.content-with-sidebar { display: flex; gap: 28px; align-items: flex-start; }
.main-content { flex: 1; min-width: 0; }
.sidebar { width: 240px; flex-shrink: 0; }

/* --- Titles --- */
.page-title { font-family: var(--serif); font-size: 24px; color: var(--dark); margin-bottom: 4px; padding-bottom: 10px; border-bottom: 2px solid var(--accent); }
.page-subtitle { color: var(--muted); font-size: 13px; margin-bottom: 22px; }

/* --- Notice bar --- */
.notice-bar { background: #fff8e1; border: 1px solid #ffe082; color: #8B6914; padding: 8px 14px; font-size: 13px; border-radius: 4px; margin-bottom: 18px; text-align: center; font-style: italic; }

/* --- Item Cards --- */
.items-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; margin-bottom: 28px; }
.item-card { border: 1px solid var(--border); border-radius: 5px; overflow: hidden; background: #fff; transition: box-shadow .2s, border-color .2s; display: flex; flex-direction: column; }
.item-card:hover { box-shadow: 0 4px 18px rgba(0,0,0,.1); border-color: #bbb; }
.item-card-img { height: 170px; background: #f0ede6; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.item-card-img img { width: 100%; height: 100%; object-fit: cover; }
.item-card-img-placeholder { font-size: 44px; color: #ccc; }
.item-card-body { padding: 13px 15px; flex: 1; }
.item-card-title { font-weight: 700; font-size: 14px; color: var(--dark); margin-bottom: 7px; line-height: 1.35; }
.item-card-title a { color: inherit; }
.item-card-title a:hover { color: var(--accent); text-decoration: none; }
.item-card-meta { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.item-card-meta strong { color: var(--text); }
.item-card-desc { font-size: 12px; color: var(--muted); margin-top: 7px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.5; }
.item-card-footer { padding: 9px 15px; border-top: 1px solid #f3f3f3; display: flex; align-items: center; justify-content: space-between; }
.item-card-badge { font-size: 11px; background: #f0ede6; color: #7a5c15; padding: 3px 8px; border-radius: 3px; }
.item-card-more { font-size: 12px; color: var(--accent); font-weight: 600; }
.item-card-more:hover { text-decoration: underline; }

/* --- Single item --- */
.item-single { max-width: 860px; }
.item-single-header { display: flex; gap: 28px; margin-bottom: 28px; align-items: flex-start; }
.item-cover-wrap { width: 190px; flex-shrink: 0; }
.item-cover-wrap img { width: 100%; border: 1px solid var(--border); border-radius: 4px; }
.item-no-cover { width: 190px; height: 250px; background: #f0ede6; display: flex; align-items: center; justify-content: center; font-size: 56px; color: #d0cab8; border-radius: 4px; flex-shrink: 0; }
.item-meta-box h1 { font-family: var(--serif); font-size: 20px; color: var(--dark); margin-bottom: 14px; line-height: 1.35; }
.meta-table { width: 100%; border-collapse: collapse; }
.meta-table tr td { padding: 7px 10px; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
.meta-table tr td:first-child { font-weight: 700; color: var(--dark); width: 120px; background: #fafaf8; white-space: nowrap; }
.item-description { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); }
.item-description h2 { font-family: var(--serif); font-size: 18px; margin-bottom: 12px; color: var(--dark); }
.item-description p { margin-bottom: 12px; line-height: 1.75; font-size: 15px; }
.back-link { display: inline-block; margin-top: 22px; color: var(--accent); font-size: 13px; }
.back-link:hover { text-decoration: underline; }

/* --- Sidebar --- */
.widget { background: #fafaf8; border: 1px solid var(--border); border-radius: 5px; margin-bottom: 18px; overflow: hidden; }
.widget-title { background: var(--dark); color: #fff; padding: 9px 15px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; }
.widget-body { padding: 12px 14px; }
.cat-list { list-style: none; }
.cat-list li { border-bottom: 1px solid #f0f0f0; }
.cat-list li:last-child { border-bottom: none; }
.cat-list a { display: flex; justify-content: space-between; align-items: center; padding: 7px 2px; font-size: 13px; color: var(--text); transition: color .2s; }
.cat-list a:hover { color: var(--accent); text-decoration: none; }
.cat-list .active > a { color: var(--accent); font-weight: 700; }
.cat-list .badge { font-size: 11px; background: #eee; padding: 2px 7px; border-radius: 3px; color: #888; }
.cat-sublist { list-style: none; margin: 4px 0 4px 14px; }
.cat-sublist li { border-bottom: 1px solid #f5f5f5; }
.cat-sublist a { font-size: 12px; padding: 5px 2px; display: flex; justify-content: space-between; color: var(--muted); }
.cat-sublist a:hover { color: var(--accent); text-decoration: none; }
.sidebar-search-form { display: flex; }
.sidebar-search-form input { flex: 1; padding: 7px 10px; border: 1px solid #ddd; border-right: none; border-radius: 3px 0 0 3px; font-size: 13px; outline: none; }
.sidebar-search-form button { padding: 7px 11px; background: var(--accent); color: #fff; border: none; border-radius: 0 3px 3px 0; cursor: pointer; font-size: 13px; transition: background .2s; }
.sidebar-search-form button:hover { background: var(--accent-h); }

/* --- Pagination --- */
.pagination { display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }
.pagination a, .pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 8px; border: 1px solid var(--border); border-radius: 3px; font-size: 13px; color: var(--text); transition: all .2s; }
.pagination a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pagination .active, .pagination span.current { background: var(--accent); color: #fff !important; border-color: var(--accent); }
.pagination .disabled { opacity: .4; pointer-events: none; }

/* --- Homepage sections --- */
.section-novita { padding: 36px 0; }
.section-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 22px; padding-bottom: 10px; border-bottom: 2px solid var(--accent); }
.section-header h2 { font-family: var(--serif); font-size: 22px; color: var(--dark); }
.section-more { font-size: 13px; font-weight: 700; color: var(--accent); }
.home-intro { background: var(--light); border-top: 1px solid var(--border); padding: 38px 0; }
.home-intro h2 { font-family: var(--serif); font-size: 21px; color: var(--dark); margin-bottom: 14px; }
.home-intro p { font-size: 15px; line-height: 1.8; color: var(--muted); max-width: 820px; margin-bottom: 12px; }

/* --- Default / About page --- */
.prose { max-width: 800px; }
.prose h1 { font-family: var(--serif); font-size: 26px; color: var(--dark); margin-bottom: 18px; padding-bottom: 10px; border-bottom: 2px solid var(--accent); }
.prose h2 { font-family: var(--serif); font-size: 20px; color: var(--dark); margin: 22px 0 10px; }
.prose p { font-size: 15px; line-height: 1.8; margin-bottom: 14px; }
.prose ul, .prose ol { margin: 0 0 14px 22px; font-size: 15px; line-height: 1.8; }
.prose a { color: var(--accent); }
.prose a:hover { text-decoration: underline; }

/* --- Search results --- */
.search-result-item { border-bottom: 1px solid var(--border); padding: 16px 0; }
.search-result-item:last-child { border-bottom: none; }
.search-result-item h3 { font-size: 16px; margin-bottom: 5px; }
.search-result-item h3 a { color: var(--dark); }
.search-result-item h3 a:hover { color: var(--accent); }
.search-result-item .excerpt { font-size: 13px; color: var(--muted); line-height: 1.6; }

/* --- Footer --- */
.site-footer { background: var(--darker); color: #aaa; padding: 28px 0 16px; margin-top: auto; }
.footer-grid { display: flex; gap: 36px; flex-wrap: wrap; margin-bottom: 18px; }
.footer-col h4 { color: #fff; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid #3a3a3a; }
.footer-col p, .footer-col address { font-size: 13px; line-height: 1.7; font-style: normal; }
.footer-col a { color: #999; }
.footer-col a:hover { color: #fff; text-decoration: none; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 4px; }
.footer-bottom { border-top: 1px solid #333; padding-top: 14px; font-size: 12px; color: #666; text-align: center; }
.footer-bottom a { color: #888; }
.footer-bottom a:hover { color: #ccc; }

/* ─── Responsive ─── */
@media (max-width: 920px) {
  .content-with-sidebar { flex-direction: column; align-items: stretch; }
  .sidebar { width: 100%; }
  .items-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .item-single-header { flex-direction: column; }
  .item-cover-wrap, .item-no-cover { width: 100%; max-width: 260px; }
}
@media (max-width: 700px) {
  .nav-toggle { display: block; }
  .main-nav { display: none; }
  .main-nav.open { display: block; position: absolute; top: var(--hh); left: 0; right: 0; background: var(--darker); z-index: 300; }
  .main-nav.open > ul { flex-direction: column; }
  .main-nav.open ul ul { position: static; display: block; box-shadow: none; background: #111; padding-left: 14px; }
  .header-search { display: none; }
  .cat-tiles-inner { flex-direction: column; }
  .footer-grid { flex-direction: column; gap: 20px; }
  .slide-caption { left: 18px; right: 18px; }
  .slide-caption h2 { font-size: 20px; }
}
@media (max-width: 480px) {
  .items-grid { grid-template-columns: 1fr; }
}

/* ══════════════ CARD CATALOGO – tiles quadrate ══════════════ */
.item-card-img {
  width: 100%;
  aspect-ratio: 1 / 1;   /* quadrato perfetto */
  height: auto;
  background: #f0ede6;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.item-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.item-card-img-placeholder { font-size: 44px; color: #ccc; }

/* Immagine card cliccabile – overlay link */
.item-card-img-link {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  position: relative;
}
.item-card-img-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}
.item-card-img-link:hover img { transform: scale(1.04); }

/* ══════════════ IMMAGINE PRODOTTO – singola scheda ══════════════ */
.item-cover-col { flex-shrink: 0; width: 260px; }
.item-cover-wrap {
  display: block; width: 100%;
  border: 1px solid var(--border); border-radius: 4px;
  overflow: hidden; cursor: zoom-in; text-decoration: none !important;
  transition: box-shadow .2s;
}
.item-cover-wrap:hover { box-shadow: 0 4px 18px rgba(0,0,0,.18); }
.item-cover-wrap img { width: 100%; height: auto; display: block; }
.zoom-hint {
  display: block; text-align: center; font-size: 11px; color: #999;
  padding: 5px 0 4px; background: #fafaf8; border-top: 1px solid #f0f0f0;
}
.item-no-cover {
  width: 260px; height: 320px; flex-shrink: 0;
  background: #f0ede6; display: flex; align-items: center;
  justify-content: center; font-size: 64px; color: #d0cab8; border-radius: 4px;
}

/* ══════════════ BREVE DESCRIZIONE ══════════════ */
.item-breve {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border);
  font-size: 14px; line-height: 1.75; color: var(--text);
}

/* ══════════════ GALLERIA ══════════════ */
.item-gallery { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); }
.gallery-title { font-family: var(--serif); font-size: 16px; color: var(--dark); margin-bottom: 12px; }
.gallery-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.gallery-thumb {
  display: block; border: 1px solid var(--border); border-radius: 3px;
  overflow: hidden; cursor: zoom-in; transition: border-color .2s, box-shadow .2s;
}
.gallery-thumb:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.gallery-thumb img { width: 120px; height: 120px; object-fit: cover; display: block; }

/* ══════════════ VIDEO EMBED RESPONSIVO ══════════════ */
.video-embed {
  position: relative; padding-bottom: 56.25%; height: 0;
  overflow: hidden; margin: 20px 0; background: #000; border-radius: 4px;
}
.video-embed iframe { position: absolute; top:0; left:0; width:100%; height:100%; border:0; }

/* ══════════════ BOTTONI MARKDOWN ══════════════ */
a.btn {
  display: inline-block; padding: 8px 20px; background: var(--accent);
  color: #fff !important; border-radius: 4px; font-size: 14px; font-weight: 600;
  transition: background .2s; text-decoration: none !important;
}
a.btn:hover { background: var(--accent-h); }
a.btn-outline {
  display: inline-block; padding: 7px 18px; border: 2px solid var(--accent);
  color: var(--accent) !important; border-radius: 4px; font-size: 14px; font-weight: 600;
  transition: all .2s; text-decoration: none !important;
}
a.btn-outline:hover { background: var(--accent); color: #fff !important; }

/* ══════════════ RESPONSIVE ══════════════ */
@media (max-width: 700px) {
  .item-cover-col, .item-no-cover { width: 100%; max-width: 280px; }
}

/* ══════════════ SORT BAR ══════════════ */
.sort-bar {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 18px; flex-wrap: wrap;
  padding: 10px 14px; background: #fafaf8;
  border: 1px solid var(--border); border-radius: 5px;
}
.sort-label { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.sort-sep   { color: var(--border); margin: 0 4px; }
.sort-btn {
  padding: 4px 11px; font-size: 12px; border: 1px solid var(--border);
  border-radius: 3px; background: #fff; color: var(--text);
  cursor: pointer; transition: all .2s; text-decoration: none !important;
  white-space: nowrap;
}
.sort-btn:hover  { border-color: var(--accent); color: var(--accent); }
.sort-btn.active { background: var(--accent); color: #fff !important; border-color: var(--accent); }

/* ══════════════ NAVIGAZIONE PREV / NEXT ══════════════ */
.item-sibling-nav {
  display: flex;
  gap: 16px;
  margin-top: 30px;
  padding-top: 24px;
  border-top: 2px solid var(--border);
}
.sibling-prev { flex: 1; }
.sibling-next { flex: 1; display: flex; justify-content: flex-end; }

.sibling-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #fafaf8;
  text-decoration: none !important;
  transition: border-color .2s, box-shadow .2s, background .2s;
  max-width: 320px;
  width: 100%;
}
.sibling-card:hover {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
  text-decoration: none !important;
}
.sibling-dir {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--accent);
}
.sibling-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sibling-inner-right {
  flex-direction: row-reverse;
}
.sibling-thumb {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 3px;
  overflow: hidden;
  background: #f0ede6;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sibling-thumb img {
  width: 52px;
  height: 52px;
  object-fit: cover;
}
.sibling-icon { font-size: 22px; color: #ccc; }
.sibling-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.sibling-info-right { text-align: right; }
.sibling-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sibling-meta {
  font-size: 11px;
  color: var(--muted);
}

@media (max-width: 600px) {
  .item-sibling-nav { flex-direction: column; }
  .sibling-next { justify-content: flex-start; }
  .sibling-card { max-width: 100%; }
}

/* ══════════════════════════════════════════════════
   OVERRIDES v10
   – Accento blu #193950
   – Header bianco
   – Slider gradiente sinistro
   ══════════════════════════════════════════════════ */

:root {
  --accent:  #193950;
  --accent-h: #1f4d6a;
  --link:    #193950;
}

/* ── Header bianco ── */
.site-header {
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.1);
}
.logo-text { color: var(--dark) !important; }
.site-logo img { /* invariato */ }

/* Top bar: tenuta scura per contrasto */
.top-bar { background: #193950; }
.top-bar a { color: #cde; }
.top-bar a:hover { color: #fff; }

/* Nav links su sfondo bianco */
.main-nav > ul > li > a {
  color: var(--dark);
  height: var(--hh);
  line-height: var(--hh);
}
.main-nav > ul > li > a:hover,
.main-nav > ul > li.active > a {
  color: var(--accent);
  background: rgba(25,57,80,.05);
}

/* Dropdown su sfondo bianco */
.main-nav ul ul {
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
}
.main-nav ul ul li a { color: var(--text); }
.main-nav ul ul li a:hover {
  color: var(--accent);
  background: rgba(25,57,80,.05);
}

/* Mobile nav su sfondo bianco */
.main-nav.open { background: #fff; border-top: 1px solid var(--border); }
.main-nav.open ul ul { background: #f5f5f5; }

/* Nav toggle (hamburger) su header bianco */
.nav-toggle { color: var(--dark); }

/* Search su header bianco */
.header-search input[type="text"] {
  background: #f0f2f4;
  border: 1px solid #ccc;
  color: var(--dark);
}
.header-search input::placeholder { color: #999; }

/* ── Slider: gradiente solo su sinistra, immagine piena ── */
.slide img {
  opacity: 1;   /* rimosse la patina globale */
}
.slide::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(0,0,0,0.78) 0%,
    rgba(0,0,0,0.55) 18%,
    rgba(0,0,0,0.18) 32%,
    transparent 50%
  );
  pointer-events: none;
}
/* La caption deve stare sopra il gradiente */
.slide-caption { z-index: 2; }

/* ══════════════ CATEGORY TILES CON IMMAGINE ══════════════ */
.cat-tiles { background: var(--light); padding: 28px 0; border-bottom: 1px solid var(--border); }
.cat-tiles-inner { display: flex; gap: 16px; flex-wrap: wrap; }

.cat-tile-card {
  flex: 1; min-width: 200px;
  display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: 6px;
  overflow: hidden; background: #fff;
  text-decoration: none !important; color: var(--text) !important;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.cat-tile-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  transform: translateY(-2px);
}
.cat-tile-img {
  height: 160px; background: #e8eef2;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.cat-tile-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.cat-tile-card:hover .cat-tile-img img { transform: scale(1.04); }
.cat-tile-icon-big { font-size: 52px; color: #b0c4d4; }
.cat-tile-info { padding: 14px 16px; border-top: 1px solid var(--border); }
.cat-tile-name { font-weight: 700; font-size: 15px; color: var(--dark); margin-bottom: 3px; }
.cat-tile-count { font-size: 12px; color: var(--muted); }

@media (max-width: 700px) {
  .cat-tiles-inner { flex-direction: column; }
  .cat-tile-card { min-width: 100%; }
}

/* ══ Cat tile: immagine quadrata 1:1 (come i prodotti) ══ */
.cat-tile-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  background: #dce6ed;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.cat-tile-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s;
}
.cat-tile-card:hover .cat-tile-img img { transform: scale(1.04); }
.cat-tile-icon-big { font-size: 52px; color: #8aafc2; }

/* search-meta */
.search-meta { display: none !important; }

/* home intro larghezza piena */
.home-intro p { max-width: 100%; }

/* layout */
body { background-color:#d4c5a0; background-image:url('../images/bg-map.jpg'); background-size:cover; background-attachment:fixed; background-position:center; background-repeat:no-repeat; display:block; min-height:100vh; }
.site-wrapper { max-width:var(--max); margin:0 auto; background:var(--white); box-shadow:0 0 80px rgba(0,0,0,.22); min-height:100vh; display:flex; flex-direction:column; position:relative; }
.page-main { flex:1; }

/* mobile search nascosta su desktop */
.mobile-search-wrap { display:none; }


/* ══════════════ SLIDER MOBILE – più alto, immagine panoramica ══════════════ */
@media (max-width: 700px) {

  /* Altezza fissa maggiore */
  .hero-slider {
    height: 280px;
    max-height: 280px;
  }

  /* Il singolo slide occupa tutta l'altezza */
  .slide {
    height: 280px;
    overflow: hidden;
  }

  /* Immagine più larga dello schermo, centrata, ritaglia in altezza */
  .slide img {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    height: 100%;
    min-width: 150%;   /* sporge ~25% per lato */
    max-width: none;
    max-height: none;
    object-fit: none;
    opacity: 1;
  }

  /* Gradiente: stessa proporzione desktop (copre sinistra ~50%) */
  /* Il ::after è già definito nel CSS principale – nessun override necessario */

  /* Caption sopra il gradiente */
  .slide-caption {
    position: absolute;
    z-index: 3;
    left: 20px;
    right: 50%;        /* rimane nella metà sinistra coperta dal gradiente */
    bottom: 20px;
  }
  .slide-caption h2 { font-size: 18px; }
  .slide-caption p  { font-size: 13px; }

  /* Frecce e dots sopra tutto */
  .slider-arrow { z-index: 4; }
  .slider-dots  { z-index: 4; }
}

/* ══════════════ GALLERY – carosello orizzontale ══════════════ */

.item-gallery {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.gallery-title {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--dark);
  margin-bottom: 10px;
}

/* Riga unica scrollabile */
.gallery-grid {
  display: flex;
  flex-wrap: nowrap;           /* forza riga singola */
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 8px;         /* spazio per scrollbar su desktop */
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  /* Scrollbar sottile */
  scrollbar-width: thin;
  scrollbar-color: var(--accent) #f0f0f0;
}
.gallery-grid::-webkit-scrollbar { height: 5px; }
.gallery-grid::-webkit-scrollbar-track { background: #f0f0f0; border-radius: 3px; }
.gallery-grid::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* Thumbnail: quadrate, dimensione fissa */
.gallery-thumb {
  flex-shrink: 0;              /* non si restringono */
  display: block;
  width: 100px;
  height: 100px;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  cursor: zoom-in;
  transition: border-color .2s, box-shadow .2s;
}
.gallery-thumb:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Scroll con rotella del mouse (aggiunto via JS) */
.gallery-grid.drag-scroll { cursor: grab; }
.gallery-grid.drag-scroll.dragging { cursor: grabbing; }

@media (max-width: 700px) {
  .gallery-thumb { width: 80px; height: 80px; }
}

/* ══ Gallery carousel – fix overflow mobile v2 ══ */
@media (max-width: 700px) {

  /* Rimuove il taglio brutale del wrapper che rendeva le immagini non cliccabili */
  .site-wrapper { overflow-x: visible; }

  /* Larghezza esplicita basata sul viewport (40px = padding container × 2).
     Così la galleria SA quanto è larga e scrolla internamente,
     senza espandere la pagina e senza tagliare nulla. */
  .item-single,
  .item-gallery { max-width: 100%; overflow: visible; }

  .gallery-grid {
    max-width: calc(100vw - 40px);
    width: calc(100vw - 40px);
    overflow-x: auto;
  }
}

/* ══ Immagine prodotto – 300px ══ */
.item-cover-col { width: 300px; }
.item-no-cover  { width: 300px; height: 375px; }

@media (max-width: 700px) {
  .item-cover-col, .item-no-cover { width: 100%; max-width: 300px; height: auto; }
}

/* ══ Immagine prodotto mobile – centrata e leggermente più grande ══ */
@media (max-width: 920px) {
  .item-cover-col {
    width: 100%;
    max-width: 100%;   /* era 300px, +40px */
    align-self: center; /* centra solo l'immagine, non la scheda metadati */
  }
  .item-no-cover {
    width: 100%;
    max-width: 340px;
    height: 400px;
    align-self: center;
  }
  .item-cover-wrap { width: 100%; }
  .item-cover-wrap img { width: 100%; }
}

/* ══ Form – box conferma invio ══ */
.form-ok-box {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  background: #d4edda;
  border: 2px solid #28a745;
  border-radius: 8px;
  padding: 22px 26px;
  margin-bottom: 28px;
  max-width: 560px;
}
.form-ok-icon {
  font-size: 32px;
  color: #28a745;
  line-height: 1;
  flex-shrink: 0;
}
.form-ok-title {
  font-size: 17px;
  font-weight: 700;
  color: #155724;
  margin: 0 0 4px;
}
.form-ok-text {
  font-size: 14px;
  color: #155724;
  margin: 0;
}

/* ══ Slider mobile – frecce nascoste (usa swipe touch) ══ */
@media (max-width: 700px) {
  .slider-arrow { display: none !important; }
}

/* ══ Form campi ══ */
.ponziane-form-wrap { max-width: 600px; }
.ponziane-form-wrap .form-field        { margin-bottom: 20px; }
.ponziane-form-wrap label              { display:block; font-size:13px; font-weight:700;
                                         color:var(--dark); margin-bottom:6px;
                                         text-transform:uppercase; letter-spacing:.4px; }
.ponziane-form-wrap input[type="text"],
.ponziane-form-wrap input[type="email"],
.ponziane-form-wrap select,
.ponziane-form-wrap textarea           { width:100%; padding:10px 14px;
                                         border:1px solid var(--border); border-radius:5px;
                                         font-size:14px; font-family:var(--sans);
                                         color:var(--text); background:#fafaf8;
                                         outline:none; box-sizing:border-box;
                                         transition:border-color .2s, box-shadow .2s; }
.ponziane-form-wrap input:focus,
.ponziane-form-wrap select:focus,
.ponziane-form-wrap textarea:focus     { border-color:var(--accent);
                                         box-shadow:0 0 0 3px rgba(25,57,80,.1);
                                         background:#fff; }
.ponziane-form-wrap input[type="submit"],
.ponziane-form-wrap button[type="submit"] {
  padding:12px 28px; background:var(--accent); color:#fff;
  border:none; border-radius:5px; font-size:15px; font-weight:700;
  cursor:pointer; line-height:1; transition:background .2s; }
.ponziane-form-wrap input[type="submit"]:hover,
.ponziane-form-wrap button[type="submit"]:hover { background:var(--accent-h); }

/* ══════════════ MOBILE NAV – sottomenu sempre visibili ══════════════ */
@media (max-width: 700px) {

  /* Pannello menu fisso, scrollabile */
  .main-nav.open {
    display: block;
    position: fixed;
    top: var(--hh);
    left: 0; right: 0; bottom: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border-top: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    z-index: 300;
  }

  /* Search bar in cima */
  .mobile-search-wrap {
    display: block;
    padding: 14px 16px;
    background: #f8f6f0;
    border-bottom: 2px solid var(--border);
  }
  .mobile-search-wrap form { display: flex; }
  .mobile-search-wrap input {
    flex: 1; padding: 9px 12px;
    border: 1px solid var(--border); border-right: none;
    border-radius: 4px 0 0 4px; font-size: 14px;
    background: #fff; outline: none; color: var(--dark);
  }
  .mobile-search-wrap input::placeholder { color: #aaa; }
  .mobile-search-wrap button {
    padding: 9px 14px; background: var(--accent); color: #fff;
    border: none; border-radius: 0 4px 4px 0; cursor: pointer; font-size: 14px;
  }

  /* Lista livelli */
  .main-nav.open > ul { flex-direction: column; padding-bottom: 30px; }
  .main-nav.open li { border-bottom: 1px solid var(--border); }

  /* Tutti i link */
  .main-nav.open li > a {
    display: block; height: auto; line-height: 1.4;
    color: var(--dark) !important; background: none !important;
  }
  .main-nav.open li > a:hover,
  .main-nav.open li.active > a { color: var(--accent) !important; }

  /* Tutti i sottomenu SEMPRE visibili */
  .main-nav.open ul ul { display: flex !important; }

  /* Primo livello */
  .main-nav.open > ul > li > a {
    padding: 14px 18px; font-size: 15px; font-weight: 700;
  }

  /* "Catalogo" e voci con figli: etichetta sezione, non navigabile */
  .main-nav.open > ul > li.has-children > a {
    color: var(--accent) !important;
    pointer-events: none;
    cursor: default;
  }

  /* Secondo livello (categorie): sfondo avorio */
  .main-nav.open > ul > li > ul { background: #f8f6f0; flex-direction: column; position: static; box-shadow: none; }
  .main-nav.open > ul > li > ul > li > a {
    padding: 11px 28px; font-size: 14px; font-weight: 600; color: var(--text) !important;
  }
  .main-nav.open > ul > li > ul > li > a:hover { color: var(--accent) !important; }

  /* Terzo livello (decenni): sfondo beige */
  .main-nav.open > ul > li > ul > li > ul { background: #f0ede6; flex-direction: column; position: static; box-shadow: none; }
  .main-nav.open > ul > li > ul > li > ul > li > a {
    padding: 9px 42px; font-size: 13px; color: var(--muted) !important;
  }
  .main-nav.open > ul > li > ul > li > ul > li > a:hover { color: var(--accent) !important; }

  /* Separatori */
  .main-nav.open > ul > li { border-bottom: 2px solid var(--border); }
  .main-nav.open > ul > li:last-child { border-bottom: none; }

  /* Nasconde search desktop e frecce slider */
  .header-search { display: none; }
  .mobile-search-wrap { display: block; }
  .slider-arrow { display: none !important; }
}

/* ══ MP3 PLAYER con copertina rotante ══ */
@keyframes mp3spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.mp3-player {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f8f6f0;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 18px 0;
  max-width: 560px;
  user-select: none;
}

/* Copertina rotante */
.mp3-cover {
  flex-shrink: 0;
  width: 64px; height: 64px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--accent);
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
  background: var(--dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  transition: box-shadow .3s;
}
.mp3-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.mp3-cover.spinning {
  animation: mp3spin 3s linear infinite;
  box-shadow: 0 0 0 4px rgba(25,57,80,.15), 0 4px 16px rgba(0,0,0,.2);
}

/* Controlli */
.mp3-controls { flex: 1; min-width: 0; }
.mp3-title {
  font-size: 13px; font-weight: 700; color: var(--dark);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 8px;
}
.mp3-row {
  display: flex; align-items: center; gap: 10px;
}
.mp3-play-btn {
  flex-shrink: 0;
  width: 34px; height: 34px;
  background: var(--accent); color: #fff;
  border: none; border-radius: 50%;
  font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, transform .1s;
}
.mp3-play-btn:hover  { background: var(--accent-h); }
.mp3-play-btn:active { transform: scale(.93); }
.mp3-progress-wrap {
  flex: 1; height: 5px;
  background: var(--border); border-radius: 3px;
  cursor: pointer; position: relative;
}
.mp3-progress-bar {
  height: 100%; width: 0%;
  background: var(--accent); border-radius: 3px;
  pointer-events: none; transition: width .1s linear;
}
.mp3-time { font-size: 11px; color: var(--muted); white-space: nowrap; }

@media (max-width: 500px) {
  .mp3-player  { padding: 12px 12px; gap: 10px; }
  .mp3-cover   { width: 52px; height: 52px; font-size: 22px; }
  .mp3-play-btn { width: 30px; height: 30px; font-size: 11px; }
}

/* ── Bottone download – classe dedicata - ex background: var(--accent) !important; ── */
a.btn-download {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 12px 28px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  height: auto !important;
  background: #18b81a !important;
  color: #fff !important;
  border-radius: 6px !important;
  text-decoration: none !important;
  gap: 8px !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.15) !important;
  transition: opacity .2s !important;
  cursor: pointer !important;
}
a.btn-download:hover {
  opacity: .85 !important;
  text-decoration: none !important;
}

/* ── intestazione pagine categorie ── */
.category-intro {
  margin-bottom: 24px;
  padding: 18px 20px;
  background: #f8f6f0;
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
}