/* =====================================================
   RQ OCTO - ACCESSORI PER SISTEMI RADIANTI
   VERSIONE DEFINITIVA - COLLEGATA AL DATABASE WORDPRESS
   ===================================================== */

body.rq-accessories-body .wp-block-post-title {
  display: none;
}

body.rq-accessories-body,
body.rq-accessories-body .wp-site-blocks,
body.rq-accessories-body main,
body.rq-accessories-body .entry-content {
  margin: 0;
  padding: 0;
}

body.rq-accessories-body {
  overflow-x: hidden;
}

body.rq-accessories-body main,
body.rq-accessories-body .entry-content,
body.rq-accessories-body .wp-block-post-content,
body.rq-accessories-body .wp-block-shortcode {
  width: 100%;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.rq-accessories-page,
.rq-accessories-page * {
  box-sizing: border-box;
}

.rq-accessories-page {
  width: 100%;
  max-width: 100%;
  margin: 0;
  overflow-x: clip;
  background: #111111;
  color: #ffffff;
  font-family: Futura, "Century Gothic", Montserrat, Arial, sans-serif;
}

.rq-accessories-inner {
  width: min(1500px, calc(100% - 80px));
  margin: 0 auto;
}

/* TESTATA */
.rq-accessories-hero {
  position: relative;
  padding: 72px 0 46px;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 85% 20%, rgba(226, 41, 41, 0.16), transparent 34%),
    linear-gradient(135deg, #151515 0%, #0d0d0d 100%);
}

.rq-accessories-kicker {
  display: block;
  margin-bottom: 16px;
  color: #ff3b3b;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.rq-accessories-hero h1 {
  max-width: 1050px;
  margin: 0;
  color: #ffffff;
  font-size: clamp(42px, 6vw, 82px);
  line-height: 0.98;
  text-transform: uppercase;
}

.rq-accessories-hero__text {
  max-width: 820px;
  margin: 24px 0 0;
  color: #d3d3d3;
  font-size: 20px;
  line-height: 1.55;
}

.rq-selected-panel {
  display: none;
  width: fit-content;
  margin-top: 26px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 59, 59, 0.42);
  border-radius: 999px;
  background: rgba(226, 41, 41, 0.1);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.rq-selected-panel.is-visible {
  display: inline-flex;
}

/* RIEPILOGO E RITORNO AL PANNELLO DI PROVENIENZA */
.rq-accessories-toolbar-wrap {
  padding: 18px 0 110px;
  background: #111111;
}

.rq-accessories-toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: end;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  background: #191919;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.24);
}

.rq-field-label {
  display: block;
  margin-bottom: 8px;
  color: #bdbdbd;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rq-panel-select {
  width: 100%;
  min-height: 52px;
  padding: 0 46px 0 16px;
  border: 1px solid #414141;
  border-radius: 12px;
  outline: none;
  background: #101010;
  color: #ffffff;
  font: inherit;
  font-size: 16px;
}

.rq-panel-select:focus {
  border-color: #e22929;
  box-shadow: 0 0 0 3px rgba(226, 41, 41, 0.16);
}

.rq-toolbar-copy {
  align-self: center;
  margin: 0;
  color: #bdbdbd;
  font-size: 15px;
  line-height: 1.55;
}

.rq-back-button,
.rq-document-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 22px;
  border: 1px solid #e22929;
  border-radius: 999px;
  background: transparent;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.rq-back-button:hover,
.rq-back-button:focus,
.rq-document-button:hover,
.rq-document-button:focus {
  background: #e22929;
  color: #ffffff;
  transform: translateY(-1px);
}

.rq-back-button[hidden] {
  display: none;
}

/* CONTENUTO */
.rq-accessories-content {
  min-height: 420px;
  padding: 36px 0 28px;
}

.rq-empty-state {
  display: none;
  padding: 70px 28px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: 24px;
  text-align: center;
  background: #171717;
}

.rq-empty-state.is-visible {
  display: block;
}

.rq-empty-state h2 {
  margin: 0 0 12px;
  color: #ffffff;
  font-size: clamp(28px, 4vw, 44px);
}

.rq-empty-state p {
  max-width: 640px;
  margin: 0 auto;
  color: #bdbdbd;
  font-size: 17px;
  line-height: 1.55;
}

.rq-category-section {
  margin-top: 52px;
}

.rq-category-section:first-child {
  margin-top: 0;
}

.rq-category-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}

.rq-category-heading h2 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.1;
  text-transform: uppercase;
}

.rq-category-count {
  color: #9d9d9d;
  font-size: 14px;
  white-space: nowrap;
}

.rq-product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

/* Disposizione dedicata delle cinque card della categoria Tubi. */
.rq-tube-layout-pexa {
  grid-column: 1;
  grid-row: 1;
}

.rq-tube-layout-pert {
  grid-column: 1;
  grid-row: 3;
}

.rq-tube-layout-multistrato {
  grid-column: 2;
  grid-row: 3;
}

.rq-tube-layout-pert-quick {
  grid-column: 2;
  grid-row: 2;
}

.rq-tube-layout-pexa-quick {
  grid-column: 1;
  grid-row: 2;
}

.rq-product-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 24px;
  background: #1a1a1a;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.22);
}

.rq-product-head {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  height: 420px;
  min-height: 420px;
  min-width: 0;
}

.rq-product-visual {
  position: relative;
  display: flex;
  height: 100%;
  min-height: 420px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 59, 59, 0.13), transparent 42%),
    linear-gradient(145deg, #272727, #131313);
}

.rq-product-visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 18px;
}

.rq-product-placeholder {
  width: 78%;
  color: #777777;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.5;
  text-align: center;
  text-transform: uppercase;
}

.rq-product-placeholder::before {
  content: "";
  display: block;
  width: 70px;
  height: 70px;
  margin: 0 auto 16px;
  border: 2px solid #4b4b4b;
  border-radius: 18px;
  background:
    linear-gradient(135deg, transparent 48%, #4b4b4b 49%, #4b4b4b 52%, transparent 53%);
}

.rq-product-body {
  min-width: 0;
  padding: 26px;
  display: grid;
  grid-template-rows: auto minmax(76px, auto) 1fr auto;
  align-content: stretch;
}

.rq-product-category {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  min-height: 24px;
  margin-bottom: 8px;
  padding: 4px 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: #cfcfcf;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.rq-product-title {
  display: flex;
  min-height: 76px;
  align-items: flex-start;
  margin: 0;
  color: #ffffff;
  font-size: clamp(26px, 2.3vw, 38px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -1px;
  text-transform: uppercase;
}

.rq-product-description {
  margin: 0;
  color: #d0d0d0;
  font-family: Arial, sans-serif;
  font-size: 13px;
  line-height: 1.5;
}

.rq-compatibility {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 10px;
}

.rq-compatibility span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #efefef;
  font-size: 12px;
  font-weight: 700;
}

.rq-compatibility span::before {
  content: "✓";
  display: inline-flex;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(223, 32, 38, 0.14);
  color: #ef2c32;
  font-size: 13px;
  font-weight: 900;
}

.rq-variants {
  width: 100%;
  margin-top: 0;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0;
}

.rq-variants-scroll {
  width: 100%;
  padding: 0 26px 26px;
  overflow-x: auto;
}

.rq-variants th,
.rq-variants td {
  padding: 8px 10px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #d8d8d8;
  font-family: Arial, sans-serif;
  font-size: 12px;
  line-height: 1.3;
  text-align: left;
  vertical-align: top;
}

.rq-variants th:last-child,
.rq-variants td:last-child {
  border-right: 0;
}

.rq-variants th {
  background: transparent;
  color: #bdbdbd;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.rq-variants tr:last-child td {
  border-bottom: 0;
}

.rq-variants td:first-child {
  color: #ff6868;
  font-weight: 700;
  white-space: nowrap;
}

.rq-documents {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-self: end;
  margin-top: 16px;
  padding-top: 0;
}

.rq-document-button.is-disabled {
  opacity: 0.38;
  cursor: default;
  pointer-events: none;
}

.rq-document-button {
  min-height: 39px;
  padding: 8px 15px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 800;
}

.rq-documents .rq-document-button:first-child {
  border-color: #df2026;
  background: #df2026;
  color: #ffffff;
}

.rq-documents .rq-document-button:first-child:hover,
.rq-documents .rq-document-button:first-child:focus {
  background: #f02b31;
}

.rq-drawing-menu {
  position: relative;
}

.rq-drawing-options {
  display: none;
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 10;
  width: max-content;
  max-width: 250px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: #101010;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.42);
}

.rq-drawing-menu.is-open .rq-drawing-options {
  display: grid;
  gap: 6px;
}

.rq-drawing-options .rq-document-button {
  width: 100%;
  min-height: 36px;
  justify-content: flex-start;
  white-space: nowrap;
}

/* MODALE DOCUMENTI */
.rq-document-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(0, 0, 0, 0.86);
}

.rq-document-modal.is-open {
  display: flex;
}

.rq-modal-panel {
  display: flex;
  width: min(1180px, 100%);
  height: min(820px, 92vh);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  background: #171717;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
}

.rq-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
}

.rq-modal-head strong {
  color: #ffffff;
  font-size: 16px;
}

.rq-modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rq-modal-download,
.rq-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 15px;
  border: 1px solid #4b4b4b;
  border-radius: 999px;
  background: #222222;
  color: #ffffff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.rq-modal-close {
  width: 40px;
  padding: 0;
  border-color: #e22929;
  background: #e22929;
  font-size: 20px;
}

.rq-modal-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}

@media (max-width: 1150px) {
  .rq-product-grid {
    grid-template-columns: 1fr;
  }

  .rq-tube-layout-pexa,
  .rq-tube-layout-pert,
  .rq-tube-layout-multistrato,
  .rq-tube-layout-pert-quick,
  .rq-tube-layout-pexa-quick {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 820px) {
  .rq-accessories-inner {
    width: min(100% - 32px, 1500px);
  }

  .rq-accessories-hero {
    padding: 48px 0 34px;
  }

  .rq-accessories-hero h1 {
    font-size: 42px;
  }

  .rq-accessories-hero__text {
    font-size: 17px;
  }

  .rq-accessories-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .rq-back-button {
    width: 100%;
  }

  .rq-product-head {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .rq-product-visual {
    height: 220px;
    min-height: 220px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .rq-product-body {
    display: flex;
    flex-direction: column;
    padding: 22px 18px;
  }

  .rq-product-title {
    min-height: 0;
    margin-bottom: 8px;
  }

  .rq-product-description {
    margin-top: 10px;
  }

  .rq-variants-scroll {
    padding: 0 18px 22px;
  }

  .rq-variants {
    display: block;
    overflow-x: auto;
  }

  .rq-variants th,
  .rq-variants td {
    min-width: 105px;
  }

  .rq-variants th:nth-child(2),
  .rq-variants td:nth-child(2) {
    min-width: 260px;
  }

  .rq-modal-head {
    align-items: flex-start;
  }

  .rq-modal-download {
    display: none;
  }
}
