/* ============================================================
   🌱 FITOTERAPIA OCCIDENTAL — Guía completa de fitoterapia
   CSS — Diseño cultivate.com.ar
   ============================================================ */

/* ----- VARIABLES cultivate.com.ar ----- */
:root {
    --color-bg: #F8F9F5;
    --color-leaf-dark: #435E4E;
    --color-leaf-light: #7E9E8B;
    --color-earth: #8C6A50;
    --color-earth-dark: #2A1F18;
    --color-sand: #E6DCCD;
    --color-water: #96BFC0;
    --color-text-main: #333333;
    --color-text-light: #666666;
    --color-gold: #D4AF37;
    --color-gold-light: #F3E5AB;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Outfit', 'Segoe UI', system-ui, sans-serif;
}

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

body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text-main);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--color-leaf-dark); text-decoration: none; }
a:hover { color: var(--color-leaf-light); }

img { max-width: 100%; height: auto; }

/* ----- TOPBAR ----- */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: linear-gradient(135deg, var(--color-leaf-dark), #3a5a4a);
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 12px rgba(67, 94, 78, 0.15);
    /* flex layout directo — el HTML no usa .topbar-inner */
    display: flex;
    align-items: center;
    height: 56px;
    padding: 0 24px;
    gap: 8px;
}

/* Compatibilidad si alguien usa .topbar-inner como wrapper */
.topbar-inner {
    display: contents;
}

/* Marca / brand */
.topbar-brand,
.topbar .brand,
.topbar .brand-link {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: #fff !important;
    text-decoration: none;
    white-space: nowrap;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
    background: none !important;
    flex-shrink: 0;
}
.topbar-brand .brand-icon { font-size: 1.2rem; }
.topbar .brand span { opacity: 0.75; font-size: 0.85rem; }

/* Nav empuja al centro/derecha */
.topbar nav { margin-left: auto; }

/* Lista de navegación (desktop) */
.topbar-nav {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 2px;
    margin: 0;
    padding: 0;
}
.topbar-nav li { display: flex; }

/* Links del nav */
.topbar a {
    color: rgba(255,255,255,0.85);
    font-size: 0.88rem;
    padding: 6px 14px;
    border-radius: 20px;
    transition: all 0.2s;
    text-decoration: none;
}
.topbar a:hover,
.topbar a.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

.nav-spacer { flex: 1; }

/* Link "volver a cultivate" (main page) */
.topbar-cultivate-link,
.cultivate-link {
    font-size: 0.8rem !important;
    opacity: 0.7 !important;
    margin-left: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}
.topbar-cultivate-link:hover,
.cultivate-link:hover { opacity: 1 !important; }

/* Hamburguesa — oculta en desktop */
.topbar-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 6px;
    margin-left: auto;
    flex-direction: column;
    gap: 5px;
}
.topbar-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.25s;
}

/* ----- HERO ----- */
.hero, .page-header {
    padding: 100px 20px 50px;
    text-align: center;
    background: linear-gradient(135deg, #f0f4ee 0%, #e8efe6 100%);
    border-bottom: 2px solid var(--color-sand);
}

.hero h1, .page-header h1 {
    font-family: var(--font-heading);
    font-size: 2.4rem;
    color: var(--color-leaf-dark);
    margin-bottom: 8px;
    font-weight: 700;
}

.hero .subtitle, .page-header .subtitle {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--color-leaf-light);
    display: block;
    margin-bottom: 6px;
}

.hero .hero-subheader {
    font-size: 1.05rem;
    color: var(--color-text-light);
    max-width: 640px;
    margin: 0 auto 18px;
    line-height: 1.5;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--color-gold);
    color: #fff;
    padding: 6px 20px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.page-header .meta {
    color: var(--color-text-light);
    font-size: 0.85rem;
    margin-top: 8px;
}

/* ----- CONTAINER ----- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ----- CARD GRID ----- */
.card-grid, .cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    margin: 28px 0;
}

/* Grid de 2 columnas para grupos de 4 cards (secciones principales) */
.cards-grid--2col {
    grid-template-columns: repeat(2, 1fr);
}

.card {
    background: #fff;
    border: 1px solid var(--color-sand);
    border-radius: 16px;
    overflow: hidden;
    transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    /* Acento verde sutil en el borde superior */
    border-top: 3px solid var(--color-leaf-light);
}
.card:hover {
    box-shadow: 0 8px 28px rgba(67, 94, 78, 0.13);
    transform: translateY(-3px);
    border-top-color: var(--color-leaf-dark);
    border-color: var(--color-leaf-light);
    border-top-color: var(--color-leaf-dark);
}

/* Cards de secciones principales (con card-icon-wrapper) — centradas */
.card:has(.card-icon-wrapper) {
    align-items: center;
    text-align: center;
}
.card:has(.card-icon-wrapper) .card-footer {
    justify-content: center;
}

.card-body { padding: 20px 24px 16px; flex: 1; width: 100%; }
.card-body h3 {
    font-family: var(--font-heading);
    font-size: 1.18rem;
    color: var(--color-leaf-dark);
    margin-bottom: 8px;
    font-weight: 700;
}
.card-body p {
    color: var(--color-text-light);
    font-size: 0.88rem;
    line-height: 1.58;
}
.card-body .desc {
    color: var(--color-text-light);
    font-size: 0.88rem;
    line-height: 1.55;
}

.card-footer {
    padding: 12px 24px;
    border-top: 1px solid var(--color-sand);
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.card-link {
    color: var(--color-leaf-dark);
    font-weight: 600;
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: gap 0.2s;
}
.card-link:hover { color: var(--color-leaf-light); gap: 8px; }

.card-tag {
    background: var(--color-leaf-dark);
    color: #fff;
    font-size: 0.72rem;
    padding: 3px 12px;
    border-radius: 20px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.card-icon-wrapper {
    font-size: 2.4rem;
    padding: 24px 20px 10px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(67,94,78,0.12));
}

.card-badge {
    /* Pill: no estira, se ajusta al contenido */
    display: inline-block;
    width: fit-content;
    align-self: flex-start;
    background: var(--color-gold-light);
    color: #7a5a10;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 3px 12px;
    border-radius: 20px;
    margin: 8px 24px 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
/* Cuando la card está centrada (tiene icon-wrapper), el badge también se centra */
.card:has(.card-icon-wrapper) .card-badge {
    align-self: center;
    margin: 4px auto 4px;
}

/* Cards sin card-body wrapper (directo en .card) */
.card > h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--color-leaf-dark);
    padding: 4px 24px 8px;
    font-weight: 700;
}
.card > p {
    color: var(--color-text-light);
    font-size: 0.88rem;
    padding: 0 24px 12px;
    line-height: 1.58;
}

/* ----- THEORY SECTION ----- */
.theory-section {
    background: #fff;
    border: 1px solid var(--color-sand);
    border-radius: 14px;
    padding: 32px;
    margin: 24px 0;
}
.theory-section h2 {
    font-family: var(--font-heading);
    color: var(--color-leaf-dark);
    font-size: 1.5rem;
    margin-bottom: 14px;
    border-bottom: 2px solid var(--color-sand);
    padding-bottom: 10px;
}
.theory-section p {
    color: var(--color-text-main);
    line-height: 1.7;
    margin-bottom: 12px;
}
.theory-section blockquote {
    border-left: 4px solid var(--color-gold);
    padding: 12px 20px;
    margin: 16px 0;
    background: var(--color-bg);
    border-radius: 0 10px 10px 0;
    font-style: italic;
    color: var(--color-text-light);
    font-size: 1rem;
}

/* ----- SECTION HEADER (intro de sección con h2 + subtítulo) ----- */
.section-header {
    text-align: center;
    margin: 36px 0 8px;
}
.section-header h2 {
    font-family: var(--font-heading);
    font-size: 1.7rem;
    color: var(--color-leaf-dark);
    font-weight: 700;
    margin-bottom: 6px;
}
.section-header h2 .highlight {
    color: var(--color-earth);
}
.section-header p {
    color: var(--color-text-light);
    font-size: 0.92rem;
}

/* ----- BADGE (en herb cards) ----- */
.badge {
    display: inline-block;
    background: var(--color-leaf-dark);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    margin: 4px 0 8px;
}

/* ----- CARD SUBTITLE (en teoria cards) ----- */
.card-subtitle {
    color: var(--color-leaf-light);
    font-size: 0.82rem;
    font-style: italic;
    margin-bottom: 8px;
    line-height: 1.4;
}

/* ----- SECTION TITLE ----- */
.section-title {
    font-family: var(--font-heading);
    color: var(--color-leaf-dark);
    font-size: 1.4rem;
    margin: 30px 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-title .badge {
    background: var(--color-gold);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 12px;
    border-radius: 20px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

/* ----- TABLES ----- */
.plant-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 0.88rem;
}
.plant-table thead th {
    background: var(--color-leaf-dark);
    color: #fff;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.plant-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--color-sand);
    vertical-align: top;
}
.plant-table tbody tr:nth-child(even) { background: #fafbf8; }
.plant-table tbody tr:hover { background: #f0f4ee; }

/* ----- FILTER TABS ----- */
.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    justify-content: center;
}
.filter-tab {
    background: #fff;
    border: 1px solid var(--color-sand);
    padding: 6px 18px;
    border-radius: 30px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--color-text-light);
    font-weight: 500;
}
.filter-tab:hover { border-color: var(--color-leaf-light); color: var(--color-leaf-dark); }
.filter-tab.active {
    background: var(--color-leaf-dark);
    color: #fff;
    border-color: var(--color-leaf-dark);
}

/* ----- SEARCH INPUT ----- */
.search-container {
    max-width: 480px;
    margin: 0 auto 24px;
}
#herb-search {
    width: 100%;
    padding: 10px 18px;
    border: 2px solid var(--color-sand);
    border-radius: 30px;
    font-size: 0.9rem;
    background: #fff;
    color: var(--color-text-main);
    outline: none;
    transition: border-color 0.2s;
}
#herb-search:focus { border-color: var(--color-leaf-dark); }
#herb-search::placeholder { color: #aaa; }

/* ----- INFO BOX ----- */
.info-box {
    background: #eef4ee;
    border-left: 4px solid var(--color-leaf-dark);
    padding: 14px 18px;
    border-radius: 0 8px 8px 0;
    margin: 14px 0;
    font-size: 0.88rem;
    color: var(--color-text-main);
}
.info-box.warning {
    background: #fdf6ec;
    border-left-color: var(--color-gold);
}
.info-box.danger {
    background: #fdf0ee;
    border-left-color: #c0392b;
}

/* ----- HIGHLIGHT BOX ----- */
.highlight-box {
    background: linear-gradient(135deg, var(--color-leaf-dark), #3a5a4a);
    color: #fff;
    padding: 18px 22px;
    border-radius: 12px;
    margin: 14px 0;
}
.highlight-box h4 {
    font-family: var(--font-heading);
    margin-bottom: 6px;
    font-size: 1rem;
}
.highlight-box p { color: rgba(255,255,255,0.9); font-size: 0.88rem; }

/* ----- SECTION DIVIDER ----- */
.section-divider {
    border: none;
    height: 1px;
    background: var(--color-sand);
    margin: 30px 0;
}

/* ----- COMPARISON TABLE (China vs Occidental) ----- */
.comparison-section { margin-top: 30px; }
.comparison-intro {
    text-align: center;
    max-width: 680px;
    margin: 0 auto 24px;
    color: var(--color-text-light);
    font-style: italic;
}
.comparison-table-wrapper { overflow-x: auto; }
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.comparison-table thead th {
    padding: 12px 16px;
    font-family: var(--font-heading);
    font-weight: 700;
}
.comparison-table thead th:first-child { background: var(--color-bg); color: var(--color-text-main); }
.comparison-table .col-china { background: var(--color-leaf-dark); color: #fff; }
.comparison-table .col-occidental { background: #2a4a5a; color: #fff; }
.comparison-table tbody td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--color-sand);
}
.comparison-table tbody tr:nth-child(even) td:first-child { background: #f5f7f3; }
.comparison-table tbody tr:nth-child(even) td:nth-child(2) { background: #eaf1ea; }
.comparison-table tbody tr:nth-child(even) td:nth-child(3) { background: #eaeef2; }
.comparison-table .aspect-label { font-weight: 600; color: var(--color-leaf-dark); white-space: nowrap; }
.comparison-footer {
    text-align: center;
    font-style: italic;
    color: var(--color-text-light);
    margin-top: 16px;
    font-size: 0.88rem;
}

/* ----- FOOTER ----- */
.site-footer {
    background: var(--color-leaf-dark);
    color: rgba(255,255,255,0.85);
    padding: 40px 20px 20px;
    margin-top: 40px;
}
.footer-grid {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 30px;
}
.footer-col h4 {
    font-family: var(--font-heading);
    color: #fff;
    font-size: 1rem;
    margin-bottom: 10px;
}
.footer-col p, .footer-col a {
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    line-height: 1.6;
    display: block;
}
.footer-col a:hover { color: var(--color-gold); }
.footer-bottom {
    max-width: 1100px;
    margin: 20px auto 0;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.15);
    text-align: center;
    color: rgba(255,255,255,0.5);
    font-size: 0.78rem;
}

/* ----- BACK TO TOP ----- */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-leaf-dark);
    color: #fff;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 999;
}
.back-to-top.visible { opacity: 1; }
.back-to-top:hover { transform: translateY(-2px); background: var(--color-leaf-light); }

/* ----- TOOLTIPS ----- */
.term {
    cursor: help;
    border-bottom: 1px dashed var(--color-leaf-light);
    color: var(--color-leaf-dark);
    font-weight: 600;
}
.term-tooltip {
    display: none;
    position: absolute;
    background: var(--color-earth-dark);
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.78rem;
    max-width: 280px;
    z-index: 1001;
    line-height: 1.4;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    pointer-events: none;
    bottom: calc(100% + 8px);
    left: 0;
}
.term:hover .term-tooltip {
    display: block;
}
.term-tooltip::after {
    content: '';
    position: absolute;
    top: -6px;
    left: 14px;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid var(--color-earth-dark);
}

/* ----- RESPONSIVE ----- */
@media (max-width: 992px) {
    .card-grid, .cards-grid { grid-template-columns: repeat(2, 1fr); }
    .cards-grid--2col { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

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

    .topbar nav { margin-left: 0; }
    .topbar-nav {
        display: none;
        flex-direction: column;
        position: fixed;
        top: 56px;
        left: 0;
        width: 100%;
        background: #2d4d3a;
        padding: 10px 16px 16px;
        gap: 2px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    }
    .topbar-nav.open { display: flex; }
    .topbar-toggle { display: flex; }

    .hero h1, .page-header h1 { font-size: 1.6rem; }
    .hero { padding: 80px 16px 30px; }

    .comparison-table { font-size: 0.78rem; }
    .comparison-table thead th,
    .comparison-table tbody td { padding: 6px 8px; }

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

@media (max-width: 380px) {
    .topbar .brand span { display: none; }
}

/* ----- PRINT ----- */
@media print {
    .topbar, .back-to-top, .card-footer { display: none; }
    .card { break-inside: avoid; }
    body { background: #fff; color: #000; }
}