/* ============================================
   INVICTUS - Main Stylesheet
   Replica exata do design original
   ============================================ */

/* ============================================
   CSS Variables (Design Tokens)
   ============================================ */
:root {
    /* Colors */
    --color-primary: #171717;
    --color-secondary: #7B7B7B;
    --color-accent: #FF6C0B;
    --color-background: #FFFFFF;
    --color-background-alt: #F5F5F5;
    --color-border: #E5E5E5;
    --color-text: #171717;
    --color-text-light: #7B7B7B;
    --color-sale: #FF6C0B;
    --color-success: #22C55E;
    --color-error: #EF4444;

    /* Typography */
    --font-family: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-weight-light: 300;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-bold: 700;

    /* Font Sizes */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;

    /* Spacing */
    --sp-1: 0.25rem;
    --sp-2: 0.5rem;
    --sp-3: 0.75rem;
    --sp-4: 1rem;
    --sp-5: 1.25rem;
    --sp-6: 1.5rem;
    --sp-8: 2rem;
    --sp-10: 2.5rem;
    --sp-12: 3rem;
    --sp-16: 4rem;
    --sp-20: 5rem;
    --sp-24: 6rem;

    /* Layout */
    --page-width: 1800px;
    --page-padding: clamp(1.25rem, 2.5vw, 3rem);
    --header-height: 80px;
    --topbar-height: 40px;

    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;
    --transition-bounce: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 400ms cubic-bezier(0.25, 0.1, 0.25, 1);

    /* Scale tokens */
    --scale-sm: 1.02;
    --scale-md: 1.05;
    --scale-lg: 1.1;

    /* Blur tokens */
    --blur-sm: 2px;
    --blur-md: 4px;
    --blur-lg: 8px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

    /* Z-Index */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;
}

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

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

body {
    font-family: var(--font-family);
    font-weight: var(--font-weight-light);
    font-size: var(--text-base);
    line-height: 1.5;
    color: var(--color-text);
    background-color: var(--color-background);
    min-height: 100vh;
}

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

/* Prevent SVG icons from shrinking in flex contexts */
button svg,
a svg,
.icon svg {
    flex-shrink: 0;
}

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;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-regular);
    line-height: 1.2;
}

/* ============================================
   Utility Classes
   ============================================ */
.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;
}

.page-width {
    width: 100%;
    max-width: var(--page-width);
    margin: 0 auto;
    padding-left: var(--page-padding);
    padding-right: var(--page-padding);
}

.page-width--full {
    max-width: 100%;
}

.flex {
    display: flex;
}

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

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 { gap: var(--sp-1); }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }
.gap-8 { gap: var(--sp-8); }

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

.uppercase { text-transform: uppercase; }
.capitalize { text-transform: capitalize; }

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

.hidden { display: none; }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.overflow-hidden { overflow: hidden; }

/* ============================================
   Typography
   ============================================ */
.heading {
    font-weight: var(--font-weight-regular);
    text-transform: uppercase;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.heading-xl {
    font-size: clamp(2rem, 5vw, 3.5rem);
}

.heading-lg {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
}

.heading-md {
    font-size: clamp(1.25rem, 2vw, 1.75rem);
}

.heading-sm {
    font-size: clamp(1rem, 1.5vw, 1.25rem);
}

.text-accent {
    color: var(--color-accent);
}

.text-secondary {
    color: var(--color-secondary);
}

/* ============================================
   Buttons
   ============================================ */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: var(--sp-4) var(--sp-8);
    font-size: var(--text-sm);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 0;
    transition: all var(--transition-base);
    white-space: nowrap;
}

.button--primary {
    background-color: var(--color-primary);
    color: var(--color-background);
}

.button--primary:hover {
    background-color: #333;
}

.button--secondary {
    background-color: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}

.button--secondary:hover {
    background-color: var(--color-primary);
    color: var(--color-background);
}

.button--accent {
    background-color: var(--color-accent);
    color: var(--color-background);
}

.button--accent:hover {
    background-color: #e55f00;
}

.button--sm {
    padding: var(--sp-2) var(--sp-4);
    font-size: var(--text-xs);
}

.button--lg {
    padding: var(--sp-5) var(--sp-10);
    font-size: var(--text-base);
}

.button--full {
    width: 100%;
}

/* ============================================
   Forms
   ============================================ */
.input {
    width: 100%;
    padding: var(--sp-3) var(--sp-4);
    font-size: var(--text-base);
    border: 1px solid var(--color-border);
    border-radius: 0;
    background-color: var(--color-background);
    transition: border-color var(--transition-fast);
}

.input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.input::placeholder {
    color: var(--color-secondary);
}

/* ============================================
   Grid System
   ============================================ */
.grid {
    display: grid;
    gap: var(--sp-4);
}

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

@media (min-width: 640px) {
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .sm\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
    .lg\:grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
}

@media (min-width: 1280px) {
    .xl\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
    .xl\:grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
    .xl\:grid-cols-6 { grid-template-columns: repeat(6, 1fr); }
}

/* ============================================
   Product Grid
   ============================================ */
.product-grid {
    display: grid;
    gap: clamp(1rem, 2vw, 1.5rem);
    grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 640px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

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

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

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

.animate-fade-in {
    animation: fadeIn var(--transition-base) ease forwards;
}

.animate-slide-up {
    animation: slideUp var(--transition-base) ease forwards;
}

/* ============================================
   Section Spacing
   ============================================ */
.section {
    padding-top: var(--sp-12);
    padding-bottom: var(--sp-12);
}

@media (min-width: 1024px) {
    .section {
        padding-top: var(--sp-16);
        padding-bottom: var(--sp-16);
    }
}

.section-title {
    font-size: clamp(1.25rem, 2vw, 1.75rem);
    font-weight: var(--font-weight-regular);
    text-transform: uppercase;
    letter-spacing: -0.02em;
    margin-bottom: var(--sp-8);
}

/* ============================================
   Badges
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--sp-1) var(--sp-2);
    font-size: var(--text-xs);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.badge--sale {
    background-color: var(--color-accent);
    color: white;
}

.badge--new {
    background-color: var(--color-primary);
    color: white;
}

.badge--soldout {
    background-color: var(--color-secondary);
    color: white;
}

/* ============================================
   Icons
   ============================================ */
.icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon--sm {
    width: 16px;
    height: 16px;
}

.icon--lg {
    width: 32px;
    height: 32px;
}

.icon svg {
    width: 100%;
    height: 100%;
}

/* ============================================
   Scroll Reveal Animations
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 600ms ease, transform 600ms ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animation para grids */
.reveal--stagger > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 400ms ease, transform 400ms ease;
}

.reveal--stagger.is-visible > *:nth-child(1) { transition-delay: 0ms; }
.reveal--stagger.is-visible > *:nth-child(2) { transition-delay: 80ms; }
.reveal--stagger.is-visible > *:nth-child(3) { transition-delay: 160ms; }
.reveal--stagger.is-visible > *:nth-child(4) { transition-delay: 240ms; }
.reveal--stagger.is-visible > *:nth-child(5) { transition-delay: 320ms; }
.reveal--stagger.is-visible > *:nth-child(6) { transition-delay: 400ms; }
.reveal--stagger.is-visible > *:nth-child(7) { transition-delay: 480ms; }
.reveal--stagger.is-visible > *:nth-child(8) { transition-delay: 560ms; }
.reveal--stagger.is-visible > *:nth-child(9) { transition-delay: 640ms; }
.reveal--stagger.is-visible > *:nth-child(10) { transition-delay: 720ms; }

.reveal--stagger.is-visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* Respeitar preferência do usuário por movimento reduzido */
@media (prefers-reduced-motion: reduce) {
    .reveal,
    .reveal--stagger > * {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ============================================
   Breakpoint Extra Small (< 400px)
   ============================================ */
@media (max-width: 400px) {
    .product-grid {
        gap: 0.75rem;
    }

    .product-card__title {
        font-size: var(--text-xs);
    }

    .product-card__price {
        font-size: var(--text-sm);
    }

    .button {
        padding: var(--sp-3) var(--sp-6);
        font-size: var(--text-xs);
    }
}
