/* ============================================================
   BASE.CSS — Sunvoz Design System Foundation
   Tokens, Reset, Typography, Utilities, Animations
   ============================================================ */

/* ------------------------------------------------------------
   1. CSS CUSTOM PROPERTIES (Design Tokens)
   ------------------------------------------------------------ */
:root {
    /* — Background Colors — */
    --bg-primary: #FAFAF8;
    --bg-secondary: #F2F0EB;
    --bg-card: #FFFFFF;
    --bg-dark: #1A1A1A;

    /* — Text Colors — */
    --text-primary: #1A1A1A;
    --text-secondary: #6B6B6B;
    --text-light: #999999;
    --text-on-dark: #F5F5F0;

    /* — Accent Colors — */
    --accent: #2D6A4F;
    --accent-light: #52B788;
    --accent-pale: #D8F3DC;
    --accent-sage: #A7C4A0;

    /* — Gold Colors — */
    --gold: #C4A35A;
    --gold-light: #E8D5A3;

    /* — Borders — */
    --border: #E8E5DF;
    --border-light: #F0EDE8;

    /* — Semantic Colors — */
    --error: #D64545;
    --success: #2D6A4F;

    /* — Shadows — */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);

    /* — Border Radii — */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;

    /* — Transitions — */
    --transition-fast: 0.2s ease;
    --transition: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* — Font Families — */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;

    /* — Spacing Scale (4px base) — */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 32px;
    --space-8: 40px;
    --space-9: 48px;
    --space-10: 64px;
    --space-11: 80px;
    --space-12: 96px;
    --space-13: 120px;

    /* — Category Gradient Backgrounds — */
    --gradient-kitchen: linear-gradient(135deg, #F6E6C8 0%, #FFECD2 50%, #FCF5E5 100%);
    --gradient-bathroom: linear-gradient(135deg, #D4E9F7 0%, #E8F4FD 50%, #F0F8FF 100%);
    --gradient-living: linear-gradient(135deg, #D8F3DC 0%, #E8F5E9 50%, #F1F8E9 100%);
    --gradient-garden: linear-gradient(135deg, #C8E6C9 0%, #DCEDC8 50%, #F1F8E9 100%);
    --gradient-office: linear-gradient(135deg, #F0EBE0 0%, #F5F0E8 50%, #FAF8F5 100%);
}


/* ------------------------------------------------------------
   2. CSS RESET
   ------------------------------------------------------------ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100vh;
}

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

img {
    height: auto;
}

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

button {
    cursor: pointer;
    background: none;
    border: none;
}

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

ul,
ol {
    list-style: none;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

/* Remove default focus outline — replaced with custom styling */
:focus {
    outline: none;
}

/* Accessible focus-visible for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}


/* ------------------------------------------------------------
   3. TYPOGRAPHY
   ------------------------------------------------------------ */

/* — Headings — */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

h1 {
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    line-height: 1.1;
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    line-height: 1.15;
}

h3 {
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    line-height: 1.2;
}

h4 {
    font-size: clamp(1.1rem, 2.5vw, 1.35rem);
    line-height: 1.3;
}

h5 {
    font-size: clamp(1rem, 2vw, 1.15rem);
    line-height: 1.4;
}

h6 {
    font-size: clamp(0.875rem, 1.5vw, 1rem);
    line-height: 1.4;
    font-weight: 600;
}

/* — Body Text — */
p {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 1em;
}

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

/* — Small Text — */
small {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* — Strong / Bold — */
strong,
b {
    font-weight: 600;
}

/* — Italic — */
em,
i {
    font-style: italic;
}

/* — Links (global) — */
a {
    transition: color var(--transition-fast);
}

/* — Blockquote — */
blockquote {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-style: italic;
    color: var(--text-secondary);
    border-left: 3px solid var(--accent);
    padding-left: var(--space-6);
    margin: var(--space-7) 0;
}


/* ------------------------------------------------------------
   4. UTILITY CLASSES
   ------------------------------------------------------------ */

/* — Container — */
.container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
}

/* — Section — */
.section {
    padding-top: 80px;
    padding-bottom: 80px;
}

@media (max-width: 768px) {
    .section {
        padding-top: 48px;
        padding-bottom: 48px;
    }
}

/* — Section Header — */
.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.section-subtitle {
    color: var(--text-secondary);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    font-size: 1rem;
    line-height: 1.6;
}

/* — Flexbox 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 Utilities — */
.grid {
    display: grid;
    gap: 24px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

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

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

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

@media (max-width: 480px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .grid-3 {
        grid-template-columns: 1fr;
    }

    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* — Text Alignment — */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

/* — Visibility — */
.hidden {
    display: none !important;
}

/* Screen reader only — visually hidden but accessible */
.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;
}

/* — Spacing: Margin Top — */
/* Scale: 1=8px, 2=16px, 3=24px, 4=32px, 5=48px, 6=64px, 7=80px, 8=96px */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mt-5 { margin-top: 48px; }
.mt-6 { margin-top: 64px; }
.mt-7 { margin-top: 80px; }
.mt-8 { margin-top: 96px; }

/* — Spacing: Margin Bottom — */
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mb-5 { margin-bottom: 48px; }
.mb-6 { margin-bottom: 64px; }
.mb-7 { margin-bottom: 80px; }
.mb-8 { margin-bottom: 96px; }


/* ------------------------------------------------------------
   5. ANIMATIONS
   ------------------------------------------------------------ */

/* — Keyframes — */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.8;
    }
    70% {
        transform: scale(0.9);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes float {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
    100% {
        transform: translateY(0);
    }
}

/* — Scroll-triggered Animation — */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}


/* ------------------------------------------------------------
   6. SCROLLBAR STYLING
   ------------------------------------------------------------ */

/* WebKit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background-color: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background-color: var(--accent-sage);
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-secondary);
}

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

/* Firefox */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-sage) var(--bg-secondary);
}


/* ------------------------------------------------------------
   7. SELECTION STYLING
   ------------------------------------------------------------ */
::selection {
    background-color: var(--accent-pale);
    color: var(--accent);
}

::-moz-selection {
    background-color: var(--accent-pale);
    color: var(--accent);
}
