/* ============================================================
   UGLOW Dynamic Size Chart — Frontend Modal
   ============================================================ */

/* ── Trigger button ── */
.uglow-sc-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: 1.5px solid currentColor;
  color: inherit;
  padding: 9px 18px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  cursor: pointer;
  margin: 8px 0;
  transition: background 0.18s, color 0.18s;
  text-decoration: none;
  line-height: 1.4;
}
.uglow-sc-trigger:hover {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}
.uglow-sc-trigger svg { flex-shrink: 0; }

/* ── Overlay ── */
.uglow-sc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 99999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  overflow: hidden;
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: uglow-fade-in 0.2s ease;
}

@media (min-width: 640px) {
  .uglow-sc-overlay {
    align-items: center;
    padding: 24px;
  }
}

.uglow-sc-overlay[hidden] { display: none !important; }

/* ── Modal ── */
.uglow-sc-modal {
  position: relative;
  background: #fff;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 640px;
  max-height: 92dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  animation: uglow-slide-up 0.28s cubic-bezier(0.34, 1.36, 0.64, 1);
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 640px) {
  .uglow-sc-modal {
    border-radius: 16px;
    max-height: 88vh;
    animation: uglow-pop-in 0.25s cubic-bezier(0.34, 1.2, 0.64, 1);
  }
}

/* ── Close button ── */
.uglow-sc-close {
  position: sticky;
  top: 16px;
  left: 100%;
  float: right;
  margin: 16px 16px -44px auto;
  z-index: 10;
  background: #f3f3f3;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #333;
  flex-shrink: 0;
  transition: background 0.15s;
}
.uglow-sc-close:hover { background: #e0e0e0; }

/* ── Modal header ── */
.uglow-sc-modal-header {
  padding: 20px 24px 0;
}

.uglow-sc-modal-title {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 4px;
  line-height: 1.2;
  letter-spacing: -0.3px;
}

.uglow-sc-modal-subtitle {
  font-size: 13px;
  color: #666;
  margin: 0 0 12px;
  line-height: 1.5;
}

/* ── Tabs ── */
.uglow-sc-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #f0f0f0;
  margin: 0 24px;
  padding: 0;
}

.uglow-sc-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 10px 0;
  margin-right: 24px;
  font-size: 14px;
  font-weight: 600;
  color: #999;
  cursor: pointer;
  letter-spacing: 0.2px;
  transition: color 0.15s, border-color 0.15s;
}

.uglow-sc-tab--active,
.uglow-sc-tab:focus-visible {
  color: #1a1a1a;
  border-bottom-color: #1a1a1a;
  outline: none;
}

.uglow-sc-tab:hover { color: #333; }

/* ── Tab panels ── */
.uglow-sc-tab-panel {
  padding: 20px 24px 28px;
  flex: 1;
}

.uglow-sc-tab-panel[hidden] { display: none; }

/* ── Unit toggle ── */
.uglow-sc-unit-toggle-wrap {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.uglow-sc-unit-toggle {
  display: inline-flex;
  background: #f0f0f0;
  border-radius: 100px;
  padding: 3px;
  gap: 2px;
}

.uglow-sc-unit {
  background: transparent;
  border: none;
  border-radius: 100px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #666;
  cursor: pointer;
  letter-spacing: 0.8px;
  transition: background 0.15s, color 0.15s;
}

.uglow-sc-unit--active {
  background: #1a1a1a;
  color: #fff;
}

/* ── Fit note ── */
.uglow-sc-fit-note {
  font-size: 13px;
  color: #555;
  margin-bottom: 14px;
  line-height: 1.55;
}

/* ── Size table ── */
.uglow-sc-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  border: 1px solid #eee;
}

.uglow-sc-size-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.uglow-sc-size-table thead tr {
  background: #1a1a1a;
  color: #fff;
}

.uglow-sc-size-table th,
.uglow-sc-size-table td {
  padding: 12px 16px;
  text-align: center;
  white-space: nowrap;
  border-bottom: 1px solid #eee;
}

.uglow-sc-size-table th {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.uglow-sc-size-table td:first-child {
  font-weight: 700;
  text-align: left;
  color: #1a1a1a;
}

.uglow-sc-size-table tbody tr:last-child td { border-bottom: none; }

.uglow-sc-size-table tbody tr:nth-child(odd) { background: #fafafa; }

.uglow-sc-size-table tbody tr:hover { background: #f0f4ff; }

/* ── Shortcode inline table ── */
.uglow-sc-shortcode-table { margin: 16px 0; }

/* ── How to Measure ── */
.uglow-sc-guide-wrap {
  padding-top: 4px;
}

.uglow-sc-guide-ref-img {
  text-align: center;
  margin-bottom: 20px;
}

.uglow-sc-guide-ref-img-el {
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid #eee;
}

.uglow-sc-guide-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.uglow-sc-guide-step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.uglow-sc-guide-number {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: #1a1a1a;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.uglow-sc-guide-content { flex: 1; }

.uglow-sc-guide-label {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 4px;
  color: #1a1a1a;
}

.uglow-sc-guide-desc {
  font-size: 13px;
  color: #555;
  margin: 0;
  line-height: 1.6;
}

.uglow-sc-guide-img {
  display: block;
  margin-top: 10px;
  max-width: 160px;
  border-radius: 8px;
  border: 1px solid #eee;
}

/* ── Empty state ── */
.uglow-sc-empty {
  color: #888;
  font-style: italic;
  text-align: center;
  padding: 24px 0;
}

/* ── Animations ── */
@keyframes uglow-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes uglow-slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@keyframes uglow-pop-in {
  from { transform: scale(0.92); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

/* ── Scrollbar styling ── */
.uglow-sc-modal::-webkit-scrollbar { width: 6px; }
.uglow-sc-modal::-webkit-scrollbar-track { background: transparent; }
.uglow-sc-modal::-webkit-scrollbar-thumb { background: #ddd; border-radius: 10px; }

/* ── Focus trap helper ── */
.uglow-sc-overlay:focus { outline: none; }

/* ── Body lock (added by JS when modal open) ── */
body.uglow-sc-open { overflow: hidden; }

/* ── Hidden utility ── */
.uglow-sc-hidden { display: none !important; }
