@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

:root {
    --orange: #ff7b00;
    --orange-light: #ffb84d;
    --orange-dark: #e65100;
    --gray: #2d2d2d;
    --light-gray: #f5f5f5;
    --white: #ffffff;
}

/* === GLOBAL === */
body {
    font-family: 'Poppins', sans-serif;
    background: var(--white);
    color: var(--gray);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* === TITRES === */
h1, h2, h3, h4 {
    color: var(--orange-dark);
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
    text-align: center;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

/* === HEADER === */
header {
    background: var(--orange);
    color: var(--white);
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

/* === NAVBAR === */
.navbar {
    background: linear-gradient(135deg, var(--orange) 0%, var(--orange-dark) 100%) !important;
    padding: 0.75rem 2rem;
    box-shadow: 0 4px 15px rgba(255, 123, 0, 0.3);
    animation: slideDown 0.5s ease-out;
}

.navbar-brand {
    transition: transform 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.navbar-brand img {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* Toggle button personnalisé */
.navbar-toggler {
    border: 2px solid var(--white);
    padding: 0.5rem 0.75rem;
    transition: all 0.3s ease;
}

.navbar-toggler:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Navigation items */
.navbar-nav .nav-item {
    margin: 0 0.5rem;
}

.navbar-nav .nav-link {
    color: var(--white) !important;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: visible; /* Important pour que le badge panier dépasse */
}

.navbar-nav .nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--white);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.navbar-nav .nav-link:hover::before {
    width: 80%;
}

.navbar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

/* Indicateur de page active */
.navbar-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.25);
    border-bottom: 3px solid var(--white);
}

/* Boutons de langue */
.navbar-nav .nav-link[href*="switch_locale"] {
    min-width: 45px;
    text-align: center;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--white);
    margin: 0 0.25rem;
}

.navbar-nav .nav-link[href*="switch_locale"]:hover {
    background: var(--white);
    color: var(--orange) !important;
    transform: scale(1.1);
}

/* Bouton Login */
.btn-warning.text-white {
    background: var(--white) !important;
    color: var(--orange) !important;
    font-weight: 700;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.btn-warning.text-white:hover {
    background: var(--light-gray) !important;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

/* Bouton Logout */
.btn-outline-danger {
    background: transparent !important;
    color: var(--white) !important;
    border: 2px solid var(--white) !important;
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.btn-outline-danger:hover {
    background: #e74c3c !important;
    border-color: #e74c3c !important;
    color: var(--white) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.4);
}

/* Bouton Admin */
.btn-warning.text-dark {
    background: #ffd700 !important;
    color: var(--gray) !important;
    font-weight: 700;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    box-shadow: 0 4px 10px rgba(255, 215, 0, 0.4);
    transition: all 0.3s ease;
}

.btn-warning.text-dark:hover {
    background: #ffed4e !important;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 15px rgba(255, 215, 0, 0.6);
}

/* Espacements et alignements */
.navbar .justify-content-between {
    gap: 1rem;
}

/* Responsive Navbar */
@media (max-width: 991px) {
    .navbar-collapse {
        background: rgba(255, 123, 0, 0.98);
        margin-top: 1rem;
        padding: 1rem;
        border-radius: 12px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    }

    .navbar-nav {
        text-align: center;
    }

    .navbar-nav .nav-item {
        margin: 0.5rem 0;
    }

    .navbar-nav .nav-link {
        display: block;
        width: 100%;
    }

    .btn-warning.text-white,
    .btn-outline-danger,
    .btn-warning.text-dark {
        width: 100%;
        margin: 0.5rem 0;
    }
}

@media (min-width: 992px) {
    .navbar-nav.ml-auto {
        margin-left: auto;
    }
}

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

/* === FOOTER === */
footer {
    text-align: center;
    background: var(--orange);
    color: var(--white);
    padding: 20px;
    margin-top: auto;
    font-size: 0.9rem;
}

/* === BOUTONS GÉNÉRAUX === */
.btn {
    display: inline-block;
    border: none;
    background: var(--orange);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
}

.btn:hover {
    background: var(--orange-dark);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--orange);
    color: var(--orange);
}

.btn-outline:hover {
    background: var(--orange);
    color: var(--white);
}

/* === CARDS PRODUITS (Design de base) === */
.card-deck {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding: 40px 20px;
}

.card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.card-img-top {
    width: 100%;
    object-fit: cover;
}

.card-body {
    padding: 20px;
}

.card-title {
    font-size: 1.3rem;
    color: var(--orange-dark);
    margin-bottom: 10px;
}

.card a {
    text-decoration: none;
    font-weight: 600;
}

/* === PAGE DETAIL PRODUIT === */
.product-detail-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    max-width: 900px;
    margin: 0 auto;
}

.product-detail-card h2 {
    color: var(--orange-dark);
    font-size: 2rem;
    margin-bottom: 20px;
}

.product-detail-card p {
    color: var(--gray);
    font-size: 1rem;
    margin-bottom: 15px;
}

.product-detail-card .price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--orange);
    margin-bottom: 30px;
}

.product-detail-card .images-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.product-detail-card .images-row img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.product-detail-card .images-row img:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.product-detail-card form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.product-detail-card form input[type="number"] {
    width: 100px;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    text-align: center;
}

.product-detail-card .btn-edit {
    background-color: #ffc107;
    color: #000;
}

.product-detail-card .btn-delete {
    background-color: #dc3545;
    color: #fff;
}

.product-detail-card .back-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

.product-detail-card .back-links a {
    padding: 8px 20px;
    border-radius: 8px;
    background-color: #f1f1f1;
    color: #333;
    transition: background 0.2s;
}

.product-detail-card .back-links a:hover {
    background-color: #e2e2e2;
}

/* === FORMULAIRE === */
.form-styled {
    max-width: 500px;
    margin: 50px auto;
    background: var(--light-gray);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.form-styled label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--gray);
}

.form-styled input:not([type="checkbox"]):not([type="radio"]),
.form-styled select,
.form-styled textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 15px;
    transition: border 0.2s ease-in-out;
}

.form-styled input:focus,
.form-styled select:focus,
.form-styled textarea:focus {
    border-color: var(--orange);
    outline: none;
}

/* Boutons DANS un formulaire stylisé */
.form-styled button[type="submit"],
.form-styled input[type="submit"] {
    background: var(--orange);
    color: var(--white);
    font-weight: 600;
    border: none;
    border-radius: 8px;
    padding: 12px;
    width: 100%;
    cursor: pointer;
    transition: background 0.2s ease-in-out;
    margin-top: 10px;
}

.form-styled button[type="submit"]:hover,
.form-styled input[type="submit"]:hover {
    background: var(--orange-dark);
}

/* === IMAGE D’ACCUEIL (Legacy) === */
.ImgHome {
    width: 100%;
    max-width: 800px;
    height: auto;
    display: block;
    margin: 30px auto;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.ImgHome:hover {
    transform: scale(1.03);
}

/* === TABLE ADMIN === */
.table-admin {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.table-admin thead {
    background-color: var(--gray);
    color: var(--white);
}

.table-admin td,
.table-admin th {
    padding: 12px 15px;
    text-align: center;
    vertical-align: middle;
    border-bottom: 1px solid #ddd;
}

.table-admin .actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.table-admin .btn {
    min-width: 90px;
    padding: 8px 12px;
    font-size: 0.9rem;
    border-radius: 6px;
    text-align: center;
    white-space: nowrap;
    transition: transform 0.1s ease;
}

.table-admin .btn:hover {
    transform: translateY(-2px);
}

.btn-view { background-color: #3498db; }
.btn-edit { background-color: #27ae60; }
.btn-delete { background-color: #e74c3c; }

@media (max-width: 768px) {
    .table-admin .actions {
        flex-direction: column;
        align-items: center;
    }
    .table-admin .btn {
        width: 100%;
    }
}

/* Hero Section Styles */
.hero-section {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    position: relative;
    overflow: hidden;
    padding: 100px 0;
    margin-bottom: 3rem;
    color: white;
    border-radius: 0 0 50px 50px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    text-align: center;
}

/* Force le centrage des colonnes Bootstrap */
.hero-content .row {
    justify-content: center;
}

/* Empêche les éléments d'être bloqués à gauche sur grand écran */
.hero-content .text-lg-start {
    text-align: center !important;
}

.hero-content .justify-content-lg-start {
    justify-content: center !important;
}

/* Formes d'arrière-plan animées */
.hero-shape {
    position: absolute;
    border-radius: 50%;
    background: var(--orange);
    opacity: 0.1;
    filter: blur(50px);
    z-index: 0;
    animation: float 6s ease-in-out infinite;
}
.shape-1 { width: 300px; height: 300px; top: -50px; left: -50px; animation-delay: 0s; }
.shape-2 { width: 200px; height: 200px; bottom: 20px; right: 10%; background: #fff; opacity: 0.05; animation-delay: 1s; }
.shape-3 { width: 150px; height: 150px; top: 20%; right: 20%; animation-delay: 2s; }

/* Contenu au premier plan */
.hero-content {
    position: relative;
    z-index: 1;
}

/* Animations d'entrée */
.animate-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease-out forwards;
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }

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

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* Bouton Hero Spécial */
.btn-hero {
    background: var(--orange);
    color: white;
    padding: 12px 35px;
    font-size: 1.1rem;
    border-radius: 50px;
    transition: all 0.3s ease;
    border: 2px solid var(--orange);
    box-shadow: 0 5px 15px rgba(255, 123, 0, 0.3);
    text-decoration: none;
    display: inline-block;
}

.btn-hero:hover {
    background: transparent;
    color: var(--orange);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 123, 0, 0.4);
}

.btn-hero-outline {
    background: transparent;
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    padding: 12px 35px;
    font-size: 1.1rem;
    border-radius: 50px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-hero-outline:hover {
    background: white;
    color: #1a1a1a;
    border-color: white;
}

/* Image flottante */
.hero-img-container {
    display: none;
}

@media (min-width: 992px) {
    .hero-img-container {
        display: block;
        margin: 40px auto 0;
        animation: float 5s ease-in-out infinite;
        text-align: center;
    }
    .hero-img-container img {
        max-width: 60%; /* Plus petit pour ne pas écraser le texte */
        filter: drop-shadow(0 10px 20px rgba(0,0,0,0.3));
    }
}

/* Amélioration des Cards Catégories */
.hover-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}
.hover-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.transition-zoom {
    transition: transform 0.5s ease;
}
.hover-card:hover .transition-zoom {
    transform: scale(1.1);
}

.icon-box {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}