/* ============================================================
   Lia Faria - Receitas v2.0.0
   Cores: #DA97A8 (principal) #E4C3C3 (secundária)
   ============================================================ */

:root {
    --lfrc-primary:   #DA97A8;
    --lfrc-secondary: #E4C3C3;
    --lfrc-dark:      #1a1a1a;
    --lfrc-mid:       #555;
    --lfrc-light:     #f9f5f5;
    --lfrc-white:     #ffffff;
    --lfrc-radius:    12px;
}

.lfrc-wrap { width: 100%; margin: 0 auto; }

/* ── Forçar SVGs visíveis dentro do modal (override de temas) ── */
.lfrc-modal svg,
.lfrc-modal-close svg,
.lfrc-carousel-btn svg {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 18px !important;
    height: 18px !important;
}

/* ── Barra de controlos (design 1 apenas) ── */
.lfrc-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

/* Pesquisa */
.lfrc-search-wrap {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1.5px solid var(--lfrc-secondary);
    border-radius: 50px;
    overflow: hidden;
    background: var(--lfrc-white);
    transition: border-color 0.2s;
}
.lfrc-search-wrap:focus-within { border-color: var(--lfrc-primary); }
.lfrc-search-btn {
    background: none; border: none; cursor: pointer;
    padding: 8px 10px 8px 14px;
    display: flex; align-items: center;
    color: var(--lfrc-primary);
}
.lfrc-search-input {
    border: none; outline: none; background: none;
    font-family: inherit; font-size: 0.88rem;
    color: var(--lfrc-dark); padding: 8px 14px 8px 4px;
    width: 0; max-width: 200px;
    transition: width 0.3s ease;
}
.lfrc-search-input.open { width: 180px; }
.lfrc-search-input::placeholder { color: #ccc; }

/* Botões de vista */
.lfrc-view-btns {
    display: flex; gap: 4px;
}
.lfrc-view-btn {
    background: none; border: 1.5px solid var(--lfrc-secondary);
    border-radius: 8px; cursor: pointer;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    color: #999; transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.lfrc-view-btn:hover { color: var(--lfrc-primary); border-color: var(--lfrc-primary); }
.lfrc-view-btn.active { background: var(--lfrc-primary); border-color: var(--lfrc-primary); color: #fff; }
.lfrc-view-btn svg {
    display: block !important;
    visibility: visible !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px;
    min-height: 18px;
    opacity: 1 !important;
}
.lfrc-search-btn svg {
    display: block !important;
    visibility: visible !important;
    width: 18px !important;
    height: 18px !important;
    opacity: 1 !important;
}

/* ── Vista compacta ── */
.lfrc-design-1.lfrc-view-compact .lfrc-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 3px;
}
@media (max-width: 768px) { .lfrc-design-1.lfrc-view-compact .lfrc-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 480px) { .lfrc-design-1.lfrc-view-compact .lfrc-grid { grid-template-columns: repeat(3, 1fr); } }

/* ── Vista lista (design 1) ── */
.lfrc-design-1.lfrc-view-list .lfrc-grid {
    display: flex; flex-direction: column; gap: 0;
}
.lfrc-design-1.lfrc-view-list .lfrc-item {
    aspect-ratio: unset; height: auto; background: none;
    border-bottom: 1px solid #f0e8e8;
}
/* Na vista lista esconde o trigger da imagem e mostra o row */
.lfrc-design-1 .lfrc-trigger { display: block; }
.lfrc-design-1 .lfrc-list-row-d1 { display: none; }
.lfrc-design-1.lfrc-view-list .lfrc-trigger { display: none; }
.lfrc-design-1.lfrc-view-list .lfrc-list-row-d1 {
    display: flex; align-items: center; gap: 16px;
    padding: 14px 8px; background: none; border: none;
    cursor: pointer; width: 100%; text-align: left;
    font-family: inherit; transition: background 0.2s;
}
.lfrc-design-1.lfrc-view-list .lfrc-list-row-d1:hover { background: #fdf8f8; }

.lfrc-list-icon-d1 {
    flex-shrink: 0; width: 56px; height: 56px;
    border-radius: 50%; overflow: hidden;
    background: var(--lfrc-secondary);
}
.lfrc-list-icon-d1 img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lfrc-list-body-d1 { flex: 1; min-width: 0; }
.lfrc-list-title-d1 {
    margin: 0 0 3px; font-size: 0.95rem; font-weight: 600;
    color: var(--lfrc-dark); font-family: inherit; line-height: 1.3;
}
.lfrc-list-meta-d1 { margin: 0 0 3px; font-size: 0.78rem; color: var(--lfrc-mid); font-family: inherit; }
.lfrc-list-desc-d1 {
    margin: 0; font-size: 0.82rem; color: var(--lfrc-mid);
    font-family: inherit; line-height: 1.4;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── Filtros ── */
.lfrc-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    border-bottom: 1px solid var(--lfrc-secondary);
    margin-bottom: 32px;
}
.lfrc-filter {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #999;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    padding: 10px 18px;
    margin-bottom: -1px;
    transition: color 0.2s, border-color 0.2s;
    outline: none;
    white-space: nowrap;
}
.lfrc-filter:hover { color: var(--lfrc-dark); }
.lfrc-filter.active { color: var(--lfrc-dark); border-bottom-color: var(--lfrc-primary); }

/* ── Hidden ── */
.lfrc-item.lfrc-hidden { display: none; }

/* ══════════════════════════════
   DESIGN 1 — grelha
   ══════════════════════════════ */
.lfrc-design-1 .lfrc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}
.lfrc-wrap[style*="--lfrc-linhas"] .lfrc-grid {
    grid-template-rows: repeat(var(--lfrc-linhas), auto);
    grid-auto-rows: 0px;
    overflow: hidden;
}
@media (max-width: 768px) { .lfrc-design-1 .lfrc-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 480px) { .lfrc-design-1 .lfrc-grid { grid-template-columns: 1fr; } }

.lfrc-design-1 .lfrc-item { position: relative; overflow: hidden; aspect-ratio: 1/1; background: #f3f3f3; }
.lfrc-design-1 .lfrc-trigger {
    display: block; width: 100%; height: 100%;
    position: relative; border: none; padding: 0; cursor: pointer; background: none;
}
.lfrc-design-1 .lfrc-item img {
    width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.35s;
}
.lfrc-design-1 .lfrc-item:hover img { transform: scale(1.04); }
.lfrc-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 60%);
    transition: opacity 0.25s;
}
.lfrc-item-overlay-text {
    position: absolute; bottom: 12px; left: 12px; right: 12px;
    display: flex; flex-direction: column; gap: 3px;
    text-align: left;
}
.lfrc-item-title {
    color: #fff; font-size: 0.9rem; font-weight: 600;
    font-family: inherit; line-height: 1.3;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.lfrc-item-meta {
    color: #fff; font-size: 0.72rem; font-weight: 500;
    font-family: inherit; line-height: 1.3; opacity: 0.9;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* ══════════════════════════════
   DESIGN 2 — lista
   ══════════════════════════════ */
.lfrc-design-2 .lfrc-list {
    display: grid;
    grid-template-columns: repeat(var(--lfrc-colunas, 2), 1fr);
    gap: 0;
}
.lfrc-wrap[style*="--lfrc-linhas"] .lfrc-list {
    grid-template-rows: repeat(var(--lfrc-linhas), auto);
    grid-auto-rows: 0px;
    overflow: hidden;
}
@media (max-width: 640px) { .lfrc-design-2 .lfrc-list { grid-template-columns: 1fr; } }

.lfrc-design-2 .lfrc-item { border-bottom: 1px solid #ebebeb; border-right: 1px solid #ebebeb; }
.lfrc-list-row {
    display: flex; align-items: center; gap: 16px; padding: 20px 16px;
    text-decoration: none; color: inherit; background: none;
    border: none; cursor: pointer; width: 100%; text-align: left;
    font-family: inherit; transition: background 0.2s;
}
.lfrc-list-row:hover { background: #fdf8f8; }
.lfrc-list-icon { flex-shrink: 0; width: 80px; height: 80px; border-radius: 50%; overflow: hidden; background: var(--lfrc-secondary); }
.lfrc-list-icon img { width: 100%; height: 100%; object-fit: cover; }
.lfrc-list-icon-placeholder { display: block; width: 100%; height: 100%; }
.lfrc-list-body { flex: 1; min-width: 0; }
.lfrc-list-title { margin: 0 0 4px; font-size: 1rem; font-weight: 600; color: var(--lfrc-dark); font-family: inherit; }
.lfrc-list-meta { margin: 0; font-size: 0.82rem; color: var(--lfrc-mid); font-family: inherit; }

/* ══════════════════════════════
   MODAL
   ══════════════════════════════ */
.lfrc-modal {
    display: none;
    position: fixed; inset: 0; z-index: 999999;
    align-items: center; justify-content: center;
}
.lfrc-modal.lfrc-modal--open { display: flex; }

.lfrc-modal-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(3px);
    cursor: pointer;
}

.lfrc-modal-box {
    position: relative; z-index: 1;
    background: var(--lfrc-white);
    border-radius: var(--lfrc-radius);
    width: 92vw; max-width: 860px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    animation: lfrcModalIn 0.3s ease;
}
@media (max-width: 600px) {
    .lfrc-modal-box { width: 100vw; max-width: 100vw; max-height: 100vh; border-radius: 0; }
}

.lfrc-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.55);
    border: none;
    cursor: pointer;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    z-index: 100;
    transition: background 0.2s, transform 0.2s;
    flex-shrink: 0;
}
.lfrc-modal-close:hover { background: var(--lfrc-primary); transform: scale(1.1); }
.lfrc-modal-close svg { width: 18px; height: 18px; color: #fff; display: block; }

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

/* ── Modal hero - adjust for absolute close button ── */
.lfrc-modal-hero { margin-top: 0; }

/* ── Design 2 description ── */
.lfrc-list-desc {
    margin: 4px 0 0;
    font-size: 0.82rem;
    color: var(--lfrc-mid);
    font-family: inherit;
    line-height: 1.4;
}
.lfrc-modal-hero {
    position: relative; width: 100%; aspect-ratio: 16/7;
    overflow: hidden; margin-top: -48px;
    border-radius: var(--lfrc-radius) var(--lfrc-radius) 0 0;
}
@media (max-width: 600px) { .lfrc-modal-hero { border-radius: 0; margin-top: -48px; } }
.lfrc-modal-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lfrc-modal-hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 55%);
}
.lfrc-modal-hero-title {
    position: absolute; bottom: 20px; left: 24px; right: 24px;
    color: #fff; font-size: 1.7rem; font-weight: 700;
    font-family: inherit; line-height: 1.2;
    text-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
@media (max-width: 480px) { .lfrc-modal-hero-title { font-size: 1.3rem; } }

/* ── Modal: corpo ── */
.lfrc-modal-body { padding: 24px 28px 32px; }
@media (max-width: 480px) { .lfrc-modal-body { padding: 16px; } }

/* ── Badges ── */
.lfrc-badges {
    display: flex; flex-wrap: wrap; gap: 10px;
    margin-bottom: 28px;
}
.lfrc-badge {
    display: flex; align-items: center; gap: 6px;
    background: var(--lfrc-light); border-radius: 50px;
    padding: 6px 14px; font-size: 0.82rem; font-family: inherit;
    color: var(--lfrc-dark); font-weight: 500;
}
.lfrc-badge svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--lfrc-primary); }
.lfrc-badge--eco { background: var(--lfrc-primary); color: #fff; }
.lfrc-badge--eco svg { color: #fff; }

/* ── Secção ── */
.lfrc-section { margin-bottom: 28px; }
.lfrc-section-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 1rem; font-weight: 700; color: var(--lfrc-dark);
    font-family: inherit; margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--lfrc-secondary);
}
.lfrc-section-title svg { width: 18px; height: 18px; color: var(--lfrc-primary); flex-shrink: 0; }

/* ── Duas colunas ── */
.lfrc-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 28px; }
@media (max-width: 600px) { .lfrc-two-col { grid-template-columns: 1fr; } }

/* ── Ingredientes ── */
.lfrc-ingredients-list { list-style: none; margin: 0; padding: 0; }
.lfrc-ingredients-list li {
    padding: 7px 0; border-bottom: 1px solid #f0e8e8;
    font-family: inherit; font-size: 0.9rem; color: var(--lfrc-dark);
    display: flex; align-items: baseline; gap: 8px;
}
.lfrc-ingredients-list li::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%;
    background: var(--lfrc-primary); flex-shrink: 0; margin-top: 1px;
}
.lfrc-ingredients-list li:last-child { border-bottom: none; }

/* ── Preparação ── */
.lfrc-steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.lfrc-steps li {
    counter-increment: step;
    display: flex; gap: 12px; margin-bottom: 14px;
    font-family: inherit; font-size: 0.9rem; color: var(--lfrc-dark); line-height: 1.5;
}
.lfrc-steps li::before {
    content: counter(step);
    min-width: 26px; height: 26px; border-radius: 50%;
    background: var(--lfrc-primary); color: #fff;
    font-size: 0.75rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; margin-top: 1px;
}

/* ── Valor nutricional ── */
.lfrc-nutri {
    display: flex; flex-wrap: wrap; gap: 10px;
}
.lfrc-nutri-card {
    flex: 1; min-width: 80px;
    background: var(--lfrc-light); border-radius: 10px;
    padding: 12px 10px; text-align: center;
    border-top: 3px solid var(--lfrc-primary);
}
.lfrc-nutri-card svg { width: 20px; height: 20px; color: var(--lfrc-primary); margin-bottom: 4px; }
.lfrc-nutri-value { font-size: 1.1rem; font-weight: 700; color: var(--lfrc-dark); font-family: inherit; display: block; }
.lfrc-nutri-label { font-size: 0.72rem; color: var(--lfrc-mid); font-family: inherit; display: block; margin-top: 2px; }

/* ── Carrossel ── */
.lfrc-carousel { position: relative; }
.lfrc-carousel-track-wrap { overflow: hidden; border-radius: 10px; }
.lfrc-carousel-track {
    display: flex; transition: transform 0.35s ease;
}
.lfrc-carousel-slide {
    flex-shrink: 0; width: 100%;
    aspect-ratio: 16/9;
}
.lfrc-carousel-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lfrc-carousel-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(0,0,0,0.55); border: none; cursor: pointer;
    width: 38px; height: 38px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3); z-index: 2;
    transition: background 0.2s;
}
.lfrc-carousel-btn:hover { background: var(--lfrc-primary); }
.lfrc-carousel-btn svg { width: 18px; height: 18px; color: #fff; }
.lfrc-carousel-prev { left: 10px; }
.lfrc-carousel-next { right: 10px; }
.lfrc-carousel-dots {
    display: flex; justify-content: center; gap: 6px; margin-top: 10px;
}
.lfrc-carousel-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--lfrc-secondary); border: none; cursor: pointer; padding: 0;
    transition: background 0.2s;
}
.lfrc-carousel-dot.active { background: var(--lfrc-primary); }

/* ── Vídeo ── */
.lfrc-video-wrap {
    position: relative; padding-bottom: 56.25%; height: 0;
    border-radius: 10px; overflow: hidden;
}
.lfrc-video-wrap iframe {
    position: absolute; inset: 0; width: 100%; height: 100%; border: none;
}

/* ── Notas ── */
.lfrc-notes {
    background: var(--lfrc-light);
    border-left: 4px solid var(--lfrc-primary);
    border-radius: 0 10px 10px 0;
    padding: 16px 20px;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--lfrc-mid);
    line-height: 1.6;
}
