/* =====================================================
   HAITI STORE - MAIN STYLESHEET
   Colors: Red (#DC143C), Blue (#0066CC), White (#FFFFFF), Black (#000000)
   ===================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-red: #DC143C;
    --primary-blue: #0066CC;
    --text-black: #000000;
    --bg-white: #FFFFFF;
    --gray-light: #F5F5F5;
    --gray-medium: #CCCCCC;
    --gray-dark: #666666;
    --border-color: #DDDDDD;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-black);
    background-color: var(--bg-white);
}



/* ===== GLOBAL CONTAINER ===== */
.container {
    max-width: 2500px; 
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* ===== FULL SCREEN CONTAINER (pour les bannières / sections larges) ===== */
.container-full {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


/* ===== HEADER ===== */
.main-header {
    background-color: var(--bg-white);
    border-bottom: 3px solid var(--primary-red);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    flex-wrap: wrap;
}

.logo h1 {
    font-size: 2.5em;
    color: var(--primary-red);
    margin-bottom: 5px;
}

.logo h1 a {
     font-size: 1rem;       /* réduit la taille du texte */
    font-weight: bold;
    color: #0077cc;
    text-decoration: none;
}

.logo .tagline {
    color: var(--primary-blue);
    font-size: 0.9em;
}

.header-actions {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.search-bar {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-bar input[type="text"] {
    width: 100%;
    padding: 12px 45px 12px 20px;
    border: 2px solid var(--primary-blue);
    border-radius: 50px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.search-bar input[type="text"]:focus {
    outline: none;
    border-color: #ff5e57; /* couleur accentuée au focus */
    box-shadow: 0 0 8px rgba(255, 94, 87, 0.5);
}

.search-bar button {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-bar button:hover {
    background: #ff5e57;
}


.user-menu {
    display: flex;
    gap: 10px;
}

.btn-login, .btn-register, .btn-logout {
    padding: 8px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s;
}

.logo-img {
    width: 40px;   /* Mets la taille que tu veux : 20px, 30px, 50px… */
    height: 40px;  /* Garde les proportions */
    vertical-align: middle; /* aligne avec le texte */
}


.btn-login {
    background-color: var(--primary-blue);
    color: white;
}

.btn-register {
    background-color: var(--primary-red);
    color: white;
}

.btn-logout {
    background-color: var(--text-black);
    color: white;
}

.user-link {
    color: var(--primary-blue);
    text-decoration: none;
    padding: 8px;
}

.cart-icon a {
    background-color: var(--primary-red);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    position: relative;
}

.cart-count {
    background-color: var(--text-black);
    color: white;
    border-radius: 50%;
    padding: 2px 8px;
    font-size: 0.85em;
    margin-left: 5px;
}

/* ===== NAVIGATION ===== */
.main-nav {
    background-color: var(--primary-blue);
}

.main-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.main-nav ul li {
    position: relative;
}

.main-nav ul li a {
    display: block;
    padding: 15px 45px;
    color: white;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s;
}

.main-nav ul li a:hover,
.main-nav ul li a.active {
    background-color: var(--primary-red);
}

.admin-link, .vendeur-link {
    background-color: var(--text-black) !important;
}




.dropdown-menu {
  display: none !important; /* Masque par défaut */
}

.dropdown-menu.show {
  display: block !important; /* Affiche quand "show" est ajouté par JS */
}


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



.dropdown-menu li {
    border-bottom: 1px solid var(--border-color);
}

.dropdown-menu li:last-child {
    border-bottom: none;
}

.dropdown-menu a {
    color: var(--text-black);
    padding: 12px 20px;
}

.dropdown-menu a:hover {
    background-color: var(--gray-light);
    color: var(--primary-red);
}

.dropdown-toggle {
  cursor: pointer;
}


/* ===== ALERTS ===== */
.alert {
    padding: 15px 20px;
    margin: 20px auto;
    max-width: 1200px;
    border-radius: 5px;
    font-weight: bold;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    min-height: 600px;
    padding: 40px 0;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: white;
}

.btn-primary:hover {
    background-color: #0052a3;
}

.btn-danger {
    background-color: var(--primary-red);
    color: white;
}

.btn-danger:hover {
    background-color: #b8102d;
}

.btn-secondary {
    background-color: var(--gray-medium);
    color: var(--text-black);
}

.btn-black {
    background-color: var(--text-black);
    color: white;
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--text-black);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--gray-medium);
    border-radius: 5px;
    font-size: 1em;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
}

/* ===== PRODUCT GRID ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.product-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    border-color: var(--primary-red);
}

.product-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    background-color: var(--gray-light);
}

.product-info {
    padding: 15px;
}

.product-title {
    font-size: 1.2em;
    color: var(--text-black);
    margin-bottom: 10px;
    font-weight: bold;
}

.product-price {
    color: var(--primary-red);
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 10px;
}

.product-category {
    color: var(--primary-blue);
    font-size: 0.9em;
    margin-bottom: 10px;
}

/* ===== TABLE ===== */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
}

table th {
    background-color: var(--primary-blue);
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: bold;
}

table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

table tr:hover {
    background-color: var(--gray-light);
}

/* ===== FOOTER ===== */
.main-footer {
    background-color: var(--text-black);
    color: white;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3 {
    color: var(--primary-red);
    margin-bottom: 15px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--primary-blue);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--gray-dark);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        text-align: center;
    }

    .header-actions {
        flex-direction: column;
        width: 100%;
    }

    .search-bar input[type="text"] {
        width: 100%;
    }

    .main-nav ul {
        flex-direction: column;
    }

    .main-nav ul li {
        width: 100%;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }
}
