/* GGS Jersey Options — PDP variant UI */

.ggs-jersey-options {
  --ggs-ui-ink: #0d0d0f;
  --ggs-ui-muted: #61636a;
  --ggs-ui-line: rgba(13, 13, 15, 0.12);
  --ggs-ui-line-strong: rgba(13, 13, 15, 0.6);
  --ggs-ui-soft: #f6f7f8;
  --ggs-ui-focus: #0a3776;
  --ggs-ui-red: #d2342f;
  margin: 22px 0;
  padding: 18px;
  border: 1px solid var(--ggs-ui-line);
  border-radius: 8px;
  background: #fff;
  color: var(--ggs-ui-ink);
  box-shadow: 0 14px 32px -22px rgba(0, 0, 0, 0.18);
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
}

.ggs-jersey-options *,
.ggs-jersey-options *::before,
.ggs-jersey-options *::after {
  box-sizing: border-box;
}

.ggs-option-group,
.ggs-custom-print {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
}

.ggs-option-group:last-of-type,
.ggs-custom-print:last-of-type {
  margin-bottom: 0;
}

.ggs-option-panel {
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid var(--ggs-ui-line);
  border-radius: 8px;
  background: var(--ggs-ui-soft);
}

.ggs-option-panel .ggs-option-group:last-child {
  margin-bottom: 0;
}

.ggs-jersey-options label,
.ggs-option-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ggs-ui-ink);
}

/* Native select fallback */
.ggs-jersey-options select,
.ggs-jersey-options input[type="text"] {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--ggs-ui-line);
  border-radius: 8px;
  background-color: #fff;
  color: var(--ggs-ui-ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 0 14px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.ggs-jersey-options select:focus,
.ggs-jersey-options input[type="text"]:focus {
  border-color: var(--ggs-ui-ink);
  box-shadow: 0 0 0 3px rgba(13, 13, 15, 0.08);
  outline: 0;
}

/* Size as pill grid (JS converts the native <select>) */
.ggs-size-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px;
  margin-top: 4px;
}

.ggs-size-pill {
  appearance: none;
  -webkit-appearance: none;
  background: #fff;
  color: var(--ggs-ui-ink);
  border: 1.5px solid var(--ggs-ui-line);
  border-radius: 8px;
  min-height: 44px;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease, transform 120ms ease;
}

.ggs-size-pill:hover {
  border-color: var(--ggs-ui-line-strong);
  transform: translateY(-1px);
}

.ggs-size-pill.is-active {
  background: var(--ggs-ui-ink);
  border-color: var(--ggs-ui-ink);
  color: #fff;
}

.ggs-size-pill:focus-visible {
  outline: 2px solid var(--ggs-ui-focus);
  outline-offset: 2px;
}

.ggs-option-group-size .ggs-size-select-fallback {
  margin-top: 6px;
}

.ggs-custom-print {
  grid-template-columns: 1fr 1fr;
  column-gap: 12px;
}

.ggs-custom-print .ggs-option-label {
  grid-column: 1 / -1;
}

.ggs-custom-print .ggs-print-preview {
  grid-column: 1 / -1;
}

.ggs-options-subtotal {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--ggs-ui-ink);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
}

.ggs-options-subtotal[hidden] {
  display: none;
}

/* Size chart toggle */
.ggs-size-chart {
  margin-top: 4px;
  font-size: 13px;
  max-width: 100%;
  min-width: 0;
}

.ggs-size-chart summary {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  color: var(--ggs-ui-ink);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ggs-size-chart summary::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
}

.ggs-size-chart[open] summary::after {
  transform: rotate(225deg) translate(-1px, -1px);
}

.ggs-size-chart-body {
  margin-top: 10px;
  padding: 0;
  border: 1px solid var(--ggs-ui-line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  max-width: 100%;
  min-width: 0;
}

.ggs-size-chart-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 12px;
  border-radius: 6px;
}

.ggs-size-chart-table-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.ggs-size-chart-table {
  width: 100%;
  max-width: none;
  border-collapse: collapse;
  min-width: 560px;
}

.ggs-size-chart-table thead,
.ggs-size-chart-table tbody {
  display: table-row-group !important;
}

.ggs-size-chart-table thead {
  display: table-header-group !important;
}

.ggs-size-chart-table tr {
  display: table-row !important;
}

.ggs-size-chart-table th,
.ggs-size-chart-table td {
  display: table-cell !important;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  text-align: left;
  white-space: nowrap;
  font-size: 12.5px;
  line-height: 1.3;
}

.ggs-size-chart-table th {
  background: #f0f2f4;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ggs-size-chart-table tbody tr:nth-child(even) td,
.ggs-size-chart-table tbody tr:nth-child(even) th {
  background: #fafafa;
}

.ggs-size-chart-matrix {
  width: max-content;
  min-width: 760px;
  table-layout: fixed;
  background: #f7fbfb;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #dfe7e7;
  border-radius: 4px;
  overflow: hidden;
}

.ggs-size-chart-matrix th,
.ggs-size-chart-matrix td {
  text-align: center;
  vertical-align: middle;
  padding: 8px 10px !important;
  border-right: 1px solid #dfe7e7 !important;
  border-bottom: 1px solid #dfe7e7 !important;
  background-clip: padding-box;
  color: var(--ggs-ui-ink);
  font-size: 12px !important;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}

.ggs-size-chart-matrix thead th {
  background: #eef6f6 !important;
  font-size: 12px !important;
}

.ggs-size-chart-matrix .ggs-size-chart-title-row th {
  padding: 10px 12px !important;
  background: #edf5f5 !important;
  font-size: 13px !important;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ggs-size-chart-matrix thead tr:last-child th:first-child,
.ggs-size-chart-matrix tbody th {
  min-width: 154px;
  font-weight: 850;
  white-space: normal;
}

.ggs-size-chart-matrix tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #f7fbfb !important;
  text-align: left;
}

.ggs-size-chart-matrix thead tr:last-child th {
  background: #f4f9f9 !important;
}

.ggs-size-chart-matrix thead tr:last-child th:not(:first-child),
.ggs-size-chart-matrix tbody td {
  min-width: 70px;
}

.ggs-size-chart-matrix tbody td {
  background: #fff !important;
  font-weight: 650;
}

.ggs-size-chart-matrix tbody tr:nth-child(even) th,
.ggs-size-chart-matrix tbody tr:nth-child(even) td {
  background: #f8fbfb !important;
}

.ggs-size-chart-matrix tr > :last-child {
  border-right: 0 !important;
}

.ggs-size-chart-matrix tbody tr:last-child th,
.ggs-size-chart-matrix tbody tr:last-child td {
  border-bottom: 0 !important;
}

.ggs-size-chart-note {
  margin: 0;
  padding: 11px 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--ggs-ui-muted);
  font-size: 12px;
  line-height: 1.5;
}

/* SEO summary block */
.ggs-seo-summary {
  margin: 22px 0 0;
  padding: 16px;
  border: 1px solid rgba(0, 0, 0, 0.09);
  border-radius: 8px;
  background: var(--ggs-ui-soft);
  font-size: 13px;
  line-height: 1.6;
  color: #333;
}

.ggs-seo-summary h2 {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ggs-seo-summary p {
  margin: 0 0 8px;
}

.ggs-seo-summary ul {
  margin: 0;
  padding-left: 18px;
}

.ggs-seo-summary li {
  margin: 0 0 5px;
}

/* Swatch grids (player, addons, patches) */
.ggs-swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
  margin-top: 4px;
}

.ggs-swatch {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  background: #fff;
  border: 1.5px solid var(--ggs-ui-line);
  border-radius: 8px;
  padding: 11px 9px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  font: inherit;
  font-size: 13px;
  line-height: 1.2;
  min-height: 60px;
  min-width: 0;
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease, color 140ms ease, transform 140ms ease;
  -webkit-appearance: none;
  appearance: none;
}

.ggs-swatch:hover {
  border-color: var(--ggs-ui-line-strong);
  transform: translateY(-1px);
}

.ggs-swatch:focus-visible {
  outline: 2px solid var(--ggs-ui-focus);
  outline-offset: 2px;
}

.ggs-swatch-active {
  border-color: var(--ggs-ui-ink) !important;
  box-shadow: 0 0 0 1px var(--ggs-ui-ink) inset;
  background: var(--ggs-ui-ink) !important;
  color: #fff !important;
}

.ggs-swatch-active .ggs-swatch-price {
  color: #fff;
  opacity: 0.85;
}

.ggs-swatch-image {
  width: 56px;
  height: 56px;
  object-fit: contain;
  display: block;
  flex: 0 0 auto;
}

.ggs-swatch-text {
  font-size: 12px;
  line-height: 1.25;
  font-weight: 800;
  word-break: break-word;
  letter-spacing: 0.02em;
}

.ggs-swatch-name {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.15;
}

.ggs-swatch-number {
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.ggs-swatch-price {
  font-size: 11px;
  font-weight: 700;
  color: var(--ggs-ui-red);
  opacity: 0.95;
  letter-spacing: 0.02em;
}

.ggs-swatch-grid-player .ggs-swatch {
  min-height: 86px;
}

.ggs-swatch-grid-addon .ggs-swatch {
  min-height: 60px;
}

.ggs-swatch-grid-patch {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: stretch;
}

.ggs-swatch-grid-patch .ggs-swatch {
  min-height: 82px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  justify-content: stretch;
  gap: 10px;
  padding: 10px 12px;
  text-align: left;
}

.ggs-swatch-grid-patch .ggs-swatch .ggs-swatch-text {
  min-width: 0;
  font-size: 12.5px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.ggs-swatch-grid-patch .ggs-swatch .ggs-swatch-price {
  justify-self: end;
  white-space: nowrap;
  font-size: 12px;
}

.ggs-swatch-media {
  width: 58px;
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.ggs-swatch-media .ggs-swatch-image {
  width: 52px;
  height: 52px;
}

.ggs-patch-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid currentColor;
  color: var(--ggs-ui-muted);
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.ggs-patch-icon-none {
  position: relative;
}

.ggs-patch-icon-none::before {
  content: "";
  width: 30px;
  height: 2px;
  background: currentColor;
  transform: rotate(-35deg);
}

.ggs-swatch-active .ggs-swatch-media {
  border-color: rgba(255, 255, 255, 0.2);
}

.ggs-swatch-active .ggs-patch-icon {
  color: #fff;
}

/* Preprinted block */
.ggs-option-group-preprinted {
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--ggs-ui-soft);
  border: 1px dashed rgba(0, 0, 0, 0.15);
}

.ggs-option-group-preprinted strong {
  display: inline-block;
  margin-top: 4px;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Print preview */
.ggs-print-preview {
  margin-top: 14px;
  padding: 14px;
  border: 1px dashed rgba(0, 0, 0, 0.22);
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.ggs-print-preview-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ggs-ui-muted);
  display: block;
  margin-bottom: 8px;
}

.ggs-print-jersey {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 48px;
  font-family: "Impact", "Bebas Neue", "Arial Black", sans-serif;
  letter-spacing: 0.08em;
}

.ggs-print-preview-name {
  font-size: 28px;
  font-weight: 900;
  text-transform: uppercase;
}

.ggs-print-preview-number {
  font-size: 36px;
  font-weight: 900;
}

@media (max-width: 540px) {
  .ggs-jersey-options {
    margin: 18px 0;
    padding: 14px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  body.single-product form.cart .ggs-jersey-options {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .ggs-option-panel {
    padding: 12px;
  }
  .ggs-custom-print {
    grid-template-columns: 1fr;
  }
  .ggs-swatch-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ggs-swatch-grid-patch {
    grid-template-columns: 1fr;
  }
  .ggs-size-grid {
    grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  }
  .ggs-size-chart-body {
    width: 100%;
    max-width: 100%;
  }
  .ggs-size-chart-table-wrap {
    margin-inline: 0;
    padding-bottom: 6px;
  }
  .ggs-size-chart-table {
    width: max-content;
  }
  .ggs-size-chart-matrix {
    min-width: 760px;
  }
  .ggs-print-preview-name {
    font-size: 22px;
  }
  .ggs-print-preview-number {
    font-size: 28px;
  }
}
