/* ——— Jersey product picker cards ——— */
.jersey-product-card {
  cursor: pointer;
  background: #fff;
}

.jersey-product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.jersey-card-fallback {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--line);
}

/* ——— Full-screen builder shell ——— */
#jerseyBuilderApp {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.jersey-app-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  height: 48px;
  flex-shrink: 0;
  padding: 0 1rem;
  border-bottom: 1px solid var(--line);
}

.jersey-app-body {
  flex: 1;
  display: grid;
  grid-template-columns: 3fr 2fr;
  min-height: 0;
}

@media (max-width: 991.98px) {
  .jersey-app-body {
    grid-template-columns: 1fr;
    grid-template-rows: 50vh 1fr;
    overflow-y: auto;
  }
}

/* ——— Canvas pane ——— */
.jersey-canvas-pane {
  position: relative;
  background: linear-gradient(180deg, #eef1f5 0%, #f7f9fb 100%);
  min-height: 0;
}

#jerseyCanvasHost {
  position: absolute;
  inset: 0;
  touch-action: none;
}

#jerseyCanvasHost canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.jersey-toolbar {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: .35rem;
  z-index: 2;
}

.jersey-toolbar .btn-icon {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.jersey-view-toggle {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: .25rem;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(6px);
  padding: .25rem;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow);
  z-index: 2;
}

.jersey-view-toggle .btn {
  border-radius: var(--radius-pill);
  border: 0;
  background: transparent;
  color: var(--ink);
}

.jersey-view-toggle .btn.active {
  background: var(--ink);
  color: #fff;
}

/* ——— Config pane ——— */
.jersey-config-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-left: 1px solid var(--line);
}

.jersey-tabs {
  flex-shrink: 0;
  padding: 0 1rem;
}

.jersey-tabs .nav-link {
  color: var(--muted);
  border: 0;
  border-bottom: 2px solid transparent;
  font-weight: 600;
  font-size: .9rem;
}

.jersey-tabs .nav-link.active {
  color: var(--coral);
  border-bottom-color: var(--coral);
  background: transparent;
}

.jersey-tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.jersey-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: .6rem;
}

.jersey-template-swatch {
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0;
  cursor: pointer;
  text-align: center;
  background: none;
}

.jersey-template-swatch .swatch-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--color-primary-600), var(--color-primary-800));
  color: #fff;
  font-weight: 700;
  font-size: .8rem;
}

.jersey-template-swatch.active {
  border-color: var(--coral);
}

.jersey-template-swatch .swatch-label {
  display: block;
  font-size: .7rem;
  margin-top: .25rem;
  color: var(--muted);
}

.jersey-color-row {
  margin-bottom: 1rem;
}

.jersey-color-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .4rem;
}

.jersey-color-row-head label {
  font-size: .85rem;
  font-weight: 600;
}

.jersey-color-row-head input[type="color"] {
  width: 2.5rem;
  height: 2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  cursor: pointer;
}

.jersey-swatch-list {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
}

.jersey-swatch {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
  cursor: pointer;
  padding: 0;
}

.jersey-pattern-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .5rem;
}

.jersey-pattern-row .zone-label {
  width: 4rem;
  font-size: .75rem;
  text-transform: capitalize;
  color: var(--muted);
}

.jersey-layer-list {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin-bottom: .75rem;
}

.jersey-layer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .45rem .6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: .85rem;
  cursor: pointer;
}

.jersey-layer-item.active {
  border-color: var(--coral);
  background: var(--color-primary-50);
}

.jersey-layer-item .remove-layer {
  color: var(--muted);
  border: 0;
  background: none;
}

.jersey-layer-editor {
  border-top: 1px solid var(--line);
  padding-top: .75rem;
}

.jersey-layer-editor label {
  font-size: .78rem;
  color: var(--muted);
  margin-bottom: .2rem;
  display: block;
}

.jersey-layer-editor .control-row {
  margin-bottom: .6rem;
}

.jersey-footer {
  flex-shrink: 0;
  padding: .85rem 1rem;
  border-top: 1px solid var(--line);
}

/* ——— Picker thumbnails ——— */
.jersey-product-card .product-card-media {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f1f4f8;
}

.jersey-product-card .product-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ——— Selected style badge in the header ——— */
.jersey-style-badge {
  font-size: .72rem;
  font-weight: 600;
  color: var(--coral);
  background: var(--color-primary-50, #eef3fb);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: .1rem .6rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 45vw;
}

/* ——— Template thumbnails ——— */
.jersey-template-swatch .swatch-badge {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* ——— Upload-your-design block ——— */
.jersey-design-upload {
  padding-bottom: .9rem;
  border-bottom: 1px solid var(--line);
}

.jersey-design-preview {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-top: .6rem;
  padding: .5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--color-primary-50, #f5f8fc);
}

.jersey-design-preview img {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line);
  background: #fff;
}

/* ——— Added-to-cart confirmation ——— */
.jersey-added-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e8f7ee;
  color: #27ae60;
  font-size: 1.9rem;
}
