/* =========================================================
   Royal Office — Homepage reference 8.0
   Replica layout homepage royaloffice.lenus.site
   ========================================================= */

body#index #wrapper,
body#index #content-wrapper,
body#index #main,
body#index #content,
body#index .page-home,
body#index .royal-home {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #fff !important;
}

body#index #wrapper > .container,
body#index #wrapper .container:not(.royal-home-shell) {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding-right: 0 !important;
  padding-left: 0 !important;
}

.royal-home {
  overflow: hidden;
}

/* Contenitore centrale: nel riferimento occupa circa il 74% del desktop */
body#index .royal-home-shell {
  box-sizing: border-box !important;
  width: calc(100% - 48px) !important;
  max-width: 1200px !important;
  margin-right: auto !important;
  margin-left: auto !important;
  padding-right: 0 !important;
  padding-left: 0 !important;
}

/* HERO */
body#index .royal-home-hero {
  position: relative !important;
  width: 100% !important;
  height: clamp(350px, 27vw, 445px) !important;
  margin: 0 !important;
  overflow: hidden !important;
  background: #091a2e !important;
}

body#index .royal-home-hero__frame {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
}

body#index .royal-home-hero__frame iframe {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  width: 100vw !important;
  height: 56.25vw !important;
  min-width: 100% !important;
  min-height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  border: 0 !important;
  transform: translate(-50%, -50%) !important;
  pointer-events: none !important;
}

/* CATEGORIE CIRCOLARI */
body#index .royal-categories {
  padding: 30px 0 31px !important;
  background: #fff !important;
}

body#index .royal-categories__viewport {
  width: 100% !important;
  overflow: visible !important;
}

body#index .royal-categories__track {
  display: grid !important;
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  align-items: start !important;
  gap: 18px !important;
  width: 100% !important;
}

body#index .royal-category-slide {
  min-width: 0 !important;
}

body#index .royal-category-button {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 100% !important;
  color: #078cff !important;
  text-align: center !important;
  text-decoration: none !important;
}

body#index .royal-category-button__image {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 104px !important;
  height: 104px !important;
  padding: 18px !important;
  border-radius: 50% !important;
  overflow: hidden !important;
  background: #078cff !important;
  box-shadow: 0 8px 22px rgba(7,140,255,.08) !important;
}

body#index .royal-category-button__image img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: contain !important;
}

body#index .royal-category-button__title {
  margin-top: 10px !important;
  color: #078cff !important;
  font-size: 10px !important;
  line-height: 1.1 !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
}

body#index .royal-categories__navigation {
  display: none !important;
}

/* APRIL + MARCHI */
body#index .royal-distributors {
  padding: 8px 0 26px !important;
  background: #fff !important;
}

body#index .royal-distributors__grid {
  display: grid !important;
  grid-template-columns: 32.5% minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 26px !important;
}

body#index .royal-distributors__april,
body#index .royal-distributors__logos {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

body#index .royal-distributors__april {
  background: #eaf5ff !important;
}

body#index .royal-distributors__april img,
body#index .royal-distributors__logos img {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  max-width: 100% !important;
  margin: 0 !important;
  object-fit: contain !important;
}

/* sorgente hook nascosta: soltanto Carta e Cancelleria vengono montate */
body#index .royal-home-dynamic-source {
  position: fixed !important;
  left: -200vw !important;
  top: -200vh !important;
  width: 1200px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* BLOCCO CATEGORIA */
body#index .royal-home-category-slot {
  width: calc(100% - 48px) !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 0 0 31px !important;
}

body#index .royal-home-category-slot:empty {
  display: none !important;
}

body#index .royal-home-category-slot > * {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  float: none !important;
  flex: 0 0 100% !important;
}

body#index .royal-home-category-slot .row,
body#index .royal-home-category-slot .products,
body#index .royal-home-category-slot .product_list,
body#index .royal-home-category-slot [class*="products"] {
  width: 100% !important;
  max-width: 100% !important;
}

body#index .royal-home-category-slot .products-section-title,
body#index .royal-home-category-slot h2,
body#index .royal-home-category-slot h3,
body#index .royal-home-category-slot h4 {
  text-align: left !important;
}

body#index .royal-home-category-slot .products-section-title {
  margin: 0 0 14px !important;
  color: #171f2c !important;
  font-size: 15px !important;
  line-height: 1.2 !important;
  font-weight: 800 !important;
  text-transform: none !important;
}

body#index .royal-home-category-slot .product-title,
body#index .royal-home-category-slot .product-title a {
  font-size: 11px !important;
  line-height: 1.35 !important;
}

/* BANNER MICRO SD / HDD */
body#index .royal-editorial-banners {
  padding: 0 0 26px !important;
  background: #fff !important;
}

body#index .royal-editorial-banners__grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 18px !important;
  align-items: stretch !important;
}

body#index .royal-editorial-banner {
  display: block !important;
  width: 100% !important;
  height: 170px !important;
  margin: 0 !important;
  overflow: hidden !important;
  background: #f5f6f7 !important;
}

body#index .royal-editorial-banner img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  object-fit: cover !important;
  object-position: center !important;
}

/* PROMO — 2 landscape + 4 portrait */
body#index .royal-home-promos {
  padding: 0 0 42px !important;
  background: #fff !important;
}

body#index .royal-promo-landscape-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 18px !important;
  margin: 0 0 18px !important;
}

body#index .royal-promo-portrait-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 18px !important;
  align-items: start !important;
}

body#index .royal-promo-card {
  display: block !important;
  min-width: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  background: #fff !important;
  text-decoration: none !important;
}

body#index .royal-promo-card img {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  margin: 0 !important;
}

body#index .royal-promo-card--landscape img {
  aspect-ratio: 3 / 2 !important;
  object-fit: cover !important;
}

body#index .royal-promo-card--portrait img {
  aspect-ratio: 2 / 3 !important;
  object-fit: cover !important;
}

@media (max-width: 1199.98px) {
  body#index .royal-home-shell,
  body#index .royal-home-category-slot {
    width: calc(100% - 32px) !important;
  }
  body#index .royal-category-button__image {
    width: 92px !important;
    height: 92px !important;
  }
}

@media (max-width: 767.98px) {
  body#index .royal-home-hero {
    height: 250px !important;
  }
  body#index .royal-home-shell,
  body#index .royal-home-category-slot {
    width: calc(100% - 24px) !important;
  }
  body#index .royal-categories__viewport {
    overflow-x: auto !important;
    scrollbar-width: none !important;
  }
  body#index .royal-categories__viewport::-webkit-scrollbar { display:none !important; }
  body#index .royal-categories__track {
    display: flex !important;
    justify-content: flex-start !important;
    width: max-content !important;
    gap: 12px !important;
  }
  body#index .royal-category-slide { flex: 0 0 96px !important; }
  body#index .royal-category-button__image { width:82px !important; height:82px !important; padding:15px !important; }
  body#index .royal-distributors__grid { grid-template-columns:1fr !important; gap:12px !important; }
  body#index .royal-editorial-banners__grid,
  body#index .royal-promo-landscape-grid,
  body#index .royal-promo-portrait-grid { grid-template-columns:1fr !important; gap:12px !important; }
  body#index .royal-editorial-banner { height:auto !important; }
  body#index .royal-editorial-banner img { height:auto !important; aspect-ratio:auto !important; }
}

/* =========================================================
   Homepage reference 9.0 — Carta / Cancelleria
   Mantiene intatto il markup del modulo displayRoyalHomeCategories
   e forza le proporzioni del riferimento desktop.
   ========================================================= */
body#index .royal-home-category-slot.is-ready {
  display: block !important;
  width: calc(100% - 48px) !important;
  max-width: 1200px !important;
  margin-right: auto !important;
  margin-left: auto !important;
  padding: 0 0 42px !important;
  overflow: visible !important;
}

body#index .royal-home-category-slot > .royal-reference-category-block {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
}

/* Non alterare la griglia interna generata dal modulo: è già quella del sito
   di riferimento. Annulliamo soltanto vecchie regole del tema che restringono
   o trasformano i figli diretti in card Bootstrap. */
body#index .royal-reference-category-block > .container,
body#index .royal-reference-category-block > .container-fluid,
body#index .royal-reference-category-block .container,
body#index .royal-reference-category-block .container-fluid {
  width: 100% !important;
  max-width: 100% !important;
  margin-right: auto !important;
  margin-left: auto !important;
}

body#index .royal-reference-category-block .row {
  max-width: none !important;
}

body#index .royal-reference-category-block img {
  height: auto;
}

/* Titolo: pallino colorato + nome, stessa scala dei due screenshot. */
body#index #royalCartaSlot .products-section-title,
body#index #royalCartaSlot .category-title,
body#index #royalCartaSlot h2,
body#index #royalCartaSlot h3,
body#index #royalCancelleriaSlot .products-section-title,
body#index #royalCancelleriaSlot .category-title,
body#index #royalCancelleriaSlot h2,
body#index #royalCancelleriaSlot h3 {
  margin-top: 0 !important;
  margin-bottom: 18px !important;
  color: #111 !important;
  font-size: 19px !important;
  line-height: 1.2 !important;
  font-weight: 800 !important;
  text-align: left !important;
  text-transform: none !important;
}

/* Le card del modulo devono restare prive degli stili "catalog card" del tema. */
body#index .royal-reference-category-block .product-miniature,
body#index .royal-reference-category-block .product-miniature .thumbnail-container,
body#index .royal-reference-category-block article.product-miniature,
body#index .royal-reference-category-block .product-description {
  max-width: none !important;
}

body#index .royal-reference-category-block .product-miniature .thumbnail-container,
body#index .royal-reference-category-block article.product-miniature {
  margin: 0 !important;
}

/* Nel riferimento i nomi prodotto sono compatti ma leggibili. */
body#index .royal-reference-category-block .product-title,
body#index .royal-reference-category-block .product-title a,
body#index .royal-reference-category-block .product-name,
body#index .royal-reference-category-block .product-name a {
  color: #111 !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
  font-weight: 700 !important;
  text-transform: none !important;
}

/* Nasconde gli elementi hover da catalogo che nel riferimento non occupano spazio. */
body#index .royal-reference-category-block .highlighted-informations,
body#index .royal-reference-category-block .product-flags,
body#index .royal-reference-category-block .wishlist-button-add,
body#index .royal-reference-category-block .compare-button {
  z-index: 3;
}

@media (max-width: 1199.98px) {
  body#index .royal-home-category-slot.is-ready {
    width: calc(100% - 32px) !important;
  }
}

@media (max-width: 767.98px) {
  body#index .royal-home-category-slot.is-ready {
    width: calc(100% - 24px) !important;
    padding-bottom: 28px !important;
    overflow-x: hidden !important;
  }
}
\n\n/* =========================================================
   Homepage reference 10.0 — SOLO Carta + Cancelleria
   Carta prima dei banner; Cancelleria immediatamente dopo i 2 banner.
   ========================================================= */
body#index #royalCartaSlot {
  margin-top: 0 !important;
}

body#index .royal-editorial-banners {
  margin-top: 0 !important;
}

body#index #royalCancelleriaSlot {
  margin-top: 0 !important;
}

/* La sorgente degli hook è solo tecnica e non deve mai occupare layout. */
body#index #royalHomeDynamicSource,
body#index #royalHomeCategoriesSource {
  position: fixed !important;
  left: -99999px !important;
  top: -99999px !important;
  width: 1200px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* =========================================================
   Homepage reference 11.0 — blocchi Carta / Cancelleria custom
   SOLO questi due blocchi, con banner editoriali tra i due.
   ========================================================= */
body#index .royal-ref-category {
  width: calc(100% - 48px) !important;
  max-width: 1200px !important;
  margin: 0 auto 36px !important;
  padding: 0 !important;
}
body#index .royal-ref-category__heading {
  display:flex; align-items:center; gap:12px; margin:0 0 18px; padding:0 14px;
}
body#index .royal-ref-category__heading h2 {
  margin:0; color:#111; font-size:22px; line-height:1.1; font-weight:800; text-transform:none;
}
body#index .royal-ref-category__dot { width:11px; height:11px; flex:0 0 11px; border-radius:50%; background:#78aa13; }
body#index .royal-ref-category--cancelleria .royal-ref-category__dot { background:#d61d27; }
body#index .royal-ref-category__panel {
  display:grid !important;
  grid-template-columns: 240px 240px minmax(0,1fr) !important;
  min-height:620px;
  border:1px solid #dfe3e7;
  background:#fff;
  overflow:hidden;
}
body#index .royal-ref-category--cancelleria .royal-ref-category__panel {
  min-height:0;
  height:auto;
  align-items:stretch;
}
body#index .royal-ref-category--cancelleria .royal-ref-category__products {
  grid-template-rows:repeat(2,auto) !important;
  align-content:start;
}
body#index .royal-ref-category--cancelleria .royal-ref-category__feature {
  min-height:0;
  height:auto;
}
body#index .royal-ref-category--cancelleria .royal-ref-category__feature img {
  min-height:0;
  height:100%;
  object-fit:cover;
}
body#index .royal-ref-category__sidebar {
  display:flex; flex-direction:column; justify-content:space-between; min-width:0; padding:28px 28px 24px; border-right:1px solid #dfe3e7;
}
body#index .royal-ref-category__sidebar nav { display:flex; flex-direction:column; gap:12px; }
body#index .royal-ref-category__sidebar nav a { color:#7e848a; font-size:13px; line-height:1.15; font-weight:400; text-decoration:none; }
body#index .royal-ref-category__sidebar nav a:hover { color:#078cff; }
body#index .royal-ref-category__all { color:#111 !important; font-size:13px; font-weight:700; text-decoration:none !important; }
body#index .royal-ref-category__all span { color:#f57b22; margin-right:6px; font-size:18px; }
body#index .royal-ref-category__feature { min-width:0; border-right:1px solid #dfe3e7; overflow:hidden; background:#f2f3f4; }
body#index .royal-ref-category__feature img { display:block; width:100%; height:100%; min-height:620px; object-fit:cover; }

body#index .royal-ref-category__products {
  display:grid !important; grid-template-columns:repeat(3,minmax(0,1fr)) !important; grid-template-rows:repeat(2,minmax(0,1fr)) !important; min-width:0; background:#fff;
}
body#index .royal-ref-product {
  position:relative; display:flex; min-width:0; flex-direction:column; justify-content:flex-end; padding:22px 26px 28px; border-right:1px solid #e6e8ea; border-bottom:1px solid #e6e8ea; background:#fff; text-decoration:none !important; color:#111 !important; overflow:hidden;
}
body#index .royal-ref-product:nth-child(3n) { border-right:0; }
body#index .royal-ref-product:nth-child(n+4) { border-bottom:0; }
body#index .royal-ref-product__image { display:flex; align-items:center; justify-content:center; height:190px; margin-bottom:20px; }
body#index .royal-ref-product__image img { display:block; max-width:88%; max-height:180px; width:auto; height:auto; object-fit:contain; }
body#index .royal-ref-category--cancelleria .royal-ref-product { justify-content:flex-start; padding-top:18px; }
body#index .royal-ref-category--cancelleria .royal-ref-product__image { height:150px; margin-bottom:10px; }
body#index .royal-ref-category--cancelleria .royal-ref-product__image img { max-height:145px; }
body#index .royal-ref-category--cancelleria .royal-ref-product__placeholder { height:150px; margin-bottom:10px; }
body#index .royal-ref-category--cancelleria .royal-ref-category__sidebar nav { gap:9px; }
body#index .royal-ref-product__placeholder { display:flex; align-items:center; justify-content:center; height:190px; margin-bottom:20px; color:#858585; font-size:12px; line-height:1.1; text-align:center; }
body#index .royal-ref-product__title { display:-webkit-box; overflow:hidden; color:#111; font-size:13px; line-height:1.35; font-weight:700; text-transform:none; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
body#index .royal-ref-category__loading { grid-column:1/-1; display:flex; align-items:center; justify-content:center; color:#9098a0; font-size:13px; }
body#index .royal-editorial-banners { margin: 8px 0 28px !important; padding:0 !important; }
body#index .royal-editorial-banners__grid { width:calc(100% - 48px) !important; max-width:1200px !important; grid-template-columns:repeat(2,minmax(0,1fr)) !important; gap:24px !important; }
body#index .royal-editorial-banner { display:block; width:100%; height:168px !important; overflow:hidden; }
body#index .royal-editorial-banner img { display:block; width:100% !important; height:100% !important; object-fit:cover !important; }
@media (max-width: 991.98px) {
  body#index .royal-ref-category__panel { grid-template-columns:180px 210px minmax(0,1fr) !important; }
  body#index .royal-ref-category__products { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
  body#index .royal-ref-product:nth-child(3n) { border-right:1px solid #e6e8ea; }
  body#index .royal-ref-product:nth-child(2n) { border-right:0; }
}
@media (max-width: 767.98px) {
  body#index .royal-ref-category { width:calc(100% - 24px) !important; }
  body#index .royal-ref-category__panel { display:flex !important; flex-direction:column; min-height:0; }
  body#index .royal-ref-category__sidebar { border-right:0; border-bottom:1px solid #dfe3e7; }
  body#index .royal-ref-category__sidebar nav { display:none; }
  body#index .royal-ref-category__feature { height:300px; border-right:0; border-bottom:1px solid #dfe3e7; }
  body#index .royal-ref-category__feature img, body#index .royal-ref-category--cancelleria .royal-ref-category__feature img { min-height:0; height:100%; }
  body#index .royal-ref-category__products { grid-template-columns:repeat(2,minmax(0,1fr)) !important; grid-template-rows:auto !important; }
  body#index .royal-ref-product { min-height:300px; padding:16px; }
  body#index .royal-ref-product__image { height:160px; }
  body#index .royal-editorial-banners__grid { width:calc(100% - 24px) !important; grid-template-columns:1fr !important; gap:12px !important; }
  body#index .royal-editorial-banner { height:auto !important; }
  body#index .royal-editorial-banner img { height:auto !important; object-fit:contain !important; }
}

/* Royal Office home reference v12 — prodotti reali da displayRoyalHomeCategories */
body#index .royal-home-products-source {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  pointer-events: none !important;
  opacity: 0 !important;
}
body#index .royal-ref-product__text {
  display:flex;
  flex-direction:column;
  gap:8px;
}
body#index .royal-ref-product__price {
  color:#078cff;
  font-size:13px;
  line-height:1.2;
  font-weight:800;
}
body#index .royal-ref-product--empty {
  pointer-events:none;
}

/* =========================================================
   Homepage reference 12.1 — proporzioni hero e categorie
   allineate a royaloffice.lenus.site
   ========================================================= */
@media (min-width: 1200px) {
  body#index .royal-home-hero {
    height: 480px !important;
    min-height: 480px !important;
    max-height: 480px !important;
  }
  body#index .royal-categories {
    padding: 32px 0 34px !important;
  }
  body#index .royal-categories__track {
    gap: 22px !important;
  }
  body#index .royal-category-button__image {
    width: 118px !important;
    height: 118px !important;
    padding: 20px !important;
  }
  body#index .royal-category-button__title {
    margin-top: 11px !important;
    font-size: 12px !important;
    line-height: 1.15 !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
  }
}

@media (min-width: 1440px) {
  body#index .royal-home-hero {
    height: 500px !important;
    min-height: 500px !important;
    max-height: 500px !important;
  }
  body#index .royal-category-button__image {
    width: 124px !important;
    height: 124px !important;
  }
  body#index .royal-category-button__title {
    font-size: 12.5px !important;
  }
}

/* =========================================================
   RoyalOffice v16.6 — dimensioni 1:1 categorie e distributori
   riferimento desktop royaloffice.lenus.site
   ========================================================= */
@media (min-width: 1200px) {
  body#index .royal-home-shell {
    width: calc(100% - 48px) !important;
    max-width: 1200px !important;
  }

  body#index .royal-categories {
    padding: 34px 0 62px !important;
  }

  body#index .royal-categories__track {
    width: 1200px !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 0 !important;
  }

  body#index .royal-category-slide {
    flex: 0 0 154px !important;
    width: 154px !important;
    max-width: 154px !important;
  }

  body#index .royal-category-button {
    width: 154px !important;
  }

  body#index .royal-category-button__image {
    width: 154px !important;
    height: 154px !important;
    padding: 25px !important;
    margin: 0 auto !important;
  }

  body#index .royal-category-button__title {
    margin-top: 10px !important;
    font-size: 17px !important;
    line-height: 1.15 !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
    text-transform: uppercase !important;
  }

  body#index .royal-distributors {
    padding: 0 0 28px !important;
  }

  body#index .royal-distributors__grid {
    width: 1200px !important;
    max-width: 100% !important;
    grid-template-columns: 470px 708px !important;
    gap: 22px !important;
    align-items: center !important;
  }

  body#index .royal-distributors__april,
  body#index .royal-distributors__logos {
    height: 136px !important;
    min-height: 136px !important;
    max-height: 136px !important;
  }

  body#index .royal-distributors__april img {
    width: 470px !important;
    height: 136px !important;
    max-width: 470px !important;
    object-fit: contain !important;
  }

  body#index .royal-distributors__logos img {
    width: 708px !important;
    height: 136px !important;
    max-width: 708px !important;
    object-fit: contain !important;
  }
}

@media (min-width: 1440px) {
  body#index .royal-category-button__image {
    width: 154px !important;
    height: 154px !important;
  }
  body#index .royal-category-button__title {
    font-size: 17px !important;
  }
}

/* =========================================================
   RoyalOffice v16.7 — desktop 1:1 con royaloffice.lenus.site
   Misure rilevate sul riferimento 1920px: track 1404px,
   cerchi 182px, banner April 546x158px.
   ========================================================= */
@media (min-width: 1200px) {
  body#index .royal-home-shell,
  body#index .royal-home-category-slot,
  body#index .royal-ref-category,
  body#index .royal-editorial-banners__grid {
    width: calc(100% - 48px) !important;
    max-width: 1404px !important;
  }

  body#index .royal-categories {
    padding: 40px 0 84px !important;
  }

  body#index .royal-categories__track {
    width: 1404px !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 0 !important;
  }

  body#index .royal-category-slide,
  body#index .royal-category-button {
    flex: 0 0 182px !important;
    width: 182px !important;
    max-width: 182px !important;
  }

  body#index .royal-category-button__image {
    width: 182px !important;
    height: 182px !important;
    padding: 30px !important;
    margin: 0 auto !important;
  }

  body#index .royal-category-button__title {
    margin-top: 10px !important;
    font-size: 18px !important;
    line-height: 1.15 !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
    text-transform: uppercase !important;
  }

  body#index .royal-distributors {
    padding: 0 0 32px !important;
  }

  body#index .royal-distributors__grid {
    width: 1404px !important;
    max-width: 100% !important;
    grid-template-columns: 546px 832px !important;
    gap: 26px !important;
    align-items: center !important;
  }

  body#index .royal-distributors__april,
  body#index .royal-distributors__logos {
    height: 158px !important;
    min-height: 158px !important;
    max-height: 158px !important;
  }

  body#index .royal-distributors__april img {
    width: 546px !important;
    height: 158px !important;
    max-width: 546px !important;
    object-fit: contain !important;
  }

  body#index .royal-distributors__logos img {
    width: 832px !important;
    height: 158px !important;
    max-width: 832px !important;
    object-fit: contain !important;
  }

  body#index .royal-home-dynamic-source {
    width: 1404px !important;
  }
}

/* =========================================================
   RoyalOffice v17.9 — categorie completamente responsive
   Mobile: niente elementi tagliati e niente scroll orizzontale.
   La griglia si adatta automaticamente alla larghezza reale.
   ========================================================= */
@media (max-width: 767.98px) {
  body#index .royal-categories {
    padding: 26px 0 34px !important;
    overflow: hidden !important;
  }

  body#index .royal-categories .royal-home-shell {
    width: calc(100% - 24px) !important;
    max-width: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  body#index .royal-categories__viewport {
    width: 100% !important;
    overflow: visible !important;
  }

  body#index .royal-categories__track {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)) !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 22px 10px !important;
    align-items: start !important;
    justify-items: center !important;
  }

  body#index .royal-category-slide,
  body#index .royal-category-button {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    flex: none !important;
  }

  body#index .royal-category-button__image {
    width: clamp(66px, 21vw, 88px) !important;
    height: clamp(66px, 21vw, 88px) !important;
    padding: clamp(12px, 3.8vw, 16px) !important;
    margin: 0 auto !important;
  }

  body#index .royal-category-button__title {
    width: 100% !important;
    margin-top: 8px !important;
    padding: 0 2px !important;
    font-size: clamp(9px, 2.7vw, 11px) !important;
    line-height: 1.15 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }
}

/* Schermi molto stretti: 3 elementi per riga, sempre centrati. */
@media (max-width: 339.98px) {
  body#index .royal-categories__track {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 20px 8px !important;
  }
  body#index .royal-category-button__image {
    width: 68px !important;
    height: 68px !important;
    padding: 12px !important;
  }
  body#index .royal-category-button__title {
    font-size: 9px !important;
  }
}

/* Telefoni medi e grandi: 4 elementi per riga senza tagli. */
@media (min-width: 390px) and (max-width: 767.98px) {
  body#index .royal-categories__track {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

/* Royal Office - Cancelleria: elimina spazio vuoto inferiore */
@media (min-width: 992px) {
  body#index .royal-ref-category--cancelleria .royal-ref-category__panel {
    height: 520px !important;
    min-height: 520px !important;
    align-items: stretch !important;
  }
  body#index .royal-ref-category--cancelleria .royal-ref-category__sidebar {
    justify-content: flex-start !important;
    padding: 18px 22px 16px !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }
  body#index .royal-ref-category--cancelleria .royal-ref-category__sidebar nav {
    gap: 7px !important;
  }
  body#index .royal-ref-category--cancelleria .royal-ref-category__sidebar nav a {
    font-size: 12px !important;
    line-height: 1.05 !important;
  }
  body#index .royal-ref-category--cancelleria .royal-ref-category__all {
    margin-top: 14px !important;
  }
  body#index .royal-ref-category--cancelleria .royal-ref-category__feature,
  body#index .royal-ref-category--cancelleria .royal-ref-category__feature img {
    height: 520px !important;
    min-height: 520px !important;
  }
  body#index .royal-ref-category--cancelleria .royal-ref-category__products {
    height: 520px !important;
    min-height: 520px !important;
    grid-template-rows: repeat(2, 260px) !important;
    align-content: stretch !important;
  }
  body#index .royal-ref-category--cancelleria .royal-ref-product {
    min-height: 0 !important;
    height: 260px !important;
    padding: 12px 22px 14px !important;
    justify-content: flex-start !important;
  }
  body#index .royal-ref-category--cancelleria .royal-ref-product__image,
  body#index .royal-ref-category--cancelleria .royal-ref-product__placeholder {
    height: 150px !important;
    margin-bottom: 8px !important;
  }
  body#index .royal-ref-category--cancelleria .royal-ref-product__image img {
    max-height: 145px !important;
  }
}

/* Royal Office - interazioni homepage: categorie e banner editoriali */
@media (hover: hover) and (pointer: fine) {
  body#index .royal-category-button__image {
    transition: background-color .22s ease, transform .22s ease, box-shadow .22s ease !important;
  }
  body#index .royal-category-button__image img {
    transition: transform .22s ease, filter .22s ease !important;
  }
  body#index .royal-category-button__title {
    transition: color .22s ease !important;
  }
  body#index .royal-category-button:hover .royal-category-button__image,
  body#index .royal-category-button:focus-visible .royal-category-button__image {
    background-color: #005da8 !important;
    transform: translateY(-3px) scale(1.035) !important;
    box-shadow: 0 12px 28px rgba(0,93,168,.22) !important;
  }
  body#index .royal-category-button:hover .royal-category-button__image img,
  body#index .royal-category-button:focus-visible .royal-category-button__image img {
    transform: scale(1.10) !important;
  }
  body#index .royal-category-button:hover .royal-category-button__title,
  body#index .royal-category-button:focus-visible .royal-category-button__title {
    color: #005da8 !important;
  }

  body#index .royal-editorial-banner img {
    transition: transform .32s ease !important;
    transform-origin: center center !important;
  }
  body#index .royal-editorial-banner:hover img,
  body#index .royal-editorial-banner:focus-visible img {
    transform: scale(1.055) !important;
  }
}

/* FIX REALE 2026-09-29: hover prodotti homepage + focus cerchi */
body#index .royal-ref-product__image {
  overflow: visible !important;
}
body#index .royal-ref-product__image img {
  transform: scale(1) !important;
  transform-origin: center center !important;
  transition: transform .24s ease !important;
}
body#index .royal-category-button:focus,
body#index .royal-category-button:active,
body#index .royal-category-button__image:focus,
body#index .royal-category-button__image:active {
  outline: 0 !important;
  box-shadow: none !important;
}
@media (hover:hover) and (pointer:fine) {
  body#index a.royal-ref-product:hover .royal-ref-product__image img {
    transform: scale(1.10) !important;
  }
}
