/* ==========================================
   MISTER OFFICE MAROC - STYLE DARK THEME (LOGO MATCH)
   ========================================== */

:root {
    --mister-black: #0B0B0B;
    --mister-card-bg: #141414;
    --mister-card-border: #262626;
    --mister-green: #66CC00; /* Vert lumineux assorti au logo */
    --mister-green-hover: #5bb300;
    --mister-text: #E0E0E0;
    --mister-muted: #9E9E9E;
}

/* Base Globale */
body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--mister-black);
    color: var(--mister-text);
    overflow-x: hidden;
    margin: 0;
}

/* Boutons principaux */
.btn-mister-primary {
    background-color: var(--mister-green);
    color: #000000;
    font-weight: 600;
    border: none;
    transition: all 0.3s ease;
}

.btn-mister-primary:hover {
    background-color: var(--mister-green-hover);
    color: #000000;
    transform: translateY(-2px);
}

.text-success {
    color: var(--mister-green) !important;
}

/* Navbar Dark Theme */
.navbar {
    background-color: var(--mister-black) !important;
    border-bottom: 1px solid var(--mister-card-border);
    flex-wrap: nowrap;
    align-items: center;
}

.navbar-brand {
    color: #ffffff !important;
}

.navbar .navbar-collapse {
    flex-wrap: nowrap;
}

.navbar .navbar-nav {
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.85rem;
}

.navbar-light .navbar-nav .nav-link {
    color: #cccccc !important;
    transition: color 0.3s ease;
    white-space: nowrap;
    padding: 0.4rem 0.65rem;
}

.navbar-light .navbar-nav .nav-link:hover,
.navbar-light .navbar-nav .nav-link.active {
    color: var(--mister-green) !important;
}

/* Sections & Fonds */
.bg-light {
    background-color: var(--mister-card-bg) !important;
    border-color: var(--mister-card-border) !important;
}

.bg-white {
    background-color: var(--mister-black) !important;
}

.text-muted {
    color: var(--mister-muted) !important;
}

/* Cartes et Conteneurs */
.card, .bg-light.rounded, .border {
    background-color: var(--mister-card-bg) !important;
    border-color: var(--mister-card-border) !important;
    color: var(--mister-text);
}

/* Formulaires */
.form-control, .form-select {
    background-color: #1a1a1a;
    border: 1px solid var(--mister-card-border);
    color: #ffffff;
}

.form-control:focus, .form-select:focus {
    background-color: #1a1a1a;
    border-color: var(--mister-green);
    color: #ffffff;
    box-shadow: 0 0 0 0.25rem rgba(102, 204, 0, 0.25);
}

.form-control::placeholder {
    color: #777777;
}

/* Bouton WhatsApp Flottant */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #25D366;
    color: #ffffff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.cart-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    z-index: 1200;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cart-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(450px, 100%);
    max-width: 450px;
    background: #070707;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1201;
    transform: translateX(110%);
    transition: transform 0.35s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cart-drawer.open {
    transform: translateX(0);
}

.cart-drawer-header {
    background: rgba(255, 255, 255, 0.03);
}

.cart-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 1rem;
}

.cart-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.cart-item {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
}

.cart-item-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 0.9rem;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-info h6 {
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-info h6 {
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
}

.cart-item-info p {
    font-size: 0.85rem;
    margin-bottom: 0.65rem;
    color: #c6c6c6;
}

.cart-item-qty {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.85rem;
    padding: 0.2rem 0.5rem;
}

.cart-item-qty button {
    border: transparent;
    background: transparent;
    color: #ffffff;
    font-size: 1rem;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.cart-item-qty span {
    min-width: 20px;
    text-align: center;
    font-size: 0.95rem;
}

.cart-item-remove {
    border: none;
    background: transparent;
    color: #ff6b6b;
    padding: 0;
    font-size: 0.85rem;
    cursor: pointer;
}

.cart-summary {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 1rem;
}

.cart-form .form-control {
    border-color: rgba(255, 255, 255, 0.12);
}

.cart-form .form-control:focus {
    border-color: var(--mister-green);
    box-shadow: 0 0 0 0.2rem rgba(102, 204, 0, 0.18);
}

.cart-form .btn {
    font-weight: 600;
}

.cart-empty-note {
    color: #b5b5b5;
}

.cart-add-bounce {
    animation: cartBounce 0.35s ease-out;
}

@keyframes cartBounce {
    0% { transform: scale(1); }
    40% { transform: scale(1.05); }
    70% { transform: scale(0.99); }
    100% { transform: scale(1); }
}

@media (max-width: 767.98px) {
    .cart-drawer {
        width: 100%;
        max-width: 100%;
    }

    .cart-drawer-header {
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .cart-drawer-body {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .cart-drawer .btn-close {
        width: 3rem;
        height: 3rem;
    }
}

/* Header button spacing and desktop layout fixes */
.navbar .btn {
    padding: 0.45rem 0.85rem;
}

.navbar .navbar-collapse {
    flex-wrap: nowrap;
}

.navbar .navbar-nav {
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.75rem;
}

.navbar .navbar-nav .nav-link {
    white-space: nowrap;
    padding: 0.35rem 0.65rem;
}

.navbar .navbar-nav .nav-item {
    margin: 0;
}

@media (min-width: 992px) {
    .navbar .navbar-nav {
        gap: 0.65rem;
    }
}

@media (min-width: 1200px) {
    .navbar .navbar-nav {
        gap: 0.8rem;
    }
}

.whatsapp-float:hover {
    transform: scale(1.1);
    color: #ffffff;
}

/* Footer */
footer {
    background-color: #070707 !important;
    border-top: 1px solid var(--mister-card-border);
}

/* --- SECTION GALERIE INSTAGRAM DÉFILANTE --- */
.instagram-gallery-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    display: flex;
}

.instagram-track {
    display: flex;
    width: max-content;
    animation: scrollGallery 25s linear infinite;
}

/* Pause le défilement si l'utilisateur met sa souris sur la bande */
.instagram-gallery-container:hover .instagram-track {
    animation-play-state: paused;
}

/* Instagram section mobile grid fix */
.instagram-grid {
    width: 100%;
}

@media (max-width: 767.98px) {
    .instagram-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.85rem;
    }

    .instagram-grid > [class*="col-"] {
        width: 100%;
        flex: none;
        display: contents;
    }

    .instagram-grid > [class*="col-"] .insta-item {
        width: 100%;
        margin-right: 0;
    }

    .instagram-grid > [class*="col-"]:last-child {
        grid-column: 1 / -1;
    }

    .instagram-grid > [class*="col-"]:last-child .insta-item {
        min-height: 220px;
    }

    .instagram-grid .insta-item {
        min-height: 180px;
    }
}

.insta-item {
    position: relative;
    width: 260px;
    height: 260px;
    flex-shrink: 0;
    margin-right: 12px;
    overflow: hidden;
    display: block;
}

.insta-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

/* Effet Overlay (cache l'icône par défaut, l'affiche au survol) */
.insta-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.insta-overlay i {
    color: #ffffff;
    font-size: 3rem;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

/* Au survol de l'image */
.insta-item:hover .insta-overlay {
    opacity: 1;
}

.insta-item:hover .insta-overlay i {
    transform: scale(1);
}

.insta-item:hover img {
    transform: scale(1.08);
}

/* Animation du défilement continu */
@keyframes scrollGallery {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(-272px * 5));
    }
}

/* AOS fallback / smoothing for environments without native support */
.aos-init { opacity: 0; transform: translateY(8px); }
.aos-animate { opacity: 1; transform: translateY(0); transition: transform 0.65s cubic-bezier(.2,.8,.2,1), opacity 0.65s ease; }

/* Reduce motion preference respect */
@media (prefers-reduced-motion: reduce) {
    .aos-init, .aos-animate { transition: none !important; animation: none !important; }
}

/* Responsive product and carousel images */
.product-card img, .card-img-top {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

/* Best-Sellers section styling */
.best-sellers-section .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.best-sellers-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
    align-items: stretch;
}

..best-seller-item {
    display: flex;
}

.best-seller-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.best-seller-card .card-img-top {
    width: 100%;
    height: 260px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.best-seller-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.best-seller-card:hover .card-img-top {
    transform: scale(1.08);
}

.best-seller-card .card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.5rem;
}

.best-seller-card .card-body h3 {
    margin-bottom: 1rem;
}

.best-seller-card .card-body .btn {
    margin-top: auto;
}

@media (max-width: 992px) {
    .best-sellers-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Chatbot welcome bubble */
.chatbot-welcome-bubble {
    position: fixed;
    right: 22px;
    bottom: 165px;
    max-width: 290px;
    background: linear-gradient(135deg, #66CC00 0%, #198754 100%);
    color: #0B0B0B;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 14px;
    padding: 12px 36px 12px 14px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
    z-index: 100001;
    opacity: 0;
    transform: translateY(10px) scale(0.98);
    pointer-events: none;
    visibility: hidden;
}

.chatbot-welcome-bubble::after {
    content: "";
    position: absolute;
    right: 26px;
    bottom: -10px;
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-top: 10px solid #198754;
}

.chatbot-welcome-text {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.4;
    font-weight: 600;
}

.chatbot-welcome-close {
    position: absolute;
    top: 6px;
    right: 8px;
    border: 0;
    background: transparent;
    color: rgba(11, 11, 11, 0.9);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
}

.chatbot-welcome-close:hover {
    color: #000;
}

.chatbot-welcome-bubble.is-visible {
    visibility: visible;
    pointer-events: auto;
    animation: chatbotBubbleIn 0.55s cubic-bezier(.2, .8, .2, 1) forwards;
}

.chatbot-welcome-bubble.is-hiding {
    animation: chatbotBubbleOut 0.28s ease forwards;
}

@keyframes chatbotBubbleIn {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    70% {
        opacity: 1;
        transform: translateY(-2px) scale(1.01);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes chatbotBubbleOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(6px) scale(0.98);
        visibility: hidden;
    }
}

@media (max-width: 576px) {
    .chatbot-welcome-bubble {
        right: 14px;
        bottom: 155px;
        max-width: min(86vw, 290px);
    }
}

@media (max-width: 767.98px) {
    .best-sellers-grid {
        grid-template-columns: 1fr;
    }

    .best-seller-card .card-img-top {
        height: 220px;
    }
}
/* Larger carousel images on desktop, reduced height on small screens */
.modal .carousel-item img {
    width: 100%;
    object-fit: cover;
    height: 350px;
}

.direction-gallery-grid {
    margin: 0 -0.75rem;
}

.direction-gallery-grid .gallery-card {
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.direction-gallery-grid .gallery-card img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.direction-gallery-grid .gallery-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.13);
}

.direction-gallery-grid .gallery-card:hover img {
    transform: scale(1.03);
}

@media (max-width: 767.98px) {
    .direction-gallery-grid .gallery-card img {
        height: 200px;
    }

    .product-card img, .card-img-top { height: 180px; }
    .best-sellers-section .card-img-top { height: 200px; }
    .modal .carousel-item img { height: 220px; }
}

@media (max-width: 479.98px) {
    .product-card img, .card-img-top { height: 150px; }
    .best-sellers-section .card-img-top { height: 170px; }
    .modal .carousel-item img { height: 180px; }
}

/* Mobile-only: move chatbot robot away from content blocks */
@media (max-width: 767.98px) {
    .chatbot-float {
        left: 10px !important;
        right: auto !important;
        bottom: 10px !important;
    }
}

/* Ensure images remain sharp and responsive */
img { max-width: 100%; height: auto; }