/* ============================================
   SA SHIPPING — Base Styles
   ============================================
   CSS Reset, Typography, and Global Utilities
   ============================================ */

/* ── Modern CSS Reset ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background-color: var(--color-white);
  overflow-x: hidden;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  color: var(--color-navy);
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

p {
  color: var(--color-text-light);
  line-height: var(--lh-relaxed);
  margin-bottom: var(--space-md);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--color-ocean);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-orange);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: inherit;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  outline: none;
  border: none;
}

/* ── Selection ── */
::selection {
  background-color: var(--color-orange);
  color: var(--color-white);
}

/* ── Scrollbar (Webkit) ── */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-light-grey);
}

::-webkit-scrollbar-thumb {
  background: var(--color-ocean);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-navy);
}

/* ── Layout Utilities ── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.container--wide {
  max-width: var(--container-wide);
}

.section {
  padding: var(--section-padding) 0;
}

.section--grey {
  background-color: var(--color-off-white);
}

.section--navy {
  background: var(--gradient-navy);
  color: var(--color-white);
}

.section--navy h2,
.section--navy h3,
.section--navy h4 {
  color: var(--color-white);
}

.section--navy p {
  color: rgba(255, 255, 255, 0.8);
}

/* ── Section Header ── */
.section-header {
  text-align: center;
  max-width: 650px;
  margin: 0 auto var(--space-3xl);
}

.section-label {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--color-orange);
  margin-bottom: var(--space-md);
  position: relative;
}

.section-label::before,
.section-label::after {
  content: '';
  display: inline-block;
  width: 30px;
  height: 2px;
  background: var(--color-orange);
  vertical-align: middle;
}

.section-label::before {
  margin-right: 12px;
}

.section-label::after {
  margin-left: 12px;
}

.section-title {
  font-size: var(--fs-h2);
  font-weight: var(--fw-extrabold);
  margin-bottom: var(--space-lg);
}

.section-subtitle {
  font-size: var(--fs-body-lg);
  color: var(--color-text-light);
  max-width: 550px;
  margin: 0 auto;
}

/* ── Flex & Grid Utilities ── */
.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.grid {
  display: grid;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xl);
}

/* ── Text Utilities ── */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

.text-white  { color: var(--color-white); }
.text-navy   { color: var(--color-navy); }
.text-orange { color: var(--color-orange); }
.text-ocean  { color: var(--color-ocean); }

.fw-medium   { font-weight: var(--fw-medium); }
.fw-semibold { font-weight: var(--fw-semibold); }
.fw-bold     { font-weight: var(--fw-bold); }

/* ── Spacing Utilities ── */
.mt-sm  { margin-top: var(--space-sm); }
.mt-md  { margin-top: var(--space-md); }
.mt-lg  { margin-top: var(--space-lg); }
.mt-xl  { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }

.mb-sm  { margin-bottom: var(--space-sm); }
.mb-md  { margin-bottom: var(--space-md); }
.mb-lg  { margin-bottom: var(--space-lg); }
.mb-xl  { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }

/* ── Visibility ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden { display: none !important; }

/* ── Page Transition ── */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.page-loader__spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--color-light-grey);
  border-top-color: var(--color-orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
