/**
 * Doofinder layer skin: aligns the search overlay with the site design.
 *
 * The layer renders in the page DOM (no iframe, no shadow root), so theme
 * CSS reaches it. Defensive skin: visual only (surfaces, radius, hover,
 * brand color), no layout re-architecture, so a Doofinder update that
 * renames internals degrades back to the stock look at worst.
 */

/* --- Surface: tinted canvas so the white cards and the aside read as
   panels instead of everything floating on the same white. */
.dfd-root .dfd-layer {
  background: #f4f7fc;
}

/* --- Facet sidebar: its own panel. */
.dfd-root .dfd-aside {
  background: #fff;
  border: 1px solid #e2e8f2;
  border-radius: 14px;
  padding: 20px 18px;
  height: fit-content;
}

.dfd-root .dfd-facet {
  border: 0;
}

.dfd-root input[type="checkbox"] {
  accent-color: #1551c1;
}

.dfd-root .dfd-btn-term-filter {
  border-radius: 8px;
  transition: background 0.12s ease-out;
}

.dfd-root .dfd-btn-term-filter:hover {
  background: #eef3fc;
}

/* --- Results count: eyebrow, same voice as the homepage sections. */
.dfd-root .dfd-meta {
  font-family: "Parkinsans", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #49505e;
}

/* --- Result cards. */
.dfd-root .dfd-results-grid {
  gap: 22px;
}

.dfd-root .dfd-card {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #e2e8f2;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 47, 133, 0.07);
  transition: transform 0.16s ease-out, box-shadow 0.16s ease-out;
}

.dfd-root .dfd-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(0, 47, 133, 0.16);
}

/* Image zoom on hover, clipped by the media box. */
.dfd-root .dfd-card-media,
.dfd-root .dfd-card-thumbnail {
  overflow: hidden;
}

.dfd-root .dfd-card-thumbnail img {
  transition: transform 0.25s ease-out;
}

.dfd-root .dfd-card:hover .dfd-card-thumbnail img {
  transform: scale(1.045);
}

/* Title block: consistent padding, brand hover. */
.dfd-root .dfd-card-content {
  padding: 14px 16px 16px;
}

.dfd-root .dfd-card-title,
.dfd-root .dfd-card [class*="title"] {
  font-weight: 600;
  font-size: 15.5px;
  line-height: 1.35;
  color: #16233f;
}

.dfd-root .dfd-card:hover .dfd-card-title,
.dfd-root .dfd-card:hover [class*="title"] {
  color: #1551c1;
}

/* "Risultati simili" chip on the thumbnails. */
.dfd-root .dfd-similar {
  border-radius: 8px;
}

/* --- "Hai bisogno di aiuto?" banner: same card language. */
.dfd-root [class*="banner"] a,
.dfd-root [class*="custom-slider"] a {
  border-radius: 10px;
  overflow: hidden;
}

/* --- Close button: a comfortable 44px target. */
.dfd-root [dfd-click="close-layer"],
.dfd-root .dfd-btn-close {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.12s ease-out;
}

.dfd-root [dfd-click="close-layer"]:hover,
.dfd-root .dfd-btn-close:hover {
  background: #eef3fc;
}

/* --- Scrollbar: slim, unobtrusive. */
.dfd-root ::-webkit-scrollbar {
  width: 8px;
}

.dfd-root ::-webkit-scrollbar-thumb {
  background: #c7d2e4;
  border-radius: 8px;
}

@media (prefers-reduced-motion: reduce) {
  .dfd-root .dfd-card,
  .dfd-root .dfd-card-thumbnail img {
    transition: none;
  }

  .dfd-root .dfd-card:hover {
    transform: none;
  }

  .dfd-root .dfd-card:hover .dfd-card-thumbnail img {
    transform: none;
  }
}

/* iOS Safari auto-zooms when a focused input has font-size < 16px. The
   Doofinder searchbox input is 15px, so opening the layer (which focuses it,
   including from the fabric chips) zoomed the whole page. Force 16px on
   mobile to stop the zoom; desktop keeps the skin size. */
@media (max-width: 1199.98px) {
  .dfd-searchbox-input,
  #site-search {
    font-size: 16px !important;
  }
}
