/* ========================= */
/* VARIABLES & RESET */
/* ========================= */

:root {
    --primary: #2ecc71;
    --text: #1f2937;
    --muted: #6b7280;
    --bg: #f9fafb;
    --border: #e5e7eb;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
                 Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);

    padding-bottom: 72px;
}

/* ========================= */
/* LAYOUT */
/* ========================= */

header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #fff;
}

@media (max-width: 640px) {
    header nav {
        display: none;
    }
}

@media (min-width: 768px) {
    .mobile-nav {
        display: none;
    }

    body {
        padding-bottom: 0;
    }
}

header h1 {
    margin: 0;
    font-size: 1.3rem;
}

.container {
    max-width: 900px;
    margin: auto;
    padding: 1.5rem;
}

.card {
    background: #fff;
    border-radius: 14px;
    padding: 1.2rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}

.side-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.2rem 1rem 0.2rem;
    margin-bottom: 0.8rem;
}

.side-logo {
    font-size: 1.5rem;
}

.side-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

/* ========================= */
/* TOP BAR HEADER FIX */
/* ========================= */

.top-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;

    height: 56px;
    padding: 0 1rem;

    background: #fff;
    border-bottom: 1px solid var(--border);
}

/* 🔑 CLÉ : empêcher le h1 de casser la ligne */
.top-bar h1 {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
}

/* Icône menu */
.menu-btn {
    font-size: 1.6rem;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
    cursor: pointer;
}

/* Logo + texte */
.brand-logo,
.brand-name {
    line-height: 1;
}





/* ========================= */
/* MENU LATERAL (DRAWER) */
/* ========================= */

.side-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: #fff;
    z-index: 100;

    transform: translateX(-100%);
    transition: transform 0.25s ease;
    padding: 1rem;
}

.side-menu.open {
    transform: translateX(0);
}

.side-nav a {
    display: flex;
    align-items: center;
    gap: 0.8rem;

    padding: 0.75rem 0.9rem;
    border-radius: 12px;

    text-decoration: none;
    color: #111;
    font-size: 0.95rem;
    font-weight: 500;

    transition: background 0.15s ease;
}

.side-nav a:hover {
    background: #f1f5f9;
}

.side-nav a:active {
    background: #e5e7eb;
}



.side-nav hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 0.6rem 0;
}

/* Overlay */
.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 90;

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.menu-overlay.open {
    opacity: 1;
    pointer-events: auto;
}



/* ========================= */
/* MOBILE BOTTOM NAV */
/* ========================= */

.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);

    width: 100%;
    max-width: 480px;

    background: #fff;
    border-top: 1px solid var(--border);

    display: flex;
    justify-content: space-around;
    padding: 0.4rem 0;
}


.nav-item {
    flex: 0 0 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--muted);
    font-size: 0.75rem;
    gap: 0.2rem;
}

.nav-item span {
    font-size: 1.4rem;
    line-height: 1;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item:active {
    transform: scale(0.95);
}

.mobile-nav {
    animation: slideUp 0.25s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* ========================= */
/* SCAN BUTTON ALIGNEMENT */
/* ========================= */

.scan-btn {
    display: flex;
    align-items: center;          /* 👈 centre verticalement texte + image */
    justify-content: center;
    gap: 0.6rem;                  /* espace image / texte */
    margin-top: 1rem;
    padding: 0.9rem 1.4rem;
    background: var(--primary);
    color: white;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    text-align: center;
    }

/* Icône scan */
.scan-btn .nav-icon img {
    width: 24px;                  /* 👈 réduit depuis 32px */
    height: 24px;
    object-fit: contain;
    display: block;
}

/* Texte */
.scan-btn small {
    font-size: 0.9rem;
    line-height: 1;               /* 👈 évite le décalage vertical */
}



/* ========================= */
/* HERO PELLET */
/* ========================= */

.pellet-hero {
    text-align: center;
}

.pellet-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
}


/* ========================= */
/* SEARCH BAR */
/* ========================= */

.search-block {
    margin-top: 1.5rem;
}

.search-form {
    display: flex;
    align-items: center;
    background: #f3f4f6;
    border-radius: 14px;
    padding: 0.3rem;
}

.search-form input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.7rem 0.9rem;
    font-size: 0.95rem;
    outline: none;
}

.search-form button {
    border: none;
    background: #111;
    color: #fff;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    cursor: pointer;
}


/* ========================= */
/* SITE DDESCRIPTION HOME*/
/* ========================= */


.home-intro {
    margin-top: 1.2rem;
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.5;
}


/* ========================= */
/* BURN SCORE */
/* ========================= */

.burn-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    margin: 1rem 0;
}

.burn-score-big {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
}

.burn-label {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.2rem;
}

.burn-vote {
    font-size: 1.4rem;
    text-decoration: none;
    padding: 0.5rem 0.7rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 0.2rem;
    transition: transform 0.15s ease;
}

.burn-vote:hover {
    transform: scale(1.1);
}

.burn-hot {
    background: #fee2e2;
    color: #b91c1c;
}

.burn-cold {
    background: #e0f2fe;
    color: #0369a1;
}

.burn-help {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 1rem;
}

.burn-bar {
    height: 6px;
    background: var(--primary-soft);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 0.4rem;
}

.burn-bar span {
    display: block;
    height: 100%;
    background: var(--primary);
}

/* ========================= */
/* META INFOS */
/* ========================= */

.pellet-meta {
    display: flex;
    justify-content: space-around;
    font-size: 0.9rem;
    margin-top: 1rem;
    color: #374151;
}

/* ========================= */
/* SCAN CAMERA */
/* ========================= */

.scan-zone {
    text-align: center;
}

.scan-frame {
    position: relative;
    width: 100%;
    max-width: 420px;

    height: 200px;          /* hauteur limitée */
    margin: 0 auto;

    overflow: hidden;
    border-radius: 16px;
    background: #000;
}


.scan-frame video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scan-frame::after {
    content: "";
    position: absolute;
    inset: 12%;
    border: 2px dashed rgba(255,255,255,0.7);
    border-radius: 12px;
    pointer-events: none;
}

.scan-hint {
    color: var(--muted);
    font-size: 0.9rem;
}

.scan-status {
    font-size: 0.85rem;
    color: #9ca3af;
}

/* ========================= */
/* FORMS */
/* ========================= */

input, select {
    width: 100%;
    padding: 0.7rem;
    margin-top: 0.3rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 1rem;
}

label {
    font-weight: 600;
}


/* ========================= */
/* DESKTOP OVERRIDE */
/* ========================= */

@media screen and (min-width: 768px) {
    .mobile-nav {
        display: none !important;
    }

    body {
        padding-bottom: 0 !important;
    }
}

/* ========================= */
/* GESTION AFFICHAGE MOBILE */
/* ========================= */

@media (max-width: 640px) {

    .container {
        padding: 1rem;
    }

    .pellet-title {
        font-size: 1.2rem;
    }

    .burn-score-big {
        font-size: 2.6rem;
    }

    .burn-vote {
        font-size: 1.6rem;
    }

    .pellet-meta {
        flex-direction: column;
        gap: 0.4rem;
    }

    .scan-btn {
        width: 100%;
    }
}

/* ========================= */
/* PHOTO */
/* ========================= */


.photo-gallery {
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.photo-gallery img {
    height: 160px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #e5e7eb;
}


/* ========================= */
/* SLIDER PHOTOS */
/* ========================= */

.slider {
    overflow: hidden;
    width: 100%;
    touch-action: pan-y; /* autorise vertical, bloque horizontal */
}

.slides {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.slide {
    min-width: 100%;
    scroll-snap-align: center;
}

.slide img {
    width: 100%;
    height: 260px;
    object-fit: cover;
}


.reviews-slider {
    display: flex;
    gap: 0.8rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
}

.review-card {
    min-width: 85%;
    max-width: 85%;
    background: #f9fafb;
    padding: 1rem;
    border-radius: 14px;
    scroll-snap-align: start;
    border: 1px solid #e5e7eb;
}

.review-photo {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 0.6rem;
}

.review-text {
    font-size: 0.95rem;
    line-height: 1.4;
}

.review-meta {
    margin-top: 0.6rem;
    font-size: 0.8rem;
    color: #6b7280;
}

.reviews-link {
    display: block;
    margin-top: 0.8rem;
    text-align: center;
    font-weight: 600;
    text-decoration: none;
}

/* ========================= */
/* ADD REVIEW PAGE */
/* ========================= */

.form-error {
    color: #dc2626;
    font-weight: 600;
    margin: 0.5rem 0;
}

/* ⭐ Rating */
.rating-card {
    text-align: center;
}

.rating-select {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 0.6rem;
}

.rating-select input {
    display: none;
}

.rating-select span {
    font-size: 2rem;
    cursor: pointer;
    filter: grayscale(1);
    transition: transform 0.15s ease, filter 0.15s ease;
}

.rating-select input:checked + span,
.rating-select span:hover {
    filter: none;
    transform: scale(1.15);
}

/* ✍️ Textarea */
.review-textarea {
    width: 100%;
    min-height: 120px;
    border-radius: 12px;
    padding: 0.9rem;
    border: 1px solid var(--border);
    font-size: 1rem;
    resize: vertical;
}

/* 📸 Photos */
.photo-input-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
}

.photo-slot {
    position: relative;
    aspect-ratio: 1 / 1;
    border: 2px dashed var(--border);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    cursor: pointer;
}

.photo-slot input {
    display: none;
}

.photo-slot span {
    font-size: 1.8rem;
    color: var(--muted);
}

/* Bouton full width */
.scan-btn.full {
    width: 100%;
    margin-top: 1rem;
}

.photo-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
    display: none; /* 👈 IMPORTANT */
}

.photo-slot.has-image .photo-preview {
    display: block;
}

.photo-slot.has-image span {
    display: none;
}


.review-card .photo-gallery {
    margin-top: 0.6rem;
}
.review-card .photo-gallery img {
    height: 120px;
}



/* ========================= */
/* FOOTER */
/* ========================= */


.site-footer {
    display: flex;
    justify-content: center;
    align-items: center;

    padding: 1rem;
    font-size: 0.75rem;
    color: var(--muted);
    text-align: center;
}

/* ========================= */
/* LISTE PELLETS PREMIUM */
/* ========================= */

.pellet-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;

    padding: 0.7rem 0;
    border-top: 1px solid var(--border);

    text-decoration: none;
    color: var(--text);
}

.pellet-row:first-of-type {
    border-top: none;
}

.pellet-row:active {
    background: #f3f4f6;
}

/* ========================= */
/* IMAGE DU SAC */
/* ========================= */

.pellet-thumb {
    width: 56px;
    height: 56px;
    flex-shrink: 0;

    border-radius: 8px;
    background: #f1f5f9;

    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pellet-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pellet-placeholder {
    font-size: 1.4rem;
    opacity: 0.5;
}

/* ========================= */
/* CONTENU TEXTE */
/* ========================= */

.pellet-content {
    flex: 1;
    min-width: 0;
}

.pellet-title {
    font-size: 0.95rem;
    font-weight: 600;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pellet-brand {
    font-size: 0.8rem;
    color: var(--muted);
}

/* ========================= */
/* META INFOS (PRIX / BURN / AVIS) */
/* ========================= */

.pellet-meta {
    margin-top: 0.3rem;
}

.meta-item {
    font-size: 0.75rem;
    color: var(--muted);

    white-space: nowrap;   /* 🔑 UNE SEULE LIGNE */
    overflow: hidden;
}

.meta-icon {
    display: inline-block;
    width: 1.1em;
    text-align: center;
}

.meta-text {
    line-height: 1;
}

/* ========================= */
/* TOP button (PRIX / BURN / AVIS) */
/* ========================= */


.sort-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.sort-buttons a {
    flex: 1;
    text-align: center;
    padding: 0.4rem;
    border-radius: 999px;
    background: #f3f4f6;
    text-decoration: none;
    font-size: 0.8rem;
    color: #111;
}

.sort-buttons a.active {
    background: var(--primary);
    color: white;
    font-weight: 600;
}



