@layer base {
  html {
    margin: 0;
    padding: 0;
    height: 100%;
    scroll-behavior: smooth;
  }

  body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    overflow-x: clip;
    overflow-y: auto;
  }

  main > :first-child {
    margin-top: 0 !important;
  }

  main > :last-child {
    margin-bottom: 0 !important;
  }

  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  img,
  video {
    max-width: 100%;
    height: auto;
  }

  table {
    max-width: 100%;
  }
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

input[type="number"].qty-input,
input[type="number"].input-qty {
  appearance: textfield;
  -moz-appearance: textfield;
}

input[type="number"].qty-input::-webkit-outer-spin-button,
input[type="number"].qty-input::-webkit-inner-spin-button,
input[type="number"].input-qty::-webkit-outer-spin-button,
input[type="number"].input-qty::-webkit-inner-spin-button {
  appearance: none;
  margin: 0;
}

.site-logo {
  height: 1.75rem;
  width: auto;
  object-fit: contain;
}

@media (min-width: 768px) {
  .site-logo {
    height: 2rem;
  }
}

.avatar-sm {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  object-fit: cover;
}

.avatar-md {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  object-fit: cover;
}

.product-thumb {
  height: 9rem;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.product-thumb:hover {
  transform: scale(1.05);
}

.cart-thumb {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.5rem;
  object-fit: cover;
}

.map-satelital {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}

/* Header offset: logo bar only on mobile (nav is overlay), full header on desktop */
.pt-header {
  padding-top: 4rem;
}

@media (min-width: 768px) {
  .pt-header {
    padding-top: 5rem;
  }
}

/* Page loader */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: #faf8ff;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.page-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.page-loader__spinner {
  width: 2.75rem;
  height: 2.75rem;
  border: 3px solid #dae2fd;
  border-top-color: #00288e;
  border-radius: 50%;
  animation: page-loader-spin 0.75s linear infinite;
}

.page-loader__text {
  font-family: Inter, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #00288e;
  letter-spacing: 0.02em;
}

.page-loader__brand {
  font-family: Inter, sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #00288e;
  letter-spacing: -0.02em;
}

@keyframes page-loader-spin {
  to {
    transform: rotate(360deg);
  }
}

body.is-loading {
  overflow: hidden;
}

/* Responsive tables */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-scroll table {
  min-width: 720px;
}

/* Mobile typography scaling for large headlines */
@media (max-width: 767px) {
  .font-display-lg,
  .text-display-lg {
    font-size: 28px !important;
    line-height: 36px !important;
  }

  .font-headline-lg,
  .text-headline-lg {
    font-size: 22px !important;
    line-height: 30px !important;
  }

  .px-margin {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Floating cart bar on catalog */
.floating-order-bar {
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  width: auto;
  max-width: none;
}

@media (min-width: 640px) {
  .floating-order-bar {
    left: auto;
    right: 1.5rem;
    bottom: 1.5rem;
    width: auto;
    max-width: 28rem;
  }
}

/* Order status tabs */
.order-status-tabs {
  -webkit-overflow-scrolling: touch;
}
