/* Backorder Similar Items Drawer - BEM */

/* ===== Drawer Content Container ===== */
.bo-similar {
  display: flex;
  flex-direction: column;
  font-family: var(--galls-font-gt-america-standard);
  overflow-y: auto;
  max-height: 100%;
  padding: 16px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

/* Webkit scrollbar (Chrome/Edge/Safari) */
.bo-similar::-webkit-scrollbar {
  width: 5px;
}
.bo-similar::-webkit-scrollbar-track {
  background: transparent;
}
.bo-similar::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 10px;
}
.bo-similar::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

/* ===== Header ===== */
.bo-similar__header {
  display: flex;
  align-items: center;
  padding-bottom: 2px;
}

.bo-similar__title {
  font-family: var(--galls-font-gt-america-condensed);
  font-weight: var(--galls-fw-700, 700);
  font-size: 20px;
  line-height: 1.3;
  margin: 0;
}

/* ===== Product Identity Row (thumbnail + product name, borderless) ===== */
.bo-similar__identity {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.bo-similar__identity-thumb-wrap {
  width: 44px;
  height: 44px;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
  overflow: hidden;
  flex-shrink: 0;
}

.bo-similar__identity-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bo-similar__identity-name {
  font-family: var(--galls-font-gt-america-standard);
  font-weight: var(--galls-fw-600, 600);
  font-size: 13px;
  color: #1a1a1a;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-right: 8px;
}

/* ===== Status Text (mandatory legal stock message) ===== */
.bo-similar__status-text {
  font-size: 12px;
  color: #666666;
  line-height: 1.4;
  margin: 0 8px 18px 0 !important;
}

/* Fallback state: no alternatives found — just the message in black */
.bo-similar__status-text--fallback {
  color: #000000;
  font-size: 13px;
  margin-top: 4px !important;
}

/* "Shop [Category]" link below stock message on 0-results fallback */
.bo-similar__shop-category {
  display: inline-block;
  font-family: var(--galls-font-gt-america-standard);
  font-size: 14px;
  font-weight: var(--galls-fw-600, 600);
  color: var(--brand-primary, #005dac);
  text-decoration: underline;
  margin-top: 8px;
  cursor: pointer;
}

.bo-similar__shop-category:hover {
  color: var(--brand-primary, #005dac);
  text-decoration: underline;
  opacity: 0.9;
}

/* ===== Section Title (before product grid) ===== */
.bo-similar__section-title {
  display: block;
  font-family: var(--galls-font-gt-america-condensed);
  font-weight: var(--galls-fw-700, 700);
  font-size: 17px;
  color: #29845A;
  line-height: 1.3;
  margin-bottom: 6px;
}

/* ===== Disclaimer Box (below product grid) ===== */
.bo-similar__disclaimer {
  background: #f9f9f9;
  border: 1px solid #f0f0f0;
  border-radius: 6px;
  padding: 12px;
  font-size: 12px;
  color: #666;
  line-height: 1.6;
  margin: 24px 8px 24px;
}

.bo-similar__disclaimer strong {
  color: #333;
}

/* ===== Loading State ===== */
.bo-similar__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 0;
  color: #888;
  font-size: 14px;
}

.bo-similar__spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e0e0e0;
  border-top-color: var(--brand-primary, #005dac);
  border-radius: 50%;
  animation: bo-similar-spin 0.7s linear infinite;
}

@keyframes bo-similar-spin {
  to { transform: rotate(360deg); }
}

/* ===== Skeleton Lazy-Load Pulse ===== */
.bo-similar__skeleton {
  background-color: #e0e0e0;
  animation: bo-similar-skeleton-pulse 1.5s infinite ease-in-out;
}

@keyframes bo-similar-skeleton-pulse {
  0%   { background-color: #e0e0e0; }
  50%  { background-color: #f5f5f5; }
  100% { background-color: #e0e0e0; }
}

/* ===== Product Cards Grid (2-per-row, PLP hit-card from algolia_search.css) ===== */
.bo-similar__cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 0 8px;
}

/* Scoped overrides for PLP cards inside the drawer */
.bo-similar__cards .hit-card {
  width: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.bo-similar__cards .hit-card .hit-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Push mobile QV button to bottom of card */
.bo-similar__cards .hit-card .hit-body .bo-similar__mobile-qv {
  margin-top: auto;
}

.bo-similar__cards .hit-card .hit-header {
  aspect-ratio: 1 / 1;
}

.bo-similar__cards .hit-card .hit-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Ensure swatch row wraps nicely in narrow cards */
.bo-similar__cards .hit-card .hit-color-slider {
  flex-wrap: wrap;
}

/* ===== Quick View Desktop overlay (re-enable inside drawer) ===== */
.bo-similar__cards .hit-card .hit-header .hit-quickview {
  display: block !important;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
@media (min-width: 992px) {
  .bo-similar__cards .hit-card:hover .hit-header .hit-quickview {
    opacity: 1;
    visibility: visible;
  }
}

/* ===== Quick View Mobile button at bottom of card ===== */
.bo-similar__mobile-qv {
  display: none;
  width: 100%;
  padding: 8px 0;
  margin-top: 8px;
  font-family: var(--galls-font-gt-america-standard);
  font-size: 14px;
  font-weight: var(--galls-fw-600, 600);
  text-align: center;
  color: #1a1a1a;
  background: #fff;
  border: 1px solid #1a1a1a;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.bo-similar__mobile-qv:hover {
  background-color: #f5f5f5;
}
@media (max-width: 991px) {
  /* Hide desktop overlay on mobile */
  .bo-similar__cards .hit-card .hit-header .hit-quickview {
    display: none !important;
  }
  /* Show mobile button */
  .bo-similar__mobile-qv {
    display: block;
  }
}

/* ===== Category Link (bottom) ===== */
.bo-similar__category-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 14px;
  font-weight: var(--galls-fw-500, 500);
  color: #888;
  text-decoration: none;
  padding: 0 0 28px;
  transition: color 0.15s ease;
}

.bo-similar__category-link:hover {
  color: var(--brand-primary, #005dac);
}

.bo-similar__category-link svg {
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.bo-similar__category-link:hover svg {
  transform: translateX(2px);
}

/* ===== "Need it sooner?" Link (injected inside stock pill) ===== */

/* Allow the pill to wrap so the shop link falls to its own row */
.pdp__status-pill:has(.bo-similar__shop-link) {
  flex-wrap: wrap;
}

.bo-similar__shop-link {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  flex-basis: 100%;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  padding: 0 0 0 17px;
  margin-top: 4px;
  border: none;
  background: none;
  font-family: var(--galls-font-gt-america-standard);
  line-height: 1.4;
}

.bo-similar__shop-link-label {
  font-weight: var(--galls-fw-700, 700);
  color: #1a1a1a;
  white-space: nowrap;
}

.bo-similar__shop-link-cta {
  font-weight: var(--galls-fw-400, 400);
  color: var(--brand-primary, #005dac);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.bo-similar__shop-link-cta:hover {
  text-decoration: underline;
}

.bo-similar__shop-link svg {
  flex-shrink: 0;
  color: var(--brand-primary, #005dac);
  transition: transform 0.15s ease;
}

.bo-similar__shop-link:hover svg {
  transform: translateX(2px);
}

.site_USP .bo-similar__shop-link {
  padding-left: 0 !important;
}
