/*
Theme Name: Bel Caractéristiques Environnementales
Theme URI: https://envcarac.wpenginepowered.com
Description: Caractéristiques environnementales des produits Bel.
Version: 2.1.2
Author: Groupe Bel
Author URI: https://www.groupe-bel.com
Text Domain: bel-env
Requires at least: 6.0
Requires PHP: 8.0
*/

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--Grey-900);
    background: var(--White);
    line-height: 1.6;
}

:root {
    --White: #FFFFFF;
    --Green-buddy-800: #005C44;
    --Green-buddy-700: #00805F;
    --Green-buddy-600: #008F6A;
    --Green-buddy-500: #00A87E;
    --Green-buddy-400: #81D4C0;
    --Green-buddy-300: #D9EDE7;
    --Green-buddy-200: #EAF5F2;
    --Green-buddy-100: #F8FBFA;
    --Grey-100: #FAFAFA;
    --Grey-200: #EDF0EF;
    --Grey-300: #E3E5E5;
    --Grey-400: #CBCDCC;
    --Grey-500: #B1B2B2;
    --Grey-600: #929494;
    --Grey-700: #747776;
    --Grey-800: #5F6160;
    --Grey-900: #111212;
    --Red-danger-100: #FCF5F5;
    --Red-danger-500: #DA3B33;
    --Red-danger-900: #80140F;
    --Green-success-900: #00751E;
    --Green-success-500: #00A92B;
    --Green-success-100: #F0FAF2;
    --Blue-info-900: #007D99;
    --Blue-info-500: #009ABD;
    --Blue-info-100: #F0FCFF;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,.10);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: .25s cubic-bezier(.4,0,.2,1);
}

h1,h2,h3,h4 { font-weight: 700; line-height: 1.25; color: var(--Green-buddy-800); }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
p { margin-bottom: 1rem; color: var(--Grey-800); }
a { color: var(--Green-buddy-600); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--Green-buddy-800); }
img { max-width: 100%; height: auto; display: block; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.container--narrow { max-width: 900px; }

.site-header {
    background: var(--White);
    border-bottom: 1px solid var(--Grey-200);
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .875rem 0;
    gap: 1.5rem;
}
.site-header__logo img { height: 40px; width: auto; }
.site-header__title { font-size: 1rem; font-weight: 600; color: var(--Green-buddy-800); }

.hero {
    background: linear-gradient(135deg, var(--Green-buddy-800), var(--Green-buddy-600));
    padding: 4rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%; right: -20%;
    width: 600px; height: 600px;
    border-radius: 50%;
    background: rgba(255,255,255,.04);
}
.hero__title { font-size: 2.25rem; color: var(--White); margin-bottom: .75rem; }
.hero__subtitle {
    font-size: 1.1rem;
    color: var(--Green-buddy-300);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.info-banner {
    background: var(--Green-buddy-200);
    border-bottom: 1px solid var(--Green-buddy-300);
    padding: 1rem 0;
    text-align: center;
}
.info-banner p { font-size: .875rem; color: var(--Green-buddy-800); margin: 0; }

.section { padding: 3rem 0; }

.tag {
    display: inline-flex;
    align-items: center;
    padding: .2rem .6rem;
    font-size: .7rem;
    font-weight: 600;
    border-radius: 100px;
    white-space: nowrap;
}
.tag--green { background: var(--Green-success-100); color: var(--Green-success-900); }
.tag--blue  { background: var(--Blue-info-100); color: var(--Blue-info-900); }
.tag--red   { background: var(--Red-danger-100); color: var(--Red-danger-900); }
.tag--grey  { background: var(--Grey-200); color: var(--Grey-700); }

.empty-state { text-align: center; padding: 4rem 2rem; }
.empty-state__title { font-size: 1.25rem; color: var(--Grey-800); margin-bottom: .5rem; }
.empty-state__text { color: var(--Grey-600); font-size: .9rem; }

.site-footer {
    margin-top: auto;
    background: var(--Grey-900);
    color: var(--Grey-500);
    padding: 2rem 0;
}
.site-footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.site-footer__copy { font-size: .8rem; }
.site-footer__links { display: flex; gap: 1.5rem; list-style: none; }
.site-footer__links a { font-size: .8rem; color: var(--Grey-500); transition: color var(--transition); }
.site-footer__links a:hover { color: var(--White); }

.page-404 {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 4rem 2rem;
    text-align: center;
}
.page-404__code { font-size: 6rem; font-weight: 800; color: var(--Green-buddy-300); line-height: 1; margin-bottom: 1rem; }
.btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .75rem 1.5rem;
    font-size: .9rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}
.btn--primary { background: var(--Green-buddy-500); color: var(--White); }
.btn--primary:hover { background: var(--Green-buddy-700); color: var(--White); }

.spinner {
    width: 24px; height: 24px;
    border: 3px solid var(--Grey-200);
    border-top-color: var(--Green-buddy-500);
    border-radius: 50%;
    animation: spin .6s linear infinite;
    margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================
   FILTRES
   ============================================ */
.filters-section {
    padding: 2.5rem 0;
    background: var(--Grey-100);
    border-bottom: 1px solid var(--Grey-200);
}
.filters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
.filter-group {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.filter-group__label {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--Grey-700);
}
.filter-group__step {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--Green-buddy-500);
    color: var(--White);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    flex-shrink: 0;
}
.filter-group__select {
    padding: .75rem 2.5rem .75rem 1rem;
    font-size: .9rem;
    border: 2px solid var(--Grey-300);
    border-radius: var(--radius-md);
    background: var(--White);
    color: var(--Grey-900);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23747776' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .75rem center;
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition);
    width: 100%;
}
.filter-group__select:focus {
    border-color: var(--Green-buddy-400);
    box-shadow: 0 0 0 3px rgba(0,168,126,.15);
    outline: none;
}
.filter-group__select:disabled {
    background-color: var(--Grey-100);
    color: var(--Grey-500);
    cursor: not-allowed;
    border-color: var(--Grey-200);
}
.filter-group__select:not(:disabled):hover {
    border-color: var(--Green-buddy-400);
}
.filters__reset { text-align: center; margin-top: 1.25rem; }
.filters__reset-btn {
    background: none;
    border: none;
    color: var(--Grey-600);
    font-size: .85rem;
    cursor: pointer;
    padding: .375rem .75rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.filters__reset-btn:hover {
    color: var(--Red-danger-500);
    background: var(--Red-danger-100);
}

/* ============================================
   RÉSULTATS
   ============================================ */
.results-section,
.table-section {
    padding: 2rem 0 3rem;
}
.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: .75rem;
}
.results-header__title { font-size: 1.25rem; color: var(--Green-buddy-800); }
.results-header__count {
    font-size: .85rem;
    color: var(--Grey-600);
    background: var(--Grey-200);
    padding: .25rem .75rem;
    border-radius: 100px;
}

/* ============================================
   TABLEAU PRODUITS
   ============================================ */
.results-table-wrap {
    background: var(--White);
    border: 1px solid var(--Grey-200);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.product-table {
    width: 100%;
    border-collapse: collapse;
}

.product-table th {
    padding: .75rem 1rem;
    text-align: left;
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--Grey-600);
    background: var(--Grey-100);
    border-bottom: 1px solid var(--Grey-200);
    white-space: normal;
}

.product-table td {
    padding: .75rem 1rem;
    font-size: .875rem;
    color: var(--Grey-900);
    border-bottom: 1px solid var(--Grey-200);
    vertical-align: top;
    white-space: normal;
}

.product-table tr:last-child td { border-bottom: none; }

.product-row { cursor: pointer; }
.product-row:hover td { background: var(--Green-buddy-100) !important; }

.td-recycle { font-size: .8rem; }
.td-prime { font-size: .8rem; }
.prime-text { color: var(--Red-danger-500); font-size: .75rem; line-height: 1.3; }

/* ============================================
   FICHE DÉTAILLÉE
   ============================================ */
.detail-card {
    background: var(--White);
    border: 1px solid var(--Grey-200);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.detail-card__header {
    background: linear-gradient(135deg, var(--Green-buddy-800), var(--Green-buddy-600));
    padding: 1.5rem 2rem;
    color: var(--White);
}
.detail-card__title { font-size: 1.25rem; color: var(--White); margin-bottom: .25rem; }
.detail-card__format { font-size: 1rem; color: var(--Green-buddy-300); margin: 0; font-weight: 500; }
.detail-card__body { padding: 0; }
.detail-row {
    display: flex;
    border-bottom: 1px solid var(--Grey-200);
    padding: 1rem 2rem;
}
.detail-row:last-child { border-bottom: none; }
.detail-row--warning { background: var(--Red-danger-100); }
.detail-row__label {
    width: 40%;
    font-size: .85rem;
    font-weight: 600;
    color: var(--Grey-700);
    padding-right: 1.5rem;
    flex-shrink: 0;
}
.detail-row__value { flex: 1; font-size: .9rem; color: var(--Grey-900); }

.back-to-table-btn {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    margin-top: 1.25rem;
    padding: .625rem 1.25rem;
    font-size: .85rem;
    font-weight: 500;
    color: var(--Green-buddy-600);
    background: var(--White);
    border: 1px solid var(--Green-buddy-400);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
}
.back-to-table-btn:hover {
    background: var(--Green-buddy-100);
    color: var(--Green-buddy-800);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .hero { padding: 2.5rem 0; }
    .hero__title { font-size: 1.5rem; }
    .filters { grid-template-columns: 1fr; gap: 1rem; }
    .detail-row { flex-direction: column; gap: .375rem; padding: .875rem 1.25rem; }
    .detail-row__label { width: 100%; padding-right: 0; }
    .detail-card__header { padding: 1.25rem; }
    .site-footer__inner { flex-direction: column; text-align: center; }
    .product-table th,
    .product-table td { padding: .5rem .625rem; font-size: .75rem; }
}
@media (max-width: 480px) {
    .container { padding: 0 1rem; }
}