/* Top bar */
.topbar {
  background: var(--brand-blue-dark);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.8125rem;
  min-height: var(--topbar-h);
  display: flex;
  align-items: center;
}

.topbar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.65rem;
  width: 100%;
  text-align: center;
}

.topbar a {
  color: inherit;
}

.topbar a:hover {
  color: #fff;
}

.topbar__item {
  white-space: nowrap;
}

.topbar__sep {
  opacity: 0.45;
  user-select: none;
}

@media (max-width: 575px) {
  .topbar__inner {
    flex-direction: column;
    gap: 0.2rem;
  }

  .topbar__sep {
    display: none;
  }
}

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
  position: relative;
}

.logo img {
  height: 52px;
  width: auto;
}

.main-nav {
  display: none;
  align-items: center;
  gap: 0.25rem;
}

.main-nav a {
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
}

.main-nav a:hover,
.main-nav a.is-active {
  background: var(--brand-blue-light);
  color: var(--brand-blue);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.menu-toggle span {
  display: block;
  height: 2px;
  background: var(--brand-blue);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mega menu */
.nav-item.has-mega {
  position: static;
}

.nav-item.has-mega > button {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.875rem;
  border: none;
  background: transparent;
  font: inherit;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.nav-item.has-mega > button:hover,
.nav-item.has-mega.is-open > button {
  background: var(--brand-blue-light);
  color: var(--brand-blue);
}

.mega-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 1.25rem 0 1.5rem;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem 1.5rem;
  max-height: min(70vh, 520px);
  overflow-y: auto;
  z-index: 101;
}

@media (min-width: 1200px) {
  .mega-menu {
    grid-template-columns: repeat(5, 1fr);
  }
}

.nav-item.has-mega.is-open .mega-menu {
  display: grid;
}

.mega-menu__group h4 {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  color: var(--brand-blue);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.mega-menu__group h4 a {
  color: inherit;
  text-decoration: none;
}

.mega-menu__group h4 a:hover {
  color: var(--brand-red);
}

.mega-menu__empty {
  margin: 0;
  font-size: 0.8125rem;
}

.mega-menu__empty a {
  color: var(--text-muted);
}

.mega-menu__empty a:hover {
  color: var(--brand-blue);
}

.mega-menu__group ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mega-menu__group li + li {
  margin-top: 0.35rem;
}

.mega-menu__group a {
  font-size: 0.875rem;
  color: var(--text);
}

.mega-menu__group a:hover {
  color: var(--brand-red);
}

/* Mobile nav */
.mobile-nav {
  display: none;
  position: fixed;
  inset: calc(var(--topbar-h) + var(--header-h)) 0 0 0;
  background: var(--surface);
  padding: 1rem;
  overflow-y: auto;
  z-index: 99;
  border-top: 1px solid var(--border);
}

.mobile-nav.is-open {
  display: block;
}

.mobile-nav__link {
  display: block;
  padding: 0.875rem 0.5rem;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.mobile-nav__link:hover {
  color: var(--brand-blue);
}

.mobile-nav__section {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.mobile-nav__label {
  display: block;
  padding: 0.875rem 0.5rem 0.35rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.mobile-nav__cat + .mobile-nav__cat {
  margin-top: 0.15rem;
}

.mobile-nav__cat-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 0.5rem;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  border-radius: var(--radius-sm);
}

.mobile-nav__cat-btn:hover,
.mobile-nav__cat.is-open > .mobile-nav__cat-btn {
  background: var(--brand-blue-light);
  color: var(--brand-blue);
}

.mobile-nav__cat-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.mobile-nav__cat-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-muted);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.mobile-nav__cat.is-open .mobile-nav__cat-count {
  background: rgba(255, 255, 255, 0.7);
}

.mobile-nav__chevron {
  flex-shrink: 0;
  transition: transform 0.2s;
}

.mobile-nav__cat.is-open .mobile-nav__chevron {
  transform: rotate(180deg);
}

.mobile-nav__subs {
  list-style: none;
  margin: 0;
  padding: 0 0 0.5rem 0.75rem;
  display: none;
}

.mobile-nav__cat.is-open .mobile-nav__subs {
  display: block;
}

.mobile-nav__subs a {
  display: block;
  padding: 0.5rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
}

.mobile-nav__subs a:hover {
  color: var(--brand-blue);
  background: var(--surface-muted);
}

.mobile-nav__cat-link {
  display: block;
  padding: 0.75rem 0.5rem;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-sm);
}

.mobile-nav__cat-link:hover {
  background: var(--brand-blue-light);
  color: var(--brand-blue);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn--primary {
  background: var(--brand-red);
  color: #fff;
}

.btn--primary:hover {
  background: var(--brand-red-dark);
  color: #fff;
}

.btn--secondary {
  background: var(--brand-blue);
  color: #fff;
}

.btn--secondary:hover {
  background: var(--brand-blue-dark);
  color: #fff;
}

.btn--outline {
  background: transparent;
  border-color: var(--brand-blue);
  color: var(--brand-blue);
}

.btn--outline:hover {
  background: var(--brand-blue-light);
}

.btn--whatsapp {
  background: var(--success);
  color: #fff;
}

.btn--whatsapp:hover {
  background: #15803d;
  color: #fff;
}

.btn--sm {
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
}

.btn--block {
  width: 100%;
}

.btn-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--brand-blue-light);
  color: var(--brand-blue);
  border: none;
  cursor: pointer;
}

.btn-icon:hover {
  background: var(--brand-blue);
  color: #fff;
}

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

.cart-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--brand-red);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-badge:empty,
.cart-badge[data-count="0"] {
  display: none;
}

/* Cards */
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}

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

.product-card__image {
  aspect-ratio: 1;
  background: var(--surface-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.product-card__image img {
  object-fit: contain;
  max-height: 100%;
}

.product-card__body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card__title {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card__title a {
  color: inherit;
}

.product-card__title a:hover {
  color: var(--brand-blue);
}

.product-card__meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.product-card__price {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--brand-blue);
  margin-bottom: 0.75rem;
}

.product-card__price small {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.product-card .btn {
  margin-top: auto;
}

.category-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.category-card:hover {
  border-color: var(--brand-blue);
  box-shadow: var(--shadow-md);
}

.category-card__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  background: var(--brand-blue-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-blue);
}

.category-card__icon svg {
  width: 28px;
  height: 28px;
}

.category-card h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.category-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

/* Trust badges */
.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.trust-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--surface);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.trust-item__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  background: var(--brand-blue-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-blue);
}

.trust-item h3 {
  font-size: 0.9375rem;
  margin-bottom: 0.25rem;
}

.trust-item p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.breadcrumb a {
  color: var(--brand-blue);
}

.breadcrumb span[aria-current] {
  color: var(--text);
  font-weight: 500;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.form-group label .required {
  color: var(--brand-red);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(0, 74, 141, 0.15);
}

.form-control.is-invalid {
  border-color: var(--brand-red);
}

.form-error {
  font-size: 0.8125rem;
  color: var(--brand-red);
  margin-top: 0.25rem;
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

.qty-input {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.qty-input button {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--surface-muted);
  cursor: pointer;
  font-size: 1.125rem;
  color: var(--brand-blue);
}

.qty-input button:hover {
  background: var(--brand-blue-light);
}

.qty-input input {
  width: 48px;
  height: 36px;
  border: none;
  text-align: center;
  font: inherit;
  font-weight: 600;
}

/* Quote drawer */
.quote-drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  visibility: hidden;
}

.quote-drawer.is-open {
  pointer-events: auto;
  visibility: visible;
}

.quote-drawer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.25s;
}

.quote-drawer.is-open .quote-drawer__overlay {
  opacity: 1;
}

.quote-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(100%, 400px);
  height: 100%;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s;
}

.quote-drawer.is-open .quote-drawer__panel {
  transform: translateX(0);
}

.quote-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.quote-drawer__header h2 {
  font-size: 1.125rem;
  margin: 0;
}

.quote-drawer__close {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
}

.quote-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
}

.quote-drawer__footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}

.quote-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.quote-item__info {
  flex: 1;
  min-width: 0;
}

.quote-item__name {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.quote-item__price {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.quote-item__remove {
  background: none;
  border: none;
  color: var(--brand-red);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0;
}

.quote-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
}

.quote-total {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 1.0625rem;
  margin-bottom: 1rem;
}

/* Footer */
.site-footer {
  background: var(--brand-blue-dark);
  color: rgba(255, 255, 255, 0.85);
  padding: 3rem 0 1.5rem;
  margin-top: auto;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.9);
}

.site-footer a:hover {
  color: #fff;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-grid h3 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.footer-grid p,
.footer-grid li {
  font-size: 0.875rem;
  margin-bottom: 0.35rem;
}

.footer-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 1rem;
  font-size: 0.8125rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 300;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Mobile bottom bar */
.mobile-cta-bar {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 0.5rem;
  gap: 0.5rem;
}

.mobile-cta-bar .btn {
  flex: 1;
  padding: 0.625rem;
  font-size: 0.8125rem;
}
