/*
 * Gift Wrap Selector — Tema Nonni
 * Paleta: oliva escuro, creme, bege
 * Tipografia: herda Baskerville do tema Astra
 */

/* ── Variáveis de marca ────────────────────────────────────────── */
:root {
  --gws-cor-marca:       #5C5B1E;   /* Marca (oliva principal)     */
  --gws-cor-marca-alt:   #454418;   /* Marca alternativa (escuro)  */
  --gws-cor-titulo:      #6B6A22;   /* Título                      */
  --gws-cor-texto:       #4A4A40;   /* Texto corpo                 */
  --gws-cor-borda:       #E2DECA;   /* Borda sutil                 */
  --gws-cor-bg-sutil:    #F5F1E4;   /* Fundo sutil (creme claro)   */
  --gws-cor-extra:       #D8E4B4;   /* Extra (verde sálvia claro)  */
  --gws-raio:            6px;       /* Border radius global        */
}

/* ── Botão no carrinho ─────────────────────────────────────────── */
.gws-button-wrap {
  margin: 0 0 12px;
  width: 100%;
}

.gws-open-btn {
  width: 100% !important;
  display: block !important;
  background: var(--gws-cor-marca) !important;
  color: #fff !important;
  border-color: var(--gws-cor-marca) !important;
  font-family: inherit !important;
  font-size: 14px !important;
  letter-spacing: .06em !important;
  text-transform: uppercase !important;
  padding: 11px 22px !important;
  border-radius: var(--gws-raio) !important;
  cursor: pointer;
  text-align: center !important;
  transition: background 0.2s;
}

.gws-open-btn:hover {
  background: var(--gws-cor-marca-alt) !important;
  border-color: var(--gws-cor-marca-alt) !important;
}

/* ── Overlay ───────────────────────────────────────────────────── */
#gws-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(30, 28, 18, 0.6);
  z-index: 99999;
  overflow-y: auto;
  padding: 28px 14px;
}

/* ── Modal ─────────────────────────────────────────────────────── */
#gws-modal {
  background: #fff;
  border-radius: 10px;
  max-width: 760px;
  margin: 0 auto;
  box-shadow: 0 12px 48px rgba(30, 28, 18, .22);
  overflow: hidden;
  font-family: inherit;
  color: var(--gws-cor-texto);
}

.gws-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px 18px;
  border-bottom: 1px solid var(--gws-cor-borda);
  background: var(--gws-cor-bg-sutil);
}

.gws-popup-header h2 {
  margin: 0;
  font-size: 20px;
  font-family: inherit;
  font-weight: 600;
  color: var(--gws-cor-titulo);
  letter-spacing: .02em;
}

.gws-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--gws-cor-texto);
  opacity: .5;
  padding: 0 4px;
  line-height: 1;
  font-family: inherit;
}

.gws-close:hover { opacity: 1; }

.gws-popup-body {
  padding: 26px;
  max-height: 68vh;
  overflow-y: auto;
}

/* Scrollbar discreta */
.gws-popup-body::-webkit-scrollbar { width: 5px; }
.gws-popup-body::-webkit-scrollbar-track { background: var(--gws-cor-bg-sutil); }
.gws-popup-body::-webkit-scrollbar-thumb { background: var(--gws-cor-borda); border-radius: 99px; }

.gws-popup-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 26px;
  border-top: 1px solid var(--gws-cor-borda);
  background: var(--gws-cor-bg-sutil);
}

/* ── Slot de embrulho ──────────────────────────────────────────── */
.gws-slot {
  background: #fafaf7;
  border: 1px solid var(--gws-cor-borda);
  border-radius: var(--gws-raio);
  padding: 20px;
  margin-bottom: 18px;
}

.gws-slot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.gws-slot-num {
  font-weight: 600;
  font-size: 13px;
  color: var(--gws-cor-marca);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.gws-remove-slot {
  background: none;
  border: 1px solid var(--gws-cor-borda);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  cursor: pointer;
  color: var(--gws-cor-texto);
  opacity: .5;
  font-size: 13px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}

.gws-remove-slot:hover { opacity: 1; border-color: #a00; color: #a00; }

/* ── Seleção do tipo de embrulho ───────────────────────────────── */
.gws-wrap-selector label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--gws-cor-texto);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 10px;
  opacity: .7;
}

.gws-wrap-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.gws-wrap-option {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1.5px solid var(--gws-cor-borda);
  border-radius: var(--gws-raio);
  padding: 10px 14px;
  cursor: pointer;
  background: #fff;
  transition: border-color .15s, background .15s, box-shadow .15s;
  flex: 1 1 190px;
  max-width: 260px;
}

.gws-wrap-option:hover {
  border-color: var(--gws-cor-marca);
  background: var(--gws-cor-bg-sutil);
}

.gws-wrap-option.selected {
  border-color: var(--gws-cor-marca);
  background: #f3f1e6;
  box-shadow: 0 0 0 3px rgba(92, 91, 30, .12);
}

.gws-wrap-option img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.gws-wrap-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.gws-wrap-info strong {
  font-size: 13px;
  color: var(--gws-cor-titulo);
  font-weight: 600;
  font-family: inherit;
}

.gws-wrap-info span {
  font-size: 12px;
  color: var(--gws-cor-texto);
  opacity: .7;
}

.gws-capacity {
  font-style: italic;
  opacity: .6 !important;
}

/* ── Barra de peso ─────────────────────────────────────────────── */
.gws-slot-items { margin-top: 18px; }

.gws-weight-bar-bg {
  background: var(--gws-cor-borda);
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
  margin-bottom: 5px;
}

.gws-weight-bar {
  height: 100%;
  border-radius: 999px;
  background: var(--gws-cor-marca);
  transition: width .2s, background .2s;
}

.gws-weight-bar.overweight { background: #b94040; }

.gws-weight-label {
  font-size: 11px;
  color: var(--gws-cor-texto);
  opacity: .65;
  margin-bottom: 16px;
  letter-spacing: .02em;
}

.gws-weight-label.overweight {
  color: #a03030;
  opacity: 1;
  font-weight: 600;
}

/* ── Lista de itens ────────────────────────────────────────────── */
.gws-items-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--gws-cor-texto);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 8px;
  opacity: .7;
}

.gws-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--gws-raio);
  margin-bottom: 5px;
  background: #fff;
  border: 1px solid var(--gws-cor-borda);
  flex-wrap: wrap;
  transition: background .1s;
}

.gws-item-row:hover { background: var(--gws-cor-bg-sutil); }

.gws-item-row.unavailable { opacity: .45; }

.gws-item-row label {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  cursor: pointer;
  margin: 0;
}

/* Checkbox com cor da marca */
.gws-item-check { accent-color: var(--gws-cor-marca); width: 15px; height: 15px; cursor: pointer; }

.gws-item-thumb {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.gws-item-name {
  font-size: 13px;
  color: var(--gws-cor-titulo);
  font-family: inherit;
}

.gws-item-weight {
  font-size: 11px;
  color: var(--gws-cor-texto);
  opacity: .55;
  white-space: nowrap;
}

.gws-item-no-weight { font-size: 11px; color: #b07a00; }
.gws-item-taken     { font-size: 11px; color: var(--gws-cor-texto); opacity: .5; font-style: italic; }

.gws-qty-control {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--gws-cor-texto);
  opacity: .8;
}

.gws-item-qty {
  width: 52px;
  padding: 3px 6px;
  border: 1px solid var(--gws-cor-borda);
  border-radius: 4px;
  font-size: 13px;
  text-align: center;
  font-family: inherit;
  color: var(--gws-cor-texto);
}

/* ── Mensagem do cartão ────────────────────────────────────────── */
.gws-message-field { margin-top: 16px; }

.gws-message-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--gws-cor-texto);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 6px;
  opacity: .7;
}

.gws-message {
  width: 100%;
  border: 1px solid var(--gws-cor-borda);
  border-radius: var(--gws-raio);
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--gws-cor-texto);
  background: #fff;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color .15s;
}

.gws-message:focus {
  outline: none;
  border-color: var(--gws-cor-marca);
  box-shadow: 0 0 0 3px rgba(92, 91, 30, .1);
}

/* ── Botão adicionar slot ──────────────────────────────────────── */
.gws-add-slot {
  width: 100%;
  border: 1.5px dashed var(--gws-cor-borda);
  background: transparent;
  border-radius: var(--gws-raio);
  padding: 12px;
  cursor: pointer;
  color: var(--gws-cor-marca);
  font-size: 13px;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  transition: border-color .15s, background .15s;
}

.gws-add-slot:hover {
  border-color: var(--gws-cor-marca);
  background: var(--gws-cor-bg-sutil);
}

/* ── Botões do footer ──────────────────────────────────────────── */
.gws-btn-cancel {
  background: #fff;
  border: 1px solid var(--gws-cor-borda);
  border-radius: var(--gws-raio);
  padding: 9px 18px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  color: var(--gws-cor-texto);
  text-transform: uppercase;
  letter-spacing: .06em;
  transition: background .15s;
}

.gws-btn-cancel:hover { background: var(--gws-cor-bg-sutil); }

.gws-btn-confirm {
  background: var(--gws-cor-marca);
  color: #fff;
  border: none;
  border-radius: var(--gws-raio);
  padding: 9px 22px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  transition: background .15s;
}

.gws-btn-confirm:hover    { background: var(--gws-cor-marca-alt); }
.gws-btn-confirm:disabled { background: #aaa8a0; cursor: not-allowed; }

/* ── Loading / erro ────────────────────────────────────────────── */
.gws-loading, .gws-error-msg {
  text-align: center;
  padding: 48px 24px;
  color: var(--gws-cor-texto);
  opacity: .6;
  font-size: 15px;
  font-family: inherit;
}

.gws-error-msg { color: #a03030; opacity: 1; }

/* ── Responsivo ────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .gws-wrap-option  { max-width: 100%; }
  .gws-popup-body   { padding: 16px; }
  .gws-popup-header { padding: 16px 18px 14px; }
  .gws-popup-footer { padding: 12px 16px; }
}