/*
Theme Name: RideAndParts theme
Theme URI: http://exemple.com
Author: Ton Nom
Author URI: http://exemple.com
Description: Mon premier thème WordPress personnalisé
Version: 1.0
License: GNU General Public License v2 or later
Text Domain: rideandparts
*/

:root {
    --color-primary: #f7ff00;
    --color-secondary: #191919;
    --color-terciaire: #fafafa;
}
body, html {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    overflow-x: hidden;
}

/*****************************************************************
*                           HEADER                               *
*****************************************************************/

header h1 {
    margin: 0;
}

.header_item_logo_desktop {
    display: none;
}

.header_item_logo_mobile {
    display: block;
}

.logo {
    padding-top: 5px;
    max-height: 50px;
    width: auto;
}

.header_container {
    background: linear-gradient(90deg,black,#282828);
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 20px;
    display: flex;
    flex-direction: column-reverse;
    justify-content: space-between;
}

.header_parts {
    color: var(--color-terciaire);
}

.header_parts_infos {
    text-align: center;
}

.header_parts_options {
    display: flex;
    justify-content: space-between;
}

.search_input {
    margin-top: 15px;
    font-size: 16px;
    width: 90%;
    padding: 10px;
    border-radius: 0pt;
    border: none;
}

@media screen and (min-width: 1100px) {
    .header_container {
        background-color: var(--color-secondary);  
        padding: 20px;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
    }

    .header_parts {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        color: var(--color-terciaire);
        
    }

    .header_item_logo_desktop {
        display: block;
    }

    .header_item_logo_mobile {
        display: none;
    }

    .logo {
        max-height: 100px;
    }

    .header_parts_infos {
        width: 40%;
    }

    .search_input {
        width: 400px;
        margin-top: 30px;
    }
    
}


/*****************************************************************
*                           NAV                               *
*****************************************************************/



/* --- Bouton hamburger --- */
.hamburger {
  width: 30px;
  height: 24px;
  position: relative;
  cursor: pointer;
  margin-top: 20px;
}

.hamburger span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 3px;
  background: white;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger span:nth-child(1) {
  top: 0;
}

.hamburger span:nth-child(2) {
  top: 50%;
  transform: translateY(-50%);
}

.hamburger span:nth-child(3) {
  bottom: 0;
}

/* Animation croix */
.hamburger.active span:nth-child(1) {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

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

.hamburger.active span:nth-child(3) {
  top: 50%;
  transform: translateY(-50%) rotate(-45deg);
}

.menu-principal-mobile {
    display: flex;
    position: absolute;
    top: 130px;
    left: 0;
    right: 0;
    background: #FFFFFF;
    display: none;
    flex-direction: column;
    align-items: left;
    gap: 20px;
    
    padding-left: 50px;
    padding-right: 50px;
    padding-top: 30px;
    padding-bottom: 30px;
    text-transform: uppercase;
    font-size: 16px;
    font-weight: 1000;
}

.menu-principal-mobile a, .submenu-link a {
    color: #000000;
    text-decoration: none;
    transition: color 0.3s;
    
}

.submenu-link {
    
    padding-left: 50px;
    padding-right: 50px;
    padding-top: 30px;
    text-transform: uppercase;
    font-size: 16px;
    font-weight: 1000;
}

.submenu-link a {
    display: block;
    padding-bottom: 25px;
}

.menu-principal-mobile a+a, .submenu-link a+a {
    border-top: 1px solid #CFCFCF;
    padding-top: 20px;
}

.menu-principal-mobile a:hover {
    color: #ff9800;
}

.menu-principal-mobile.active {
    display: flex;
    animation: slideDown 0.3s ease;
}

.submenu {
    position: fixed; /* plutôt que fixed */
    top: 130px;
    right: 0;
    width: 100%;
    height: auto;
    min-height: 100%;
    background: #fff;
    z-index: 10; /* au-dessus du menu principal */
     transform: translateX(100%); /* hors écran */
    transition: transform 0.3s ease;
}

.submenu.active {
    transform: translateX(0);
}

.submenu-header {
    background-color: var(--color-primary);
    color: var(--color-secondary);
    
    
    
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #eee;
    
}

.back-btn,
.submenu-title {
    background: none;
    border: none;
    cursor: pointer;
    
    font-weight: 1000;
}

.back-btn {
    font-size: 15px;
}

.submenu-title {
    margin: auto;
    font-style: italic;
    text-transform: uppercase;
    font-size: 18px;
}

.menu-principal-desktop {
    display: none;
}

.menu-footer {
    background-color: var(--color-secondary);
    padding-top: 20px;
    padding-bottom: 20px;
    padding-left: 20px;
    padding-right: 20px;
}
.menu-footer a {
    text-decoration: none;
    color: var(--color-terciaire);
    display: block;
    font-weight: 1000;
}
.menu-footer a:hover {
    text-decoration: none;
    text-decoration: underline;
}

@media screen and (min-width: 1100px) {
    
    .hamburger {
        display: none;
    }

    .menu-principal-mobile {
        display: none;
    }

    .menu-principal-desktop {
        background-color: var(--color-primary);
        display: flex;
        flex-direction: row;
        justify-content: space-evenly;
        padding-left: 20px;
        padding-right: 20px;
    }

    /*.menu-principal-desktop a {
        
    }

    .menu-principal-desktop a:hover {
        text-decoration: none;
        background-color: var(--color-terciaire);
    }*/

    .menu-item {
        position: relative;
        display: inline-block;
    }

    .dropdown-btn {
        background-color: var(--color-primary);
        color: var(--color-secondary);
        padding: 12px 20px;
        font-size: 14px;
        font-weight: 900;
        text-transform: uppercase;
        border: none;
        cursor: pointer;
    }

    .dropdown-btn:hover, .selected-btn {
        color: var(--color-secondary);
        background-color: var(--color-terciaire);
    }

    .dropdown-title {
        padding-left: 70px;
    }

    .dropdown-container {
        display: flex;
        min-width: 30%;
        max-width: 80%;
        margin: auto;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
        
    }

    /*.dropdown-container a {
        text-decoration: none;
        color: var(--color-secondary);
        padding-top: 20px;
        padding-left: 20px;
        padding-right: 20px;
        padding-bottom: 20px;
    }*/

    .dropdown-content {
        display: none;
        position: fixed;
        top: 190px; /* ajuste selon la hauteur de ta barre de navigation */
        left: 0;
        width: 100vw; /* pleine largeur de l'écran */
        min-height: 30vh;
        max-height: 80vh; /* limite la hauteur visible du menu */
        overflow-y: auto; /* permet le scroll interne */
        background-color: white;
        border-bottom-left-radius: 8px;
        border-bottom-right-radius: 8px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.15);
        z-index: 1000;
        scroll-behavior: smooth; /* défilement fluide */
    }

    .dropdown-item {
        max-width: 100%;
        min-width: 13%
    }

    .dropdown-item-link {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        font-size: 12px;
        color: var(--color-secondary);
        flex-wrap: wrap;
    }

    .dropdown-item-link-name {
        text-transform: uppercase;
        font-weight: 900;
        font-size: 14px;
    }
    /* Liens dans le menu */
    .dropdown-content a {
        padding: 12px 16px;
        text-decoration: none;
        color: var(--color-secondary);
        display: block;
    }

    .dropdown-content a:hover {
        background-color: #f1f1f1;
    }

    /* Animation d’apparition */
    .show {
        display: block;
        animation: fadeIn 0.3s ease;
    }

    /* Désactive le scroll du body */
    body.no-scroll {
        overflow: hidden;
        touch-action: none; /* aide à bloquer certains mouvements tactiles */
    }

    /* (Optionnel) Scrollbar stylée */
    .dropdown-content::-webkit-scrollbar {
        width: 8px;
    }
    .dropdown-content::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.2);
        border-radius: 4px;
    }

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

}

/*****************************************************************
*                           MAIN                                 *
*****************************************************************/
main {
    background-color: #fafafa;
}

.main_container {
    width: 90%;
    margin: auto;
}


@media screen and (min-width: 1100px) {
    .main_container {
        width: 90%;
    }
}