/* ==========================================================================
   Global Styles — Full Reset, Typography, Utilities
   ========================================================================== */

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: var(--fw-regular);
    font-size: var(--fs-base);
    line-height: 1.6;
    color: var(--color-charcoal);
    background-color: var(--color-cream);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

input,
button,
textarea,
select {
    font: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

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

ul,
ol {
    list-style: none;
}

table {
    border-collapse: collapse;
}

/* Typography Scale */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: var(--fw-bold);
    line-height: 1.2;
    color: var(--color-charcoal);
}

h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); }
h5 { font-size: var(--fs-lg); }
h6 { font-size: var(--fs-md); }

@media (max-width: 768px) {
    h1 { font-size: var(--fs-3xl); }
    h2 { font-size: var(--fs-2xl); }
    h3 { font-size: var(--fs-xl); }
}

p {
    margin-bottom: var(--space-md);
    line-height: 1.7;
}

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

strong, b {
    font-weight: var(--fw-bold);
}

em, i {
    font-style: italic;
}

small {
    font-size: var(--fs-sm);
}

/* Links */
.sc-link {
    color: var(--color-ocean);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color var(--transition-fast);
}

.sc-link:hover {
    color: var(--color-ocean-dark);
}

/* Container */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-xl);
}

.container--narrow {
    max-width: 800px;
}

.container--wide {
    max-width: 1440px;
}

/* Section spacing */
.section {
    padding: var(--space-5xl) 0;
}

.section--sm {
    padding: var(--space-3xl) 0;
}

.section--sand {
    background-color: var(--color-sand);
}

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

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

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

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

:focus-visible {
    outline: 2px solid var(--color-ocean);
    outline-offset: 2px;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-md);
    background: var(--color-ocean);
    color: var(--color-white);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    z-index: 999;
    font-size: var(--fs-sm);
}

.skip-link:focus {
    top: var(--space-md);
}

/* Utility classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-ocean { color: var(--color-ocean); }
.text-driftwood { color: var(--color-driftwood); }
.text-charcoal { color: var(--color-charcoal); }
.text-white { color: var(--color-white); }

.font-display { font-family: var(--font-display); }
.font-body { font-family: var(--font-body); }

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

.uppercase {
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.eyebrow {
    font-family: var(--font-body);
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-ocean);
    margin-bottom: var(--space-sm);
}

.subtitle {
    font-family: var(--font-body);
    font-size: var(--fs-lg);
    color: var(--color-driftwood);
    line-height: 1.6;
    max-width: 600px;
}

.subtitle--center {
    margin-left: auto;
    margin-right: auto;
}

/* Grid utilities */
.grid {
    display: grid;
    gap: var(--space-xl);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .grid--4 { grid-template-columns: repeat(2, 1fr); }
    .grid--3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .grid--4,
    .grid--3,
    .grid--2 {
        grid-template-columns: 1fr;
    }
}

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* 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); }

/* Aspect ratio helper */
.aspect-4-5 {
    aspect-ratio: 4 / 5;
    object-fit: cover;
}

.aspect-16-9 {
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.aspect-1-1 {
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

/* Divider */
.divider {
    border: none;
    border-top: 1px solid var(--color-driftwood);
    opacity: 0.2;
    margin: var(--space-3xl) 0;
}

/* Body lock for modals */
body.menu-open,
body.cart-open,
body.popup-open {
    overflow: hidden;
}
