/* Retete Frontend Styles */

/* Header spacing fix */
.rt-hero { background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 50%, #f8fafb 100%); padding: 140px 0 30px; margin-top: 0; }
.rt-single-hero { background: #f8fafb; padding: 120px 0 16px; }

/* Hero */
.rt-hero-title { font-size: 32px; font-weight: 800; color: #0f172a; margin: 0 0 8px; }
.rt-hero-desc { font-size: 16px; color: #64748b; margin: 0 0 20px; max-width: 600px; }
.rt-search-wrap { position: relative; max-width: 500px; }
.rt-search { width: 100%; padding: 14px 40px 14px 20px; border: 2px solid #10b981; border-radius: 12px; font-size: 16px; outline: none; background: #fff; transition: border-color .2s, box-shadow .2s; box-sizing: border-box; }
.rt-search:focus { border-color: #059669; box-shadow: 0 0 0 4px rgba(16,185,129,.12); }
.rt-search-clear { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 18px; text-decoration: none; line-height: 1; }
.rt-search-clear:hover { color: #ef4444; }

/* Content layout — sidebar + grid */
.rt-content { padding: 30px 0 60px; }
.rt-layout { display: grid; grid-template-columns: 240px 1fr; gap: 30px; }

/* Sidebar */
.rt-sidebar { position: sticky; top: 80px; align-self: start; max-height: calc(100vh - 100px); overflow-y: auto; }
.rt-sidebar-title { font-size: 13px; font-weight: 700; color: #0f172a; text-transform: uppercase; letter-spacing: .5px; margin: 0 0 10px; padding: 0 0 8px; border-bottom: 2px solid #10b981; }
.rt-sidebar-list { list-style: none; margin: 0; padding: 0; }
.rt-sidebar-item { margin: 0; }
.rt-sidebar-btn { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 8px 12px; border: none; background: none; font-size: 13px; color: #475569; cursor: pointer; border-radius: 6px; text-align: left; transition: all .15s; }
.rt-sidebar-btn:hover { background: #f0fdf4; color: #059669; }
.rt-sidebar-btn.active { background: #10b981; color: #fff; font-weight: 600; }
.rt-sidebar-btn .rt-count { font-size: 11px; opacity: .7; }

/* Mobile filters toggle */
.rt-mobile-toggle { display: none; width: 100%; padding: 12px 16px; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; font-size: 14px; color: #475569; cursor: pointer; text-align: left; margin-bottom: 16px; }
.rt-mobile-toggle i { float: right; transition: transform .2s; }
.rt-mobile-toggle.open i { transform: rotate(180deg); }
.rt-mobile-filters { display: none; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.rt-mobile-filters.open { display: flex; }
.rt-mobile-filter { padding: 6px 14px; border: 1px solid #e2e8f0; border-radius: 20px; background: #fff; font-size: 12px; color: #475569; cursor: pointer; }
.rt-mobile-filter.active { background: #10b981; color: #fff; border-color: #10b981; }

/* Hide desktop sidebar filters (old) */
.rt-filters { display: none; }

/* Grid */
.rt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.rt-card { display: flex; flex-direction: column; background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; overflow: hidden; text-decoration: none; color: inherit; transition: transform .2s, box-shadow .2s; }
.rt-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.rt-card-img { width: 100%; height: 180px; object-fit: cover; }
.rt-card-noimg { display: flex; align-items: center; justify-content: center; background: #f1f5f9; font-size: 48px; }
.rt-card-body { padding: 12px 14px; flex: 1; }
.rt-card-title { font-size: 15px; font-weight: 700; color: #0f172a; margin: 0 0 4px; }
.rt-card-section { font-size: 11px; color: #10b981; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.rt-card-nutri { display: flex; gap: 6px; margin-top: 8px; font-size: 11px; color: #64748b; }
.rt-card-nutri span { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; }

/* ── SINGLE PAGE ──────────────────────────── */

.rt-breadcrumb { font-size: 13px; color: #94a3b8; }
.rt-breadcrumb a { color: #64748b; text-decoration: none; }
.rt-breadcrumb a:hover { color: #10b981; }
.rt-breadcrumb strong { color: #0f172a; }

.rt-single { padding: 30px 0 60px; }
.rt-single-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-bottom: 40px; }
.rt-single-img { width: 100%; border-radius: 16px; object-fit: cover; max-height: 500px; }
.rt-single-noimg { width: 100%; height: 300px; background: #f1f5f9; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 80px; }
.rt-single-section { font-size: 12px; color: #10b981; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.rt-single-title { font-size: 28px; font-weight: 800; color: #0f172a; margin: 4px 0 12px; }
.rt-single-desc { font-size: 15px; color: #475569; line-height: 1.7; margin-bottom: 16px; }
.rt-single-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.rt-badge { padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; background: #f1f5f9; color: #475569; }
.rt-badge-weight { background: #ede9fe; color: #6366f1; }
.rt-badge-price { background: #dcfce7; color: #166534; }

/* Nutritional Cards */
.rt-nutri-cards { display: flex; gap: 10px; flex-wrap: wrap; }
.rt-nutri-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px 16px; text-align: center; min-width: 80px; }
.rt-nutri-card.rt-nutri-kcal { background: #fef3c7; border-color: #fde68a; }
.rt-nutri-value { display: block; font-size: 22px; font-weight: 800; color: #0f172a; }
.rt-nutri-label { font-size: 11px; color: #94a3b8; text-transform: uppercase; letter-spacing: .3px; }

/* Sections */
.rt-section { margin-bottom: 30px; }
.rt-section-title { font-size: 20px; font-weight: 700; color: #0f172a; margin: 0 0 14px; padding-bottom: 8px; border-bottom: 2px solid #10b981; }

/* Table — responsive */
.rt-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.rt-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 500px; }
.rt-table th { background: #f8fafc; padding: 10px 12px; text-align: left; font-weight: 600; color: #475569; border-bottom: 2px solid #e2e8f0; font-size: 12px; text-transform: uppercase; letter-spacing: .3px; white-space: nowrap; }
.rt-table td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; color: #1e293b; }
.rt-table tbody tr:hover { background: #f8fafb; }
.rt-table-total td { background: #f0fdf4; border-top: 2px solid #10b981; }
.rt-table-compact { font-size: 13px; min-width: auto; }
.rt-table-compact caption { font-weight: 700; font-size: 14px; margin-bottom: 8px; color: #0f172a; text-align: left; }
.rt-table-compact td { padding: 6px 10px; }
.rt-indent { padding-left: 28px !important; color: #94a3b8; font-size: 12px; }

/* Nutritional detail grid */
.rt-nutri-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.rt-nutri-detail { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px; }

/* Tags */
.rt-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.rt-tag { padding: 4px 12px; border-radius: 6px; font-size: 12px; font-weight: 500; }
.rt-tag-allergen { background: #fef3c7; color: #92400e; }
.rt-tag-additive { background: #fef2f2; color: #991b1b; }

/* Results info */
.rt-results-info { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.rt-results-count { font-size: 13px; color: #94a3b8; }
.rt-active-filter { background: #10b981; color: #fff; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.rt-clear-filter { color: #fff; text-decoration: none; opacity: .7; font-size: 14px; }
.rt-clear-filter:hover { opacity: 1; }

/* Sidebar links */
.rt-sidebar-btn { text-decoration: none; }

/* Pagination */
.rt-pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 32px; padding-top: 24px; border-top: 1px solid #e2e8f0; flex-wrap: wrap; }
.rt-page-btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: 10px; font-size: 13px; font-weight: 600; color: #475569; background: #fff; border: 1px solid #e2e8f0; text-decoration: none; transition: all .2s; }
.rt-page-btn:hover { border-color: #10b981; color: #10b981; background: #f0fdf4; }
.rt-page-num { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; font-size: 14px; font-weight: 600; color: #475569; background: #fff; border: 1px solid #e2e8f0; text-decoration: none; transition: all .2s; }
.rt-page-num:hover { border-color: #10b981; color: #10b981; background: #f0fdf4; }
.rt-page-current { background: #10b981; color: #fff; border-color: #10b981; }
.rt-page-current:hover { background: #059669; color: #fff; }
.rt-page-dots { color: #94a3b8; font-size: 14px; padding: 0 4px; }

/* Mobile ingredient cards */
.rt-desktop-only { display: block; }
.rt-mobile-only { display: none; }

.rt-ing-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; }
.rt-ing-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.rt-ing-card-header strong { font-size: 14px; color: #0f172a; }
.rt-ing-card-header span { font-size: 13px; color: #6366f1; font-weight: 600; }
.rt-ing-card-nutri { display: flex; gap: 6px; flex-wrap: wrap; }
.rt-ing-pill { background: #f1f5f9; padding: 2px 8px; border-radius: 4px; font-size: 11px; color: #475569; }
.rt-ing-pill-kcal { background: #fef3c7; color: #92400e; font-weight: 600; }
.rt-ing-card-total { background: #f0fdf4; border-color: #86efac; }
.rt-ing-card-total .rt-ing-card-header strong { color: #059669; }

/* Admin image tools */
.rt-admin-img-tools { margin-top: 12px; padding: 12px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; }
.rt-admin-btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border: none; border-radius: 6px; font-size: 12px; font-weight: 600; color: #fff; cursor: pointer; transition: opacity .2s; text-decoration: none; }
.rt-admin-btn:hover { opacity: .85; }
.rt-admin-btn-upload { background: #475569; margin-bottom: 8px; }
.rt-admin-gen-btns { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* Back link */
.rt-back { margin-top: 30px; padding-top: 20px; border-top: 1px solid #e2e8f0; }
.rt-back-link { color: #10b981; text-decoration: none; font-weight: 600; font-size: 14px; }
.rt-back-link:hover { color: #059669; }

/* ── RESPONSIVE ──────────────────────────── */

@media (max-width: 900px) {
    .rt-layout { grid-template-columns: 1fr; }
    .rt-sidebar { display: none; }
    .rt-mobile-toggle { display: block; }
}

@media (max-width: 768px) {
    .rt-hero { padding: 120px 20px 20px; }
    .rt-single-hero { padding: 110px 20px 12px; }
    .rt-hero-title { font-size: 24px; }
    .rt-content { padding: 20px 0 40px; }
    .rt-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
    .rt-card-img { height: 120px; }
    .rt-card-body { padding: 8px 10px; }
    .rt-card-title { font-size: 13px; }
    .rt-card-nutri { display: none; }
    .rt-single-grid { grid-template-columns: 1fr; }
    .rt-single-title { font-size: 22px; }
    .rt-nutri-detail-grid { grid-template-columns: 1fr; }
    .rt-desktop-only { display: none !important; }
    .rt-mobile-only { display: block !important; }
    .rt-nutri-cards { gap: 6px; }
    .rt-nutri-card { min-width: 60px; padding: 8px 10px; }
    .rt-nutri-value { font-size: 18px; }
    .rt-single { padding: 20px 0 40px; }
    .w { padding-left: 16px; padding-right: 16px; }
}
