/* Páginas internas da loja — complementa style.css */

.store-page {
  min-height: 60vh;
  padding: 28px 0 64px;
  background:
    radial-gradient(circle at 8% 0%, rgba(34, 168, 50, 0.06), transparent 40%),
    #fff;
}

.store-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.store-filter-hint {
  margin: -8px 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.store-filter-hint .linkish {
  border: 0;
  background: none;
  padding: 0;
  color: var(--green-dark);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.store-hero h1 {
  margin: 0 0 6px;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  color: var(--blue-dark);
}

.store-hero p {
  margin: 0;
  color: var(--muted);
  max-width: 52ch;
}

.store-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--muted);
}

.store-breadcrumb a:hover { color: var(--green); }

.store-detail-top {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin: 0 0 18px;
  min-width: 0;
}

.store-detail-top .store-breadcrumb {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  line-height: 1.3;
}

.store-detail-top .store-meta-row {
  flex: 0 1 auto;
  flex-shrink: 1;
  max-width: min(52%, 240px);
  margin: 0;
  min-width: 0;
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.store-card { width: auto; min-width: 0; }

.store-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}

.store-toolbar input,
.store-toolbar select {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 200px;
  background: #fff;
}

.store-empty {
  padding: 48px 24px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius-xl);
  color: var(--muted);
  background: var(--green-soft);
}

.store-empty strong {
  display: block;
  margin-bottom: 8px;
  color: var(--blue-dark);
  font-size: 1.1rem;
}

.store-empty a {
  color: var(--green-dark);
  font-weight: 600;
}

.store-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 28px;
  align-items: start;
}

.store-detail-media {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
  display: block;
  aspect-ratio: auto;
  max-height: none;
  line-height: 0;
}

.store-detail-media img {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: unset;
  object-position: center;
  border-radius: 0;
  background: transparent;
}

.store-detail-info h1 {
  margin: 0;
  font-size: clamp(1.6rem, 2.5vw, 2.1rem);
  line-height: 1.15;
}

.store-detail-desc {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.store-detail-info .muted { color: var(--muted); margin: 0 0 16px; }

.store-price-xl {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 14px 0 12px;
}

.store-price-xl strong {
  font-size: 1.8rem;
  color: var(--blue-dark);
}

.store-price-xl del { color: var(--muted); }

.store-meta-row {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 0;
  border-radius: 999px;
  background: #f1f4f8;
  border: 1px solid #e8ecf1;
  overflow: hidden;
}

.store-cat-chip {
  display: inline-flex;
  align-items: center;
  max-width: 9.5rem;
  padding: 5px 10px;
  border-radius: 0;
  background: transparent;
  color: #5b6475;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  border-right: 1px solid #e0e5ec;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.store-stock {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  color: #8b92a6;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

.detail-discount-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #319e0d;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

/* Badge de canto só no card — nunca no detalhe */
.store-detail .offer-badge {
  display: none !important;
}

.offer-card .offer-badge {
  position: absolute;
}

.store-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.store-actions--tabs {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 4px;
  width: 100%;
  max-width: 420px;
  padding: 4px;
  margin-top: 18px;
  border-radius: 999px;
  background: #eef1f5;
  border: 1px solid var(--border);
}

.store-tab-chip {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.store-tab-chip:hover {
  color: var(--green-dark);
}

.store-tab-chip.is-active {
  background: var(--green);
  color: #fff;
  box-shadow: none;
}

.store-tab-chip.is-active:hover {
  color: #fff;
  background: var(--green-dark, #1b8f2b);
}

.btn-store {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
  border: 0;
  font-weight: 600;
  text-decoration: none;
}

.btn-store-primary {
  background: var(--green);
  color: #fff;
}

.btn-store-primary:hover { background: var(--green-dark); }

.btn-store-ghost {
  background: #fff;
  color: var(--blue-dark);
  border: 1px solid var(--border);
}

.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.7fr);
  gap: 20px;
  align-items: start;
}

.cart-panel,
.account-panel,
.page-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.cart-line {
  display: grid;
  grid-template-columns: auto 72px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
}

.cart-line:last-child { border-bottom: 0; }

.cart-line.is-deselected {
  opacity: 0.55;
}

/* Checkbox Uiverse (cl-checkbox) — Lenín / adaptado à loja */
.cl-checkbox {
  position: relative;
  display: inline-block;
  margin-top: 2px;
  flex-shrink: 0;
}

.cl-checkbox > input {
  appearance: none;
  -moz-appearance: none;
  -webkit-appearance: none;
  z-index: -1;
  position: absolute;
  left: -10px;
  top: -8px;
  display: block;
  margin: 0;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  background-color: rgba(0, 0, 0, 0.6);
  box-shadow: none;
  outline: none;
  opacity: 0;
  transform: scale(1);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.2s;
}

.cl-checkbox > span {
  display: inline-block;
  width: 100%;
  cursor: pointer;
}

.cl-checkbox > span::before {
  content: "";
  display: inline-block;
  box-sizing: border-box;
  margin: 3px 11px 3px 1px;
  border: solid 2px;
  border-color: rgba(0, 0, 0, 0.6);
  border-radius: 2px;
  width: 18px;
  height: 18px;
  vertical-align: top;
  transition: border-color 0.2s, background-color 0.2s;
}

.cl-checkbox > span::after {
  content: "";
  display: block;
  position: absolute;
  top: 3px;
  left: 1px;
  width: 10px;
  height: 5px;
  border: solid 2px transparent;
  border-right: none;
  border-top: none;
  transform: translate(3px, 5.5px) rotate(-45deg);
}

.cl-checkbox > input:checked,
.cl-checkbox > input:indeterminate {
  background-color: var(--green);
}

.cl-checkbox > input:checked + span::before,
.cl-checkbox > input:indeterminate + span::before {
  border-color: var(--green);
  background-color: var(--green);
}

.cl-checkbox > input:checked + span::after,
.cl-checkbox > input:indeterminate + span::after {
  border-color: #fff;
}

.cl-checkbox > input:indeterminate + span::after {
  border-left: none;
  transform: translate(4px, 3px);
}

.cl-checkbox:hover > input {
  opacity: 0.04;
}

.cl-checkbox > input:focus {
  opacity: 0.12;
}

.cl-checkbox:hover > input:focus {
  opacity: 0.16;
}

.cl-checkbox > input:active {
  opacity: 1;
  transform: scale(0);
  transition: transform 0s, opacity 0s;
}

.cl-checkbox > input:active + span::before {
  border-color: #9effab;
}

.cl-checkbox > input:checked:active + span::before {
  border-color: transparent;
  background-color: rgba(0, 0, 0, 0.6);
}

.cl-checkbox > input:disabled {
  opacity: 0;
}

.cl-checkbox > input:disabled + span {
  color: rgba(0, 0, 0, 0.38);
  cursor: initial;
}

.cl-checkbox > input:disabled + span::before {
  border-color: currentColor;
}

.cl-checkbox > input:checked:disabled + span::before,
.cl-checkbox > input:indeterminate:disabled + span::before {
  border-color: transparent;
  background-color: currentColor;
}

.cart-line img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--border);
  align-self: start;
}

.cart-line-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 0;
}

.cart-line h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
}

.cart-line-price small {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.cart-qty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.cart-qty button {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
}

.cart-remove {
  width: auto !important;
  min-width: 0 !important;
  padding: 0 10px !important;
  border-color: #fecaca !important;
  background: #fef2f2 !important;
  color: #b91c1c !important;
  font-size: 12px;
  font-weight: 600;
}

.cart-remove:hover {
  background: #fee2e2 !important;
  border-color: #f87171 !important;
  color: #991b1b !important;
}

.cart-summary h2 {
  margin: 0 0 14px;
  font-size: 1.1rem;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  color: var(--muted);
}

.cart-summary-row.total {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--blue-dark);
  font-weight: 700;
  font-size: 1.05rem;
}

.cart-summary-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.cart-summary-actions .btn-store {
  width: 100%;
}

.cart-summary-actions .btn-store:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.account-panel {
  padding: 0;
  overflow: hidden;
}

.account-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-light);
}

.account-panel-head h2,
.account-panel h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--blue-dark);
}

.account-panel .form-stack {
  padding: 20px;
  gap: 14px;
}

.account-panel-body {
  padding: 20px;
}

.account-panel .form-stack label span {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue-dark);
}

.account-panel .form-stack input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--blue-dark);
  outline: none;
  font: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.account-panel .form-stack input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(34, 168, 50, 0.12);
}

.account-panel .input-readonly,
.account-panel .form-stack input[readonly] {
  background: #f8fafc !important;
  color: var(--muted) !important;
  cursor: default;
  box-shadow: none !important;
}

.form-actions-inline {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--blue-dark);
  padding: 0;
  cursor: pointer;
}

.icon-btn:hover {
  background: #f8fafc;
}

.icon-btn img {
  width: 15px;
  height: 15px;
  object-fit: contain;
  opacity: 0.75;
}

.form-msg {
  margin: 0;
  font-size: 13px;
}

.form-msg--ok {
  color: #15803d;
}

.form-msg--err {
  color: #b91c1c;
}

.form-stack {
  display: grid;
  gap: 12px;
}

.form-stack label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.form-stack input {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  color: var(--blue-dark);
}

.orders-list {
  display: grid;
  gap: 10px;
}

.order-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--border-light);
}

.order-row strong { display: block; color: var(--blue-dark); }
.order-row small { color: var(--muted); }

.badge-status {
  align-self: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #eef2ff;
  color: var(--blue-dark);
  text-transform: capitalize;
}

.page-panel h1 {
  margin: 0 0 12px;
  font-size: 1.6rem;
}

.page-panel h2 {
  margin: 24px 0 8px;
  font-size: 1.1rem;
}

.page-panel p,
.page-panel li {
  color: #445;
  line-height: 1.65;
}

.page-panel ul { padding-left: 1.2rem; }

@media (max-width: 860px) {
  .store-detail,
  .cart-layout {
    grid-template-columns: 1fr;
  }

  .cart-line {
    grid-template-columns: auto 64px minmax(0, 1fr);
    gap: 8px 12px;
    align-items: start;
  }

  .cl-checkbox { margin-top: 2px; }
  .cart-line img { width: 64px; height: 64px; }

  .cart-layout {
    gap: 16px;
    padding-bottom: 8px;
  }

  .cart-summary {
    position: static;
    z-index: auto;
    margin: 0;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
  }

  .cart-qty button {
    width: 36px;
    height: 36px;
  }

  .cart-qty .cart-remove {
    width: auto !important;
    height: 36px;
  }

  .store-detail-top {
    gap: 6px 8px;
  }

  .store-detail-top .store-breadcrumb {
    font-size: 11px;
  }

  .store-detail-top .store-meta-row {
    max-width: min(58%, 200px);
  }

  .store-cat-chip {
    max-width: 7rem;
    padding: 4px 8px;
    font-size: 11px;
  }

  .store-stock {
    padding: 4px 8px;
    font-size: 11px;
  }

  .store-detail-media img {
    max-height: none;
    border-radius: 0;
  }
}
