/* ===== Top bar ===== */
.topbar {
  background: var(--color-dark);
  padding: 10px 40px;
  text-align: center;
}

.topbar span {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.9);
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* ===== Navbar ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border-light);
  transition: box-shadow var(--transition);
}

.site-header.is-stuck {
  box-shadow: var(--shadow-md);
}

.header-main {
  max-width: var(--max-width);
  margin: 0 auto;
  height: var(--header-height);
  padding: 0 40px;
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-logo-icon {
  height: 36px;
  width: auto;
  display: block;
}

.header-logo-text {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.3px;
  line-height: 1;
}

.header-logo-text .header-logo-accent {
  color: var(--color-accent-orange);
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-left: var(--space-xl);
}

.navbar-links a {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}

.navbar-links a:hover {
  color: var(--color-text);
}

.navbar-links a.is-active {
  color: var(--color-text);
  font-weight: 600;
  border-bottom-color: var(--color-primary);
}

.categories-dropdown {
  position: relative;
}

.categories-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}

.categories-dropdown-trigger:hover {
  color: var(--color-text);
}

.categories-dropdown-trigger svg {
  width: 14px;
  height: 14px;
  transition: transform var(--transition);
}

.categories-dropdown.is-open .categories-dropdown-trigger {
  color: var(--color-text);
  border-bottom-color: var(--color-primary);
}

.categories-dropdown.is-open .categories-dropdown-trigger svg {
  transform: rotate(180deg);
}

.categories-dropdown-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  background: var(--color-white);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  padding: var(--space-xs);
  display: none;
  z-index: 110;
}

.categories-dropdown.is-open .categories-dropdown-menu {
  display: block;
}

.categories-dropdown-menu a {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  text-transform: none;
  letter-spacing: normal;
  color: var(--color-text);
  transition: var(--transition);
}

.categories-dropdown-menu a:hover {
  background: var(--color-surface);
}

.categories-dropdown-menu a.categories-dropdown-see-all {
  margin-top: var(--space-xs);
  border-top: 1px solid var(--color-border-light);
  border-radius: 0;
  font-weight: 600;
  color: var(--color-primary);
}

.header-search {
  flex: 1;
  max-width: 320px;
  margin-left: auto;
  display: none;
  position: relative;
}

.header-search input {
  width: 100%;
  background: var(--color-surface);
  border-radius: var(--radius-full);
  padding: 10px 16px 10px 38px;
  font-size: var(--text-base);
  border: none;
}

.header-search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--color-text-muted);
  pointer-events: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-left: var(--space-md);
  flex-shrink: 0;
}

.header-icon-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--color-text);
  transition: var(--transition);
}

.header-icon-btn:hover {
  background: var(--color-surface);
}

.header-icon-btn svg {
  width: 20px;
  height: 20px;
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--color-accent-orange);
  color: var(--color-white);
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

.header-link-entrar {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  transition: var(--transition);
}

.header-link-entrar:hover {
  background: var(--color-surface);
}

.header-btn-cadastrar {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-white);
  transition: var(--transition);
}

.header-btn-cadastrar:hover {
  background: var(--color-primary-dark);
}

.user-menu {
  position: relative;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--color-text);
  transition: var(--transition);
}

.user-menu-trigger:hover {
  background: var(--color-surface);
}

.user-menu-trigger svg {
  width: 20px;
  height: 20px;
}

.user-menu-name {
  display: none;
}

.user-menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  background: var(--color-white);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 190px;
  padding: var(--space-xs);
  display: none;
  z-index: 110;
}

.user-menu.is-open .user-menu-dropdown {
  display: block;
}

.user-menu-dropdown a,
.user-menu-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  color: var(--color-text);
  transition: var(--transition);
}

.user-menu-dropdown a:hover,
.user-menu-dropdown button:hover {
  background: var(--color-surface);
}

.header-mobile-search {
  padding: 0 var(--space-md) var(--space-sm);
  position: relative;
}

.header-mobile-search svg {
  position: absolute;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--color-text-muted);
  pointer-events: none;
}

.header-mobile-search .form-control {
  padding-left: 38px;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  border: none;
}

@media (min-width: 1024px) {
  .header-search { display: block; }
  .header-mobile-search { display: none; }
  .user-menu-name { display: block; width: auto; padding: 0 8px; }
  .user-menu-trigger { width: auto; border-radius: var(--radius-full); padding-right: 10px; }
}

/* ===== Footer ===== */
.site-footer {
  background: var(--color-dark);
  color: var(--color-white);
  margin-top: var(--space-4xl);
  padding: var(--space-3xl) 40px 0;
}

.footer-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  padding-bottom: var(--space-2xl);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-col-brand .header-logo {
  margin-bottom: var(--space-md);
  display: inline-flex;
}

.footer-col-brand .header-logo-icon {
  height: 32px;
}

.footer-col-brand .header-logo-text {
  display: inline;
  font-size: var(--text-2xl);
  color: var(--color-primary-light);
}

.footer-col-brand .header-logo-accent {
  display: inline;
}

.footer-col p {
  font-size: var(--text-base);
  color: rgba(255,255,255,0.5);
  line-height: 1.7;
  max-width: 260px;
}

.footer-col p.footer-legal-info {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.35);
  line-height: 1.6;
  margin-top: var(--space-md);
  max-width: 280px;
}

.footer-social {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.footer-social a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-social a svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: rgba(255,255,255,0.7);
}

.footer-social a:hover {
  background: var(--color-primary);
}


.footer-col h4 {
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.9);
  margin-bottom: var(--space-lg);
}

.footer-col a:not(.footer-social a),
.footer-col span {
  display: block;
  font-size: var(--text-base);
  color: rgba(255,255,255,0.5);
  margin-bottom: var(--space-sm);
  transition: var(--transition);
}

.footer-col a:hover {
  color: var(--color-white);
}

.footer-bottom {
  text-align: center;
  padding: var(--space-lg) 0;
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.3);
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr;
  }
}

/* ===== Toasts ===== */
.toast-container {
  position: fixed;
  top: var(--space-md);
  right: var(--space-md);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-width: calc(100vw - 2rem);
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  background: var(--color-white);
  border-left: 4px solid var(--color-text-muted);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: var(--space-md);
  min-width: 260px;
  max-width: 360px;
  font-size: var(--text-md);
  animation: toastIn 0.25s ease both;
}

.toast.toast-out {
  animation: toastOut 0.25s ease both;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(24px); }
}

.toast-success { border-left-color: var(--color-success); }
.toast-error { border-left-color: var(--color-error); }
.toast-warning { border-left-color: var(--color-warning); }
.toast-info { border-left-color: var(--color-info); }

.toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.toast-success .toast-icon { color: var(--color-success); }
.toast-error .toast-icon { color: var(--color-error); }
.toast-warning .toast-icon { color: var(--color-warning); }
.toast-info .toast-icon { color: var(--color-info); }

.toast-message {
  flex: 1;
  color: var(--color-text);
}

.toast-close {
  color: var(--color-text-muted);
  flex-shrink: 0;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 46, 0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  z-index: 900;
  animation: fadeIn 0.2s ease both;
}

.modal {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.2s ease both;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--color-border-light);
}

.modal-header h3 {
  font-size: var(--text-xl);
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--color-text-secondary);
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--color-surface);
}

.modal-body {
  padding: var(--space-lg);
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding: var(--space-lg);
  border-top: 1px solid var(--color-border-light);
}

.modal-subtitle {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

/* ===== Product card (usado por buildProductCard em api.js) ===== */
.product-card {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border-light);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.product-card-image {
  aspect-ratio: 3 / 4;
  background: linear-gradient(145deg, var(--color-primary-surface), var(--color-primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  color: rgba(0,0,0,0.2);
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--color-accent-lime);
  color: #1F2937;
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  z-index: 2;
}

.product-card-wishlist {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  background: var(--color-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  z-index: 2;
  color: var(--color-primary);
}

.product-card-wishlist svg {
  width: 16px;
  height: 16px;
}

.product-card-badge--stock {
  background: var(--color-warning);
}

.product-card-body {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.product-card-category {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.product-card-name {
  font-weight: 600;
  color: var(--color-text);
  font-size: var(--text-lg);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-card-price {
  font-weight: 700;
  color: var(--color-primary);
  font-size: var(--text-2xl);
  margin-top: 8px;
}

.product-card-installment {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}
