/* =========================================================
   MODAL BASE
========================================================= */

.modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  isolation: isolate;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 18px;
  overflow: hidden;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: -4px;
  z-index: 0;

  display: block;

  width: auto;
  min-width: 0;
  height: auto;
  min-height: 0;

  margin: 0;
  padding: 0;

  border: 0;
  border-width: 0;
  border-style: none;
  border-color: transparent;
  border-radius: 0;

  outline: 0;

  appearance: none;
  -webkit-appearance: none;

  background: rgba(5, 5, 8, 0.76);

  box-shadow: none;

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  cursor: default;

  -webkit-tap-highlight-color: transparent;
}

.modal-backdrop:hover,
.modal-backdrop:active,
.modal-backdrop:focus,
.modal-backdrop:focus-visible {
  border: 0;
  outline: 0;

  box-shadow: none;

  transform: none;
}

.modal-card {
  position: relative;
  z-index: 2;
  isolation: isolate;

  width: min(720px, 100%);
  max-height: calc(100vh - 36px);
  padding: 24px;

  overflow-y: auto;
  overscroll-behavior: contain;

  border: 1px solid var(--border);
  border-radius: var(--radius-lg);

  background:
    radial-gradient(
      circle at top right,
      rgba(var(--accent-rgb), 0.07),
      transparent 32%
    ),
    var(--surface);

  color: var(--text);

  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.025);
}
.modal-card::-webkit-scrollbar {
  width: 5px;
}

.modal-card::-webkit-scrollbar-track {
  background: transparent;
}

.modal-card::-webkit-scrollbar-thumb {
  border-radius: 999px;

  background: rgba(255, 255, 255, 0.12);
}

.modal-card::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--accent-rgb), 0.4);
}

/* =========================================================
   BOTÃO DE FECHAR
========================================================= */

.close-modal {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 140;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 36px;
  height: 36px;
  padding: 0;

  border: 1px solid var(--border);
  border-radius: var(--radius-sm);

  background: var(--surface-soft);
  color: var(--text-muted);

  font-size: 0.95rem;
  line-height: 1;

  box-shadow: none;

  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease;
}

.close-modal:hover {
  transform: rotate(4deg);

  border-color: rgba(var(--accent-rgb), 0.44);

  background: rgba(var(--accent-rgb), 0.1);
  color: #ffffff;
}

/* =========================================================
   MODAL DO PRODUTO
========================================================= */

.modal-product-card {
  padding: 22px;
}

.modal-product-layout {
  display: grid;
  grid-template-columns:
    minmax(220px, 0.85fr)
    minmax(0, 1.15fr);
  align-items: start;
  gap: 20px;

  min-width: 0;
}

.modal-gallery {
  display: grid;
  gap: 10px;

  min-width: 0;
}

#modal-image {
  display: block;

  width: 100%;
  aspect-ratio: 1 / 1;

  border: 1px solid var(--border);
  border-radius: var(--radius-md);

  background:
    radial-gradient(
      circle at 50% 15%,
      rgba(var(--accent-rgb), 0.08),
      transparent 36%
    ),
    #0b0906;

  object-fit: contain;
}

/* =========================================================
   MINIATURAS
========================================================= */

.modal-thumbnails {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
  gap: 7px;
}

.modal-thumbnail {
  min-width: 0;
  padding: 4px;

  border: 1px solid var(--border);
  border-radius: var(--radius-sm);

  background: var(--surface-soft);

  transition:
    transform 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.modal-thumbnail:hover {
  transform: translateY(-1px);

  border-color: rgba(var(--accent-rgb), 0.4);
}

.modal-thumbnail.is-active {
  border-color: var(--accent);

  box-shadow:
    0 0 0 1px var(--accent),
    0 7px 16px rgba(0, 0, 0, 0.16);
}

.modal-thumbnail img {
  display: block;

  width: 100%;
  aspect-ratio: 1 / 1;

  border-radius: 6px;

  background: #0b0906;

  object-fit: contain;
}

/* =========================================================
   CONTEÚDO DO PRODUTO
========================================================= */

.modal-product-content {
  display: grid;
  gap: 13px;

  min-width: 0;
}

.modal-product-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;

  min-width: 0;
}

.modal-product-topbar .close-modal {
  position: relative;
  top: auto;
  right: auto;
  z-index: 220;

  width: 34px;
  height: 34px;

  background: var(--surface-soft);

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal-product-content h2,
.auth-modal-content h2 {
  margin: 0;

  color: var(--text);

  font-family: var(--site-font-family);
  font-size: clamp(1.35rem, 2.7vw, 1.8rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.modal-description {
  margin: 0;

  color: var(--text-muted);

  font-size: 0.82rem;
  line-height: 1.55;
}

/* =========================================================
   ETIQUETAS ANIMADAS
========================================================= */

.modal-tags-marquee {
  overflow: hidden;

  border: 1px solid var(--border);
  border-radius: 999px;

  background: rgba(255, 255, 255, 0.025);

  mask-image: linear-gradient(
    90deg,
    transparent 0%,
    #000 7%,
    #000 93%,
    transparent 100%
  );
}

.modal-tags-track {
  display: flex;

  width: max-content;

  animation: modalTagsScroll 24s linear infinite;
}

.modal-tags-track:hover {
  animation-play-state: paused;
}

.modal-tags-group {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 7px;

  padding: 7px 9px;
}

.modal-tag-pill {
  display: inline-flex;
  align-items: center;

  min-height: 27px;
  padding: 0 9px;

  border: 1px solid var(--border);
  border-radius: 999px;

  background: var(--surface-soft);
  color: var(--text);

  font-size: 0.69rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.modal-tag-pill.is-accent {
  border-color: rgba(var(--accent-rgb), 0.3);

  background: var(--accent-soft);
  color: var(--accent-light);
}

.modal-tag-pill.is-muted {
  color: var(--text-muted);
}

@keyframes modalTagsScroll {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

/* =========================================================
   PREÇOS
========================================================= */

.modal-prices {
  display: grid;
  justify-items: start;
  gap: 4px;

  width: max-content;
  max-width: 100%;
  padding: 9px 12px;

  border: 1px solid rgba(var(--accent-rgb), 0.42);
  border-radius: 9px;

  background: linear-gradient(180deg, #272117, #17130e);

  box-shadow:
    0 7px 18px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.modal-prices strong {
  display: block;

  color: #ffd26f;

  font-family: var(--site-font-family);
  font-size: 1.42rem;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.02em;

  text-shadow: 0 1px 7px rgba(255, 193, 69, 0.16);
}

.modal-prices small {
  color: #b8b1a5;

  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

/* =========================================================
   CAMPOS DO PRODUTO
========================================================= */

.modal-field {
  display: grid;
  gap: 6px;
}

.modal-field span,
.quantity-picker > span {
  color: #d9d9e2;

  font-size: 0.78rem;
  font-weight: 700;
}

.modal-field select {
  width: 100%;
  min-height: 42px;
  padding: 0 11px;

  border: 1px solid var(--border);
  border-radius: var(--radius-sm);

  outline: none;

  background: var(--surface-soft);
  color: var(--text);

  transition:
    border-color 150ms ease,
    outline-color 150ms ease;
}

.modal-field select:hover {
  border-color: var(--border-strong);
}

.modal-field select:focus {
  border-color: var(--accent);

  outline: 3px solid rgba(var(--accent-rgb), 0.11);
}

/* =========================================================
   QUANTIDADE
========================================================= */

.quantity-picker {
  display: grid;
  gap: 7px;
}

.piece-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.piece-preset-button {
  min-height: 31px;
  padding: 0 10px;

  border: 1px solid var(--border);
  border-radius: 999px;

  background: var(--surface-soft);
  color: var(--text-muted);

  font-size: 0.7rem;
  font-weight: 700;

  transition:
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease;
}

.piece-preset-button:hover {
  border-color: rgba(var(--accent-rgb), 0.35);

  color: var(--text);
}

.piece-preset-button.is-active {
  border-color: rgba(var(--accent-rgb), 0.48);

  background: var(--accent-soft);
  color: var(--accent-light);
}

.quantity-controls {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 7px;
}

.quantity-controls input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 0 10px;

  border: 1px solid var(--border);
  border-radius: var(--radius-sm);

  outline: none;

  background: var(--surface-soft);
  color: var(--text);

  font-weight: 800;
  text-align: center;
}

.quantity-controls input:focus {
  border-color: var(--accent);

  outline: 3px solid rgba(var(--accent-rgb), 0.1);
}

.quantity-controls .button-secondary {
  width: 44px;
  min-width: 44px;
  min-height: 40px;
  padding: 0;
}
.quantity-controls #decrease-quantity,
.quantity-controls #increase-quantity {
  display: grid;
  place-items: center;

  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;

  border: 1px solid rgba(var(--accent-rgb), 0.35);
  border-radius: 8px;

  background: #272117;
  color: #ffd26f;

  font-family: var(--site-font-family);
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1;

  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);

  cursor: pointer;

  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease,
    box-shadow 150ms ease;
}

.quantity-controls #decrease-quantity:hover,
.quantity-controls #increase-quantity:hover {
  border-color: rgba(var(--accent-rgb), 0.7);

  background: #3a2f1d;
  color: #ffe29a;

  box-shadow:
    0 5px 14px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.quantity-controls #decrease-quantity:active,
.quantity-controls #increase-quantity:active {
  transform: scale(0.95);

  background: #1d1811;
  color: #ffd26f;
}

.quantity-controls #decrease-quantity:focus-visible,
.quantity-controls #increase-quantity:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* =========================================================
   ESPECIFICAÇÕES
========================================================= */

.modal-specs {
  padding: 13px;

  border: 1px solid var(--border);
  border-radius: var(--radius-md);

  background: rgba(255, 255, 255, 0.025);
}

.modal-specs h3 {
  margin: 0 0 9px;

  color: var(--text);

  font-size: 0.82rem;
  font-weight: 800;
}

.modal-specs ul {
  display: grid;
  gap: 6px;

  margin: 0;
  padding-left: 17px;

  color: var(--text-muted);

  font-size: 0.75rem;
  line-height: 1.4;
}

.modal-specs li::marker {
  color: var(--accent);
}

.modal-related-panel {
  padding: 13px;

  border: 1px solid var(--border);
  border-radius: var(--radius-md);

  background: rgba(255, 255, 255, 0.025);
}

.modal-action {
  width: 100%;
}

/* =========================================================
   LOGIN E CADASTRO
========================================================= */

.auth-modal-card {
  width: min(460px, 100%);
}

.auth-modal-content {
  display: grid;
  gap: 13px;
}

.auth-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;

  padding: 4px;

  border: 1px solid var(--border);
  border-radius: var(--radius-md);

  background: rgba(255, 255, 255, 0.025);
}

.auth-mode-switch .button-secondary {
  min-height: 36px;

  border-color: transparent;

  background: transparent;
}

.auth-mode-switch .button-secondary.is-active {
  border-color: rgba(var(--accent-rgb), 0.34);

  background: var(--accent-soft);
  color: var(--accent-light);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 9px;

  color: var(--text-muted);

  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";

  flex: 1;

  height: 1px;

  background: var(--border);
}

.google-login-block {
  display: grid;
  gap: 8px;
}

.google-login-block.is-unavailable {
  padding: 10px 11px;

  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);

  background: rgba(255, 255, 255, 0.025);
}

#google-login-render {
  display: flex;
  justify-content: center;
}

#google-login-render > div {
  display: flex;
  justify-content: center;

  width: 100%;
}

.auth-modal-content .button-secondary {
  width: 100%;
}

.password-requirements {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin: -2px 0 3px;
  padding: 10px 11px;

  border: 1px solid rgba(194, 125, 12, 0.22);
  border-radius: 10px;

  background: rgba(255, 184, 61, 0.08);

  list-style: none;

  transition:
    border-color 150ms ease,
    background-color 150ms ease;
}

.password-requirements li {
  display: flex;
  align-items: center;
  gap: 8px;

  min-width: 0;

  color: #b36a00;

  font-size: 0.76rem;
  font-weight: 650;
  line-height: 1.4;

  transition: color 150ms ease;
}

.password-requirements li::before {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;

  border: 2px solid currentColor;
  border-radius: 50%;

  background: transparent;

  content: "";

  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    box-shadow 150ms ease;
}

.password-requirements li.is-valid {
  color: #188653;
}

.password-requirements li.is-valid::before {
  background: currentColor;

  box-shadow: 0 0 0 3px rgba(24, 134, 83, 0.12);
}

@media (max-width: 420px) {
  .password-requirements {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   BUSCA DE PRODUTOS
   Visual claro com acento dourado inspirado no modelo Hubt
========================================================= */

#search-modal {
  align-items: flex-start;
  justify-content: flex-end;

  padding: 76px 18px 18px;

  --search-surface: #ffffff;
  --search-surface-soft: #f6f7f9;
  --search-page: #eef0f3;
  --search-border: #e2e4e8;
  --search-border-strong: #cbcfd6;
  --search-text: #1c1e22;
  --search-muted: #6b7078;

  --search-accent: #161616;
  --search-accent-soft: rgba(22, 22, 22, 0.1);
  --search-accent-border: rgba(22, 22, 22, 0.38);

  --search-radius-sm: 8px;
  --search-radius-md: 16px;

  --search-shadow:
    0 30px 70px rgba(15, 20, 30, 0.32), 0 8px 22px rgba(15, 20, 30, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

#search-modal .modal-backdrop {
  background: rgba(0, 0, 0, 0.22);

  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.search-modal-card {
  width: min(580px, calc(100vw - 24px));
  max-height: calc(100vh - 96px);
  padding: 0;

  overflow: hidden;

  border: 1px solid var(--search-border);
  border-radius: var(--search-radius-md);

  background: var(--search-surface);
  color: var(--search-text);

  box-shadow: var(--search-shadow);
}

.search-modal-card::-webkit-scrollbar {
  width: 5px;
}

.search-modal-card::-webkit-scrollbar-thumb {
  border-radius: 999px;

  background: #cccccc;
}

.search-modal-content {
  display: grid;
  gap: 0;

  min-width: 0;
}

#search-modal .close-modal {
  top: 8px;
  right: 8px;

  width: 32px;
  height: 32px;

  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;

  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

#search-modal .close-modal:hover {
  transform: none;

  border-color: #ffffff;

  background: rgba(255, 255, 255, 0.25);
}

/* =========================================================
   CABEÇALHO PRETO DA BUSCA
========================================================= */

.search-mini-bar {
  display: grid;
  grid-template-columns:
    20px
    minmax(0, 1fr)
    auto
    auto;
  align-items: center;
  gap: 9px;

  min-height: 56px;
  padding: 8px 46px 8px 14px;

  border: 0;
  border-radius: 0;

  background: linear-gradient(180deg, #252525 0%, #151515 62%, #080808 100%);

  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 6px 16px rgba(0, 0, 0, 0.32);
}

.search-mini-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 20px;
  height: 20px;

  color: #ffffff;
}

.search-mini-icon svg {
  width: 100%;
  height: 100%;
}

.search-mini-bar input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 0 4px;

  border: 0;

  outline: none;

  background: transparent;
  color: #ffffff;

  font-size: 0.88rem;
  font-weight: 500;
}

.search-mini-bar input::placeholder {
  color: rgba(255, 255, 255, 0.78);
}

.search-mini-bar input:focus {
  outline: none;
}

.search-mini-bar {
  transition: box-shadow 150ms ease;
}

.search-mini-bar:focus-within {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.16) inset,
    0 0 0 3px rgba(255, 255, 255, 0.28),
    0 6px 16px rgba(20, 94, 163, 0.28);
}

.search-mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 34px;
  padding: 0 13px;

  border: 1.5px solid rgba(255, 255, 255, 0.72);
  border-radius: 20px;

  background: transparent;
  color: #ffffff;

  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;

  box-shadow: none;

  transition:
    background 130ms ease,
    border-color 130ms ease;
}

.search-mini-button:hover {
  transform: none;

  border-color: #ffffff;

  background: rgba(255, 255, 255, 0.15);

  box-shadow: none;
}

/* =========================================================
   INFORMAÇÕES DA BUSCA
========================================================= */

.search-mini-meta {
  padding: 11px 14px;

  border-bottom: 1px solid var(--search-border);

  background: var(--search-surface-soft);
}

.search-mini-meta .section-subtitle {
  margin: 0;

  color: var(--search-muted);

  font-size: 0.74rem;
  line-height: 1.45;
}

/* =========================================================
   FILTROS
========================================================= */

.search-filters-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;

  padding: 12px 14px;

  border-bottom: 1px solid var(--search-border);

  background: var(--search-surface);
  box-shadow: 0 1px 0 rgba(15, 20, 30, 0.03);
}

.search-filters-panel.is-collapsed {
  display: none;
}

.search-filters-panel label {
  display: grid;
  gap: 5px;

  min-width: 0;
}

.search-filters-panel span {
  color: #555555;

  font-size: 0.68rem;
  font-weight: 700;
}

.search-filters-panel input,
.search-filters-panel select {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 0 10px;

  border: 1px solid var(--search-border);
  border-radius: var(--search-radius-sm);

  outline: none;

  background: var(--search-surface);
  color: var(--search-text);

  font-size: 0.75rem;

  transition:
    border-color 130ms ease,
    box-shadow 130ms ease;
}

.search-filters-panel input::placeholder {
  color: #999999;
}

.search-filters-panel input:hover,
.search-filters-panel select:hover {
  border-color: var(--search-border-strong);
}

.search-filters-panel input:focus,
.search-filters-panel select:focus {
  border-color: var(--search-accent);

  box-shadow: 0 0 0 3px var(--search-accent-soft);
}

/* =========================================================
   SELETOR VISUAL DAS PALETAS
   Só aparece caso esses elementos existam no HTML
========================================================= */

.search-palette-field {
  display: grid;
  gap: 6px;

  grid-column: 1 / -1;
}

.search-palette-field > span {
  color: #555555;

  font-size: 0.68rem;
  font-weight: 700;
}

.search-palette-list {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.search-palette-button {
  position: relative;

  width: 28px;
  height: 28px;
  padding: 0;

  border: 2px solid #ffffff;
  border-radius: 50%;

  background: var(--palette-color, var(--accent));

  box-shadow:
    0 0 0 1px var(--search-border),
    0 3px 7px rgba(0, 0, 0, 0.14);

  transition:
    transform 130ms ease,
    box-shadow 130ms ease;
}

.search-palette-button:hover {
  transform: scale(1.08);
}

.search-palette-button.is-active {
  box-shadow:
    0 0 0 2px var(--search-accent),
    0 4px 9px rgba(0, 0, 0, 0.16);
}

.search-palette-button.is-blue {
  --palette-color: var(--accent);
}

.search-palette-button.is-purple {
  --palette-color: var(--accent);
}

.search-palette-button.is-green {
  --palette-color: #16a369;
}

.search-palette-button.is-red {
  --palette-color: #e53935;
}

.search-palette-button.is-gold {
  --palette-color: var(--accent);
}

/* =========================================================
   MAIS VENDIDOS
========================================================= */

.search-best-sellers-section {
  display: grid;
  gap: 10px;

  padding: 13px 14px 14px;

  background: var(--search-page);
}

.search-best-sellers-head {
  display: grid;
  gap: 2px;
}

.search-best-sellers-head h3 {
  margin: 0;

  color: var(--search-text);

  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.2;
}

.search-best-sellers-head p {
  margin: 0;

  color: var(--search-muted);

  font-size: 0.7rem;
  line-height: 1.4;
}

.search-best-sellers-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

/* =========================================================
   CARDS DOS RESULTADOS DA BUSCA
========================================================= */

.search-best-sellers-grid .product-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  grid-template-rows: auto;
  gap: 0;

  min-height: 104px;
  padding: 0;

  overflow: hidden;

  border: 1px solid var(--search-border);
  border-radius: var(--search-radius-md);

  background: var(--search-surface);
  color: var(--search-text);

  box-shadow: none;

  transition:
    transform 130ms ease,
    border-color 130ms ease,
    box-shadow 130ms ease;
}

.search-best-sellers-grid .product-card:hover {
  transform: translateY(-1px);

  border-color: var(--search-accent-border);

  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.09);
}

.search-best-sellers-grid .product-image-wrap {
  grid-column: 1;
  grid-row: 1;

  min-height: 104px;
  padding: 7px;

  border: 0;
  border-right: 1px solid var(--search-border);
  border-radius: 0;

  background: #f4f4f4;
}

.search-best-sellers-grid .product-image {
  width: 100%;
  height: 90px;

  border: 0;
  border-radius: 4px;

  background: transparent;

  object-fit: contain;
}

.search-best-sellers-grid .product-body {
  grid-column: 2;
  grid-row: 1;

  display: grid;
  align-content: center;

  min-width: 0;
  padding: 9px;

  background: var(--search-surface);
}

.search-best-sellers-grid .product-caption-shell {
  display: grid;
  gap: 7px;

  min-width: 0;
  padding: 0;

  border: 0;
  border-radius: 0;

  background: transparent;

  box-shadow: none;
}

.search-best-sellers-grid .product-caption {
  display: grid;
  gap: 5px;

  min-width: 0;
}

.search-best-sellers-grid .product-body h3 {
  min-height: auto;
  max-height: 2.6em;
  margin: 0;

  color: var(--search-text);

  font-family: var(--site-font-family);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.3;

  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.search-best-sellers-grid .product-description,
.search-best-sellers-grid .product-spec-preview,
.search-best-sellers-grid .product-highlight-row,
.search-best-sellers-grid .product-meta {
  display: none;
}

.search-best-sellers-grid .product-prices {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
}

.search-best-sellers-grid .product-prices strong {
  color: var(--search-accent);

  font-family: var(--site-font-family);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: left;
}

.search-best-sellers-grid .product-prices small {
  color: var(--search-muted);

  font-size: 0.62rem;
}

.search-best-sellers-grid .product-details-button {
  min-height: 30px;
  padding: 0 9px;

  border: 1px solid var(--search-accent);
  border-radius: var(--search-radius-sm);

  background: var(--search-surface);
  color: var(--search-accent);

  font-size: 0.66rem;
  font-weight: 700;

  box-shadow: none;
}

.search-best-sellers-grid .product-details-button:hover {
  transform: none;

  background: var(--search-accent-soft);

  box-shadow: none;
}

.search-best-sellers-grid .product-stock-pill,
.search-best-sellers-grid .product-gallery-counter {
  display: none;
}

/* =========================================================
   RESULTADO VAZIO
========================================================= */

.search-modal-content .empty-card,
.search-empty-state {
  display: grid;
  justify-items: center;
  gap: 6px;

  padding: 24px 15px;

  border: 1px dashed var(--search-border-strong);
  border-radius: var(--search-radius-md);

  background: var(--search-surface);
  color: var(--search-muted);

  text-align: center;
}

.search-modal-content .empty-card h3,
.search-empty-state h3 {
  margin: 0;

  color: var(--search-text);

  font-size: 0.84rem;
}

.search-modal-content .empty-card p,
.search-empty-state p {
  margin: 0;

  color: var(--search-muted);

  font-size: 0.72rem;
  line-height: 1.4;
}

/* =========================================================
   FOCO
========================================================= */

.close-modal:focus-visible,
.modal-thumbnail:focus-visible,
.piece-preset-button:focus-visible,
.search-mini-button:focus-visible,
.search-palette-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

#search-modal .close-modal:focus-visible,
#search-modal .search-mini-button:focus-visible,
#search-modal .search-palette-button:focus-visible {
  outline-color: #ffffff;
}

/* =========================================================
   RESPONSIVIDADE
========================================================= */

@media (max-width: 900px) {
  .modal-product-layout {
    grid-template-columns: 1fr;
  }

  #search-modal {
    align-items: flex-start;
    justify-content: center;

    padding: 72px 12px 12px;
  }

  .search-modal-card {
    width: min(620px, 100%);
    max-height: calc(100vh - 84px);
  }
}

@media (max-width: 640px) {
  .modal {
    padding: 8px;
  }

  .modal-card {
    max-height: calc(100vh - 16px);
    padding: 15px;

    border-radius: var(--radius-md);
  }

  .modal-product-card {
    padding-top: 58px;
  }

  .modal-product-layout {
    gap: 15px;
  }

  .close-modal,
  .modal-product-card .close-modal {
    top: 11px;
    right: 11px;
  }

  #modal-image {
    max-height: 340px;
  }

  .modal-thumbnails {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  #search-modal {
    align-items: stretch;

    padding: 68px 6px 6px;
  }

  .search-modal-card {
    width: 100%;
    max-height: calc(100vh - 74px);

    border-radius: var(--search-radius-md);
  }

  .search-mini-bar {
    grid-template-columns:
      18px
      minmax(0, 1fr)
      auto;

    min-height: 54px;
    padding: 7px 42px 7px 11px;
  }

  .search-mini-bar > :nth-last-child(2):not(input) {
    display: none;
  }

  .search-mini-button {
    min-height: 32px;
    padding: 0 10px;

    font-size: 0.67rem;
  }

  .search-filters-panel {
    grid-template-columns: 1fr;

    padding: 10px;
  }

  .search-palette-field {
    grid-column: auto;
  }

  .search-best-sellers-section {
    padding: 10px;
  }

  .search-best-sellers-grid {
    grid-template-columns: 1fr;
  }

  .search-best-sellers-grid .product-card {
    grid-template-columns: 80px minmax(0, 1fr);

    min-height: 96px;
  }

  .search-best-sellers-grid .product-image-wrap {
    min-height: 96px;
  }

  .search-best-sellers-grid .product-image {
    height: 82px;
  }
}

@media (max-width: 420px) {
  .modal-thumbnails {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .quantity-controls {
    grid-template-columns:
      40px
      minmax(0, 1fr)
      40px;
  }

  .quantity-controls .button-secondary {
    width: 40px;
    min-width: 40px;
  }

  .search-mini-bar {
    grid-template-columns:
      18px
      minmax(0, 1fr);
  }

  .search-mini-button {
    grid-column: 1 / -1;

    width: 100%;
  }
}

/* =========================================================
   MOVIMENTO REDUZIDO
========================================================= */

@media (prefers-reduced-motion: reduce) {
  .close-modal,
  .modal-thumbnail,
  .piece-preset-button,
  .search-mini-button,
  .search-palette-button,
  .search-best-sellers-grid .product-card,
  .search-best-sellers-grid .product-details-button {
    transition: none;
  }

  .modal-tags-track {
    animation: none;
  }
}

/* =========================================================
   CORREÇÃO FINAL — MODAIS CLAROS COMO A SIDEBAR
========================================================= */

#product-modal,
#auth-modal,
#address-modal,
#checkout-modal,
#customer-data-modal {
  --surface: #ffffff;
  --surface-soft: #f5f5f5;
  --surface-strong: #ececec;
  --border: #d7d7d7;
  --border-strong: #bfbfbf;
  --text: #222222;
  --text-muted: #6f6f6f;
}

#product-modal .modal-backdrop,
#auth-modal .modal-backdrop,
#address-modal .modal-backdrop,
#checkout-modal .modal-backdrop,
#customer-data-modal .modal-backdrop {
  background: rgba(35, 35, 35, 0.46) !important;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

#product-modal .modal-card,
#auth-modal .modal-card,
#address-modal .modal-card,
#checkout-modal .modal-card,
#customer-data-modal .modal-card {
  border-color: #d2d2d2 !important;
  background: #ebebeb !important;
  color: #222222 !important;
  box-shadow:
    0 26px 72px rgba(0, 0, 0, 0.25),
    0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

#product-modal .close-modal,
#auth-modal .close-modal,
#address-modal .close-modal,
#checkout-modal .close-modal,
#customer-data-modal .close-modal {
  border-color: #d2d2d2 !important;
  background: #ffffff !important;
  color: #555555 !important;
  box-shadow: none !important;
}

#product-modal .close-modal:hover,
#auth-modal .close-modal:hover,
#address-modal .close-modal:hover,
#checkout-modal .close-modal:hover,
#customer-data-modal .close-modal:hover {
  transform: none !important;
  border-color: var(--accent) !important;
  background: var(--accent-soft) !important;
  color: var(--accent-dark) !important;
}

#modal-image {
  border-color: #d7d7d7 !important;
  background: #f3f3f3 !important;
}

.modal-thumbnail,
.modal-specs,
.modal-related-panel,
.auth-mode-switch,
.google-login-block.is-unavailable {
  border-color: #d7d7d7 !important;
  background: #ffffff !important;
  color: #222222 !important;
}

.modal-thumbnail img {
  background: #f3f3f3 !important;
}

.modal-product-content h2,
.auth-modal-content h2,
.modal-specs h3,
.modal-related-panel h3 {
  color: #222222 !important;
}

.modal-description,
.modal-specs ul,
.auth-modal-content .section-subtitle,
#auth-feedback,
#google-login-feedback {
  color: #6f6f6f !important;
}

.modal-tags-marquee {
  border-color: #d7d7d7 !important;
  background: #ffffff !important;
}

.modal-tag-pill {
  border-color: #d7d7d7 !important;
  background: #f5f5f5 !important;
  color: #333333 !important;
}

.modal-field span,
.quantity-picker > span,
.auth-modal-content label > span,
#address-modal label > span {
  color: #4f4f4f !important;
}

.modal-field select,
.quantity-controls input,
#auth-modal input,
#address-modal input,
#address-modal textarea {
  border-color: #d4d4d4 !important;
  background: #ffffff !important;
  color: #222222 !important;
}

.piece-preset-button,
.auth-mode-switch .button-secondary,
#guest-login-button {
  border-color: #d4d4d4 !important;
  background: #ffffff !important;
  color: #444444 !important;
}

.piece-preset-button:hover,
.auth-mode-switch .button-secondary:hover,
#guest-login-button:hover {
  border-color: var(--accent) !important;
  background: var(--accent-soft) !important;
  color: var(--accent-dark) !important;
}
.password-requirements li span {
  color: #000000;
}
