/* =============================================================================
   Size Chart for WooCommerce — Frontend Styles
   ============================================================================= */

/* ---- CSS custom properties (defaults; overridden per-chart via inline style) */
:root {
  --sc-heading-font-size: 14px;
  --sc-body-font-size: 13px;
  --sc-heading-bg: #000000;
  --sc-heading-color: #ffffff;
  --sc-odd-row-bg: #ffffff;
  --sc-even-row-bg: #f5f5f5;
  --sc-tab-active-bg: #000000;
  --sc-tab-active-color: #ffffff;
  --sc-tab-border-color: #000000;
  --sc-tab-hover-bg: #f0f0f0;
}

/* =============================================================================
   Shared Table Styles
   ============================================================================= */

.sc-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  box-sizing: border-box;
  border-radius: 0;
  overflow-y: hidden;
}

.sc-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  min-width: 560px;
  font-size: var(--sc-body-font-size);
  table-layout: auto;
  color: #0f172a;
}

.sc-table thead tr {
  background-color: #2b3948;
  color: var(--sc-heading-color);
}

.sc-table th {
  font-size: max(var(--sc-heading-font-size), 14px);
  font-weight: 700;
  padding: 16px 20px;
  text-align: center;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.sc-table td {
  padding: 13px 20px;
  text-align: center;
  white-space: nowrap;
  font-size: max(var(--sc-body-font-size), 14px);
  font-weight: 500;
}

.sc-table .sc-row--odd td {
  background-color: #dfe3e7;
}

.sc-table .sc-row--even td {
  background-color: #ffffff;
}

.sc-table tbody tr td:first-child {
  font-weight: 600;
}

/* =============================================================================
   Trigger Button
   ============================================================================= */

.sc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.18s ease, transform 0.12s ease;
  outline: none;
}

.sc-btn:hover {
  opacity: 0.86;
}

.sc-btn:active {
  transform: scale(0.97);
}

.sc-btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* =============================================================================
   Popup Overlay + Panel
   ============================================================================= */

.sc-popup {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999999;
}

.sc-popup.is-open {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Overlay / backdrop */
.sc-popup__overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(1.5px);
  cursor: pointer;
  animation: sc-fade-in 0.22s ease;
}

/* Desktop panel — 32px padding all sides */
.sc-popup__panel {
  position: relative;
  background: #f3f5f7;
  border-radius: 14px;
  border: 2px solid #4b5563;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.24);
  padding: 22px 24px 24px;
  width: 94%;
  max-width: 980px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: sc-slide-up-desktop 0.25s ease;
  z-index: 1;
}

.sc-popup__handle {
  display: none;
}

.sc-popup__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  flex-shrink: 0;
}

.sc-popup__title {
  font-size: clamp(44px, 4.7vw, 66px);
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
  flex: 1;
  color: #0f172a;
}

.sc-popup__close {
  width: 52px;
  height: 52px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  line-height: 0;
  color: #64748b;
  border-radius: 10px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.sc-popup__close:hover {
  background: rgba(255, 255, 255, 0.7);
  color: #111827;
}

.sc-popup__close:focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
}

.sc-popup__description {
  font-size: 16px;
  color: #475569;
  margin: 0 0 16px;
  flex-shrink: 0;
  line-height: 1.5;
}

.sc-popup__body {
  overflow-y: auto;
  overflow-x: visible;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

/* Animations */
@keyframes sc-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes sc-slide-up-desktop {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sc-slide-up-sheet {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

/* =============================================================================
   Tablet (769px – 1024px)
   ============================================================================= */

@media (max-width: 1024px) and (min-width: 769px) {
  .sc-popup__panel {
    padding: 24px;
    max-width: 840px;
  }
}

/* =============================================================================
   Mobile: Bottom Sheet (≤ 768px)
   ============================================================================= */

@media (max-width: 768px) {

  .sc-popup.is-open {
    align-items: flex-end;
    justify-content: stretch;
  }

  .sc-popup__panel {
    width: 100%;
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    padding: 14px 20px 24px;
    max-height: 84vh;
    animation: sc-slide-up-sheet 0.28s cubic-bezier(0.32, 0.72, 0, 1);
    border-left: 1px solid #4b5563;
    border-right: 1px solid #4b5563;
    border-bottom: none;
    box-shadow: 0 -8px 30px rgba(15, 23, 42, 0.22);
  }

  .sc-popup__handle {
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: #d1d5db;
    margin: 0 auto 16px;
    flex-shrink: 0;
  }

  .sc-popup__header {
    margin-bottom: 4px;
  }

  .sc-popup__title {
    font-size: 34px;
  }

  .sc-popup__description {
    font-size: 14px;
    margin-bottom: 18px;
  }

  /* Table inside popup: horizontal scroll on mobile */
  .sc-popup__body .sc-table-wrap {
    margin: 0;
    padding-bottom: 8px;
    padding-left: 2px;
    padding-right: 2px;
  }

  .sc-popup__body .sc-table-wrap::-webkit-scrollbar {
    height: 4px;
  }

  .sc-popup__body .sc-table-wrap::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 2px;
  }

  .sc-popup__body .sc-table-wrap::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 2px;
  }
}

/* =============================================================================
   Inline Table Block
   ============================================================================= */

.sc-inline {
  margin: 1em 0;
}

.sc-inline__title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 20px;
}

.sc-inline__description {
  font-size: 16px;
  color: #6b7280;
  margin: -12px 0 15px;
  line-height: 1.5;
}

.sc-chart-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px 24px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.sc-chart-controls__primary,
.sc-chart-controls__secondary {
  display: flex;
  align-items: center;
}

.sc-chart-controls__secondary {
  margin-left: auto;
}

/* Body scroll lock when popup open */
html.sc-scroll-locked,
html.sc-scroll-locked body {
  overflow: hidden !important;
  height: 100% !important;
}

/* ============================================================
   Pill toggle — multi-table tab switcher
   ============================================================ */

.sc-tab-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.sc-tab-toggle__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 24px;
  background: #fff;
  border: 1.5px solid #475569;
  border-radius: 999px;
  font-size: 15px;
  color: #334155;
  cursor: pointer;
  font-weight: 700;
  line-height: 1.4;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
  white-space: nowrap;
  position: relative;
  box-sizing: border-box;
}

.sc-tab-toggle__btn:first-child {
  margin-left: 0;
}

.sc-tab-toggle__btn:last-child {
}

.sc-tab-toggle__btn:only-child {
}

.sc-tab-toggle__btn:hover {
  background: #f8fafc;
}

.sc-tab-toggle__btn.is-active {
  background: linear-gradient(180deg, #2f4d76 0%, #243c5c 100%);
  color: #fff;
  border-color: #243c5c;
  z-index: 1;
}

.sc-tab-toggle__btn.is-active:hover {
  background: linear-gradient(180deg, #2f4d76 0%, #243c5c 100%);
  color: #fff;
}

.sc-tab-toggle--units {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 4px;
  border: 1.5px solid #475569;
  border-radius: 999px;
  background: #fff;
  flex-wrap: nowrap;
}

.sc-tab-toggle__btn--sub {
  min-width: 96px;
  min-height: 46px;
  padding: 10px 22px;
  margin-left: 0;
  border: none;
  border-radius: 999px !important;
  background: transparent;
  color: #334155;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  box-sizing: border-box;
}

.sc-tab-toggle__btn--sub:hover {
  background: #f8fafc;
}

.sc-tab-toggle__btn--sub.is-active,
.sc-tab-toggle__btn--sub.is-active:hover {
  background: linear-gradient(180deg, #2f4d76 0%, #243c5c 100%);
  color: #fff;
  border-color: transparent;
}

@media (max-width: 768px) {
  .sc-chart-controls {
    align-items: stretch;
    margin-bottom: 18px;
  }

  .sc-chart-controls__primary,
  .sc-chart-controls__secondary {
    width: 100%;
  }

  .sc-chart-controls__secondary {
    margin-left: 0;
  }

  .sc-tab-toggle--primary {
    gap: 10px;
  }

  .sc-tab-toggle__btn {
    min-height: 42px;
    padding: 8px 16px;
    font-size: 12px;
  }

  .sc-tab-toggle--units {
    width: fit-content;
    max-width: 100%;
  }

  .sc-tab-toggle__btn--sub {
    min-width: 82px;
    min-height: 40px;
    padding: 8px 18px;
    font-size: 13px;
  }

  .sc-table {
    min-width: 520px;
  }

  .sc-table th,
  .sc-table td {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* Tab panel visibility */
.sc-tab-panel {
  display: block;
}

.sc-tab-panel[hidden],
.sc-tab-panel:not(.is-active) {
  display: none;
}