/* ==========================================================================
   ThemeServiceV9 — platform additions

   style.css is the incoming design, kept as delivered. Everything the
   GreenMango integration needs on top of it lives here: nav dropdowns (the
   menu is built from the CMS page list, so it can nest), the admin-managed
   banner slider, the listing toolbar and pager, and rich text coming out of
   the CMS. Same tokens as style.css, so it reads as one stylesheet.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. NAV DROPDOWNS
   The page list can nest one level, and featured product categories hang off
   their own item, so the flat design menu needs a dropdown treatment.
   -------------------------------------------------------------------------- */
.cx-nav .dropdown-toggle::after {
  margin-left: 0.4rem;
  border-top-color: currentColor;
  vertical-align: 0.15em;
}

.cx-nav .dropdown-menu {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  margin-top: 0.35rem;
  min-width: 14rem;
}

.cx-nav .dropdown-item {
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-primary);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  white-space: normal;
}

.cx-nav .dropdown-item:hover,
.cx-nav .dropdown-item:focus {
  color: var(--color-secondary);
  background: var(--color-tint);
}

/* From xl up the menu is a real bar, so open the dropdown on hover too —
   below that Bootstrap's click behaviour inside the off-canvas panel is
   the only sensible interaction. */
@media (min-width: 1200px) {
  .cx-nav .cx-nav-drop:hover > .dropdown-menu { display: block; }
}

@media (max-width: 1199.98px) {
  .cx-nav .dropdown-menu {
    border: 0;
    box-shadow: none;
    padding: 0 0 0 0.85rem;
    margin: 0;
    border-left: 2px solid var(--color-tint-strong);
  }
  .cx-nav .dropdown-item { padding: 0.5rem 0; }
}

/* --------------------------------------------------------------------------
   2. HERO BANNER SLIDER
   Shown when the admin has uploaded banner images. The slide keeps the
   design's white wash, so the copy stays readable over any photograph.
   -------------------------------------------------------------------------- */
.cx-hero__swiper { width: 100%; }
.cx-hero__swiper .swiper-slide { height: auto; }

.cx-hero__video img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center right;
  display: block;
}

.cx-hero__dots.swiper-pagination {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1.25rem;
  z-index: 3;
}

/* The feature row moved out of the banner into its own strip, so the copy
   block is not competing with a slideshow for height. */
.cx-hero-features {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  padding: 1.5rem 0;
}
.cx-hero-features .cx-hero__features { margin-top: 0; }

/* --------------------------------------------------------------------------
   3. LISTING TOOLBAR + CATEGORY CHIPS
   Category links, not a client-side filter — the grid is paged server-side.
   -------------------------------------------------------------------------- */
.cx-listing-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--color-border);
}

.cx-listing-count {
  font-size: var(--fs-sm);
  color: var(--color-muted);
}
.cx-listing-count strong { color: var(--color-primary); }

.cx-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.cx-chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--color-primary);
  background: var(--color-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 0.45rem 0.95rem;
  text-decoration: none;
  transition: color var(--t-fast), background-color var(--t-fast), border-color var(--t-fast);
}
.cx-chip:hover {
  color: var(--color-secondary);
  background: var(--color-tint);
  border-color: var(--color-tint-strong);
}
.cx-chip.is-active {
  color: var(--color-white);
  background: var(--color-secondary);
  border-color: var(--color-secondary);
}

/* --------------------------------------------------------------------------
   4. PAGINATION
   -------------------------------------------------------------------------- */
.cx-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin-top: var(--sp-6);
}

.cx-page-link {
  display: grid;
  place-items: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.6rem;
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--color-primary);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: color var(--t-fast), background-color var(--t-fast), border-color var(--t-fast);
}
.cx-page-link:hover {
  color: var(--color-secondary);
  background: var(--color-tint);
  border-color: var(--color-tint-strong);
}
.cx-page-link.is-current {
  color: var(--color-white);
  background: var(--color-secondary);
  border-color: var(--color-secondary);
}
.cx-page-link.is-disabled {
  color: var(--color-border);
  background: var(--color-light);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   5. CMS RICH TEXT
   Description and Specification come out of the admin editor, so the tags
   inside them are whatever the editor produced.
   -------------------------------------------------------------------------- */
.cx-rte { color: var(--color-muted); }
.cx-rte > *:last-child { margin-bottom: 0; }
.cx-rte p { margin-bottom: 1rem; }
.cx-rte h2, .cx-rte h3, .cx-rte h4 {
  color: var(--color-heading);
  margin: 1.75rem 0 0.75rem;
}
.cx-rte h2:first-child, .cx-rte h3:first-child { margin-top: 0; }
.cx-rte ul, .cx-rte ol { margin: 0 0 1rem 1.15rem; padding: 0; }
.cx-rte li { margin-bottom: 0.4rem; }
.cx-rte a { color: var(--color-secondary); }
.cx-rte img { max-width: 100%; height: auto; border-radius: var(--radius); }
.cx-rte table {
  width: 100%;
  margin-bottom: 1rem;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
.cx-rte th, .cx-rte td {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--color-border);
  text-align: left;
}
.cx-rte th { background: var(--color-light); color: var(--color-primary); }
.cx-rte iframe { max-width: 100%; }

/* --------------------------------------------------------------------------
   6. DETAIL PANEL SHARE ROW
   -------------------------------------------------------------------------- */
.cx-detail-panel__share {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--color-border);
}
.cx-detail-panel__share a {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-size: 0.8125rem;
  color: var(--color-primary);
  background: var(--color-light);
  border-radius: 50%;
  transition: color var(--t-fast), background-color var(--t-fast);
}
.cx-detail-panel__share a:hover {
  color: var(--color-white);
  background: var(--color-secondary);
}

/* --------------------------------------------------------------------------
   7. TESTIMONIAL AVATAR PHOTO
   The design's avatar is an initial; an uploaded photo takes the same box.
   -------------------------------------------------------------------------- */
.cx-avatar--img {
  object-fit: cover;
  padding: 0;
  background: none;
}

/* --------------------------------------------------------------------------
   8. BUTTONS STANDING IN FOR THE DESIGN'S LINKS
   Several design anchors became <button onclick="openEnquiry()"> so the one
   enquiry dialog serves them all. These reset the UA button styling the
   design never had to deal with.
   -------------------------------------------------------------------------- */
button.cx-btn,
button.cx-actionbar__cta {
  border: 0;
  font: inherit;
  cursor: pointer;
}
button.cx-btn-outline,
button.cx-btn-ghost { border-width: 1.5px; border-style: solid; }

/* --------------------------------------------------------------------------
   9. ENQUIRY FORM INSIDE THE MODAL
   The platform partial arrives as a Bootstrap grid, so it needs the design's
   field styling rather than Bootstrap's defaults.
   -------------------------------------------------------------------------- */
#cxEnquiryModalInner .cx-form { margin: 0; }
#cxEnquiryModalInner input[readonly] {
  background: var(--color-light);
  color: var(--color-muted);
}
.cx-form .form-check-label {
  font-size: var(--fs-sm);
  color: var(--color-text);
}
