/* Kalories Community - Estilos principales */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

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

/* Variables */
:root {
    --primary: #5C910C;
    --primary-light: rgba(92,145,12,0.08);
    --primary-mid: rgba(92,145,12,0.15);
    --bg: #FAFAF7;
    --fg: #F0F2E8;
    --text: #171C0D;
    --text-light: #888;
    --tertiary: #DEE5D1;
    --border: #e8e8e2;
    --white: #ffffff;
    --max-width: 1060px;
    --padding: 48px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

/* Container */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--padding);
}

/* ==================== NAV ==================== */
.nav {
    display: flex;
    align-items: center;
    padding: 14px var(--padding);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-inner {
    display: flex;
    align-items: center;
    max-width: var(--max-width);
    margin: 0 auto;
    width: 100%;
}

.nav-logo {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
}

.nav-logo span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 28px;
    margin-left: 40px;
}

.nav-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-light);
    transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
    font-weight: 600;
}

.nav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-lang {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    padding: 6px 10px;
    background: var(--primary-light);
    border-radius: 6px;
    cursor: pointer;
    border: none;
}

.nav-cta {
    font-size: 12px;
    font-weight: 600;
    color: var(--white);
    background: var(--primary);
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    transition: opacity 0.2s;
}

.nav-cta:hover {
    opacity: 0.9;
}

/* ==================== HERO ==================== */
.hero {
    background: linear-gradient(180deg, var(--fg) 0%, var(--bg) 100%);
    padding: 56px 0 40px;
    text-align: center;
}

.hero h1 {
    font-size: 34px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
    margin-bottom: 10px;
}

.hero h1 em {
    font-style: normal;
    color: var(--primary);
}

.hero p {
    font-size: 15px;
    color: var(--text-light);
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Search */
.hero-search {
    display: flex;
    gap: 8px;
    max-width: 540px;
    margin: 24px auto 0;
}

.hero-search input {
    flex: 1;
    padding: 12px 18px;
    border-radius: 12px;
    border: 1px solid var(--border);
    font-size: 14px;
    font-family: inherit;
    background: var(--white);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.hero-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(92,145,12,0.1);
}

.hero-search input::placeholder {
    color: var(--text-light);
}

.hero-search button {
    padding: 12px 24px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    transition: opacity 0.2s;
}

.hero-search button:hover {
    opacity: 0.9;
}

/* Filters */
.hero-filters {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 16px;
}

.filter-btn {
    padding: 7px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    transition: all 0.2s;
}

.filter-btn.active {
    background: var(--primary);
    color: var(--white);
}

.filter-btn.inactive {
    background: var(--white);
    color: var(--text);
    border: 1px solid var(--border);
}

.filter-btn.inactive:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ==================== STATS ==================== */
.stats {
    display: flex;
    gap: 32px;
    justify-content: center;
    padding: 24px 0;
}

.stat {
    text-align: center;
}

.stat-num {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
}

/* ==================== CARDS GRID ==================== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.section-header .count {
    font-size: 12px;
    color: var(--text-light);
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

/* Card */
.item-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.2s;
    cursor: pointer;
    display: block;
}

.item-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.card-image {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

.card-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--fg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-placeholder.prep {
    background: var(--primary-mid);
}

.card-placeholder svg {
    width: 24px;
    height: 24px;
    stroke: var(--primary);
    fill: none;
    stroke-width: 1.5;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.card-subtitle {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 2px;
}

.card-macros-grid {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 4px;
    margin-bottom: 12px;
}

.card-macro-box {
    flex: 1;
    border-radius: 8px;
    padding: 6px 4px;
    text-align: center;
}

.card-macro-box.fat { background: rgba(224,164,88,0.12); }
.card-macro-box.carb { background: rgba(91,155,213,0.12); }
.card-macro-box.prot { background: rgba(196,91,132,0.12); }
.card-macro-box.fiber { background: rgba(46,204,113,0.12); }
.card-macro-box.salt { background: rgba(149,165,166,0.10); }

.card-macro-label {
    font-size: 9px;
    font-weight: 600;
    text-transform: capitalize;
}

.card-macro-box.fat .card-macro-label { color: #E0A458; }
.card-macro-box.carb .card-macro-label { color: #5B9BD5; }
.card-macro-box.prot .card-macro-label { color: #C45B84; }
.card-macro-box.fiber .card-macro-label { color: #2ECC71; }
.card-macro-box.salt .card-macro-label { color: #95A5A6; }

.card-macro-val {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.card-kcal {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}

.btn-download {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid rgba(92,145,12,0.3);
    transition: all 0.2s;
}

.btn-download:hover {
    background: var(--primary);
    color: var(--white);
}

/* View all */
.view-all-wrap {
    text-align: center;
    padding: 8px 0 40px;
}

.btn-view-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    background: var(--white);
    border: 1px solid rgba(92,145,12,0.3);
    transition: all 0.2s;
}

.btn-view-all:hover {
    background: var(--primary);
    color: var(--white);
}

/* ==================== ITEM DETAIL ==================== */
.item-detail {
    padding-bottom: 16px;
}

.item-layout {
    display: flex;
    gap: 32px;
    padding-bottom: 28px;
}

.item-left { flex: 1; }
.item-right { width: 340px; flex-shrink: 0; }

.item-image {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 16px;
    margin-bottom: 16px;
}

.item-image-placeholder {
    width: 100%;
    height: 280px;
    background: var(--fg);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.item-image-placeholder svg {
    width: 48px;
    height: 48px;
    stroke: var(--tertiary);
}

.item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.item-type-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
}

.item-type-badge.food {
    color: var(--primary);
    background: var(--primary-light);
}

.item-type-badge.preparation {
    color: #8B6914;
    background: #FFF8E1;
}

.item-downloads {
    font-size: 12px;
    color: var(--text-light);
}

.item-name {
    font-size: 26px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 4px;
}

.item-desc {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 12px;
    line-height: 1.5;
}

.item-brand {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: 12px;
}

.item-ingredients {
    margin-bottom: 16px;
}

.item-ingredients h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.item-ingredients ul {
    padding-left: 18px;
}

.item-ingredients li {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.6;
}

.item-portions {
    margin-bottom: 16px;
}

.item-portions h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.item-portions ul {
    padding-left: 18px;
}

.item-portions li {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.6;
}

.item-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 20px;
    background: var(--white);
    color: var(--primary);
    border: 1px solid rgba(92,145,12,0.3);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-outline:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.item-buttons .btn-primary {
    flex: 1;
}

/* Nutrition card */
.nutrition-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    position: sticky;
    top: 80px;
}

.nutrition-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}

.nutrition-per {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 14px;
}

/* Macro rows - app colors */
.macro-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 5px;
}

.macro-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.macro-icon svg { width: 15px; height: 15px; }
.macro-label { flex: 1; font-size: 13px; font-weight: 500; color: var(--text); }
.macro-value { font-size: 15px; font-weight: 700; color: var(--text); }
.macro-unit { font-size: 11px; font-weight: 400; color: var(--text-light); }

/* Calories */
.macro-row.calories { background: var(--primary); }
.macro-row.calories .macro-icon { background: rgba(255,255,255,0.2); color: white; }
.macro-row.calories .macro-label { color: white; }
.macro-row.calories .macro-value { color: white; }
.macro-row.calories .macro-unit { color: rgba(255,255,255,0.7); }

/* Fats: #E0A458 */
.macro-row.fats { background: rgba(224,164,88,0.12); }
.macro-row.fats .macro-icon { background: white; color: #E0A458; }

/* Carbs: #5B9BD5 */
.macro-row.carbs { background: rgba(91,155,213,0.12); }
.macro-row.carbs .macro-icon { background: white; color: #5B9BD5; }

/* Proteins: #C45B84 */
.macro-row.proteins { background: rgba(196,91,132,0.12); }
.macro-row.proteins .macro-icon { background: white; color: #C45B84; }

/* Fiber: #2ECC71 */
.macro-row.fiber { background: rgba(46,204,113,0.12); }
.macro-row.fiber .macro-icon { background: white; color: #2ECC71; }

/* Salt: #95A5A6 */
.macro-row.salt { background: rgba(149,165,166,0.10); }
.macro-row.salt .macro-icon { background: white; color: #95A5A6; }

/* App banner */
.app-ban {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--fg);
    border-radius: 12px;
}

.app-ban-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    flex-shrink: 0;
}

.app-ban-info { flex: 1; }
.app-ban-title { font-size: 13px; font-weight: 600; color: var(--text); }
.app-ban-desc { font-size: 11px; color: var(--text-light); }

.app-ban-btn {
    font-size: 11px;
    font-weight: 600;
    color: white;
    background: var(--primary);
    padding: 7px 14px;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .item-layout { flex-direction: column; }
    .item-right { width: 100%; }
    .nutrition-card { position: static; }
}

/* ==================== LEGAL PAGES ==================== */
.legal-page {
    padding: 40px 0 56px;
    max-width: 720px;
}

.legal-page h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 8px;
}

.legal-lead {
    font-size: 15px;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.legal-section {
    margin-bottom: 28px;
}

.legal-section h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.legal-section p {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 8px;
}

.legal-section p:last-child {
    margin-bottom: 0;
}

.legal-section strong {
    color: var(--text);
    font-weight: 600;
}

.legal-section ul {
    margin: 10px 0;
    padding-left: 20px;
}

.legal-section ul li {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 6px;
}

.legal-section ul li strong {
    color: var(--text);
}

.legal-section .muted {
    font-size: 13px;
    color: var(--text-light);
    opacity: 0.7;
}

/* ==================== COMMUNITY PAGE ==================== */
.page-header {
    padding: 28px 0 16px;
}

.page-header h1 {
    font-size: 26px;
    font-weight: 800;
    color: var(--text);
}

.community-search {
    margin-bottom: 16px;
}

.community-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
}

.community-toolbar-left {
    display: flex;
    align-items: center;
}

.community-toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.community-count {
    font-size: 13px;
    color: var(--text-light);
    white-space: nowrap;
}

.community-sort {
    font-size: 12px;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px 10px;
    background: var(--white);
    font-family: inherit;
    cursor: pointer;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 28px 0;
}

.page-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s;
}

.page-btn:hover:not(.active):not(.disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.page-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.page-btn.disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

.page-info {
    font-size: 12px;
    color: var(--text-light);
    margin: 0 12px;
    white-space: nowrap;
}

/* ==================== FEATURES ==================== */
.features-section {
    padding: 56px 0;
    border-top: 1px solid var(--border);
}

.features-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text);
    text-align: center;
    margin-bottom: 8px;
}

.features-subtitle {
    font-size: 14px;
    color: var(--text-light);
    text-align: center;
    max-width: 500px;
    margin: 0 auto 36px;
}

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

.feature-card {
    background: var(--fg);
    border-radius: 14px;
    padding: 24px;
    text-align: center;
}

.feature-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--primary-mid);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}

.feature-icon svg {
    width: 22px;
    height: 22px;
    stroke: var(--primary);
    fill: none;
}

.feature-card h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.feature-card p {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.5;
}

/* ==================== FAQ ==================== */
.faq-section {
    padding: 56px 0;
    background: var(--fg);
}

.faq-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text);
    text-align: center;
    margin-bottom: 8px;
}

.faq-subtitle {
    font-size: 14px;
    color: var(--text-light);
    text-align: center;
    max-width: 500px;
    margin: 0 auto 32px;
}

.faq-list {
    max-width: 680px;
    margin: 0 auto;
}

.faq-item {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 8px;
    overflow: hidden;
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    transition: background 0.2s;
}

.faq-question:hover {
    background: rgba(92,145,12,0.03);
}

.faq-question h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.faq-arrow {
    font-size: 18px;
    color: var(--text-light);
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 12px;
}

.faq-item.open .faq-arrow {
    transform: rotate(90deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.open .faq-answer {
    max-height: 300px;
}

.faq-answer p {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.6;
    padding: 0 20px 16px;
}

/* ==================== CONTACT ==================== */
.contact-section {
    padding: 56px 0;
    border-top: 1px solid var(--border);
    text-align: center;
}

.contact-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 10px;
}

.contact-desc {
    font-size: 14px;
    color: var(--text-light);
    max-width: 480px;
    margin: 0 auto 24px;
    line-height: 1.6;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--primary);
    color: var(--white);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    transition: opacity 0.2s;
}

.contact-btn:hover {
    opacity: 0.9;
}

.contact-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    :root { --padding: 20px; }

    .nav-links { display: none; }

    .hero h1 { font-size: 26px; }

    .hero-search { flex-direction: column; }
    .hero-search button { width: 100%; }

    .items-grid { grid-template-columns: 1fr; }
    .features-grid { grid-template-columns: 1fr; }

    .stats { gap: 20px; }
    .stat-num { font-size: 20px; }
}

@media (max-width: 1024px) and (min-width: 769px) {
    .items-grid { grid-template-columns: repeat(2, 1fr); }
    .features-grid { grid-template-columns: repeat(2, 1fr); }
}
