/**
 * Product configurator — clear, trustworthy, pleasant to use.
 */

.atc-shell,
.add-to-cart-wrapper {
  --atc-red: #c1272d;
  --atc-red-dark: #9a1e23;
  --atc-ink: #222;
  --atc-muted: #666;
  --atc-line: #e2e2e2;
  --atc-panel: #f6f6f6;
  --atc-card: #ffffff;
  --atc-radius: 12px;
  color: var(--atc-ink);
  font-family: "Open Sans", "Helvetica Neue", Arial, sans-serif;
}

.atc-shell--loading,
.atc-shell--error,
.sends-atc__status,
.sends-atc__error {
  padding: 2rem;
  text-align: center;
  color: var(--atc-red);
  background: var(--atc-panel);
  border-radius: var(--atc-radius);
}

.atc-shell.add-to-cart-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.35rem;
  padding: 1.15rem;
  background: #fff;
  border: 1px solid var(--atc-line);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.07);
}

/* —— Gallery —— */
.atc-gallery {
  background: var(--atc-panel);
  border-radius: var(--atc-radius);
  padding: 0.85rem;
  border: 1px solid var(--atc-line);
}

.atc-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  margin-bottom: 1rem;
  background: linear-gradient(180deg, #fafafa 0%, #f0f0f0 100%);
  border-radius: 10px;
  overflow: hidden;
}

.atc-hero img {
  display: block;
  max-width: 100%;
  max-height: 320px;
  width: auto;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  transition: opacity 0.25s ease, transform 0.35s ease;
}

.atc-thumbs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.atc-thumb {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.4rem;
  border: 2px solid transparent;
  border-radius: 10px;
  background: #fafafa;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.atc-thumb:hover {
  border-color: #ccc;
  transform: translateY(-1px);
}

.atc-thumb.is-active {
  border-color: var(--atc-red);
  box-shadow: 0 0 0 1px var(--atc-red);
  background: #fff;
}

.atc-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
}

.atc-thumb__label {
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  color: var(--atc-muted);
}

.atc-thumb__price {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  color: var(--atc-ink);
}

.atc-thumb.is-active .atc-thumb__label {
  color: var(--atc-ink);
}

.atc-thumb.is-active .atc-thumb__price {
  color: var(--atc-red);
}

.atc-thumb__fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
  color: var(--atc-muted);
}

/* —— Config panel —— */
.atc-panel {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.atc-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--atc-red);
}

.atc-product-title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--atc-ink);
}

.atc-locked-variant {
  margin: 0;
  font-weight: 700;
}

.atc-variant-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
  margin: 0;
  padding: 0.7rem 0.85rem;
  background: var(--atc-panel);
  border: 1px solid var(--atc-line);
  border-radius: 10px;
  font-size: 0.95rem;
}

.atc-variant-hint__label {
  width: 100%;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--atc-muted);
}

.atc-variant-hint strong {
  font-size: 1.05rem;
}

.atc-variant-hint__price {
  margin-left: auto;
  font-weight: 700;
  color: var(--atc-red);
}

.atc-section__title,
.atc-field__label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--atc-ink);
}

.atc-field__hint {
  display: block;
  margin: -0.2rem 0 0.45rem;
  font-size: 0.82rem;
  color: var(--atc-muted);
  font-weight: 400;
}

.atc-select,
.atc-textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0.7rem 0.85rem;
  border: 1px solid #d0d0d0;
  border-radius: 10px;
  background: #fff;
  color: var(--atc-ink);
  font: inherit;
  font-weight: 600;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.atc-select {
  min-height: 46px;
  cursor: pointer;
}

.atc-textarea {
  font-weight: 400;
  min-height: 96px;
  resize: vertical;
}

.atc-select:focus,
.atc-textarea:focus {
  outline: none;
  border-color: var(--atc-red);
  box-shadow: 0 0 0 3px rgba(193, 39, 45, 0.15);
}

/* —— Addon cards —— */
.atc-addons {
  display: grid;
  gap: 0.65rem;
}

.atc-addon {
  position: relative;
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 0.75rem;
  align-items: center;
  margin: 0;
  padding: 0.7rem 0.75rem;
  border: 2px solid var(--atc-line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.atc-addon:hover {
  border-color: #bbb;
}

.atc-addon.is-checked {
  border-color: var(--atc-red);
  background: #fff8f8;
  box-shadow: 0 0 0 1px var(--atc-red);
}

.atc-addon__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.atc-addon__img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--atc-line);
}

.atc-addon__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: var(--atc-panel);
  color: var(--atc-red);
  font-size: 1.5rem;
  font-weight: 700;
}

.atc-addon__body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.atc-addon__title {
  font-weight: 700;
  font-size: 0.95rem;
}

.atc-addon__price {
  font-size: 0.85rem;
  color: var(--atc-muted);
}

.atc-addon__info {
  appearance: none;
  width: 28px;
  height: 28px;
  border: 1px solid #ccc;
  border-radius: 50%;
  background: #fff;
  color: var(--atc-muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  font-style: italic;
  cursor: pointer;
  line-height: 1;
}

.atc-addon__info:hover {
  color: var(--atc-red);
  border-color: var(--atc-red);
}

/* —— Checkout block —— */
.atc-checkout {
  margin-top: 0.25rem;
  padding: 1rem 1.1rem 1.15rem;
  background: #fff;
  border: 1px solid var(--atc-line);
  border-radius: var(--atc-radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.atc-price {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "label value"
    "hint value";
  align-items: baseline;
  gap: 0.15rem 1rem;
  margin-bottom: 0.9rem;
}

.atc-price__label {
  grid-area: label;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--atc-muted);
}

.atc-price__value,
.atc-price .price-item {
  grid-area: value;
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--atc-ink);
  line-height: 1;
}

.atc-price__hint,
.atc-price .price-info {
  grid-area: hint;
  font-size: 0.8rem;
  color: var(--atc-muted);
}

.atc-buy__btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  margin: 0;
  padding: 0.85rem 1.25rem;
  border: 0;
  border-radius: 999px;
  background: var(--atc-red);
  color: #fff;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 14px rgba(193, 39, 45, 0.35);
}

.atc-buy__btn:hover:not(:disabled) {
  background: var(--atc-red-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(193, 39, 45, 0.4);
}

.atc-buy__btn:active:not(:disabled) {
  transform: translateY(0);
}

.atc-buy__btn:disabled {
  opacity: 0.65;
  cursor: wait;
  box-shadow: none;
}

.atc-msg {
  margin: 0.6rem 0 0;
  color: var(--atc-red);
  font-weight: 600;
  font-size: 0.9rem;
}

.atc-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.85rem;
  list-style: none;
  margin: 0.9rem 0 0.75rem;
  padding: 0;
}

.atc-trust li {
  position: relative;
  padding-left: 1.1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #444;
}

.atc-trust li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #2f9e44;
  font-weight: 700;
}

.atc-payments {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--atc-line);
}

.atc-payments img {
  display: block;
  height: 22px;
  width: auto;
  opacity: 0.9;
  filter: grayscale(0.15);
}

/* —— Dialog —— */
.atc-dialog {
  border: 0;
  padding: 0;
  max-width: 26rem;
  width: calc(100% - 2rem);
  border-radius: 14px;
  background: #fff;
  color: var(--atc-ink);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.atc-dialog::backdrop {
  background: rgba(20, 20, 20, 0.5);
}

.atc-dialog__inner {
  padding: 1.15rem 1.25rem 1.25rem;
}

.atc-dialog__inner header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.atc-dialog__inner h3 {
  margin: 0;
  font-size: 1.15rem;
}

.atc-dialog__close {
  appearance: none;
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--atc-muted);
}

.atc-dialog__inner img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0.5rem 0 0.75rem;
  border-radius: 8px;
}

.atc-dialog__ok {
  appearance: none;
  margin-top: 0.75rem;
  padding: 0.55rem 1rem;
  border: 0;
  border-radius: 8px;
  background: var(--atc-red);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

/* —— Desktop —— */
@media (min-width: 860px) {
  .atc-shell.add-to-cart-wrapper {
    grid-template-columns: minmax(280px, 0.95fr) minmax(300px, 1.05fr);
    gap: 1.5rem 1.75rem;
    padding: 1.5rem;
    align-items: start;
  }

  .atc-gallery {
    position: sticky;
    top: 1rem;
  }

  .atc-hero {
    min-height: 280px;
  }

  .atc-hero img {
    max-height: 360px;
  }

  .atc-thumbs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Keep 3 columns so thumb labels stay readable (2×3 grid). */
