:root {
    --kb-green: #1a5c38;
    --kb-gold: #c9a227;
    --kb-brown: #6b3a1f;
    --kb-cream: #faf7f0;
    --kb-dark: #0f1b12;
    --kb-text: #2d2d2d;
}

/* ========== Base ========== */
body {
    font-family: 'Inter', sans-serif;
    color: var(--kb-text);
    background: #fff;
}

.brand-text {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--kb-gold);
}

/* ========== Navbar ========== */
#main-navbar {
    background: var(--kb-dark);
    padding: 0.75rem 0;
    box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.navbar-brand .brand-icon { font-size: 1.4rem; }

.search-group .form-control {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-radius: 8px 0 0 8px !important;
    min-width: 200px;
}
.search-group .form-control::placeholder { color: rgba(255,255,255,0.5); }
.search-group .form-control:focus { background: rgba(255,255,255,0.2); box-shadow: none; }
.search-group .btn-warning { border-radius: 0 8px 8px 0 !important; }

.avatar-circle {
    width: 28px; height: 28px;
    background: var(--kb-gold);
    color: var(--kb-dark);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ========== Hero ========== */
.hero-section {
    background: linear-gradient(135deg, var(--kb-dark) 0%, var(--kb-green) 60%, #2d7a4f 100%);
    min-height: 500px;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.15;
    color: #fff;
}
.hero-subtitle { color: rgba(255,255,255,0.8); }

/* ========== Section Headers ========== */
.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--kb-dark);
    position: relative;
}
.section-title::after {
    content: '';
    display: block;
    width: 50px; height: 3px;
    background: var(--kb-gold);
    margin-top: 8px;
}
.section-title.text-center::after { margin: 8px auto 0; }

/* ========== Book Cards ========== */
.book-card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.book-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}
.book-card .card-img-wrapper {
    height: 220px;
    overflow: hidden;
    background: var(--kb-cream);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.book-card .card-img-wrapper img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.book-card:hover .card-img-wrapper img { transform: scale(1.05); }
.book-card .no-img-placeholder {
    font-size: 4rem;
    color: var(--kb-brown);
    opacity: 0.3;
}
.book-card .card-body { padding: 1rem; }
.book-card .book-title {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.book-card .book-author {
    font-size: 0.8rem;
    color: #666;
}
.book-price { font-weight: 700; color: var(--kb-green); }
.book-price-promo { text-decoration: line-through; color: #aaa; font-size: 0.85rem; }
.price-badge {
    background: var(--kb-gold);
    color: var(--kb-dark);
    font-weight: 700;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.9rem;
}
.badge-promo {
    position: absolute;
    top: 10px; left: 10px;
    background: #e63946;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
}

/* ========== Category Cards ========== */
.category-card {
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    background: var(--kb-cream);
    border: 2px solid transparent;
    transition: all 0.25s ease;
    cursor: pointer;
    text-decoration: none;
    color: var(--kb-text);
    display: block;
}
.category-card:hover {
    border-color: var(--kb-gold);
    background: #fff;
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    color: var(--kb-dark);
}
.category-card .cat-icon { font-size: 2.5rem; }
.category-card .cat-name { font-weight: 600; font-size: 0.9rem; margin-top: 0.5rem; }
.category-card .cat-count { font-size: 0.75rem; color: #888; }

/* ========== Buttons ========== */
.btn-kb-primary {
    background: var(--kb-green);
    color: #fff;
    border-radius: 8px;
    padding: 0.6rem 1.5rem;
    font-weight: 500;
    border: none;
    transition: all 0.2s;
}
.btn-kb-primary:hover { background: #145030; color: #fff; transform: translateY(-1px); }

.btn-kb-gold {
    background: var(--kb-gold);
    color: var(--kb-dark);
    border-radius: 8px;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    border: none;
    transition: all 0.2s;
}
.btn-kb-gold:hover { background: #b08a1e; color: var(--kb-dark); transform: translateY(-1px); }

/* ========== Auth pages ========== */
.auth-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--kb-dark) 0%, var(--kb-green) 100%);
    display: flex;
    align-items: center;
}
.auth-card {
    background: #fff;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 440px;
}
.auth-card .auth-logo { font-family: 'Playfair Display', serif; font-size: 1.5rem; color: var(--kb-green); }

/* ========== Dashboard ========== */
.stat-card {
    border-radius: 16px;
    padding: 1.5rem;
    border: none;
    position: relative;
    overflow: hidden;
}
.stat-card .stat-icon {
    width: 56px; height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; }
.stat-card .stat-label { font-size: 0.85rem; color: #888; }

/* ========== Footer ========== */
.footer-main {
    background: var(--kb-dark);
    color: rgba(255,255,255,0.85);
    margin-top: auto;
}
.footer-main h5, .footer-main h6 { color: #fff; }
.footer-main a { text-decoration: none; transition: color 0.2s; }
.footer-main a:hover { color: var(--kb-gold) !important; }

/* ========== Star rating ========== */
.star-rating .bi-star-fill { color: var(--kb-gold); }
.star-rating .bi-star { color: #ccc; }

/* ========== Breadcrumb ========== */
.breadcrumb-section {
    background: var(--kb-cream);
    padding: 0.75rem 0;
    border-bottom: 1px solid #e8e0d4;
}

/* ========== Panier ========== */
.cart-item-img {
    width: 80px; height: 80px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--kb-cream);
}

/* ========== Status badges ========== */
.badge-en_attente { background-color: #6c757d; }
.badge-confirmee { background-color: #0d6efd; }
.badge-payee { background-color: #198754; }
.badge-en_preparation { background-color: #fd7e14; }
.badge-expediee { background-color: #20c997; }
.badge-livree { background-color: #198754; }
.badge-annulee { background-color: #dc3545; }

/* ========== Admin sidebar ========== */
.admin-sidebar {
    background: var(--kb-dark);
    min-height: 100vh;
    position: sticky;
    top: 0;
}
.admin-sidebar .nav-link {
    color: rgba(255,255,255,0.7);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    margin-bottom: 2px;
    transition: all 0.2s;
}
.admin-sidebar .nav-link:hover, .admin-sidebar .nav-link.active {
    background: rgba(255,255,255,0.1);
    color: var(--kb-gold);
}

/* ========== Utilities ========== */
.bg-kb-cream { background: var(--kb-cream); }
.bg-kb-green { background: var(--kb-green); }
.bg-kb-gold { background: var(--kb-gold); }
.text-kb-green { color: var(--kb-green); }
.text-kb-gold { color: var(--kb-gold); }
.border-kb-gold { border-color: var(--kb-gold) !important; }

.rounded-xl { border-radius: 16px !important; }
.rounded-2xl { border-radius: 20px !important; }

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .hero-section { min-height: 350px; }
    .search-group .form-control { min-width: 140px; }
}
