@font-face {
    font-family: 'Tagesschrift';
    src: url('../fonts/Tagesschrift-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'ZillaSlab';
    src: url('../fonts/ZillaSlab-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Raleway';
    src: url('../fonts/Raleway-VariableFont_wght.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

/* PROPOSITION DE DESIGN SYSTEM */
:root {
  /* 1. Couleurs (Mode Clair) */
  --color-text: #333;
  --color-background: #f4f4f4;
  --color-surface: #FFFAFA; /* Fond des cartes, etc. (Blanc Neige) */
  --color-primary: #eb7b12; /* Orange principal */
  --color-primary-darker: #d36e10; /* Pour les hover de boutons */
  --color-header-bg: #1a1a1a;
  --color-header-text: #fff;
  --color-border: #ddd;
  --color-main-bg: snow; /* Blanc neige pour le fond du main en mode clair */

  /* 2. Couleurs (Mode Sombre) */
  --color-text-dark: #E0E0E0;
  --color-background-dark: #121212;
  --color-surface-dark: #1E1E1E;
  --color-border-dark: #444;
  --color-main-bg-dark: darkslategray; /* Gris anthracite pour le fond du main en mode sombre */
  /* La couleur primaire (orange) reste la même */

  /* 3. Typographie */
  --font-family-base: 'ZillaSlab', 'Georgia', 'Times New Roman', 'Times', serif;
  --font-family-headings: 'Raleway', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
  --font-size-h1: 2.2em;
  --font-size-h2: 1.6em;
  --font-size-p: 1em;

  /* 4. Espacements */
  --spacing-small: 8px;
  --spacing-medium: 16px;
  --spacing-large: 32px;

  /* 5. Styles des éléments */
  --border-radius: 15px; /* Le radius de nos cartes */
  --box-shadow-light: 0 4px 8px rgba(0, 0, 0, 0.1);
  --box-shadow-hover: 0 0 15px var(--color-primary);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-text: var(--color-text-dark);
    --color-background: var(--color-background-dark);
    --color-surface: var(--color-surface-dark);
    --color-border: var(--color-border-dark);
    --color-main-bg: var(--color-main-bg-dark);
  }
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-family-base);
    background-color: var(--color-background);
    color: var(--color-text);
    background-image: url(../images/page.jpg);
    background-size:auto;
    background-position: center;
    background-repeat: repeat;
    background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-headings);
    font-weight: bold;
}

/* Top Bar styles */
.top-bar {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    padding: var(--spacing-medium) var(--spacing-large);
    background-color: var(--color-surface); /* White background */
    border-bottom: 1px solid var(--color-border);
    min-height: 100px;
    margin: 0 auto; /* Centrer le top-bar */
}

/* Assurez-vous que le logo est bien dimensionné */
.top-bar .logo img {
    max-height: 80px; /* Ajustez la hauteur max de votre logo si nécessaire */
    width: auto;
}

.top-bar .search-bar {
    display: flex;
    align-items: center;
    position: relative; /* For positioning search results */
}

.top-bar .search-bar input {
    padding: var(--spacing-small);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    width: 400px; /* Adjust search bar width */
}

#search-results {
    position: absolute;
    top: 100%; /* Position below the input */
    left: 0;
    width: 100%;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-top: none;
    z-index: 1002; /* Ensure it's above other content, including hamburger */
    display: none; /* Hidden by default */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-height: 200px; /* Limit height and add scroll */
    overflow-y: auto;
}

#search-results ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#search-results li {
    padding: 8px 12px;
    border-bottom: 1px solid var(--color-border);
}

#search-results li:last-child {
    border-bottom: none;
}

#search-results li a {
    text-decoration: none;
    color: var(--color-text);
    display: block;
}

#search-results li a:hover {
    background-color: var(--color-background);
}

#search-results p {
    padding: 8px 12px;
    margin: 0;
    color: var(--color-text);
}

.top-bar .top-icons {
    display: flex;
    gap: var(--spacing-medium); /* Space between icons */
}

.top-bar .top-icons .icon-link {
    text-decoration: none;
    color: var(--color-text);
    font-weight: bold;
    transition: color 0.3s ease;
}

.top-bar .icon-link img {
    height: 40px;
}

#cart-icon-container {
    position: relative;
    display: inline-block;
}

#cart-item-count-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: red;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center; /* Ensure text is centered horizontally */
    font-size: 0.8em;
    font-weight: bold;
    border: 2px solid white;
}

.top-bar .top-icons .icon-link:hover {
    color: var(--color-primary);
}


/* Header styles */
header {
    background-color: var(--color-header-bg); /* Dark black background */
    color: var(--color-header-text);
    padding: var(--spacing-small) 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

h1 {
    text-align: center;
}

header h1 {
    margin: 0;
    padding: var(--spacing-small) 0;
    font-size: var(--font-size-h1);
    color: var(--color-header-text);
}

nav{
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60px;
}

/* Navigation bar styles */
nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

nav ul li {
    position: relative; /* Needed for positioning the dropdowns */
    margin: 0 5px; /* Spacing between main navigation items */
}


nav ul li a {
    display: flex; /* Change to flex */
    align-items: center; /* Vertically center items */
    justify-content: space-between; /* Push icon to the right on desktop */
    padding: 10px 15px; /* Increased padding for better click area and visual spacing */
    text-decoration: none; /* Supprime le soulignement */
    color: var(--color-header-text); /* Texte blanc */
    white-space: normal; /* Allow text to wrap */
    transition: color 0.3s ease, background-color 0.3s ease; /* Added background-color to transition */
    border-radius: 5px; /* Slightly rounded corners for the background hover */
}

nav ul li a.nav-link:hover {
    color: var(--color-primary); /* Texte orange au survol */
    background-color: rgba(255, 255, 255, 0.1); /* Subtle white background on hover */
}



/* Style spécifique pour les liens générés par le tag */
.nav-link {
    margin: 0 5px; /* Ajoute un espacement horizontal (gap) */
    color: var(--color-header-text); /* Ensure base color is set */
}

/* Dropdown menu styles (nested ULs) */
nav ul ul {
    display: none; /* Hide sub-menus by default */
    position: absolute;
    top: 100%; /* Position below the parent link */
    left: 0; /* Align to the left */
    background-color: var(--color-header-bg); /* Use header background color */
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.4);
    min-width: 220px; /* Minimum width for dropdowns */
    z-index: 1000; /* Ensure dropdown appears above other content */
    flex-direction: column; /* Stack dropdown items vertically */
    padding: 5px 0;
    text-align: left; /* Align sub-menu text to the left */
}

nav ul li:hover > ul {
    display: flex; /* Show the sub-menu when the parent li is hovered */
}

nav ul ul li {
    margin: 0; /* Remove margin for dropdown list items */
}

nav ul ul li a {
    padding: 5px 5px; /* Adjust padding for dropdown links */
    color: var(--color-header-text); /* White text for dropdown links */
    white-space: normal;
    word-wrap: break-word;
    word-break: break-all;
}

nav ul ul li a:hover {
    background-color: rgba(255, 255, 255, 0.1); /* Subtle white background on hover */
    color: var(--color-primary); /* Orange text on hover for dropdown items */
}

/* --- DESKTOP NAVBAR FONT SIZES --- */
/* Increase font size for main desktop navigation links */
nav .nav-links-container > ul > li > a {
    font-size: 1.2em; /* Adjusted font size for desktop main items */
}

/* Set a specific, smaller font size for desktop sub-menu links */
nav .nav-links-container > ul > li > ul li a {
    font-size: 1em; /* Adjusted font for desktop sub-items */
}

main {
  width: 95%; /* Default width for main content */
  margin: 0 auto; /* Center the main content */
  /* Add any default main content styles here */
  background-color: var(--color-main-bg); /* Example: slightly more opaque for content */
  padding: 20px;
  box-sizing: border-box; /* Include padding in the width */
  /* min-height: calc(100vh - 180px); */ /* Removed to allow content to dictate height */
  border-radius: var(--border-radius);
}


/* --- NEW FOOTER STYLES --- */
footer {
    background-color: var(--color-header-bg);
    color: var(--color-header-text);
    padding: 40px 20px;
    text-align: center;
}

.footer-container {
    display: flex;
    justify-content: center; /* Center the items */
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 30px;
}

.footer-logo img {
    max-height: 80px;
}

.footer-socials {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 40px 0;
}

.social-link {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 60px;
  height: 60px;
  background: #111;
  border-radius: 15px;
  overflow: hidden;
  transition: all 0.5s ease;
}

.social-link img {
  width: 30px;
  height: 30px;
  z-index: 2;
  transition: all 0.5s ease;
}

/* L’effet holographique */
.social-link::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    0deg, 
    transparent, 
    transparent 30%, 
    rgba(235, 123, 18, 0.3)
  );
  transform: rotate(-45deg);
  transition: all 0.5s ease;
  opacity: 0;
}

/* Effet au survol */
.social-link:hover {
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(235, 123, 18, 0.5);
}

.social-link:hover::before {
  opacity: 1;
  transform: rotate(-45deg) translateY(100%);
}

.social-link:hover img {
  filter: brightness(1.5);
}

.footer-agencies {
    display: flex;
    gap: 50px;
}

.agency h3 {
    color: var(--color-primary);
    font-size: 1.2em;
    margin-bottom: 10px;
}

.agency address {
    font-style: normal;
    line-height: 1.6;
}

.agency address a {
    color: var(--color-header-text);
    text-decoration: none;
}

.agency address a:hover {
    color: var(--color-primary);
}

.footer-credits {
    border-top: 1px solid #444;
    padding-top: 20px;
    font-size: 0.9em;
    color: #888;
}

.footer-credits a {
    color: #888;
    text-decoration: none;
}

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

nav ul li a {
    display: flex;
    justify-content: center; /* Center the items */
    align-items: center;
    margin-left: auto; /* Push to the right on desktop */
    font-size: 2.4em;
    flex-shrink: 0; /* Prevent the icon from shrinking */
    color: var(--color-header-text); /* Default color for the icon */
    transition: color 0.3s ease; /* Smooth transition for color change */
}

nav ul li a:hover {
    color: var(--color-primary); /* Change icon color to orange on hover */
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

nav ul li:hover > a .arrow-icon {
    animation: spin 1s linear infinite;
}

/* Scroll-to-top button */
#scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--color-primary); /* Orange background */
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%; /* Circular shape */
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5em;
    text-decoration: none;
    border: none;
    opacity: 0; /* Initially hidden */
    visibility: hidden; /* Initially hidden */
    transition: all 0.3s ease-in-out; /* Smooth transition for all properties */
    z-index: 1000; /* Ensure it's above other content */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

#scroll-to-top:hover {
    background-color: var(--color-primary-darker); /* Darker orange on hover */
    transform: translateY(-5px) scale(1.05); /* Lift and slightly enlarge */
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3); /* Enhance shadow for lifted effect */
}

#scroll-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* Floating Cart Icon */
.scroll-cart-icon {
    position: fixed;
    bottom: 20px;
    right: 80px;
    background-color: white;
    color: var(--color-primary); /* Change icon color to primary if it's an SVG or font icon */
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 999;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Lighter shadow for white background */
    border: 1px solid var(--color-border); /* Add a subtle border */
}

.scroll-cart-icon.show {
    opacity: 1;
    visibility: visible;
}

.scroll-cart-icon:hover {
    background-color: var(--color-background); /* Light grey on hover */
}

#cart-scroll-item-count-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: red;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 0.8em;
    font-weight: bold;
    border: 2px solid white;
}

/* Hamburger menu button */
.hamburger-menu {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001; /* Above other content */
}

.hamburger-menu .bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--color-header-text); /* White bars */
    margin: 5px auto;
    transition: all 0.3s ease-in-out;
}

/* Mobile navigation container */
.nav-links-container {
    display: flex; /* Default for desktop */
}

/* New styles for menu-toggle */
.menu-toggle {
    display: none; /* Hidden by default on desktop */
    align-items: center;
    gap: 5px; /* Space between hamburger and text */
}

.menu-text {
    color: var(--color-header-text);
    font-size: 1em;
    font-weight: bold;
}

/* Media query for mobile and tablet devices */
@media (max-width: 1269px) {
    .footer-container {
        flex-direction: column;
    }
    .top-bar {
        flex-direction: column;
        padding: var(--spacing-small);
        min-height: auto;
    }

    .top-bar .search-bar {
        width: 100%;
        margin-top: var(--spacing-small);
    }

    .top-bar .search-bar input {
        width: calc(100%); /* Adjust for button width */
    }

    .top-bar .top-icons {
        margin-top: var(--spacing-small);
    }

    /* Main content adjustments */
    main {
        width: 98%; /* Main content takes 98% width on smaller screens */
    }

    /* Navigation adjustments */
    nav {
        display: flex; /* Keep flex properties */
        justify-content: space-between;
        align-items: center;
        height: auto; /* Allow nav to adjust height based on content */
        padding: 0 20px;
        position: relative; /* Make nav a positioning context for absolute children */
    }

    .menu-toggle {
        display: flex;
    }

    .hamburger-menu {
        display: block;
    }

    .nav-links-container {
        position: absolute; /* Position relative to nav */
        top: 100%; /* Start right below the nav bar */
        left: 0;
        width: 100%;
        height: auto; /* Allow height to be determined by content */
        max-height: calc(100vh - 60px); /* Max height to prevent overflow, assuming nav is 60px */
        overflow-y: auto; /* Enable scrolling if content exceeds max-height */
        background-color: var(--color-header-bg);
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start; /* Align items to the start (left) */
        visibility: hidden; /* Initially hidden */
        opacity: 0; /* Initially transparent */
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: 999; /* Ensure it's below hamburger but above main content */
        overflow-x: hidden;
    }

    .nav-links-container.active {
        visibility: visible;
        opacity: 1;
    }

    nav ul {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        width: 100%;
        text-align: left;
        padding: 0;
        margin-top: 0; /* No longer needed */
    }

    nav ul li {
        margin: 0;
        width: 100%;
    }

    nav ul li a {
        padding: 15px 20px;
        font-size: 1.2em;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    nav ul li a span:first-child {
        flex-grow: 1; /* Allow the text span to take up all available space */
    }

    /* Set a permanent larger font size for main navigation links */
    .nav-links-container > ul > li > a {
        font-size: 1.8em;
    }

    /* Ensure sub-category links retain their original, smaller font size */
    .nav-links-container > ul > li > ul > li > a {
        font-size: 1.2em;
    }

    /* Disable hover effects on mobile */
    nav ul li a:hover,
    nav ul ul li a:hover {
        color: var(--color-header-text);
        background-color: transparent;
    }

    nav ul li a:hover .arrow-icon {
        color: var(--color-primary);
    }

    nav ul li:hover > a .arrow-icon {
        animation: none;
    }

    nav ul li:hover > ul {
        display: none;
    }
    .footer-agencies{
        display: flex;
        flex-direction: row;
        justify-content: space-around;
        flex-wrap: wrap;
        gap: 15px;
        width: 100%; /* Ensure it takes full width */
    }
    .agency {
        text-align: center;
        flex: 1; /* Allow agencies to grow and shrink */
        min-width: 250px; /* Minimum width for each agency */
    }
    .footer-container{
        display: flex;
        flex-direction: column;
    }
}

/* Styles for admin forms */
.submit-row input[type="submit"],
.button {
    background-color: var(--color-primary);
    color: var(--color-header-text);
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

.submit-row input[type="submit"]:hover,
.button:hover {
    background-color: var(--color-primary-darker);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
textarea,
select {
    padding: 8px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 1em;
    width: 100%;
    box-sizing: border-box;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 5px rgba(var(--color-primary), 0.5);
}
.hamburger-menu.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger-menu.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* --- Category Menu Styles --- */

.category-item {
    position: relative;
}

.subcategory-list {
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: transparent; /* Ensures it blends in mobile view */
}

.arrow-icon {
    display: inline-block;
    transition: transform 0.3s ease;
    font-size: 0.7em; /* Adjust size if needed */
    margin-left: 5px;
}

/* --- Mobile Accordion (max-width: 1269px) --- */
@media (max-width: 1269px) {
    .subcategory-list {
        display: none; /* Hidden for accordion */
        position: static; /* IMPORTANT: Keeps the list in the normal document flow */
        padding-left: 20px; /* Indent sub-items */
        background-color: rgba(255, 255, 255, 0.05); /* Subtle background for context */
        border-radius: 5px;
        margin-top: 5px;
    }
    .category-item.open > .category-link .arrow-icon {
        transform: rotate(180deg);
    }
}

/* --- Desktop Dropdown (min-width: 1270px) --- */
@media (min-width: 1270px) {
    .arrow-icon {
        transform: rotate(0deg); /* Ensure it points down by default */
    }
    .category-item:hover > .category-link .arrow-icon {
        transform: rotate(180deg);
    }
    .subcategory-list {
        display: none; /* Hide by default */
        position: absolute;
        top: 100%;
        left: 0;
        background-color: var(--color-header-bg);
        border: 1px solid #444;
        box-shadow: 0 8px 16px rgba(0,0,0,0.2);
        z-index: 1000;
        padding: 10px 0;
        border-radius: 0 0 5px 5px;
        width: max-content;
        min-width: 100%;
    }
    .category-item:hover > .subcategory-list {
        display: block; /* Show on hover */
    }    .subcategory-list .subcategory-item a {
        display: block;
        padding: 8px 20px;
        white-space: nowrap;
        color: var(--color-header-text);
        text-decoration: none;
    }
    .subcategory-list .subcategory-item a:hover {
        background-color: var(--color-primary);
        color: white;
    }
}

/* --- Responsive Font Size for Navbar --- */
@media (min-width: 1270px) and (max-width: 1475px) {
    nav .nav-links-container > ul > li > a {
        font-size: 0.9em; /* Reduced font size for this specific range */
    }
}

/* --- reCAPTCHA Badge Styles --- */

/* Hide reCAPTCHA badge on mobile devices by default */
.grecaptcha-badge {
    visibility: hidden;
}

/* Show reCAPTCHA badge on desktop screens and set its position */
@media (min-width: 1270px) {
    .grecaptcha-badge {
        visibility: visible !important;
        bottom: 75px !important;
    }
}