/* ========================================
   MIPS Colombia - Lista de Precios
   Modern CSS with Best Practices
   ======================================== */

/* --- Custom Fonts --- */
@font-face {
    font-family: 'Nexa Bold';
    src: url('../assets/Nexa Bold.otf') format('opentype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

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

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
    /* Colors */
    --clr-bg-primary: hsl(215, 28%, 5%);
    --clr-bg-secondary: hsl(215, 25%, 10%);
    --clr-bg-card: hsl(215, 25%, 15%, 0.6);
    
    --clr-accent: hsl(158, 77%, 38%);
    --clr-accent-light: hsl(158, 68%, 52%);
    --clr-accent-glow: hsl(158, 77%, 38%, 0.2);
    
    --clr-text-primary: hsl(210, 17%, 98%);
    --clr-text-secondary: hsl(214, 14%, 83%);
    --clr-text-muted: hsl(220, 9%, 65%);
    
    --clr-warning: hsl(38, 92%, 50%);
    --clr-warning-bg: hsl(38, 92%, 50%, 0.1);
    --clr-warning-border: hsl(38, 92%, 50%, 0.3);
    
    /* Typography Scale */
    --fs-300: clamp(0.875rem, 0.85rem + 0.125vw, 0.9375rem);
    --fs-400: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
    --fs-500: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
    --fs-600: clamp(2rem, 1.5rem + 2.5vw, 3.5rem);
    
    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
    
    --ff-heading: 'Nexa Bold', 'Inter', system-ui, sans-serif;
    --ff-body: 'Inter', system-ui, -apple-system, sans-serif;
    
    /* Spacing Scale (8px base) */
    --space-2xs: 0.25rem;  /* 4px */
    --space-xs: 0.5rem;    /* 8px */
    --space-sm: 1rem;      /* 16px */
    --space-md: 1.5rem;    /* 24px */
    --space-lg: 2rem;      /* 32px */
    --space-xl: 3rem;      /* 48px */
    --space-2xl: 4rem;     /* 64px */
    
    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px hsl(0 0% 0% / 0.3);
    --shadow-md: 0 4px 12px hsl(0 0% 0% / 0.4);
    --shadow-lg: 0 10px 40px hsl(0 0% 0% / 0.5);
    
    /* Transitions */
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Base Styles --- */
html {
    font-size: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    min-height: 100dvh;
    font-family: var(--ff-body);
    font-size: var(--fs-400);
    line-height: 1.6;
    color: var(--clr-text-primary);
    background: linear-gradient(
        135deg,
        var(--clr-bg-primary) 0%,
        var(--clr-bg-secondary) 100%
    );
    background-attachment: fixed;
}

/* --- Layout Container --- */
.container {
    --max-width: 1400px;
    --container-padding: var(--space-lg);
    
    width: min(100% - var(--container-padding) * 2, var(--max-width));
    margin-inline: auto;
    
    display: grid;
    grid-template-rows: auto auto auto 1fr auto auto;
    gap: var(--space-lg);
    min-height: 100dvh;
    padding-block: var(--space-lg);
}

@media (width < 48em) {
    .container {
        --container-padding: var(--space-sm);
        gap: var(--space-md);
    }
}

/* --- Logo Section --- */
.logo-container {
    text-align: center;
    padding-block: var(--space-md);
    animation: fadeInDown 600ms var(--transition-base) backwards;
}

.logo {
    max-width: min(220px, 50vw);
    height: auto;
    filter: drop-shadow(0 4px 12px var(--clr-accent-glow));
    transition: filter var(--transition-base);
}

.logo:hover {
    filter: drop-shadow(0 6px 20px hsl(158, 77%, 38%, 0.4));
}

/* --- Title --- */
.title {
    font-family: var(--ff-heading);
    font-size: var(--fs-600);
    font-weight: var(--fw-bold);
    text-align: center;
    letter-spacing: -0.02em;
    line-height: 1.1;
    background: linear-gradient(
        135deg,
        var(--clr-text-primary) 0%,
        var(--clr-accent-light) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 700ms var(--transition-base) 100ms backwards;
}

/* --- Alert Component --- */
.alert {
    background: var(--clr-warning-bg);
    border: 3px solid var(--clr-warning-border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    align-items: center;
    
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md), 0 0 30px hsl(38, 92%, 50%, 0.15);
    animation: fadeInUp 800ms var(--transition-base) 200ms backwards;
}

.alert-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--clr-warning);
    animation: pulse 2s ease-in-out infinite;
}

.alert-icon svg {
    filter: drop-shadow(0 2px 8px hsl(38, 92%, 50%, 0.3));
}

.alert-content {
    flex: 1;
    min-width: min-content;
}

.alert-text {
    color: var(--clr-text-primary);
    font-size: var(--fs-400);
    line-height: 1.5;
    margin-block-end: var(--space-xs);
}

.highlight-date {
    color: var(--clr-warning);
    font-weight: var(--fw-bold);
    font-size: 1.2em;
    white-space: nowrap;
}

.alert-subtext {
    color: var(--clr-text-secondary);
    font-size: var(--fs-300);
    font-style: italic;
}

@media (width < 36em) {
    .alert {
        flex-direction: column;
        text-align: center;
        padding: var(--space-sm);
    }
}

/* --- PDF Container --- */
.pdf-container {
    container-type: inline-size;
    container-name: pdf;
    
    min-height: clamp(500px, 60vh, 800px);
    background: var(--clr-bg-card);
    border: 2px solid var(--clr-accent-glow);
    border-radius: var(--radius-lg);
    overflow: hidden;
    
    box-shadow: var(--shadow-lg), 0 0 60px hsl(158, 77%, 38%, 0.1);
    animation: fadeInUp 900ms var(--transition-base) 300ms backwards;
    
    position: relative;
}

.pdf-viewer {
    width: 100%;
    height: 100%;
    min-height: clamp(500px, 60vh, 800px);
    border: none;
    background: white;
}

/* PDF Fallback */
.pdf-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-xl);
    gap: var(--space-md);
    min-height: 400px;
}

.fallback-icon {
    color: var(--clr-accent);
    opacity: 0.8;
}

.pdf-fallback h2 {
    font-family: var(--ff-heading);
    font-size: var(--fs-500);
    color: var(--clr-text-primary);
}

.pdf-fallback p {
    color: var(--clr-text-secondary);
    font-size: var(--fs-400);
    max-width: 50ch;
}

.fallback-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    
    padding: 1rem 2rem;
    font-size: var(--fs-400);
    font-weight: var(--fw-semibold);
    color: var(--clr-bg-primary);
    text-decoration: none;
    
    background: linear-gradient(135deg, var(--clr-accent) 0%, hsl(158, 77%, 30%) 100%);
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    
    transition: all var(--transition-base);
}

.fallback-link:hover,
.fallback-link:focus-visible {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* --- Social Links --- */
.social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
    padding-block: var(--space-md);
    animation: fadeInUp 1s var(--transition-base) 400ms backwards;
}

.social-link {
    --size: 3.5rem;
    
    display: grid;
    place-items: center;
    width: var(--size);
    height: var(--size);
    
    color: var(--clr-text-secondary);
    background: var(--clr-bg-secondary);
    border: 2px solid hsl(0 0% 100% / 0.1);
    border-radius: 50%;
    
    transition: all var(--transition-base);
}

.social-link:hover,
.social-link:focus-visible {
    color: var(--clr-accent);
    background: hsl(158, 77%, 38%, 0.1);
    border-color: var(--clr-accent);
    transform: translateY(-4px);
    box-shadow: 0 8px 25px var(--clr-accent-glow);
}

.social-link:focus-visible {
    outline: 2px solid var(--clr-accent);
    outline-offset: 2px;
}

@media (width < 30em) {
    .social-link {
        --size: 3rem;
    }
}

/* --- Footer --- */
.footer {
    text-align: center;
    padding-block: var(--space-md);
    border-top: 1px solid hsl(0 0% 100% / 0.1);
    animation: fadeIn 1.1s var(--transition-base) 500ms backwards;
}

.footer p {
    color: var(--clr-text-muted);
    font-size: var(--fs-300);
}

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

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

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

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

/* --- Print Styles --- */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .social-links,
    .alert,
    .logo-container {
        display: none;
    }
    
    .pdf-container {
        min-height: auto;
        border: none;
        box-shadow: none;
    }
}
