/* Auto-hide trigger button on products where size guide is disabled (e.g. Pendants) */
body.site-size-guide-disabled .site-size-guide-trigger-wrap,
body.site-size-guide-disabled #site-open-size-guide-btn,
body.site-size-guide-disabled .site-size-guide-btn {
  display: none !important;
}

/**
 * Site Jewelry Size Guides - Luxury Borderless Trigger & Slide-Out Drawer Styles
 */

/* 1. Trigger Link on Product Page (Seamlessly matches XStore links like Wishlist & View Details) */
.site-size-guide-trigger-wrap {
  margin: 10px 0;
  display: inline-flex;
  align-items: center;
}

.site-size-guide-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  color: #171831 !important;
  font-size: 15px !important;
  font-weight: 400 !important;
  cursor: pointer !important;
  text-decoration: none !important;
  line-height: 1.5 !important;
  font-family: inherit !important;
  transition: color 0.2s ease, opacity 0.2s ease !important;
  vertical-align: middle !important;
}

.site-size-guide-btn:hover,
.site-size-guide-btn:focus {
  color: #c7b3a5 !important;
  background: transparent !important;
  border: none !important;
  text-decoration: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.site-size-guide-btn svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  flex-shrink: 0;
  vertical-align: middle;
  transition: stroke 0.2s ease;
}

.site-size-guide-btn span {
  display: inline-block;
  vertical-align: middle;
}

/* 2. Overlay Backdrop */
.site-sg-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999990;
  background: rgba(23, 24, 49, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.site-sg-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* 3. Slide-Out Drawer */
.site-sg-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(100vw, 540px);
  background: #ffffff;
  z-index: 99999999;
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
  color: #222222;
  box-sizing: border-box;
}

.site-sg-drawer.active {
  transform: translateX(0);
  visibility: visible;
}

/* 4. Drawer Header */
.site-sg-header {
  padding: 24px 28px 18px 28px;
  border-bottom: 1px solid #eeeeee;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background: #faf8f6;
}

.site-sg-badge {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
  color: #c7b3a5;
  margin-bottom: 4px;
}

.site-sg-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #171831;
  line-height: 1.25;
}

.site-sg-subtitle {
  margin: 5px 0 0 0;
  font-size: 13px;
  color: #666666;
  line-height: 1.4;
}

.site-sg-close-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #666666;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin-left: 10px;
}

.site-sg-close-btn:hover {
  color: #171831;
  background: #eae6e2;
}

/* 5. Navigation Bar */
.site-sg-nav-bar {
  padding: 12px 28px;
  background: #ffffff;
  border-bottom: 1px solid #eeeeee;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.site-sg-tabs {
  display: flex;
  gap: 8px;
}

.site-sg-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
  color: #777777;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.site-sg-tab:hover {
  color: #171831;
}

.site-sg-tab.active {
  color: #171831;
  border-bottom-color: #171831;
}

/* 6. Unit Switcher */
.site-sg-unit-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-sg-unit-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: #888888;
}

.site-sg-unit-toggle {
  display: inline-flex;
  background: #f1f1f1;
  border-radius: 20px;
  padding: 2px;
}

.site-sg-unit-btn {
  background: transparent;
  border: none;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 16px;
  color: #666666;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.site-sg-unit-btn.active {
  background: #171831;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 7. Drawer Body Content */
.site-sg-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  -webkit-overflow-scrolling: touch;
}

.site-sg-tab-pane {
  display: none;
}

.site-sg-tab-pane.active {
  display: block;
}

/* 8. Visual Cards & Diagrams */
.site-sg-visual-card {
  background: #faf8f6;
  border: 1px solid #eae6e2;
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 20px;
}

.site-sg-visual-header h4 {
  margin: 0;
  font-size: 14px;
  color: #171831;
  font-weight: 700;
}

.site-sg-visual-header span {
  font-size: 12px;
  color: #777777;
}

.site-sg-necklace-diagram {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.site-sg-neck-tier {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid #eeeeee;
  font-size: 13px;
}

.site-sg-neck-tier.highlight {
  border-color: #c7b3a5;
  background: #fdfcfa;
}

.site-sg-neck-tag {
  background: #171831;
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 11px;
  min-width: 44px;
  text-align: center;
}

/* 9. Tip Box */
.site-sg-tip-box {
  background: #f8f6f4;
  border-left: 3px solid #c7b3a5;
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 13px;
  color: #444444;
  margin-bottom: 18px;
  line-height: 1.5;
}

/* 10. Tables */
.site-sg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 10px;
}

.site-sg-table th {
  text-align: left;
  padding: 10px 12px;
  background: #f7f7f7;
  color: #171831;
  font-weight: 700;
  border-bottom: 2px solid #e2e2e2;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.site-sg-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #eeeeee;
  color: #444444;
}

.site-sg-table tr.highlight-row {
  background: #fdfbf7;
}

.site-sg-table tr.highlight-row td {
  color: #171831;
  font-weight: 600;
}

/* 11. Steps (How to measure) */
.site-sg-step {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.site-sg-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #171831;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.site-sg-step-content h4 {
  margin: 0 0 6px 0;
  font-size: 15px;
  color: #171831;
}

.site-sg-step-content p {
  margin: 0;
  font-size: 13px;
  color: #555555;
  line-height: 1.5;
}

.site-sg-step-img {
  margin-top: 14px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #eae6e2;
  background: #ffffff;
  max-width: 300px;
  box-shadow: 0 4px 12px rgba(23, 24, 49, 0.04);
}

.site-sg-step-img img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.site-sg-visual-guide {
  margin: 0 auto 30px auto;
  max-width: 300px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #eae6e2;
  background: #ffffff;
  text-align: center;
  box-shadow: 0 4px 12px rgba(23, 24, 49, 0.04);
  display: flex;
  justify-content: center;
  align-items: center;
}

.site-sg-visual-guide img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

/* 12. Tips Cards */
.site-sg-tip-card {
  background: #faf8f6;
  border: 1px solid #eae6e2;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 15px;
}

.site-sg-tip-card h4 {
  margin: 0 0 6px 0;
  font-size: 14px;
  color: #171831;
}

.site-sg-tip-card p {
  margin: 0;
  font-size: 13px;
  color: #555555;
  line-height: 1.5;
}

/* 13. Footer */
.site-sg-footer {
  padding: 16px 28px;
  border-top: 1px solid #eeeeee;
  background: #ffffff;
}

.site-sg-footer-btn {
  width: 100%;
  background: #171831;
  color: #ffffff;
  border: none;
  padding: 12px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
  font-family: inherit;
}

.site-sg-footer-btn:hover {
  background: #333333;
}

/* 14. Responsive for Mobile */
@media (max-width: 600px) {
  .site-sg-drawer {
    width: 100vw;
  }
  .site-sg-header {
    padding: 18px 20px 14px 20px;
  }
  .site-sg-nav-bar {
    padding: 10px 20px;
  }
  .site-sg-body {
    padding: 18px 20px;
  }
  .site-sg-footer {
    padding: 12px 20px;
  }
}
