/* ─── WP Size Guide — Public Styles ─────────────────────────────────────────── */

/* Import a clean modern font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Size Guide Button ──────────────────────────────────────────────────────── */

/* Hard reset — neutralise WooCommerce and theme button overrides */
button#wpsg-open-modal,
button#wpsg-open-modal:hover,
button#wpsg-open-modal:focus,
button#wpsg-open-modal:active {
  all: unset; /* nuclear reset */
  box-sizing: border-box;
}

button#wpsg-open-modal {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  margin-top: 10px !important;
  padding: 0 !important;
  background: none !important;
  background-color: transparent !important;
  border: none !important;
  border-bottom: 1.5px dashed currentColor !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #555 !important;
  font-family: inherit !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  letter-spacing: 0.3px !important;
  line-height: 1.6 !important;
  cursor: pointer !important;
  text-transform: none !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  height: auto !important;
  vertical-align: middle !important;
  text-decoration: none !important;
  transition: color 0.2s ease, border-color 0.2s ease !important;
  outline: none !important;
  -webkit-appearance: none !important;
}

button#wpsg-open-modal:hover {
  color: #111 !important;
  border-bottom-color: #111 !important;
  background: none !important;
  background-color: transparent !important;
  transform: none !important;
  box-shadow: none !important;
}

button#wpsg-open-modal:focus-visible {
  outline: 2px solid #6366f1 !important;
  outline-offset: 3px !important;
  border-radius: 2px !important;
}

button#wpsg-open-modal svg {
  flex-shrink: 0 !important;
  width: 14px !important;
  height: 14px !important;
  opacity: 0.65 !important;
}


/* ── No-scroll lock ─────────────────────────────────────────────────────────── */
body.wpsg-no-scroll {
  overflow: hidden;
}

/* ── Backdrop ───────────────────────────────────────────────────────────────── */
.wpsg-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 20, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.wpsg-backdrop.wpsg-backdrop-open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Modal Container ────────────────────────────────────────────────────────── */
.wpsg-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  pointer-events: none;
  /* Hidden state */
  opacity: 0;
  transform: translateY(24px) scale(0.97);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.wpsg-modal.wpsg-modal-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ── Modal Inner Card ───────────────────────────────────────────────────────── */
.wpsg-modal-inner {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.22), 0 8px 24px rgba(0, 0, 0, 0.12);
  max-width: 860px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: 'Inter', sans-serif;
}

/* ── Modal Header ───────────────────────────────────────────────────────────── */
.wpsg-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid #f1f1f5;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #ffffff;
}

.wpsg-modal-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
}

.wpsg-title-icon {
  font-size: 22px;
}

.wpsg-close-btn {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  border-radius: 8px;
  color: #ffffff;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}
.wpsg-close-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}
.wpsg-close-btn:focus {
  outline: 2px solid rgba(255,255,255,0.5);
  outline-offset: 2px;
}

/* ── Modal Body ─────────────────────────────────────────────────────────────── */
.wpsg-modal-body {
  overflow-y: auto;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  scroll-behavior: smooth;
}

/* Custom scrollbar */
.wpsg-modal-body::-webkit-scrollbar { width: 6px; }
.wpsg-modal-body::-webkit-scrollbar-track { background: #f5f5f5; border-radius: 3px; }
.wpsg-modal-body::-webkit-scrollbar-thumb { background: #c9cdd4; border-radius: 3px; }
.wpsg-modal-body::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ── Image Gallery ──────────────────────────────────────────────────────────── */
.wpsg-image-gallery {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wpsg-gallery-main {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #f8f9fa;
  max-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wpsg-main-img {
  width: 100%;
  height: 100%;
  max-height: 360px;
  object-fit: contain;
  display: block;
  transition: opacity 0.2s;
}

.wpsg-gallery-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.wpsg-thumb-btn {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  background: #f1f1f5;
  transition: border-color 0.2s, transform 0.15s;
}
.wpsg-thumb-btn:hover {
  border-color: #6366f1;
  transform: scale(1.05);
}
.wpsg-thumb-btn.wpsg-thumb-active {
  border-color: #1a1a2e;
}
.wpsg-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Measurement Table ──────────────────────────────────────────────────────── */
.wpsg-table-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wpsg-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.wpsg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 400px;
}

.wpsg-table thead {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #ffffff;
}

.wpsg-table thead th {
  padding: 13px 16px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  white-space: nowrap;
}

.wpsg-table thead th:first-child {
  text-align: left;
}

.wpsg-table tbody tr {
  transition: background 0.15s;
  border-bottom: 1px solid #f1f5f9;
}

.wpsg-table tbody tr:last-child {
  border-bottom: none;
}

.wpsg-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.wpsg-table tbody tr:hover {
  background: #eef2ff;
}

.wpsg-table td {
  padding: 12px 16px;
  text-align: center;
  color: #374151;
  font-size: 14px;
}

.wpsg-table td.wpsg-size-cell {
  text-align: left;
  font-weight: 700;
  color: #1a1a2e;
  font-size: 15px;
  letter-spacing: 0.5px;
}

.wpsg-table-note {
  font-size: 12px;
  color: #9ca3af;
  margin: 0;
  text-align: center;
  font-style: italic;
}

/* ── Empty state ────────────────────────────────────────────────────────────── */
.wpsg-empty-state {
  text-align: center;
  color: #9ca3af;
  padding: 40px 0;
  font-size: 15px;
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .wpsg-modal-inner {
    border-radius: 12px;
    max-height: 95vh;
  }

  .wpsg-modal-header {
    padding: 16px 18px;
  }

  .wpsg-modal-title {
    font-size: 17px;
  }

  .wpsg-modal-body {
    padding: 18px;
    gap: 18px;
  }

  .wpsg-gallery-main {
    max-height: 240px;
  }

  .wpsg-table thead th,
  .wpsg-table td {
    padding: 10px 12px;
    font-size: 13px;
  }
}
