/* ============================================================
   SuriHub Connector — Frontend CSS
   Usa CSS custom properties che ereditano dal tema attivo
   ============================================================ */

:root {
  --sh-brand:       #1a6b5e;
  --sh-brand-light: #e8f4f2;
  --sh-brand-dark:  #0f4a40;
  --sh-text:        #1a1a1a;
  --sh-muted:       #6b7280;
  --sh-border:      #e5e7eb;
  --sh-radius:      10px;
  --sh-shadow:      0 2px 12px rgba(0,0,0,.07);
}

/* ── Archivio ─────────────────────────────────────────────── */

.sh-archive { max-width: 1200px; margin: 0 auto; padding: 24px 16px 60px; }

/* Filtri */
.sh-filters-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--sh-border);
  border-radius: var(--sh-radius);
  padding: 14px 18px;
  margin-bottom: 28px;
  box-shadow: var(--sh-shadow);
}

.sh-filters-inner { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.sh-filter-select {
  border: 1.5px solid var(--sh-border);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: .875rem;
  background: #fff;
  cursor: pointer;
  outline: none;
  transition: border-color .2s;
}
.sh-filter-select:focus { border-color: var(--sh-brand); }

.sh-filter-reset {
  font-size: .8rem;
  color: var(--sh-muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  background: #f5f5f5;
  transition: background .15s;
}
.sh-filter-reset:hover { background: #ffe4e4; color: #dc2626; }

.sh-filters-count { font-size: .875rem; color: var(--sh-muted); white-space: nowrap; }

/* Griglia */
.sh-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
  margin-bottom: 40px;
}

/* Card */
.sh-card {
  background: #fff;
  border-radius: var(--sh-radius);
  box-shadow: var(--sh-shadow);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.sh-card:hover { transform: translateY(-3px); box-shadow: 0 6px 24px rgba(0,0,0,.11); }

.sh-card-link { display: block; text-decoration: none; color: inherit; }

.sh-card-img { position: relative; aspect-ratio: 4/3; overflow: hidden; background: #f0f0ee; }
.sh-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.sh-card:hover .sh-card-img img { transform: scale(1.03); }

.sh-card-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #ccc;
}

.sh-card-badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; }

.sh-card-body { padding: 16px; }
.sh-card-cat { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--sh-muted); margin-bottom: 5px; }
.sh-card-title { font-size: 1rem; font-weight: 700; line-height: 1.35; margin: 0 0 7px; color: var(--sh-text); }
.sh-card-loc { font-size: .82rem; color: var(--sh-muted); display: flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.sh-card-classe { display: inline-block; font-size: .72rem; background: var(--sh-brand-light); color: var(--sh-brand); border-radius: 4px; padding: 1px 7px; margin-bottom: 10px; }
.sh-card-footer { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--sh-border); }
.sh-card-prezzo { font-size: 1.15rem; font-weight: 800; color: var(--sh-brand); }
.sh-card-codice { font-size: .72rem; color: #bbb; }

/* Badge */
.sh-badge { display: inline-block; border-radius: 5px; padding: 2px 8px; font-size: .72rem; font-weight: 600; }
.sh-badge-contr { background: var(--sh-brand); color: #fff; }
.sh-badge-cat { background: #f3f4f6; color: #374151; }
.sh-badge-tratt { background: #fef3c7; color: #92400e; }

/* Vuoto */
.sh-empty { text-align: center; padding: 80px 20px; color: var(--sh-muted); }
.sh-empty-icon { font-size: 4rem; margin-bottom: 16px; opacity: .3; }
.sh-empty h2 { font-size: 1.3rem; font-weight: 700; color: var(--sh-text); margin-bottom: 8px; }

/* Paginazione */
.sh-pagination { display: flex; justify-content: center; gap: 8px; margin-top: 40px; flex-wrap: wrap; }
.sh-pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; border-radius: 8px;
  background: #fff; border: 1px solid var(--sh-border);
  text-decoration: none; color: var(--sh-text); font-size: .9rem;
  transition: background .15s;
}
.sh-pagination .page-numbers.current { background: var(--sh-brand); color: #fff; border-color: var(--sh-brand); }
.sh-pagination .page-numbers:hover:not(.current) { background: var(--sh-brand-light); }

/* ── Singolo ──────────────────────────────────────────────── */

.sh-single { padding: 0 0 60px; }
.sh-single-container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* Breadcrumb */
.sh-breadcrumb { font-size: .82rem; color: var(--sh-muted); padding: 16px 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sh-breadcrumb a { color: var(--sh-brand); text-decoration: none; }
.sh-breadcrumb a:hover { text-decoration: underline; }

/* Layout 2 colonne */
.sh-single-layout { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start; }

/* Gallery */
.sh-single-gallery { margin-bottom: 24px; }
.sh-gallery-main-wrap { position: relative; border-radius: var(--sh-radius); overflow: hidden; background: #000; }
.sh-gallery-main-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.sh-gallery-count { position: absolute; bottom: 12px; right: 12px; background: rgba(0,0,0,.55); color: #fff; border-radius: 20px; padding: 3px 10px; font-size: .78rem; }
.sh-gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.85); border: none; border-radius: 50%; width: 40px; height: 40px; font-size: 1.3rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s; }
.sh-gallery-prev { left: 12px; }
.sh-gallery-next { right: 12px; }
.sh-gallery-nav:hover { background: #fff; }
.sh-gallery-strip { display: flex; gap: 8px; padding: 8px 0 0; overflow-x: auto; }
.sh-strip-thumb { height: 68px; width: 100px; object-fit: cover; border-radius: 6px; cursor: pointer; opacity: .6; flex-shrink: 0; transition: opacity .2s; border: 2px solid transparent; }
.sh-strip-thumb.active, .sh-strip-thumb:hover { opacity: 1; border-color: var(--sh-brand); }

/* Intestazione singolo */
.sh-single-header { margin-bottom: 20px; }
.sh-single-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.sh-single-title { font-size: 1.6rem; font-weight: 800; line-height: 1.25; margin: 0 0 8px; color: var(--sh-text); }
.sh-single-loc { display: flex; align-items: center; gap: 5px; color: var(--sh-muted); font-size: .9rem; margin-bottom: 12px; }
.sh-single-prezzo { font-size: 2rem; font-weight: 800; color: var(--sh-brand); margin-bottom: 4px; }
.sh-single-codice { font-size: .78rem; color: #bbb; }

/* Card sezioni */
.sh-single-card { background: #fff; border-radius: var(--sh-radius); box-shadow: var(--sh-shadow); padding: 22px; margin-bottom: 20px; }
.sh-single-card-title { font-size: 1rem; font-weight: 700; color: var(--sh-text); margin: 0 0 16px; padding-bottom: 10px; border-bottom: 2px solid var(--sh-brand-light); }

/* Griglia dettagli */
.sh-details-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.sh-detail-item { background: #f9f9f7; border-radius: 8px; padding: 11px 13px; }
.sh-detail-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--sh-muted); margin-bottom: 3px; }
.sh-detail-val { font-size: .95rem; font-weight: 700; color: var(--sh-text); }

/* Descrizione */
.sh-single-desc { font-size: .95rem; line-height: 1.8; color: #444; white-space: pre-line; }

/* Planimetrie */
.sh-planimetrie { display: flex; gap: 12px; flex-wrap: wrap; }
.sh-planimetrie a img { height: 140px; border-radius: 8px; object-fit: cover; cursor: zoom-in; }

/* Sidebar */
.sh-single-sidebar { position: sticky; top: 80px; }
.sh-sidebar-card { background: #fff; border-radius: var(--sh-radius); box-shadow: var(--sh-shadow); padding: 22px; margin-bottom: 18px; }
.sh-sidebar-prezzo { font-size: 1.75rem; font-weight: 800; color: var(--sh-brand); margin-bottom: 4px; }
.sh-sidebar-codice { font-size: .78rem; color: #bbb; margin-bottom: 18px; }
.sh-sidebar-cta { display: flex; flex-direction: column; gap: 10px; }

/* Agente */
.sh-agente { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.sh-agente-foto { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.sh-agente-initials { width: 56px; height: 56px; border-radius: 50%; background: var(--sh-brand-light); color: var(--sh-brand); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; font-weight: 700; flex-shrink: 0; }
.sh-agente-nome { font-weight: 700; font-size: .95rem; margin-bottom: 2px; }
.sh-agente-ruolo { font-size: .78rem; color: var(--sh-muted); }
.sh-agente-contatti { display: flex; flex-direction: column; gap: 8px; }
.sh-agente-link { font-size: .85rem; color: var(--sh-brand); text-decoration: none; }
.sh-agente-link:hover { text-decoration: underline; }

/* Bottoni */
.sh-btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--sh-brand); color: #fff; border: none; border-radius: 8px;
  padding: 11px 20px; font-size: .9rem; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background .15s;
}
.sh-btn-primary:hover { background: var(--sh-brand-dark); color: #fff; }
.sh-btn-wa { background: #25D366; }
.sh-btn-wa:hover { background: #128C7E; }
.sh-btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--sh-brand-light); color: var(--sh-brand); border: 1.5px solid var(--sh-brand);
  border-radius: 8px; padding: 10px 18px; font-size: .88rem; font-weight: 600; text-decoration: none;
  cursor: pointer; transition: background .15s;
}
.sh-btn-secondary:hover { background: #d4ede9; }
.sh-btn-block { width: 100%; text-align: center; }

/* Form contatto */
.sh-contact-section { margin-top: 32px; }
.sh-contact-card { max-width: 640px; margin: 0 auto; background: #fff; border-radius: var(--sh-radius); box-shadow: var(--sh-shadow); padding: 28px; }
.sh-form { display: grid; gap: 14px; }
.sh-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sh-form label { display: block; font-size: .8rem; font-weight: 600; color: var(--sh-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .04em; }
.sh-form input, .sh-form textarea {
  width: 100%; border: 1.5px solid var(--sh-border); border-radius: 8px;
  padding: 10px 13px; font-size: .9rem; font-family: inherit; outline: none; transition: border-color .2s;
}
.sh-form input:focus, .sh-form textarea:focus { border-color: var(--sh-brand); }
.sh-form textarea { resize: vertical; min-height: 100px; }
.sh-form-submit {
  background: var(--sh-brand); color: #fff; border: none; border-radius: 8px;
  padding: 12px 24px; font-size: .95rem; font-weight: 600; cursor: pointer; width: 100%; transition: background .15s;
}
.sh-form-submit:hover { background: var(--sh-brand-dark); }
.sh-form-privacy { font-size: .72rem; color: var(--sh-muted); text-align: center; margin: 4px 0 0; }
.sh-form-success { background: #f0fdf4; color: #166534; border-radius: 8px; padding: 14px; font-weight: 600; text-align: center; }
.sh-form-error   { background: #fef2f2; color: #991b1b; border-radius: 8px; padding: 14px; }

/* Responsive */
@media (max-width: 768px) {
  .sh-single-layout { grid-template-columns: 1fr; }
  .sh-single-sidebar { position: static; }
  .sh-form-row { grid-template-columns: 1fr; }
  .sh-single-title { font-size: 1.3rem; }
  .sh-single-prezzo { font-size: 1.5rem; }
  .sh-sidebar-card:first-child { order: -1; }
}
