/* ══════════════════════════════════════════════════════
   giftsell Cap Konfigurator — CSS v1.2.0
   4-kolumnowy układ: foto | nadruki | kolor+nakład | cena
   Prefix: .gs- wewnątrz .gs-root.gs-type-cap
   ══════════════════════════════════════════════════════ */

.gs-root.gs-type-cap * { box-sizing: border-box; }
.gs-root.gs-type-cap {
  font-family: 'Barlow', sans-serif;
  font-size: 14px;
  color: #222;
  line-height: 1.4;
}

/* ── LOADING / ERROR ─────────────────────────────────── */
.gs-root.gs-type-cap .gs-loading {
  display: flex; align-items: center; gap: 10px;
  padding: 32px 0; color: #999; font-size: 13px;
}
.gs-root.gs-type-cap .gs-spinner {
  width: 20px; height: 20px;
  border: 2.5px solid #eee; border-top-color: #c8102e;
  border-radius: 50%; animation: gs-cap-spin .8s linear infinite; flex-shrink: 0;
}
@keyframes gs-cap-spin { to { transform: rotate(360deg); } }
.gs-root.gs-type-cap .gs-error {
  padding: 14px 16px; background: #fff5f5;
  border: 1px solid #fcc; border-radius: 6px; font-size: 13px; color: #c00;
}

/* ══════════════════════════════════════════════════════
   GRID 4 KOLUMNY
   col1: foto produktu
   col2: pozycje nadruku
   col3: kolory + nakład
   col4: panel ceny (sticky)
   ══════════════════════════════════════════════════════ */
.gs-root.gs-type-cap .gs-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 240px;
  grid-template-areas: "photo print config price";
  gap: 24px;
  align-items: start;
}
@media (max-width: 1100px) {
  .gs-root.gs-type-cap .gs-wrap {
    grid-template-columns: 1fr 1fr 1fr 220px;
    gap: 18px;
  }
}
@media (max-width: 860px) {
  .gs-root.gs-type-cap .gs-wrap {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "photo price"
      "print config";
    gap: 16px;
  }
}
@media (max-width: 560px) {
  .gs-root.gs-type-cap .gs-wrap {
    grid-template-columns: 1fr;
    grid-template-areas: "photo" "print" "config" "price";
  }
}

/* ── KOL 1: FOTO + MINIATURKI ────────────────────────── */
.gs-root.gs-type-cap .gs-col-photo {
  grid-area: photo;
  display: flex; flex-direction: column; gap: 7px;
  min-width: 0;
}

.gs-root.gs-type-cap .gs-preview {
  background: #f4f4f4; border-radius: 8px; overflow: hidden; aspect-ratio: 1/1;
}
.gs-root.gs-type-cap .gs-preview img {
  width: 100%; height: 100%; object-fit: contain; display: block;
}
.gs-root.gs-type-cap .gs-preview.gs-preview-empty {
  display: flex; align-items: center; justify-content: center; color: #ccc; font-size: 12px;
}

.gs-root.gs-type-cap .gs-thumbs {
  display: flex; flex-wrap: wrap; gap: 5px;
}
.gs-root.gs-type-cap .gs-thumb {
  width: 48px; height: 48px; border-radius: 4px; overflow: hidden;
  cursor: pointer; border: 2px solid #e0e0e0; transition: border-color .15s; flex-shrink: 0;
}
.gs-root.gs-type-cap .gs-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gs-root.gs-type-cap .gs-thumb.gs-active { border-color: #c8102e; }
.gs-root.gs-type-cap .gs-thumb:hover:not(.gs-active) { border-color: #aaa; }

/* ── KOL 2: POZYCJE NADRUKU ──────────────────────────── */
.gs-root.gs-type-cap .gs-col-print { grid-area: print; }

/* Nagłówek sekcji — wspólny styl */
.gs-root.gs-type-cap .gs-sec-title {
  font-size: 10px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase;
  color: #aaa; margin: 0 0 12px; padding-bottom: 6px; border-bottom: 1px solid #ebebeb;
}

/* Kafelek nadruku — poziomy rząd */
.gs-root.gs-type-cap .gs-pt-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px 9px 9px;
  border: 1.5px solid #e4e4e4; border-radius: 8px; background: #fff;
  cursor: pointer; margin-bottom: 8px; user-select: none;
  transition: border-color .15s, background .12s;
}
.gs-root.gs-type-cap .gs-pt-row:last-child { margin-bottom: 0; }
.gs-root.gs-type-cap .gs-pt-row:hover { border-color: #c4c4c4; background: #fafafa; }
.gs-root.gs-type-cap .gs-pt-row.gs-selected {
  border-color: #c8102e; background: #fff9f9;
}

/* Miniaturka z nakładką */
.gs-root.gs-type-cap .gs-pt-thumb {
  width: 96px; height: 60px; flex-shrink: 0;
  position: relative; border-radius: 5px; overflow: hidden; background: #efefef;
}
.gs-root.gs-type-cap .gs-pt-thumb img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center; display: block;
}
.gs-root.gs-type-cap .gs-pt-zone {
  display: none;
}
.gs-root.gs-type-cap .gs-pt-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; color: #d0d0d0;
}

/* Tekst kafelka */
.gs-root.gs-type-cap .gs-pt-info { flex: 1; min-width: 0; }
.gs-root.gs-type-cap .gs-pt-label {
  display: block; font-size: 13px; font-weight: 700; color: #1a1a1a; line-height: 1.2;
}
.gs-root.gs-type-cap .gs-pt-size {
  display: block; font-size: 11px; color: #aaa; margin-top: 2px;
}

/* Cena */
.gs-root.gs-type-cap .gs-pt-price {
  font-size: 12px; font-weight: 700; color: #c8102e; white-space: nowrap; flex-shrink: 0;
}
.gs-root.gs-type-cap .gs-pt-price.gs-muted { color: #ccc; font-weight: 400; }

/* ── KOL 3: KOLORY + NAKŁAD ──────────────────────────── */
.gs-root.gs-type-cap .gs-col-config { grid-area: config; min-width: 0; }

/* Siatka kolorów */
.gs-root.gs-type-cap .gs-colors-grid {
  display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 7px;
}
.gs-root.gs-type-cap .gs-color-tile {
  width: 22px; height: 22px; cursor: pointer;
  border: 1.5px solid #d4d4d4; border-radius: 3px; padding: 1px;
  background: #fff; flex-shrink: 0;
  transition: border-color .15s, box-shadow .12s, transform .1s;
}
.gs-root.gs-type-cap .gs-color-tile:hover { border-color: #999; transform: scale(1.12); }
.gs-root.gs-type-cap .gs-color-tile.gs-active {
  border-color: #c8102e; box-shadow: 0 0 0 2px rgba(200,16,46,.2);
}
.gs-root.gs-type-cap .gs-color-tile img {
  width: 16px; height: 16px; border-radius: 1px; object-fit: cover; display: block;
}

/* Nazwa koloru */
.gs-root.gs-type-cap .gs-color-label {
  font-size: 13px; color: #444; min-height: 18px; margin-bottom: 16px;
}

/* Nakład */
.gs-root.gs-type-cap .gs-qty-placeholder { font-size: 12px; color: #bbb; padding-top: 8px; }
.gs-root.gs-type-cap .gs-stock-row { font-size: 12px; color: #888; margin-bottom: 3px; }
.gs-root.gs-type-cap .gs-qty-hint { font-size: 11px; color: #c0c0c0; margin-bottom: 10px; }

.gs-root.gs-type-cap .gs-qty-ctrl {
  display: inline-flex; align-items: center;
  border: 1.5px solid #ddd; border-radius: 8px; overflow: hidden; margin-bottom: 10px;
}
.gs-root.gs-type-cap .gs-qb {
  width: 33px; height: 33px; background: #f6f6f6; border: none; cursor: pointer;
  font-size: 17px; color: #333; display: flex; align-items: center; justify-content: center;
  transition: background .1s; flex-shrink: 0;
}
.gs-root.gs-type-cap .gs-qb:hover { background: #ececec; }
.gs-root.gs-type-cap .gs-qv {
  min-width: 42px; text-align: center; font-size: 15px; font-weight: 700;
  color: #111; line-height: 33px; padding: 0 4px;
}

.gs-root.gs-type-cap .gs-ppu { font-size: 13px; color: #555; }
.gs-root.gs-type-cap .gs-ppu strong { color: #111; }

/* Stan magazynowy */
.gs-root.gs-type-cap .gs-sok  { color: #2e7d32; font-weight: 600; }
.gs-root.gs-type-cap .gs-slow { color: #e65100; font-weight: 600; }
.gs-root.gs-type-cap .gs-s0   { color: #bbb; }

/* ── KOL 4: PANEL CENY ────────────────────────────────── */
.gs-root.gs-type-cap .gs-col-price {
  grid-area: price; position: sticky; top: 24px;
}
@media (max-width: 860px) { .gs-root.gs-type-cap .gs-col-price { position: static; } }

.gs-root.gs-type-cap .gs-price-panel {
  background: #1a1a1a; color: #fff; padding: 20px 18px; border-radius: 10px;
}
.gs-root.gs-type-cap .gs-price-label {
  font-size: 10px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase;
  color: #555; padding-bottom: 8px; border-bottom: 1px solid #2a2a2a; margin-bottom: 10px;
}
.gs-root.gs-type-cap .gs-price-main {
  font-size: 36px; font-weight: 700;
  font-family: 'Barlow Condensed', 'Barlow', sans-serif;
  letter-spacing: -.02em; line-height: 1; margin-bottom: 3px;
}
.gs-root.gs-type-cap .gs-price-sub {
  font-size: 11px; color: rgba(255,255,255,.3); margin-bottom: 14px;
}
.gs-root.gs-type-cap .gs-breakdown {
  border-top: 1px solid #282828; padding-top: 10px; margin-bottom: 14px;
}
.gs-root.gs-type-cap .gs-br-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px; color: #666; padding: 3px 0;
}
.gs-root.gs-type-cap .gs-br-row span:last-child { font-weight: 600; color: #aaa; }
.gs-root.gs-type-cap .gs-br-total {
  border-top: 1px solid #2a2a2a; margin-top: 5px; padding-top: 7px; font-weight: 700;
}
.gs-root.gs-type-cap .gs-br-total span { color: #fff !important; }
.gs-root.gs-type-cap .gs-termin {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: rgba(255,255,255,.3); margin-bottom: 14px;
}
.gs-root.gs-type-cap .gs-termin strong { color: rgba(255,255,255,.55); }
.gs-root.gs-type-cap .gs-btn-cart {
  width: 100%; padding: 13px 10px;
  background: #c8102e; color: #fff; border: none; border-radius: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: .06em; cursor: pointer;
  font-family: 'Barlow', sans-serif;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  transition: background .2s, transform .1s;
}
.gs-root.gs-type-cap .gs-btn-cart:hover:not(:disabled) { background: #a50d25; transform: translateY(-1px); }
.gs-root.gs-type-cap .gs-btn-cart:active:not(:disabled) { transform: translateY(0); }
.gs-root.gs-type-cap .gs-btn-cart:disabled { background: #2a2a2a; cursor: not-allowed; opacity: .45; }
.gs-root.gs-type-cap .gs-msg {
  font-size: 11px; color: #f87171; margin-top: 8px; min-height: 14px; text-align: center;
}
