/* ============================================================
   HOPPY — Thème principal (PWA / Hybride)
   Palette : Ambre #FFBF00 + Noir profond
   ============================================================ */

:root {
    --amber: #FFBF00;
    --amber-light: #FFD54F;
    --amber-dark: #E6AC00;
    --black: #1a1a1a;
    --black-deep: #0d0d0d;
    --gray-900: #212121;
    --gray-800: #2c2c2c;
    --gray-950: #0a0a0a;
    --gray-700: #3a3a3a;
    --gray-600: #6b6b6b;
    --gray-500: #8a8a8a;
    --gray-400: #9e9e9e;
    --gray-300: #b0b0b0;
    --gray-200: #e0e0e0;
    --white: #fafafa;
    --danger: #ef4444;
    --success: #22c55e;

    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 2px 16px rgba(0,0,0,0.3);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset & Base ---- */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-main);
    background: var(--black-deep);
    color: var(--white);
    margin: 0;
    padding-bottom: 80px; /* espace pour bottom-nav mobile */
    min-height: 100vh;
    overscroll-behavior-y: contain;
}

@media (min-width: 768px) {
    body {
        padding-top: 72px;  /* espace pour navbar fixe desktop */
        padding-bottom: 0;
    }
}

a { color: var(--amber); text-decoration: none; }
a:hover { color: var(--amber-light); }

/* ---- Desktop Navbar ---- */
.hoppy-navbar {
    background: var(--black) !important;
    border-bottom: 1px solid var(--gray-800);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.hoppy-navbar .navbar-brand {
    color: var(--amber) !important;
    font-size: 1.4rem;
}

.hoppy-navbar .nav-link {
    color: var(--gray-200) !important;
    font-weight: 500;
    transition: var(--transition);
}

.hoppy-navbar .nav-link:hover {
    color: var(--amber) !important;
}

/* ---- Bottom Navigation (Mobile PWA) ---- */
.hoppy-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: var(--black);
    border-top: 1px solid var(--gray-800);
    padding: 8px 0 env(safe-area-inset-bottom, 8px);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--gray-400);
    font-size: 0.65rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    padding: 4px 12px;
}

.bottom-nav-item i {
    font-size: 1.3rem;
}

.bottom-nav-item.active,
.bottom-nav-item:hover {
    color: var(--amber);
}

.bottom-nav-item.scan-btn i {
    background: var(--amber);
    color: var(--black);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-top: -16px;
    box-shadow: 0 4px 12px rgba(255, 191, 0, 0.4);
}

/* ---- Boutons ---- */
.btn-amber {
    background: var(--amber);
    color: var(--black);
    border: none;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-amber:hover {
    background: var(--amber-light);
    color: var(--black);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 191, 0, 0.3);
}

.btn-outline-amber {
    border: 2px solid var(--amber);
    color: var(--amber);
    background: transparent;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: var(--transition);
}

.btn-outline-amber:hover {
    background: var(--amber);
    color: var(--black);
}

/* ---- Cards (glassmorphism) ---- */
.hoppy-card {
    background: rgba(33, 33, 33, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 191, 0, 0.08);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
}

.hoppy-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--amber), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hoppy-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(255, 191, 0, 0.1), 0 2px 16px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 191, 0, 0.2);
}

.hoppy-card:hover::before {
    opacity: 1;
}

.hoppy-card .card-img-top {
    height: 200px;
    object-fit: contain;
    background: transparent;
    padding: 12px;
    border-radius: 12px 12px 0 0;
    transition: transform 0.3s ease;
}

.hoppy-card:hover .card-img-top {
    transform: scale(1.03);
}

.hoppy-card .card-body {
    padding: 16px;
}

.hoppy-card .card-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 4px;
}

.hoppy-card .card-subtitle {
    color: var(--gray-400);
    font-size: 0.85rem;
}

/* ---- Rating Stars ---- */
.rating-stars {
    color: var(--amber);
    font-size: 0.9rem;
    display: inline-flex;
    gap: 1px;
}

.rating-value {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--amber);
}

/* ---- Badge Style ---- */
.badge-style {
    background: rgba(255, 191, 0, 0.15);
    color: var(--amber);
    border: 1px solid rgba(255, 191, 0, 0.3);
    font-weight: 500;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
}

.badge-abv {
    background: rgba(255, 255, 255, 0.1);
    color: var(--gray-200);
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 20px;
}

/* ---- Section Headers ---- */
.section-title {
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--white);
    margin-bottom: 16px;
}

.section-title .see-all {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--amber);
}

/* ---- Scroll horizontal (mobile) ---- */
.horizontal-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    scrollbar-width: none;
}

.horizontal-scroll::-webkit-scrollbar { display: none; }

.horizontal-scroll > .hoppy-card {
    min-width: 240px;
    max-width: 240px;
    scroll-snap-align: start;
    flex-shrink: 0;
}

/* ---- Search Bar ---- */
.hoppy-search {
    background: var(--gray-900);
    border: 1px solid var(--gray-800);
    border-radius: var(--radius);
    color: var(--white);
    padding: 14px 16px 14px 44px;
    font-size: 1rem;
    width: 100%;
    transition: var(--transition);
}

.hoppy-search:focus {
    outline: none;
    border-color: var(--amber);
    box-shadow: 0 0 0 3px rgba(255, 191, 0, 0.15);
}

.hoppy-search::placeholder {
    color: var(--gray-400);
}

.search-wrapper {
    position: relative;
}

.search-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 1.1rem;
}

/* ---- Beer Detail Page ---- */
.beer-hero {
    display: flex;
    align-items: stretch;
    background: var(--gray-900);
    border: 1px solid var(--gray-800);
    border-radius: var(--radius);
    overflow: hidden;
    min-height: 280px;
    max-width: 640px;
    margin: 0 auto 20px;
    padding: 0;
}
@media (min-width: 768px) {
    .beer-hero { max-width: 960px; }
}

.beer-hero-img-wrap {
    position: relative;
    width: 280px;
    min-width: 280px;
    background: #141414;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    border-right: 1px solid var(--gray-800);
}

.beer-hero-img-wrap img {
    max-width: 100%;
    max-height: 320px;
    object-fit: contain;
    filter: drop-shadow(0 6px 20px rgba(0,0,0,0.5));
}

.beer-hero-overlay {
    flex: 1;
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Mobile : empiler verticalement */
@media (max-width: 576px) {
    .beer-hero {
        flex-direction: column;
    }
    .beer-hero-img-wrap {
        width: 100%;
        min-width: unset;
        height: 280px;
        padding: 28px;
        border-right: none;
        border-bottom: 1px solid var(--gray-700);
    }
    .beer-hero-img-wrap img {
        max-height: 240px;
    }
    .beer-hero-overlay {
        padding: 20px;
        text-align: center;
    }
}

.beer-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.beer-stat {
    text-align: center;
    padding: 12px 16px;
    background: var(--gray-900);
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-800);
    min-width: 80px;
}

.beer-stat .stat-value {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--amber);
}

.beer-stat .stat-label {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 2px;
}

/* ---- Review Cards ---- */
.review-card {
    background: var(--gray-900);
    border: 1px solid var(--gray-800);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 12px;
}

.review-card .reviewer {
    font-weight: 600;
    font-size: 0.9rem;
}

.review-card .review-date {
    font-size: 0.75rem;
    color: var(--gray-400);
}

/* ---- Forms ---- */
.hoppy-form .form-control,
.hoppy-form .form-select {
    background: var(--gray-900);
    border: 1px solid var(--gray-700);
    color: var(--white);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
}

.hoppy-form .form-control:focus,
.hoppy-form .form-select:focus {
    border-color: var(--amber);
    box-shadow: 0 0 0 3px rgba(255, 191, 0, 0.15);
    background: var(--gray-900);
    color: var(--white);
}

.hoppy-form label {
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: var(--gray-200);
}

/* ---- Page Container ---- */
.hoppy-container {
    max-width: 640px;
    margin: 0 auto;
    padding: 16px;
}

@media (min-width: 768px) {
    .hoppy-container {
        max-width: 960px;
        padding: 24px;
    }
}

/* ---- Lazy Loading Images ---- */
img[data-src] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[data-src].loaded,
img.loaded {
    opacity: 1;
}

/* ---- Animations ---- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: fadeInUp 0.4s ease-out;
}

/* ---- Pull to refresh indicator ---- */
.loading-spinner {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.loading-spinner::after {
    content: '';
    width: 32px;
    height: 32px;
    border: 3px solid var(--gray-700);
    border-top-color: var(--amber);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---- Pagination ---- */
.hoppy-pagination ul {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 24px 0;
}

.hoppy-pagination a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gray-200);
    background: var(--gray-900);
    border: 1px solid var(--gray-800);
    text-decoration: none;
    transition: var(--transition);
}

.hoppy-pagination a:hover {
    border-color: var(--amber);
    color: var(--amber);
}

.hoppy-pagination a.active {
    background: var(--amber);
    color: var(--black);
    border-color: var(--amber);
}

.hoppy-pagination .dots {
    color: var(--gray-400);
    padding: 0 4px;
}

/* ---- Discover Grid ---- */
.discover-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* (Beer hero styles defined above in "Beer Detail Page" section) */

/* ════════════════════════════════════════════════════════════════════════════════
   PART 2: Animated Rating Stars
   ════════════════════════════════════════════════════════════════════════════════ */
.stars-animated {
    display: inline-flex;
    gap: 2px;
}

.stars-animated .star {
    color: var(--gray-600);
    transition: color 0.2s, transform 0.2s;
    display: inline-block;
    font-size: inherit;
}

.stars-animated .star.filled {
    color: var(--amber);
    animation: starPop 0.3s ease-out;
}

.stars-animated .star.half {
    position: relative;
    color: var(--gray-600);
}

.stars-animated .star.half::before {
    content: '\F586'; /* bi-star-fill */
    font-family: 'bootstrap-icons';
    position: absolute;
    left: 0;
    width: 50%;
    overflow: hidden;
    color: var(--amber);
}

@keyframes starPop {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.stars-animated .star:nth-child(1) { animation-delay: 0s; }
.stars-animated .star:nth-child(2) { animation-delay: 0.05s; }
.stars-animated .star:nth-child(3) { animation-delay: 0.1s; }
.stars-animated .star:nth-child(4) { animation-delay: 0.15s; }
.stars-animated .star:nth-child(5) { animation-delay: 0.2s; }

@media (min-width: 768px) {
    .discover-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

@media (min-width: 1024px) {
    .discover-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.discover-grid .hoppy-card .card-img-top {
    height: 150px;
}

@media (min-width: 768px) {
    .discover-grid .hoppy-card .card-img-top {
        height: 180px;
    }
}

/* ---- Discover Tags Grid ---- */
.discover-grid-tags {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

@media (min-width: 768px) {
    .discover-grid-tags {
        grid-template-columns: repeat(3, 1fr);
    }
}

.discover-tag {
    display: flex;
    flex-direction: column;
    padding: 16px;
    background: var(--gray-900);
    border: 1px solid var(--gray-800);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: var(--transition);
}

.discover-tag:hover {
    border-color: var(--amber);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.discover-tag .tag-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--white);
}

.discover-tag .tag-count {
    font-size: 0.8rem;
    color: var(--gray-400);
    margin-top: 4px;
}

/* ---- Rankings Page ---- */
.ranking-card {
    display: flex;
    align-items: center;
    padding: 14px;
    background: var(--gray-900);
    border: 1px solid var(--gray-800);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.ranking-card:hover {
    border-color: var(--gray-700);
    transform: translateX(4px);
}

.ranking-position {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--gray-400);
    min-width: 36px;
    text-align: center;
}

.ranking-position.gold { color: #FFD700; }
.ranking-position.silver { color: #C0C0C0; }
.ranking-position.bronze { color: #CD7F32; }

.ranking-card img {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--gray-800);
    margin: 0 12px;
}

.ranking-info {
    flex-grow: 1;
    min-width: 0;
}

.ranking-info .beer-name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ranking-info .beer-meta {
    font-size: 0.8rem;
    color: var(--gray-400);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ranking-score {
    text-align: right;
    min-width: 50px;
}

.ranking-score .score-value {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--amber);
}

.ranking-score .score-label {
    font-size: 0.7rem;
    color: var(--gray-400);
}

/* ---- Gold #1 ranking highlight ---- */
.ranking-card:first-child {
    border-color: rgba(255, 215, 0, 0.3);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.08), var(--gray-900));
}

/* ---- Dropdown dark theme fix ---- */
.dropdown-menu {
    background: var(--gray-900) !important;
    border: 1px solid var(--gray-700) !important;
}

.dropdown-item {
    color: var(--gray-200) !important;
    transition: var(--transition);
}

.dropdown-item:hover, .dropdown-item:focus {
    background: var(--gray-800) !important;
    color: var(--amber) !important;
}

/* ---- Horizontal scroll desktop improvements ---- */
@media (min-width: 768px) {
    .horizontal-scroll {
        gap: 16px;
        padding: 4px 0 12px;
    }
    .horizontal-scroll > .hoppy-card {
        min-width: 260px;
        max-width: 260px;
    }
}

/* ---- Beer hero image fix (handled in .beer-hero-img-wrap img) ---- */

/* ---- Search result list style ---- */
.search-result-card {
    display: flex;
    align-items: center;
    padding: 14px;
    background: var(--gray-900);
    border: 1px solid var(--gray-800);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.search-result-card:hover {
    border-color: var(--gray-700);
    transform: translateX(4px);
}

/* ---- Footer spacer desktop ---- */
@media (min-width: 768px) {
    .hoppy-container {
        padding-bottom: 40px;
    }
}

/* ---- Empty state styling ---- */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--gray-400);
}

.empty-state i {
    font-size: 3rem;
    color: var(--gray-700);
    margin-bottom: 16px;
    display: block;
}

/* ---- Card image placeholder background ---- */
.ranking-card img {
    background: var(--gray-800);
}

/* ---- Smooth page transitions ---- */
.hoppy-container {
    animation: fadeInUp 0.3s ease-out;
}

/* ---- Scan button pulse animation (mobile) ---- */
@keyframes pulse-amber {
    0%, 100% { box-shadow: 0 4px 12px rgba(255, 191, 0, 0.4); }
    50% { box-shadow: 0 4px 20px rgba(255, 191, 0, 0.7); }
}

.bottom-nav-item.scan-btn i {
    animation: pulse-amber 2s ease-in-out infinite;
}

/* ---- Better focus styles for accessibility ---- */
.btn-amber:focus-visible,
.btn-outline-amber:focus-visible,
.hoppy-search:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 2px;
}

/* ---- Toast / notification style ---- */
.hoppy-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-900);
    border: 1px solid var(--amber);
    color: var(--white);
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 2000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    animation: fadeInUp 0.3s ease-out;
}

/* ============================================================
   MOBILE REFONTE COMPLÈTE
   ============================================================ */

/* ---- Force Dark Theme on ALL Bootstrap Components ---- */
.form-control,
.form-select,
.input-group-text {
    background-color: var(--gray-900) !important;
    border-color: var(--gray-700) !important;
    color: var(--white) !important;
}

.form-control:focus,
.form-select:focus {
    background-color: var(--gray-900) !important;
    border-color: var(--amber) !important;
    color: var(--white) !important;
    box-shadow: 0 0 0 3px rgba(255, 191, 0, 0.15) !important;
}

.form-control::placeholder {
    color: var(--gray-400) !important;
}

.card, .list-group-item, .modal-content, .offcanvas, .accordion-item {
    background-color: var(--gray-900) !important;
    border-color: var(--gray-800) !important;
    color: var(--white) !important;
}

/* ---- Mobile Top Header ---- */
.mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 56px;
    background: var(--black-deep);
    border-bottom: 1px solid var(--gray-800);
}

.mobile-header-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--amber) !important;
    font-weight: 800;
    font-size: 1.2rem;
    text-decoration: none;
}

.mobile-header-brand i {
    font-size: 1.3rem;
}

/* ---- Hamburger Button ---- */
.mobile-hamburger {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 36px;
    height: 36px;
    justify-content: center;
    align-items: center;
}

.mobile-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--gray-200);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.mobile-hamburger.active span:nth-child(2) {
    opacity: 0;
}
.mobile-hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ---- Language Quick Button (mobile header) ---- */
.mobile-lang-btn {
    background: var(--gray-800);
    border: 1px solid var(--gray-700);
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition);
}

.mobile-lang-btn:hover,
.mobile-lang-btn:active {
    border-color: var(--amber);
    background: var(--gray-700);
}

/* ---- Language Quick Panel (dropdown from flag) ---- */
.mobile-lang-panel {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    z-index: 1055;
    background: var(--black-deep);
    border-bottom: 1px solid var(--gray-700);
    padding: 12px 16px;
    transform: translateY(-100%);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.mobile-lang-panel.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.mobile-lang-panel-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.mobile-lang-panel-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--gray-900);
    border: 1px solid var(--gray-800);
    text-decoration: none;
    color: var(--gray-200);
    font-size: 0.7rem;
    font-weight: 600;
    transition: var(--transition);
    min-width: 56px;
}

.mobile-lang-panel-item .lang-flag {
    font-size: 1.4rem;
}

.mobile-lang-panel-item .lang-code {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mobile-lang-panel-item.active {
    border-color: var(--amber);
    background: rgba(255, 191, 0, 0.1);
    color: var(--amber);
}

.mobile-lang-panel-item:hover {
    border-color: var(--amber);
    color: var(--amber);
}

/* ---- Mobile Slide Menu (overlay) ---- */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 1070;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

.mobile-slide-menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1080;
    width: 300px;
    max-width: 85vw;
    background: var(--black-deep);
    border-left: 1px solid var(--gray-800);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

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

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-800);
}

.mobile-menu-title {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--amber);
}

.mobile-menu-close {
    background: none;
    border: none;
    color: var(--gray-400);
    font-size: 1.2rem;
    padding: 8px;
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition);
}

.mobile-menu-close:hover {
    color: var(--white);
    background: var(--gray-800);
}

.mobile-menu-nav {
    padding: 12px 16px;
}

.mobile-menu-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    color: var(--gray-200);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}

.mobile-menu-link:hover {
    background: var(--gray-900);
    color: var(--white);
}

.mobile-menu-link.active {
    background: rgba(255, 191, 0, 0.1);
    color: var(--amber);
    font-weight: 600;
}

.mobile-menu-link i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.mobile-menu-link-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 16px;
    background: var(--amber);
    color: var(--black) !important;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 8px;
    transition: var(--transition);
}

.mobile-menu-link-btn:hover {
    background: var(--amber-light);
}

.mobile-menu-divider {
    height: 1px;
    background: var(--gray-800);
    margin: 4px 20px;
}

.mobile-menu-section-title {
    padding: 12px 20px 8px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray-400);
}

/* ---- Language Grid in Slide Menu ---- */
.mobile-lang-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    padding: 0 16px 12px;
}

.mobile-lang-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--gray-900);
    border: 1px solid var(--gray-800);
    text-decoration: none;
    color: var(--gray-200);
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
}

.mobile-lang-item .lang-flag {
    font-size: 1.1rem;
}

.mobile-lang-item .lang-name {
    font-size: 0.8rem;
}

.mobile-lang-item.active {
    border-color: var(--amber);
    background: rgba(255, 191, 0, 0.08);
    color: var(--amber);
    font-weight: 600;
}

.mobile-lang-item:hover {
    border-color: var(--amber);
    color: var(--amber);
}

/* ---- Mobile Body Spacing ---- */
@media (max-width: 767.98px) {
    body {
        padding-top: 56px;  /* mobile header height */
        padding-bottom: 72px; /* bottom nav height */
    }

    .hoppy-container {
        padding: 12px 14px;
    }

    /* Hero section mobile sizing */
    .beer-hero {
        margin-left: -14px;
        margin-right: -14px;
        margin-top: -12px;
    }
    .beer-hero-img-wrap {
        height: 220px;
    }

    /* Cards mobile */
    .horizontal-scroll > .hoppy-card {
        min-width: 200px;
        max-width: 200px;
    }

    .hoppy-card .card-img-top {
        height: 140px;
    }

    .discover-grid .hoppy-card .card-img-top {
        height: 120px;
    }

    /* Stats mobile */
    .beer-stats {
        gap: 8px;
    }

    .beer-stat {
        padding: 10px 8px;
        min-width: 60px;
        flex: 1;
    }

    .beer-stat .stat-value {
        font-size: 1rem;
    }

    /* Section titles mobile */
    .section-title {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }

    /* Ranking cards mobile */
    .ranking-card {
        padding: 10px;
    }

    .ranking-card img {
        width: 40px;
        height: 40px;
        margin: 0 8px;
    }

    .ranking-info .beer-name {
        font-size: 0.85rem;
    }

    .ranking-info .beer-meta {
        font-size: 0.7rem;
    }

    /* Search results mobile */
    .search-wrapper {
        margin-bottom: 8px !important;
    }

    /* Buttons mobile */
    .btn-sm {
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    /* Fix bottom nav overlap on login/register */
    .hoppy-form {
        padding-bottom: 16px;
    }
}

/* ---- Improved Bottom Nav ---- */
.hoppy-bottom-nav {
    height: 64px;
    padding: 4px 0 env(safe-area-inset-bottom, 6px);
    background: linear-gradient(to top, var(--black-deep), var(--black));
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.5);
}

.bottom-nav-item {
    position: relative;
    padding: 6px 0;
    min-width: 56px;
}

.bottom-nav-item span {
    font-size: 0.6rem;
    letter-spacing: 0.2px;
}

.bottom-nav-item i {
    font-size: 1.2rem;
    transition: var(--transition);
}

.bottom-nav-item.active i {
    transform: scale(1.1);
}

/* Active indicator dot */
.bottom-nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--amber);
}

/* Scan button stays prominent */
.bottom-nav-item.scan-btn {
    position: relative;
}

.bottom-nav-item.scan-btn i {
    width: 48px;
    height: 48px;
    margin-top: -20px;
    font-size: 1.3rem;
    border: 3px solid var(--black-deep);
}

.bottom-nav-item.scan-btn.active::after {
    display: none;
}

/* ---- Scroll Arrows (navigation horizontale) ---- */
.scroll-wrapper {
    position: relative;
}

.scroll-arrow {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--gray-700);
    background: rgba(13, 13, 13, 0.85);
    backdrop-filter: blur(6px);
    color: var(--amber);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.scroll-arrow:hover {
    background: var(--amber);
    color: var(--black-deep);
    border-color: var(--amber);
}

.scroll-arrow-left {
    left: -4px;
}

.scroll-arrow-right {
    right: -4px;
}

.scroll-arrow.visible {
    display: flex;
}

/* Desktop : toujours visible si besoin */
@media (min-width: 768px) {
    .scroll-wrapper {
        padding: 0 20px;
    }
    .scroll-arrow {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    .scroll-arrow-left {
        left: -8px;
    }
    .scroll-arrow-right {
        right: -8px;
    }
}

/* ---- Site Footer ---- */
.hoppy-footer {
    background: var(--gray-900);
    border-top: 2px solid rgba(255, 191, 0, 0.15);
    padding: 32px 16px 24px;
    margin-top: 40px;
    color: var(--gray-400);
    font-size: 0.82rem;
    line-height: 1.6;
}

.hoppy-footer a {
    color: var(--gray-400);
    text-decoration: none;
    transition: color 0.2s;
}

.hoppy-footer a:hover {
    color: var(--amber);
}

.hoppy-footer-brand {
    color: var(--amber);
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.hoppy-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin: 12px 0;
    list-style: none;
    padding: 0;
}

.hoppy-footer-links a {
    font-size: 0.82rem;
}

.hoppy-footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-800);
    font-size: 0.78rem;
    color: var(--gray-600);
}

/* Espace footer pour bottom-nav mobile */
@media (max-width: 767.98px) {
    .hoppy-footer {
        padding-bottom: 90px;
    }
}

/* ---- Star Rating Interactive (mobile) ---- */
@media (max-width: 767.98px) {
    .star-rating {
        font-size: 2.2rem !important;
    }

    .star-rating .star {
        padding: 0 4px;
    }
}

/* ---- Mobile-friendly dropdowns ---- */
@media (max-width: 767.98px) {
    .dropdown-menu {
        position: fixed !important;
        bottom: 72px !important;
        left: 8px !important;
        right: 8px !important;
        top: auto !important;
        transform: none !important;
        border-radius: var(--radius) !important;
        max-height: 60vh;
        overflow-y: auto;
    }

    .dropdown-item {
        padding: 12px 16px !important;
        font-size: 0.9rem !important;
    }
}

/* ============================================================
   Skeleton Loaders (shimmer)
   Usage: <div class="skeleton skeleton-text"></div>
   ============================================================ */
.skeleton {
    background: var(--gray-800);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

.skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 191, 0, 0.04) 40%,
        rgba(255, 191, 0, 0.08) 50%,
        rgba(255, 191, 0, 0.04) 60%,
        transparent 100%);
    animation: shimmer 1.8s ease-in-out infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    width: 80%;
}

.skeleton-text.short { width: 50%; }
.skeleton-text.xs { width: 30%; }

.skeleton-title {
    height: 20px;
    margin-bottom: 10px;
    width: 60%;
}

.skeleton-img {
    height: 180px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton-card {
    background: var(--gray-900);
    border: 1px solid var(--gray-800);
    border-radius: var(--radius);
    padding: 16px;
    overflow: hidden;
}

/* ============================================================
   Staggered Grid Animations
   Usage: <div class="stagger-grid"> <div class="stagger-item">
   ============================================================ */
.stagger-item {
    opacity: 0;
    transform: translateY(20px);
    animation: staggerIn 0.5s ease forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.05s; }
.stagger-item:nth-child(2) { animation-delay: 0.1s; }
.stagger-item:nth-child(3) { animation-delay: 0.15s; }
.stagger-item:nth-child(4) { animation-delay: 0.2s; }
.stagger-item:nth-child(5) { animation-delay: 0.25s; }
.stagger-item:nth-child(6) { animation-delay: 0.3s; }
.stagger-item:nth-child(7) { animation-delay: 0.35s; }
.stagger-item:nth-child(8) { animation-delay: 0.4s; }
.stagger-item:nth-child(9) { animation-delay: 0.45s; }
.stagger-item:nth-child(10) { animation-delay: 0.5s; }
.stagger-item:nth-child(11) { animation-delay: 0.55s; }
.stagger-item:nth-child(12) { animation-delay: 0.6s; }

@keyframes staggerIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Désactiver les animations si l'utilisateur le préfère */
@media (prefers-reduced-motion: reduce) {
    .stagger-item {
        opacity: 1;
        transform: none;
        animation: none;
    }
    .skeleton::after { animation: none; }
}

/* ============================================================
   Rating Badge Overlay (sur les cards)
   Usage: <span class="rating-badge">4.2</span>
   ============================================================ */
.rating-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(13, 13, 13, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 191, 0, 0.3);
    color: var(--amber);
    font-weight: 700;
    font-size: 0.82rem;
    padding: 4px 10px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

.rating-badge::before {
    content: '\2605';
    font-size: 0.75rem;
}

.rating-badge.high { color: #22c55e; border-color: rgba(34, 197, 94, 0.3); }
.rating-badge.low { color: #ef4444; border-color: rgba(239, 68, 68, 0.3); }

/* ============================================================
   Style Color Tags (couleur par type de bière)
   ============================================================ */
.style-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid;
}

.style-tag.ipa      { color: #f97316; border-color: rgba(249, 115, 22, 0.3); background: rgba(249, 115, 22, 0.1); }
.style-tag.stout    { color: #a78bfa; border-color: rgba(167, 139, 250, 0.3); background: rgba(167, 139, 250, 0.1); }
.style-tag.lager    { color: #fbbf24; border-color: rgba(251, 191, 36, 0.3); background: rgba(251, 191, 36, 0.1); }
.style-tag.blonde   { color: #fcd34d; border-color: rgba(252, 211, 77, 0.3); background: rgba(252, 211, 77, 0.1); }
.style-tag.wheat    { color: #fdba74; border-color: rgba(253, 186, 116, 0.3); background: rgba(253, 186, 116, 0.1); }
.style-tag.sour     { color: #f472b6; border-color: rgba(244, 114, 182, 0.3); background: rgba(244, 114, 182, 0.1); }
.style-tag.porter   { color: #c084fc; border-color: rgba(192, 132, 252, 0.3); background: rgba(192, 132, 252, 0.1); }
.style-tag.pilsner  { color: #a3e635; border-color: rgba(163, 230, 53, 0.3); background: rgba(163, 230, 53, 0.1); }
.style-tag.amber    { color: #fb923c; border-color: rgba(251, 146, 60, 0.3); background: rgba(251, 146, 60, 0.1); }
.style-tag.triple   { color: #fde68a; border-color: rgba(253, 230, 138, 0.3); background: rgba(253, 230, 138, 0.1); }
.style-tag.default  { color: var(--gray-400); border-color: var(--gray-700); background: rgba(107, 107, 107, 0.1); }

/* ============================================================
   Smooth Page Transitions
   ============================================================ */
.page-enter {
    animation: pageEnter 0.35s ease-out;
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   Follow Button
   ============================================================ */
.btn-follow {
    border: 2px solid var(--amber);
    color: var(--amber);
    background: transparent;
    border-radius: 20px;
    padding: 4px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-follow:hover {
    background: var(--amber);
    color: var(--black);
}

.btn-follow.following {
    background: var(--amber);
    color: var(--black);
    border-color: var(--amber);
}

.btn-follow.following:hover {
    background: transparent;
    color: #ef4444;
    border-color: #ef4444;
}

/* ============================================================
   Notification Badge (compteur)
   ============================================================ */
.notif-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 10px;
    padding: 0 5px;
    line-height: 1;
}

/* ============================================================
   Toast Notification (global)
   ============================================================ */
.hoppy-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: toastSlide 0.3s ease;
    max-width: 400px;
}

@keyframes toastSlide {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.hoppy-toast.success { background: rgba(34, 197, 94, 0.15); border: 1px solid rgba(34, 197, 94, 0.3); color: #22c55e; }
.hoppy-toast.warning { background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.3); color: #f59e0b; }
.hoppy-toast.error   { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.3); color: #ef4444; }
.hoppy-toast.info    { background: rgba(59, 130, 246, 0.15); border: 1px solid rgba(59, 130, 246, 0.3); color: #3b82f6; }

/* ============================================================
   Infinite Scroll Sentinel
   ============================================================ */
.infinite-scroll-sentinel {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
}

.infinite-scroll-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.infinite-scroll-sentinel .spinner-border {
    flex-shrink: 0;
}

/* ============================================================
   Page Transitions (fade in/out on navigation)
   ============================================================ */
.hoppy-container {
    animation: pageEnter 0.3s ease-out;
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade out on navigation */
body.page-leaving .hoppy-container {
    animation: pageLeave 0.15s ease-in forwards;
}

@keyframes pageLeave {
    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}

/* ============================================================
   Breadcrumbs enhanced
   ============================================================ */
nav[aria-label="Fil d'Ariane"] a:hover {
    color: var(--amber) !important;
    transition: color 0.2s;
}

/* ============================================================
   Autocomplete Dropdown
   ============================================================ */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 2000;
    background: var(--gray-900);
    border: 1px solid var(--gray-700);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);
    max-height: 420px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.ac-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    color: var(--white);
    transition: background 0.15s;
    border-bottom: 1px solid var(--gray-800);
}

.ac-item:last-of-type {
    border-bottom: none;
}

.ac-item:hover,
.ac-item.ac-selected {
    background: rgba(255, 191, 0, 0.08);
}

.ac-img {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--gray-800);
    flex-shrink: 0;
}

.ac-info {
    flex: 1;
    min-width: 0;
}

.ac-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--white);
}

.ac-meta {
    font-size: 0.78rem;
    color: var(--gray-400);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.ac-rating {
    flex-shrink: 0;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--amber);
    display: flex;
    align-items: center;
    gap: 4px;
}

.ac-rating .bi-star-fill {
    font-size: 0.7rem;
}

.ac-empty {
    padding: 20px 16px;
    text-align: center;
    color: var(--gray-500);
    font-size: 0.88rem;
}

.ac-empty .bi {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 6px;
}

/* --- "Bière introuvable ?" block --- */
.ac-notfound {
    padding: 10px 16px 14px;
    border-top: 1px solid var(--gray-800);
    text-align: center;
}
.ac-notfound-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--gray-300);
    margin-bottom: 8px;
}
.ac-notfound-btn {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    text-decoration: none;
    margin: 3px 4px;
    transition: background 0.15s, color 0.15s;
}
.ac-btn-search {
    background: rgba(255,191,0,0.12);
    color: var(--amber);
}
.ac-btn-search:hover {
    background: rgba(255,191,0,0.25);
    color: var(--amber);
}
.ac-btn-suggest {
    background: rgba(76,175,80,0.12);
    color: #66bb6a;
}
.ac-btn-suggest:hover {
    background: rgba(76,175,80,0.25);
    color: #66bb6a;
}

.ac-view-all {
    display: block;
    text-align: center;
    padding: 10px;
    color: var(--amber);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    border-top: 1px solid var(--gray-800);
    transition: background 0.15s;
}

.ac-view-all:hover {
    background: rgba(255, 191, 0, 0.08);
    color: var(--amber);
}

.autocomplete-dropdown mark {
    background: rgba(255, 191, 0, 0.25);
    color: var(--amber);
    padding: 0 1px;
    border-radius: 2px;
}
