/* ═══════════════════════════════════════════════
   Food Safety Sub-Score Styles
   ═══════════════════════════════════════════════ */

/* ── Grade Badges ── */
.stcdb-food-grade-spotless  { background: #dcfce7; color: #166534; border: 1px solid #22c55e; }
.stcdb-food-grade-clean     { background: #fef9c3; color: #854d0e; border: 1px solid #eab308; }
.stcdb-food-grade-scrubbing { background: #ffedd5; color: #9a3412; border: 1px solid #f97316; }
.stcdb-food-grade-codered   { background: #fee2e2; color: #991b1b; border: 1px solid #ef4444; }

/* ── Food Safety Hero ── */
.stcdb-food-safety-section {
    margin-top: 2rem;
}

.stcdb-food-safety-hero {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.stcdb-food-grade-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 2rem;
    border-radius: 12px;
    min-width: 140px;
}

.stcdb-food-grade-score {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
}

.stcdb-food-grade-label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stcdb-food-safety-stats {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.stcdb-food-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stcdb-food-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.stcdb-food-stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
}

/* ── Breakdown Table ── */
.stcdb-food-breakdown {
    margin-top: 1.5rem;
}

.stcdb-food-breakdown h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #1f2937;
}

.stcdb-food-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.stcdb-food-table th {
    background: #f3f4f6;
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.stcdb-food-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #f3f4f6;
}

.stcdb-food-row-deducted {
    background: #fff5f5;
}

.stcdb-food-row-clean td {
    color: #374151;
}

.stcdb-food-critical {
    background: #fef2f2;
    color: #dc2626;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.stcdb-food-noncritical {
    background: #f0f9ff;
    color: #0284c7;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.stcdb-food-deducted {
    color: #dc2626;
    font-weight: 700;
}

.stcdb-food-clean {
    color: #16a34a;
}

.stcdb-food-pass-icon {
    color: #16a34a;
    font-size: 1.1rem;
}

.stcdb-food-fail-icon {
    color: #dc2626;
    font-size: 1.1rem;
}

.stcdb-food-table tfoot td {
    background: #f9fafb;
    font-weight: 600;
    border-top: 2px solid #e5e7eb;
}

.stcdb-food-methodology-note {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: #6b7280;
    font-style: italic;
}

.stcdb-food-methodology-note a {
    color: #0077B6;
}

/* ── Inspection Row Food Badge ── */
.stcdb-inspection-food-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 4px;
}

/* ── Rankings Page ── */
.stcdb-food-rankings-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

.stcdb-food-rankings-header {
    text-align: center;
    margin-bottom: 24px;
}

.stcdb-food-rankings-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 8px;
}

.stcdb-food-rankings-header p {
    color: #6b7280;
    font-size: 0.95rem;
    max-width: 680px;
    margin: 0 auto;
}

.stcdb-food-nav {
    margin-bottom: 24px;
}

.stcdb-food-nav-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.stcdb-food-nav-pill {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    color: #4b5563;
    background: #f3f4f6;
    transition: all 0.15s ease;
}

.stcdb-food-nav-pill:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.stcdb-food-nav-pill.is-active {
    background: #0077B6;
    color: #fff;
}

.stcdb-food-nav-dropdown select {
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid #d1d5db;
    font-size: 0.85rem;
    background: #fff;
    cursor: pointer;
}

/* Rankings Table */
.stcdb-food-rankings-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.stcdb-food-rankings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.stcdb-food-rankings-table th {
    background: #f9fafb;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6b7280;
    border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
}

.stcdb-food-rankings-table th a {
    color: inherit;
    text-decoration: none;
}

.stcdb-food-rankings-table th.is-sorted {
    color: #0077B6;
}

.stcdb-food-rankings-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
}

.stcdb-food-rankings-table tbody tr:hover {
    background: #f9fafb;
}

.stcdb-food-cell-ship a {
    color: #0077B6;
    text-decoration: none;
    font-weight: 500;
}

.stcdb-food-cell-ship a:hover {
    text-decoration: underline;
}

.stcdb-food-cell-score {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.85rem;
}

.stcdb-food-cell-grade {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .stcdb-food-safety-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .stcdb-food-table {
        font-size: 0.8rem;
    }

    .stcdb-food-table th,
    .stcdb-food-table td {
        padding: 0.4rem 0.5rem;
    }

    /* Hide Type and Max columns on mobile */
    .stcdb-food-table th:nth-child(3),
    .stcdb-food-table td:nth-child(3),
    .stcdb-food-table th:nth-child(5),
    .stcdb-food-table td:nth-child(5) {
        display: none;
    }

    .stcdb-food-rankings-table {
        font-size: 0.8rem;
    }

    /* Hide CDC Score and Trend on mobile rankings */
    .stcdb-food-rankings-table .stcdb-food-col-cdc,
    .stcdb-food-rankings-table .stcdb-food-col-trend {
        display: none;
    }
}
