/* ==========================================================================
   MEDIC FARM — DISTRIBUIDOR MÉDICO
   Core Design System (WCAG 2.1 AA Compliant)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --purple: #7B4FD4;
    --purple-light: #EDE8FC;
    --purple-tint: #F5F3FF;
    --teal: #1DC9A4;
    --teal-dark: #148F75;
    --bg: #F8F7FF;
    --dark: #1A1A2E;
    --gray-text: #5A5A75;
    --border: #E4E2F0;
    --white: #FFFFFF;
    --gradient: linear-gradient(135deg, var(--purple) 0%, var(--teal) 100%);
    --shadow-sm: 0 2px 8px rgba(26, 26, 46, 0.04);
    --shadow-md: 0 8px 24px rgba(123, 79, 212, 0.08);
    --shadow-lg: 0 16px 32px rgba(26, 26, 46, 0.12);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base & Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg);
    color: var(--dark);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.section-padding {
    padding: 100px 0;
}

.section-title {
    text-align: center;
    font-size: 2.25rem;
    margin-bottom: 16px;
    color: var(--dark);
}

.section-subtitle {
    text-align: center;
    color: var(--gray-text);
    max-width: 600px;
    margin: 0 auto 60px auto;
    font-size: 1.1rem;
}

/* Global Scroll Animation Classes */
.scroll-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Buttons & Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background-color: var(--purple);
    color: var(--white);
}

.btn-primary:hover {
    background-color: transparent;
    border-color: var(--teal);
    color: var(--dark);
    box-shadow: 0 0 15px rgba(29, 201, 164, 0.2);
}

.btn-outline-teal {
    background-color: transparent;
    border-color: var(--teal);
    color: var(--dark);
}

.btn-outline-teal:hover {
    background-color: var(--teal);
    color: var(--white);
}

/* 1. Header */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: transparent;
    transition: var(--transition);
    padding: 20px 0;
}

.main-header.scrolled {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 12px 0;
    box-shadow: var(--shadow-sm);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
}
.logo-text .med { color: var(--teal); }
.logo-text .farm { color: var(--purple); }

.nav-menu {
    display: flex;
    gap: 32px;
    list-style: none;
}

.nav-link {
    font-weight: 500;
    color: var(--dark);
    font-size: 0.95rem;
}

.nav-link:hover, .nav-link.active {
    color: var(--purple);
}

/* 2. Hero Section */
.hero {
    min-height: 100vh;
    padding-top: 140px;
    display: flex;
    align-items: center;
    background: linear-gradient(180deg, var(--bg) 0%, var(--purple-light) 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 15v30M15 30h30' stroke='%237B4FD4' stroke-width='2' opacity='0.03' stroke-linecap='round'/%3E%3C/svg%3E");
    opacity: 0.7;
    pointer-events: none;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 48px;
    align-items: center;
}

.hero-headline {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 24px;
}

.word-reveal {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    animation: wordFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes wordFadeIn {
    to { opacity: 1; transform: translateY(0); }
}

.hero-subheadline {
    font-size: 1.2rem;
    color: var(--gray-text);
    line-height: 1.6;
    margin-bottom: 36px;
}

.hero-ctas {
    display: flex;
    gap: 16px;
    margin-bottom: 40px;
}

.hero-badges {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.badge-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--purple);
    background: var(--white);
    padding: 6px 14px;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
}

.hero-image-wrapper {
    position: relative;
    border-radius: 24px;
    background: var(--white);
    padding: 20px;
    box-shadow: var(--shadow-lg);
}

/* 3. Trust Bar */
.trust-bar {
    background: var(--gradient);
    padding: 40px 0;
    color: var(--white);
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.stat-card h3 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.stat-card p {
    font-size: 0.95rem;
    opacity: 0.85;
    font-weight: 500;
}

/* 4. Product Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.category-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient);
    opacity: 0;
    z-index: -1;
    transition: var(--transition);
}

.category-icon {
    color: var(--purple);
    margin-bottom: 20px;
    transition: var(--transition);
}

.category-card h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
    transition: var(--transition);
}

.category-count {
    color: var(--teal);
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.category-card .action-text {
    opacity: 0;
    transform: translateX(-10px);
    transition: var(--transition);
    color: var(--white);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.category-card:hover::before {
    opacity: 1;
}

.category-card:hover h3, 
.category-card:hover .category-icon {
    color: var(--white);
}

.category-card:hover .category-count {
    color: rgba(255, 255, 255, 0.75);
}

.category-card:hover .action-text {
    opacity: 1;
    transform: translateX(0);
}

/* 5. Featured Products Carousel */
.carousel-wrapper {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    display: flex;
    gap: 24px;
    padding: 20px 4px;
    scrollbar-width: none;
}

.carousel-wrapper::-webkit-scrollbar {
    display: none;
}

.product-card {
    scroll-snap-align: start;
    flex: 0 0 calc(25% - 18px);
    min-width: 260px;
    background: var(--white);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    position: relative;
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.product-img-holder {
    background: var(--bg);
    border-radius: 12px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.product-badge {
    position: absolute;
    top: 32px;
    right: 32px;
    background: rgba(29, 201, 164, 0.15);
    color: var(--teal-dark);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

.product-card h4 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.product-sku {
    font-size: 0.8rem;
    color: var(--gray-text);
    margin-bottom: 16px;
}

.btn-product {
    width: 100%;
    background: transparent;
    border: 1px solid var(--purple);
    color: var(--purple);
    padding: 10px 0;
    border-radius: 8px;
    font-weight: 600;
}

.product-card:hover .btn-product {
    background: var(--teal);
    border-color: var(--teal);
    color: var(--white);
}

/* 6. Why Choose Us Layout */
.why-us-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 60px;
    align-items: center;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.feature-row {
    display: flex;
    gap: 20px;
}

.feature-icon-box {
    background: var(--purple-light);
    color: var(--purple);
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feature-row h4 {
    font-size: 1.15rem;
    margin-bottom: 6px;
}

.feature-row p {
    color: var(--gray-text);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* 7. How To Order (Pipeline) */
.process-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    position: relative;
}

.process-grid::before {
    content: '';
    position: absolute;
    top: 36px;
    left: 12%;
    width: 76%;
    height: 2px;
    border-top: 2px dashed var(--border);
    z-index: 0;
}

.process-step {
    text-align: center;
    position: relative;
    z-index: 1;
}

.step-number {
    width: 48px;
    height: 48px;
    background: var(--gradient);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin: 0 auto 16px auto;
    box-shadow: var(--shadow-sm);
}

.process-step h4 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.process-step p {
    font-size: 0.85rem;
    color: var(--gray-text);
}

/* 8. Client Sectors Grid */
.sectors-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.sector-card {
    background: var(--white);
    border: 1px solid var(--border);
    padding: 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.sector-card:hover {
    transform: translateY(-4px);
    border-color: var(--teal);
    box-shadow: var(--shadow-md);
}

/* 9. Testimonials */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.testimonial-card {
    background: var(--white);
    border-radius: 16px;
    padding: 32px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.client-profile {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.avatar {
    width: 44px;
    height: 44px;
    background: var(--purple-light);
    color: var(--purple);
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.client-info h4 {
    font-size: 0.95rem;
}

.client-info p {
    font-size: 0.8rem;
    color: var(--gray-text);
}

.rating-stars {
    color: var(--teal);
    margin-bottom: 14px;
    font-size: 0.85rem;
}

.testimonial-card q {
    font-style: italic;
    color: var(--gray-text);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* 10. Contact / Quote Section */
.contact-section {
    background-color: var(--purple-tint);
}

.contact-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 60px;
}

.info-details {
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-item {
    display: flex;
    gap: 14px;
}

.info-item p {
    color: var(--gray-text);
    font-size: 0.95rem;
}

.quote-form-wrapper {
    background: var(--white);
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(123, 79, 212, 0.15);
}

/* 11. Footer */
.main-footer {
    background-color: var(--dark);
    color: rgba(255, 255, 255, 0.7);
    padding: 80px 0 30px 0;
    font-size: 0.9rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr repeat(3, 0.6fr);
    gap: 40px;
    padding-bottom: 60px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand p {
    margin: 16px 0 24px 0;
    line-height: 1.5;
}

.footer-col h4 {
    color: var(--white);
    font-size: 1rem;
    margin-bottom: 20px;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a:hover {
    color: var(--teal);
}

.footer-bottom {
    padding-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

/* Sticky WhatsApp Button */
.whatsapp-floating {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 60px;
    height: 60px;
    background-color: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    z-index: 999;
    transition: var(--transition);
}

.whatsapp-floating::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #25D366;
    animation: pulseRing 1.5s infinite;
}

@keyframes pulseRing {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* ==========================================================================
   Responsive Breakpoints (Mobile-First)
   ========================================================================== */

@media (max-width: 1024px) {
    .hero-grid, .why-us-grid, .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .categories-grid { grid-template-columns: repeat(2, 1fr); }
    .product-card { flex: 0 0 calc(50% - 12px); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .nav-menu { display: none; } /* Implementar menú hamburguesa en ambiente real */
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .categories-grid, .sectors-grid, .testimonials-grid { grid-template-columns: 1fr; }
    .product-card { flex: 0 0 100%; }
    .form-grid { grid-template-columns: 1fr; }
    .form-group.full-width { grid-column: span 1; }
    .process-grid { grid-template-columns: 1fr; }
    .process-grid::before { display: none; }
    .hero-headline { font-size: 2.5rem; }
    .footer-grid { grid-template-columns: 1fr; }
}