/* ================================
   Custom product compare function
================================ */

/* Compare toggle button */
.compare-toggle {
  border: 0;
  padding: 6px 6px 6px 6px !important;
  background-color: #FFFFFF !important;
	color: #1E1E1E !important;
  text-transform: uppercase;
	font-family: 'Montserrat', sans-serif !important;
	font-weight: 300 !important;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.compare-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 16px;
  height: 16px;

  border: 1px solid #000000;
  border-radius: 1px;

  font-size: 13px;
  line-height: 1;

  /* unchecked = invisible checkmark */
  color: transparent;
}

/* Checked state = always show black checkmark and border */
.compare-toggle.is-active .compare-check {
  color: #000000;
  border-color: #000000;
}

/* Label */
.compare-label {
  line-height: 1;
}

/* Mobile compare toggle (icon-only) */
.compare-toggle.compare-toggle-mobile {
  width: 44px;
  height: 44px;
  padding: 0 !important;
  border-radius: 50%;
  justify-content: center;
}

.compare-toggle-mobile .compare-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.compare-toggle-mobile .compare-mobile-icon {
  width: 35px;
  height: 35px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: url('/wp-content/plugins/sm_wordpress_plugin/assets/img/add-compare.png') center center / contain no-repeat;
  color: #1E1E1E;
  font-size: 18px;
  line-height: 1;
}

.compare-toggle-mobile.is-active .compare-mobile-icon {
  background-image: none;
}

.compare-toggle-mobile.is-active .compare-mobile-icon::after {
  content: '✓';
}

/* Stirling sub-brand variant: white on black */
.stirling-compare .compare-toggle {
  background-color: #0A0A0A !important;
  color: #FFFFFF !important;
}

.stirling-compare .compare-toggle .compare-check {
  border-color: #FFFFFF;
  color: transparent;
}

.stirling-compare .compare-toggle.is-active .compare-check {
  color: #FFFFFF;
  border-color: #FFFFFF;
}

.stirling-compare .compare-toggle-mobile {
  background-color: #0A0A0A !important;
}

.stirling-compare .compare-toggle-mobile .compare-mobile-icon {
  color: #FFFFFF;
}

.stirling-compare .compare-toggle-mobile.is-active .compare-mobile-icon {
  color: #FFFFFF;
}

/* Loading spinner */
.compare-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  min-height: 300px;
  text-align: center;
}

.compare-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f0f0f0;
  border-top: 4px solid #326C88;
  border-radius: 50%;
  animation: compare-spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes compare-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.compare-loading p {
  color: #595959;
  font-size: 16px;
  margin: 0;
  font-family: Montserrat, sans-serif;
}

/*  Modal shell  */

.compare-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  background-color: rgba(30, 30, 30, 0.3);
}

.compare-modal.is-open {
  display: block;
}

.compare-modal-dialog {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  margin: 5vh auto;
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
}

@media (max-width: 768px) {
  .compare-modal-dialog {
    max-width: 100vw;
    max-height: 100vh;
    margin: 0;
    border-radius: 16px 16px 0 0;
  }
}



.compare-modal-content {
  position: relative;
  padding: 24px;
  max-height: calc(90vh - 48px);
  overflow: auto;
}

@media (max-width: 768px) {
  .compare-modal-content {
    padding: 16px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
    max-height: calc(100vh - 32px);
  }
}

.compare-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  border: 0 !important;
  padding: 0 !important;
  width: 30px !important;
  height: 30px !important;
  line-height: 1 !important;
  background-image: url('/wp-content/plugins/sm_wordpress_plugin/assets/img/x-button.png') !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  background-color: transparent !important;
  color: transparent !important;
  font-size: 0 !important;
  transition: none !important;
  z-index: 10;
}

/* Compare table base */

.compare-table {
  width: 96%;
  border-collapse: collapse;
  color: #6B6B6B;
  margin-left: 46px;
}

.compare-table th {
  border-right: 1px solid #C2C2C2;
  border-left: 0px;
  padding: 12px;
  text-align: center;
  color: #6B6B6B;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.compare-table td {
  border: 1px solid #C2C2C2;
  padding: 12px;
  text-align: center;
  color: #6B6B6B;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.compare-table td ul {
  margin: 0;
  padding-left: 16px;
  text-align: left;
}

.compare-table td ul li {
  text-align: left;
}

/* Empty product slots */
.compare-table th.compare-empty-slot,
.compare-table td.compare-empty-slot {
  max-width: 150px !important;
}

/* Non-empty product slots */
.compare-table th.compare-product-slot,
.compare-table td.compare-product-slot {
  max-width: 190px !important;
}

@media (max-width: 768px) {
  .compare-table th,
  .compare-table td {
    padding: 8px 6px;
    font-size: 13px;
  }
}

.compare-table th {
  background: #f7f7f7;
  font-weight: 600;
}

/* Image spacing */
.compare-table thead img {
  display: block;
  max-width: 100%;
}

/* Image row should be white */
.compare-table thead tr.compare-images th {
  background: #ffffff;
  position: relative;
  vertical-align: bottom;
}


/*  Group header rows */

.compare-modal .compare-table tr.compare-group th {
  background: #1F3440 !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  text-align: left !important;
  font-family: Montserrat, sans-serif !important;
  font-size: 18px !important;
  text-transform: uppercase !important;
}

.compare-modal .compare-table tr.compare-group th * {
  color: #ffffff !important;
}

.compare-modal .compare-table tr.compare-group td {
  background: #1F3440 !important;
  color: #ffffff !important;
}

/* Lock group rows against hover effects */

.compare-modal .compare-table tr.compare-group > th,
.compare-modal .compare-table tr.compare-group > td {
  color: #ffffff !important;
}

.compare-modal .compare-table tr.compare-group:hover > th,
.compare-modal .compare-table tr.compare-group:hover > td {
  color: #ffffff !important;
  background: #1F3440 !important;
}

.compare-modal .compare-table tr.compare-group > th *,
.compare-modal .compare-table tr.compare-group > td * {
  color: #ffffff !important;
}

.compare-modal .compare-table tbody tr.compare-group:first-of-type > th,
.compare-modal .compare-table tbody tr.compare-group:first-of-type > td {
  vertical-align: middle !important;
}

.compare-modal .compare-table tbody tr.compare-group:first-of-type .compare-add-placeholder,
.compare-modal .compare-table tbody tr.compare-group:first-of-type .compare-product-slot a {
  min-height: 100%;
  align-self: center;
}

/* Left sidebar - external visual element */
.compare-table-wrap {
  position: relative;
}

.compare-sidebar-bar {
  position: absolute;
  left: 0;
  width: 46px !important;
  background-color: #326C88 !important;
  z-index: 5;
}

/* Left-hand attribute labels */

.compare-modal .compare-table tbody th {
  color: #4F4F4F !important;
  font-weight: 600 !important;
  text-align: left !important;
}

.compare-modal .compare-table .compare-label-column {
  width: 170px !important;
  max-width: 170px !important;
}

/*  Controls */

.compare-remove {
  position: absolute;
  top: 15px;
  right: 15px;
  border: 0 !important;
  padding: 0 !important;
  width: 13px !important;
  height: 13px !important;
  line-height: 1 !important;
  background-image: url('/wp-content/plugins/sm_wordpress_plugin/assets/img/x-button.png') !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  background-color: transparent !important;
  color: transparent !important;
  font-size: 0 !important;
  transition: none !important;
  z-index: 10;
}

@media (max-width: 768px) {
  .compare-remove {
    top: 10px;
    right: 10px;
  }
}


.compare-modal .compare-table .compare-add-placeholder,
.compare-modal .compare-table .compare-product-slot a {
  border: 0 !important;
  background: none !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  text-transform: uppercase !important;
  text-align: center !important;
  font-family: Montserrat, sans-serif !important;
  font-weight: 500 !important;
  font-size: 17px !important;
  text-wrap: auto;
}

@media (max-width: 768px) {
  .compare-modal .compare-table .compare-add-placeholder,
  .compare-modal .compare-table .compare-product-slot a {
    font-size: 14px !important;
  }
}

.compare-modal .compare-table .compare-add-placeholder:hover,
.compare-modal .compare-table .compare-add-placeholder:active,
.compare-modal .compare-table .compare-add-placeholder:focus
{
  border: 0 !important;
  background: none !important;
  color: #595959 !important;
}

/* Compare table */
.compare-table a,
.compare-table a:visited,
.compare-table a:hover,
.compare-table a:active {
  color: #000000;
  text-decoration: none;
}

.compare-table a:hover {
  text-decoration: underline;
}

/* Scoped harder inside modal */
.compare-modal .compare-table a,
.compare-modal .compare-table a:visited,
.compare-modal .compare-table a:hover,
.compare-modal .compare-table a:active {
  color: #000000 !important;
  text-decoration: none;
}

.compare-modal .compare-table a:hover {
  text-decoration: underline;
}

.compare-table-wrap {
  padding-top: 10px;
	position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  .compare-table-wrap {
    padding-top: 8px;
    padding-bottom: calc(32px + env(safe-area-inset-bottom));
  }
}

/* Top-left controls live inside the first header cell */
.compare-controls-cell {
  vertical-align: bottom;
  background: #ffffff; /* keep the image row white */
  padding: 12px;
  border-top: none !important;
  border-left: none !important;
}

.compare-table-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;

  width: 100%; /* automatically matches the cell width */
}

.compare-table-controls button {
  display: block;
  width: 100%;
  box-sizing: border-box;
  white-space: normal;
}

.compare-table-controls .compare-toggle-differences {
  border: 0;
  border-radius: 9px;
  margin-bottom: 6px;
  line-height: 1;
  background-color: #1F3440 !important;
  color: #FFFFFF !important;
  font-size: 14px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: Inter, sans-serif;
  font-weight: 500;
}

.compare-toggle-differences:hover,
.compare-toggle-differences:active,
.compare-toggle-differences:focus 

{
  border: 1;
  border-color: #1E1E1E;
  background-color: #8D8D8D !important;
  color: #1E1E1E !important;
}

.compare-toggle-differences:focus {
  outline: none;
}

.compare-table-controls .compare-toggle-differences:focus-visible {
  outline: 2px solid #000000;
  outline-offset: 2px;
}

.compare-table-controls .compare-clear-all {
  border: 0;
  background: none !important;
  padding: 0;
  margin: 0;
  color: #595959 !important;
  font-size: 14px;
  cursor: pointer;
  min-height: auto;
  display: block;
  width: 100%;
  text-decoration: underline;
  text-align: center;
  font-family: Inter, sans-serif;
  font-weight: 300;
}


.compare-table-controls .compare-clear-all:focus {
  outline: none;
}

.compare-clear-all:focus-visible {
  outline: 2px solid #000000;
  outline-offset: 2px;
}


/* ================================
   Compare modal heading
================================ */

.compare-modal-header {
  text-align: center;
  margin-bottom: 24px;
  margin-left: 46px;
}

.compare-modal-header h2 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #2f6f8b; /* brand blue from earlier */
}

.compare-modal-header h3 {
  margin: 0;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #2f6f8b;
}


/* ================================
   Compare tray
================================ */

.compare-tray {
  position: fixed;
  right: 15px;
  bottom: 70px;
  width: 240px;

  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 8px;

  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 9999;

  display: none;
}

@media (max-width: 768px) {
  .compare-tray {
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--compare-tray-bottom, 0);
    width: 100%;
    max-height: 60vh;
    border-radius: 16px 16px 0 0;
    border: 1px solid #ddd;
    border-bottom: none;
    box-shadow: 0 -8px 24px rgba(0,0,0,0.15);
    margin: 0;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
  }
}

.compare-tray.is-open {
  display: block;
}

@media (max-width: 768px) {
  .compare-tray.is-open {
    transform: translateY(0);
  }
}

.compare-tray-inner {
  padding: 12px;
}

@media (max-width: 768px) {
  .compare-tray-inner {
    padding: 12px;
    max-height: 60vh;
    overflow-y: auto;
  }
}

.compare-tray-title {
  padding: 3px 3px;
  margin: 0 0 8px;
  font-weight: 500;
  font-size: 15px;
  color: #326C88 !important;
  text-transform: none;
  display: inline-flex;
  align-items: center;
}

@media (max-width: 768px) {
  .compare-tray-title {
    font-size: 16px;
  }
}

.compare-tray-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.compare-tray-item {
  display: grid;
  grid-template-columns: 48px auto;
  gap: 10px;
  justify-content: center;
  align-items: center;
  position: relative;
  border: 1px solid #C2C2C2;
  border-radius: 10px;
  padding: 8px 28px;
  min-height: 56px;
}

.compare-tray-meta {
  display: flex;
  align-items: center;
  justify-content: center;
}

.compare-tray-thumb img {
  max-width: 48px;
  height: auto;
  display: block;
}

.compare-tray-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 12px;
}

.compare-tray-placeholder .compare-tray-add-placeholder {
  border: 0 !important;
  background: none !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 100%;
  color: #595959 !important;
  font-size: 12px !important;
  line-height: 1;
  letter-spacing: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: Inter, sans-serif !important;
  font-weight: 400 !important;
  text-transform: none !important;
}

@media (max-width: 768px) {
  .compare-tray-placeholder .compare-tray-add-placeholder {
    font-size: 14px !important;
  }
}

.compare-tray-placeholder .compare-tray-add-placeholder img {
  width: 12px;
  height: 12px;
  display: block;
}

.compare-tray-sku {
  font-size: 13px;
  color: #333;
  text-align: center;
}

.compare-tray-thumb a,
.compare-tray-sku a {
  color: inherit;
  text-decoration: none;
  display: block;
}

.compare-tray-sku a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .compare-tray-sku {
    font-size: 15px;
  }
}

/* Drawer button */
.compare-tray-open {
  border: 0;
  padding: 6px 14px !important;
  margin-top: 10px;
  background-color: #326C88 !important;
	color: #FFFFFF !important;
  text-transform: none;
	font-family: 'Montserrat', sans-serif !important;
	font-weight: 500 !important;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border-radius: 12px;
  box-shadow: 0px 3px 10px -3px rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {
  .compare-tray-open {
    position: relative;
    border: 0;
    border-radius: 14px;
    min-height: 52px;
    padding: 8px 14px !important;
    background-color: #2F6F8B !important;
    color: #FFFFFF !important;
    font-weight: 500 !important;
    text-transform: none;
    gap: 12px;
  }

  .compare-tray-open::before {
    content: '';
    display: inline-block;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #FFFFFF;
    background:
      linear-gradient(#FFFFFF 0 0) center/12px 2px no-repeat,
      linear-gradient(#FFFFFF 0 0) center/2px 12px no-repeat;
  }
}

.compare-tray-open:hover,
.compare-tray-open:active,
.compare-tray-open:focus

{
  color: #FFFFFF !important;
  background-color: #275B72 !important;
}

@media (max-width: 768px) {
  .compare-tray-open:hover,
  .compare-tray-open:active,
  .compare-tray-open:focus {
    background-color: #275B72 !important;
  }
}

.compare-tray-open:focus {
  outline: none;
}

.compare-tray-open:focus-visible {
  outline: 2px solid #1E1E1E;
  outline-offset: 2px;
}

/* Minimized tray: collapse to a single-line bar */
.compare-tray-minbar {
  display: none;
  width: 100%;
  padding: 8px 10px;
  text-align: center;
  cursor: pointer;
  font-weight: 500;
  font-size: 15px;
  color: #326C88;
  background: #ffffff;
  border-radius: 6px;
  position: relative;
}

@media (max-width: 768px) {
  .compare-tray-minbar {
    font-size: 16px;
  }
}

.compare-tray-minbar-arrow {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  background: url('/wp-content/plugins/sm_wordpress_plugin/assets/img/arrow-up.svg') center center / contain no-repeat;
}

.compare-tray-minbar-arrow-down {
  position: absolute;
  right: 8px;
  top: 8px;
  transform: translateY(-50%) rotate(180deg);
}

.compare-tray-header {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

.compare-tray-item .compare-remove {
  top: 8px;
  right: 8px;
  width: 13px !important;
  height: 13px !important;
}

.compare-tray.is-minimized {
  width: 240px;
  bottom: 70px;
  right: 15px;
  display: block; /* still visible as a single bar */
  box-shadow: 0px 3px 10px -3px rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {
  .compare-tray.is-minimized {
    width: 100%;
    bottom: var(--compare-tray-bottom, 0);
    right: 0;
    left: 0;
    max-height: auto;
    transform: translateY(0);
  }
}

.compare-tray.is-minimized .compare-tray-inner {
  padding: 6px 8px;
}

/* hide detailed content when minimized */
.compare-tray.is-minimized .compare-tray-header {
  display: none !important;
}

.compare-tray.is-minimized .compare-tray-items {
  display: none !important;
}

.compare-tray.is-minimized .compare-tray-open {
  display: none !important;
}

.compare-tray.is-minimized .compare-tray-minbar {
  display: block !important;
}

/* ================================
   Overlay hierarchy & state management
   MOBILE ONLY (max-width: 768px)
================================ */

@media (max-width: 768px) {
  body {
    --compare-tray-bottom: 0px;
  }

  @supports (-webkit-touch-callout: none) {
    body {
      --compare-tray-bottom: 0px;
    }

    .compare-tray.is-minimized {
      bottom: 0 !important;
    }

    .compare-tray.is-minimized .compare-tray-inner {
      padding-bottom: 15px;
    }
  }

  /* 
    Global state: Compare controls the bottom viewport on mobile
    data-compare-state='minimized' or 'expanded'
  */

  /* EXPANDED STATE: Compare takes full bottom zone, hide utilities */
  body[data-compare-state='expanded'] .custom_fc_frame,
  body[data-compare-state='expanded'] .onetap-toggle.design-border1 {
    display: none !important;
  }

  /* 
    Expanded Compare has highest z-index in its zone
    (higher than any floating utilities would have)
  */
  body[data-compare-state='expanded'] .compare-tray {
    z-index: 9998 !important;
  }

  /* MINIMIZED STATE: Compare is a passive bar, utilities coexist */
  body[data-compare-state='minimized'] .compare-tray {
    z-index: 100; /* Below floating utilities */
  }

  /* 
    Adjust floating utilities' bottom position when Compare is minimized.
    They stack ABOVE the minimized Compare drawer without collision.
  */

  /* Freshdesk chat launcher above minimized Compare */
  body[data-compare-state='minimized'] .custom_fc_frame {
    bottom: calc(68px + var(--compare-tray-bottom, 0px)) !important;
    position: fixed !important;
  }

  /* OneTap widget above minimized Compare (lower offset) */
  body[data-compare-state='minimized'] .onetap-toggle.design-border1 {
    bottom: calc(50px + var(--compare-tray-bottom, 0px)) !important;
    position: fixed !important;
  }

  /* Safari-specific: Additional offset for transparent bottom bar */
  @supports (-webkit-touch-callout: none) {
    body[data-compare-state='minimized'] .custom_fc_frame {
      bottom: calc(70px + var(--compare-tray-bottom, 0px)) !important;
    }

    body[data-compare-state='minimized'] .onetap-toggle.design-border1 {
      bottom: calc(52px + var(--compare-tray-bottom, 0px)) !important;
    }
  }

  /* Ensure Freshdesk and OneTap are visible in minimized state */
  body[data-compare-state='minimized'] .custom_fc_frame,
  body[data-compare-state='minimized'] .onetap-toggle.design-border1 {
    display: block !important;
  }
}


/* =========================================================
   STIRLING BRAND VARIANT – Compare module
   ---------------------------------------------------------
   Activated by body.is-stirling (set by header JS when
   .site-header-stirling is present).
   
   Palette:
     Background:  #FFFFFF (stays white)
     Text:        #1C1C1C (replaces grays)
     Font:        Jost    (replaces Inter, Montserrat)
     Accent:      #DDCABB (replaces #326C88 teal)
     Buttons/Rows:#1C1C1C (replaces #1F3440)
     Borders:     #C2C2C2 (unchanged)
   ========================================================= */


/* ---------------------------------------------------------
   Modal shell
   --------------------------------------------------------- */
body.is-stirling .compare-modal-dialog {
  background: #FFFFFF;
}

body.is-stirling .compare-modal-content {
  background: #FFFFFF;
}


/* ---------------------------------------------------------
   Modal heading
   --------------------------------------------------------- */
body.is-stirling .compare-modal-header h2,
body.is-stirling .compare-modal-header h3 {
  color: #1C1C1C !important;
  font-family: 'Jost', sans-serif !important;
}


/* ---------------------------------------------------------
   Compare table – backgrounds, text, borders
   --------------------------------------------------------- */
body.is-stirling .compare-table {
  color: #1C1C1C;
}

body.is-stirling .compare-table th {
  color: #1C1C1C;
  font-family: 'Jost', sans-serif;
}

body.is-stirling .compare-table td {
  color: #1C1C1C;
  font-family: 'Jost', sans-serif;
}

/* Left-hand attribute labels */
body.is-stirling .compare-modal .compare-table tbody th {
  color: #1C1C1C !important;
  font-family: 'Jost', sans-serif !important;
}


/* ---------------------------------------------------------
   Group header rows
   --------------------------------------------------------- */
body.is-stirling .compare-modal .compare-table tr.compare-group th {
  background: #1C1C1C !important;
  color: #FFFFFF !important;
  font-family: 'Jost', sans-serif !important;
}

body.is-stirling .compare-modal .compare-table tr.compare-group th * {
  color: #FFFFFF !important;
}

body.is-stirling .compare-modal .compare-table tr.compare-group td {
  background: #1C1C1C !important;
  color: #FFFFFF !important;
}

body.is-stirling .compare-modal .compare-table tr.compare-group > th,
body.is-stirling .compare-modal .compare-table tr.compare-group > td {
  color: #FFFFFF !important;
}

body.is-stirling .compare-modal .compare-table tr.compare-group:hover > th,
body.is-stirling .compare-modal .compare-table tr.compare-group:hover > td {
  background: #1C1C1C !important;
  color: #FFFFFF !important;
}

body.is-stirling .compare-modal .compare-table tr.compare-group > th *,
body.is-stirling .compare-modal .compare-table tr.compare-group > td * {
  color: #FFFFFF !important;
}


/* ---------------------------------------------------------
   Sidebar bar
   --------------------------------------------------------- */
body.is-stirling .compare-sidebar-bar {
  background-color: #DDCABB !important;
}


/* ---------------------------------------------------------
   Links inside table
   --------------------------------------------------------- */
body.is-stirling .compare-table a,
body.is-stirling .compare-table a:visited,
body.is-stirling .compare-table a:hover,
body.is-stirling .compare-table a:active {
  color: #1C1C1C !important;
}

body.is-stirling .compare-modal .compare-table a,
body.is-stirling .compare-modal .compare-table a:visited,
body.is-stirling .compare-modal .compare-table a:hover,
body.is-stirling .compare-modal .compare-table a:active {
  color: #1C1C1C !important;
}


/* ---------------------------------------------------------
   Product name links & placeholders in modal
   --------------------------------------------------------- */
body.is-stirling .compare-modal .compare-table .compare-add-placeholder,
body.is-stirling .compare-modal .compare-table .compare-product-slot a {
  font-family: 'Jost', sans-serif !important;
  color: #1C1C1C !important;
}

body.is-stirling .compare-modal .compare-table .compare-add-placeholder:hover,
body.is-stirling .compare-modal .compare-table .compare-add-placeholder:active,
body.is-stirling .compare-modal .compare-table .compare-add-placeholder:focus {
  color: #DDCABB !important;
}


/* ---------------------------------------------------------
   Controls (toggle differences / clear all)
   --------------------------------------------------------- */
body.is-stirling .compare-table-controls .compare-toggle-differences {
  background-color: #1C1C1C !important;
  color: #FFFFFF !important;
  font-family: 'Jost', sans-serif !important;
}

body.is-stirling .compare-toggle-differences:hover,
body.is-stirling .compare-toggle-differences:active,
body.is-stirling .compare-toggle-differences:focus {
  background-color: #444444 !important;
  color: #FFFFFF !important;
}

body.is-stirling .compare-table-controls .compare-toggle-differences:focus-visible {
  outline-color: #DDCABB;
}

body.is-stirling .compare-table-controls .compare-clear-all {
  color: #1C1C1C !important;
  font-family: 'Jost', sans-serif !important;
}

body.is-stirling .compare-clear-all:focus-visible {
  outline-color: #DDCABB;
}


/* ---------------------------------------------------------
   Loading spinner
   --------------------------------------------------------- */
body.is-stirling .compare-spinner {
  border-color: #ddd;
  border-top-color: #DDCABB;
}

body.is-stirling .compare-loading p {
  color: #1C1C1C;
  font-family: 'Jost', sans-serif;
}


/* ---------------------------------------------------------
   Compare tray (expanded)
   --------------------------------------------------------- */
body.is-stirling .compare-tray {
  background: #FFFFFF;
  border-color: #ddd;
}

body.is-stirling .compare-tray-title {
  color: #1C1C1C !important;
  font-family: 'Jost', sans-serif !important;
}

body.is-stirling .compare-tray-item {
  border-color: #C2C2C2;
}

body.is-stirling .compare-tray-sku {
  color: #1C1C1C;
  font-family: 'Jost', sans-serif;
}

body.is-stirling .compare-tray-sku a {
  color: #1C1C1C;
}

body.is-stirling .compare-tray-placeholder .compare-tray-add-placeholder {
  color: #1C1C1C !important;
  font-family: 'Jost', sans-serif !important;
}


/* ---------------------------------------------------------
   Tray "Compare" button
   --------------------------------------------------------- */
body.is-stirling .compare-tray-open {
  background-color: #DDCABB !important;
  color: #1C1C1C !important;
  font-family: 'Jost', sans-serif !important;
}

body.is-stirling .compare-tray-open:hover,
body.is-stirling .compare-tray-open:active,
body.is-stirling .compare-tray-open:focus {
  background-color: #C8B5A2 !important;
  color: #1C1C1C !important;
}

body.is-stirling .compare-tray-open:focus-visible {
  outline-color: #DDCABB;
}

@media (max-width: 768px) {
  body.is-stirling .compare-tray-open {
    background-color: #DDCABB !important;
    color: #1C1C1C !important;
  }

  body.is-stirling .compare-tray-open::before {
    border-color: #1C1C1C;
    background:
      linear-gradient(#1C1C1C 0 0) center/12px 2px no-repeat,
      linear-gradient(#1C1C1C 0 0) center/2px 12px no-repeat;
  }

  body.is-stirling .compare-tray-open:hover,
  body.is-stirling .compare-tray-open:active,
  body.is-stirling .compare-tray-open:focus {
    background-color: #C8B5A2 !important;
  }
}


/* ---------------------------------------------------------
   Tray minimized bar
   --------------------------------------------------------- */
body.is-stirling .compare-tray-minbar {
  background-color: #DDCABB !important;
  color: #1C1C1C !important;
  font-family: 'Jost', sans-serif;
}

body.is-stirling .compare-tray.is-minimized {
  background: #DDCABB;
  border-color: #DDCABB;
}


/* ================================
   Print button
================================ */

.compare-table-controls .compare-print {
  border: 0;
  border-radius: 9px;
  margin-bottom: 6px;
  line-height: 1;
  background-color: #1F3440 !important;
  color: #FFFFFF !important;
  font-size: 14px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: Inter, sans-serif;
  font-weight: 500;
}

.compare-print:hover,
.compare-print:active,
.compare-print:focus {
  border: 1;
  border-color: #1E1E1E;
  background-color: #8D8D8D !important;
  color: #1E1E1E !important;
}

.compare-print:focus {
  outline: none;
}

.compare-table-controls .compare-print:focus-visible {
  outline: 2px solid #000000;
  outline-offset: 2px;
}

/* Stirling brand variant */
body.is-stirling .compare-table-controls .compare-print {
  background-color: #1C1C1C !important;
  color: #FFFFFF !important;
  font-family: 'Jost', sans-serif !important;
}

body.is-stirling .compare-print:hover,
body.is-stirling .compare-print:active,
body.is-stirling .compare-print:focus {
  background-color: #444444 !important;
  color: #FFFFFF !important;
}

body.is-stirling .compare-table-controls .compare-print:focus-visible {
  outline-color: #DDCABB;
}


/* ================================
   Print styles
================================ */

@media print {
  /* Landscape orientation for better table fit */
  @page {
    size: landscape;
    margin: 1cm;
  }

  /* Hide ALL direct children of body — removes them from flow entirely */
  body > * {
    display: none !important;
  }

  /* Show only the compare modal */
  body > .compare-modal {
    display: block !important;
  }

  /* Remove body scroll lock and fixed positioning side-effects */
  body {
    overflow: visible !important;
    height: auto !important;
  }

  /* Reset modal from fixed overlay to static document flow */
  .compare-modal {
    position: static !important;
    background: none !important;
    z-index: auto !important;
  }

  .compare-modal-backdrop {
    display: none !important;
  }

  .compare-modal-dialog {
    position: static !important;
    max-width: 100% !important;
    max-height: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    overflow: visible !important;
    background: #ffffff !important;
    box-shadow: none !important;
  }

  .compare-modal-content {
    position: static !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
    background: #ffffff !important;
  }

  /* Hide interactive controls */
  .compare-modal-close,
  .compare-table-controls,
  .compare-remove,
  .compare-add-placeholder,
  .compare-empty-slot {
    display: none !important;
  }

  /* Hide the sidebar bar */
  .compare-sidebar-bar {
    display: none !important;
  }

  /* Hide the compare tray */
  .compare-tray {
    display: none !important;
  }

  /* Table: strip colours, black text, no background */
  .compare-table-wrap {
    overflow: visible !important;
    padding-top: 0 !important;
  }

  .compare-table {
    width: 100% !important;
    margin-left: 0 !important;
    color: #000000 !important;
    font-size: 11px !important;
  }

  .compare-table th,
  .compare-table td {
    color: #000000 !important;
    background: none !important;
    border: 1px solid #999999 !important;
    padding: 6px 8px !important;
    font-size: 11px !important;
  }

  .compare-table thead tr.compare-images th {
    background: none !important;
  }

  /* Keep the controls cell visible (preserves column alignment)
     but hide its contents — .compare-table-controls is already
     hidden via the "interactive controls" rule above. */
  .compare-table thead tr.compare-images th.compare-controls-cell {
    border: none !important;
  }

  /* Pagination: avoid splitting rows or images across pages */
  .compare-table tr {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .compare-table thead {
    display: table-header-group !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  /* Prevent browser from repeating thead on subsequent pages */
  .compare-table thead tr {
    display: table-row !important;
  }

  .compare-table {
    border-collapse: collapse !important;
  }

  /* Override browser's automatic thead repetition */
  .compare-table thead {
    display: table-row-group !important;
  }

  /* Keep group headers attached to the next row */
  .compare-table tr.compare-group {
    break-after: avoid !important;
    page-break-after: avoid !important;
  }

  /* Group header rows: light grey background for distinction */
  .compare-modal .compare-table tr.compare-group th,
  .compare-modal .compare-table tr.compare-group td {
    background: #e0e0e0 !important;
    color: #000000 !important;
    font-size: 13px !important;
  }

  .compare-modal .compare-table tr.compare-group th *,
  .compare-modal .compare-table tr.compare-group td * {
    color: #000000 !important;
  }

  /* Attribute labels */
  .compare-modal .compare-table tbody th {
    color: #000000 !important;
    font-size: 11px !important;
  }

  /* Links: black text, no underline */
  .compare-table a,
  .compare-modal .compare-table a {
    color: #000000 !important;
    text-decoration: none !important;
    font-size: 11px !important;
  }

  /* Suppress browser-generated URL text after links */
  .compare-table a::after,
  .compare-table a[href]::after,
  .compare-modal a::after,
  .compare-modal a[href]::after {
    content: none !important;
    display: none !important;
  }

  /* Modal header */
  .compare-modal-header {
    margin-left: 0 !important;
  }

  .compare-modal-header h2 {
    color: #000000 !important;
    font-size: 10px !important;
  }

  .compare-modal-header h3 {
    color: #000000 !important;
    font-size: 20px !important;
  }

  /* Product images: constrain for print */
  .compare-table thead img {
    max-width: 100px !important;
    height: auto !important;
  }

  /* Lists inside cells */
  .compare-table td ul,
  .compare-table td li {
    font-size: 11px !important;
  }
}


/* END COMPARE MODULE */