/* static/css/custom.css */
:root {
    --primary-beige: #F5F5DC;
    --wood-light: #D3C7B5;
    --bg-white: #FFFFFF;
    --bg-light-gray: #F7F7F7;
    --text-dark: #333333;
    --text-muted: #6c757d;
    --bg-soft: #FAF9F6; /* Un blanc cassé pour adoucir le contraste */
    --wood-ultra-light: #EFEAE2; /* Bois clair très dilué pour les cartes */
}

/* Style pour les cartes des nouveautés */
.card-nouveaute {
    background-color: var(--bg-soft) !important;
    border: 1px solid rgba(211, 199, 181, 0.3) !important; /* Bordure bois très fine */
    transition: all 0.3s ease;
}

.card-nouveaute:hover {
    background-color: #FFFFFF !important;
    transform: scale(1.02);
}

body {
    background-color: var(--bg-white);
    color: var(--text-dark);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; /* Une police moderne */
}

/* Boutons personnalisés */
.btn-primary-nihma {
    background-color: var(--wood-light);
    border-color: var(--wood-light);
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.btn-primary-nihma:hover {
    background-color: var(--primary-beige);
    border-color: var(--wood-light);
    color: var(--text-dark);
}

/* Cartes de produits épurées*/

.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: var(--bg-light-gray) !important;
}

.card-hover:hover {
    transform: translateY(-5px);
    /* Ombre basée sur la couleur Bois clair (#D3C7B5) pour plus de douceur */
    box-shadow: 0 10px 30px rgba(211, 199, 181, 0.2) !important;
}

/*****************Pour la navbar*****************************/
/* Suppression des lignes de séparation dans l'input group pour l'aspect fusionné */
.search-group {
    background-color: #EEECE7; /* Un gris-beige très clair */
    border-radius: 20px;
    padding: 2px;
}

.search-group .form-control:focus {
    background-color: #EEECE7 !important;
}

/* Hover sur les boutons de la barre de recherche */
.search-group button:hover {
    background-color: #E5E2DA !important;
    color: #333 !important;
}



/* --------- Classes pour store.html --------- */

.filter-title {
    font-weight: 700;
    margin-bottom: 1.5rem;
    font-size: 0.875rem; /* small */
    text-transform: uppercase;
    color: var(--text-dark);
    letter-spacing: 1px;
}

.category-header {
    font-weight: 700;
    font-size: 0.7rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chevron-icon {
    font-size: 0.6rem;
    color: #E5E5E5;
}

.btn-apply-filters {
    background-color: var(--wood-light);
    color: var(--text-dark);
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-apply-filters:hover {
    background-color: var(--primary-beige);
}

.badge-status-custom {
    position: absolute;
    top: 0;
    left: 0;
    margin: 1rem;
    padding: 0.25rem 0.5rem;
    border-radius: 50rem; /* rounded-pill */
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.6rem;
    background-color: var(--primary-beige);
    color: var(--wood-light);
    letter-spacing: 0.5px;
    border: 1px solid var(--wood-light);
    z-index: 1;
}

.badge-sold-out {
    position: absolute;
    top: 0;
    right: 0;
    margin: 1rem;
    padding: 0.25rem 0.5rem;
    border-radius: 50rem;
    background-color: var(--text-dark);
    color: white;
    opacity: 0.75;
    font-size: 0.75rem; /* small */
}

.product-img-store {
    height: 180px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    margin-left: auto;
    margin-right: auto;
    display: block;
}

.product-price-store {
    margin-bottom: 0.5rem;
    color: var(--wood-light);
    font-weight: 600;
}

.alert-no-results {
    border: 0;
    border-radius: 1rem; /* rounded-4 */
    padding: 1rem;
    background-color: var(--primary-beige);
    color: var(--text-dark);
}

/* Animation au survol des liens de catégories */
.hover-beige:hover {
    color: #D3C7B5 !important;
    padding-left: 5px;
    transition: all 0.2s ease-in-out;
}

/* Style pour les boutons de pagination */
.pagination .page-link {
    color: #333;
    background-color: transparent;
    border: 1px solid #E5E5E5;
    margin: 0 3px;
    padding: 8px 16px;
    transition: all 0.3s ease;
}

.pagination .page-item.active .page-link {
    background-color: #D3C7B5; /* Bois clair */
    border-color: #D3C7B5;
    color: #FFF;
}

.pagination .page-link:hover {
    background-color: #F5F5DC; /* Beige */
    border-color: #D3C7B5;
    color: #333;
}


/* Style des liens de catégories dans la sidebar */
/* Le petit point indicateur (Bois clair) */
.active-dot {
    width: 8px !important;    /* Légèrement plus grand pour être sûr de le voir */
    height: 8px !important;
    background-color: #D3C7B5 !important;
    border-radius: 50% !important;
    display: inline-block !important;
    visibility: visible !important;
    flex-shrink: 0;           /* Empêche le point de s'écraser si le texte est long */
    margin-left: 10px;
}

.active-category {
    font-weight: 700 !important;
    color: #D3C7B5 !important;
}

.list-group-item-action {
    border-radius: 8px;
    margin-bottom: 2px;
}

.list-group-item-action:hover {
    color: #D3C7B5 !important; /* Bois clair au survol */
    background-color: #FAF9F6 !important; /* Fond blanc cassé très léger */
    padding-left: 8px !important; /* Petit décalage fluide */
}

.list-group-item-action i {
    transition: transform 0.2s ease;
}

.list-group-item-action:hover i {
    transform: translateX(3px);
    color: #D3C7B5 !important;
}




.product-card {
    transition: transform .15s ease, box-shadow .15s ease;
}
.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 .25rem .75rem rgba(0,0,0,.08);
}

.rate > input {
    display: none;
}

.rate {
    display: flex;
    flex-direction: row-reverse; /* reverses DOM order so 5→1 displays left-to-right as 1→5 */
    border: 0;
}

/* Every label = exactly half a star wide, clips its glyph precisely */
.rate > label {
    width: 0.55rem;
    height: 1.2rem;
    position: relative;
    overflow: hidden; /* clips both the visual glyph AND the pointer-event area */
    cursor: pointer;
}

.rate > label:before {
    font-size: 1.1rem;
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    content: "\f005";
    position: absolute;
    line-height: 1.2rem;
    cursor: pointer;
}

/* Integer star label → anchored to RIGHT edge, shows RIGHT half of the star glyph */
.rate > label:not(.half):before {
    right: 0;
}

/* Half star label → anchored to LEFT edge, shows LEFT half of the star glyph */
.rate .half:before {
    left: 0;
}

/* Click and hover */
input:checked ~ label,
label:hover ~ label{
    color: #ffb503;
}

/* hover highlight*/
input:checked + label:hover,
input:checked ~ label:hover,
input:checked ~ label:hover ~ label,
label:hover ~ input:checked ~ label{
    color: #cc9000;
}

.rating-star i{
    color: #cc9000;
}

/* Navbar category parent header in dropdown */
.dropdown-category-header {
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--wood-light) !important;
}

.dropdown-category-header:hover {
    color: var(--text-dark) !important;
}

/**** For product gallery*****/

ul.thumb{
    margin: 0 auto;
    padding: 0;
    float: left;
}

ul.thumb li{
    list-style: none;
    margin: 10px;
}

ul.thumb li img{
    width: 80px;
    height: 80px;
    border: 1px solid gray;
}

/* Animation douce au survol des cartes */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
}

/* Rendre les boutons plus ronds et modernes */
.btn {
    font-weight: 500;
    padding: 0.5rem 1.5rem;
}

/* ========================= HOME PAGE ========================= */

.section-home-hero {
    background: linear-gradient(to bottom, #F5F5DC, #FAF9F6);
}

.section-soft-bg {
    background-color: var(--bg-soft);
}

.section-title {
    letter-spacing: 2px;
    color: var(--text-dark);
}

.section-divider {
    width: 40px;
    height: 2px;
    background-color: var(--wood-light);
}

/* Slider (Nouveautés) */
.slider-img {
    height: 70px;
    object-fit: contain;
}

/* Popular product cards */
.card-popular {
    background-color: var(--bg-white);
    border: 1px solid rgba(211, 199, 181, 0.25);
    box-shadow: 0 2px 8px rgba(211, 199, 181, 0.15);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card-popular:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(211, 199, 181, 0.4);
    border-color: var(--wood-light);
}

.card-popular-img {
    height: 140px;
    object-fit: contain;
}

.rating-xs {
    font-size: 0.7rem;
}

/* ========================= CATEGORY BAR ========================= */

.category-bar {
    background-color: var(--bg-white);
    border-top: 1px solid rgba(211, 199, 181, 0.3);
    border-bottom: 1px solid rgba(211, 199, 181, 0.3);
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

.category-bar::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.category-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    list-style: none;
    margin: 0 auto;
    padding: 0 1rem;
    width: max-content; /* prevents wrapping so scroll kicks in */
}

.category-nav-item {
    position: relative;
}

.category-nav-item > a {
    display: block;
    padding: 0.55rem 1rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dark);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.category-nav-item > a:hover,
.category-nav-item:hover > a {
    color: var(--wood-light);
    background-color: var(--bg-soft);
}

.category-chevron {
    font-size: 0.5rem;
    margin-left: 4px;
    vertical-align: middle;
}

.category-dropdown {
    display: none;
    position: fixed;
    background-color: var(--bg-white);
    border: 1px solid rgba(211, 199, 181, 0.3);
    border-top: 2px solid var(--wood-light);
    border-radius: 0 0 0.75rem 0.75rem;
    box-shadow: 0 6px 20px rgba(211, 199, 181, 0.3);
    list-style: none;
    padding: 0.4rem 0;
    margin: 0;
    min-width: 180px;
    z-index: 1050;
}

.category-dropdown li a {
    display: block;
    padding: 0.4rem 1.1rem;
    font-size: 0.78rem;
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.2s ease, padding-left 0.2s ease;
}

.category-dropdown li a:hover {
    color: var(--wood-light);
    padding-left: 1.4rem;
    background-color: var(--bg-soft);
}

/* Back link / wood-colored anchor */
.link-wood {
    color: var(--wood-light) !important;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: gap 0.2s ease, color 0.2s ease;
}

.link-wood:hover {
    color: var(--text-dark) !important;
    gap: 0.5rem !important;
}

/* Inline sold-out badge for product detail page */
.badge-sold-out-inline {
    display: inline-block;
    padding: 0.4rem 1.2rem;
    border-radius: 50rem;
    background-color: var(--text-dark);
    color: white;
    opacity: 0.75;
    font-size: 0.8rem;
}
