@import url('https://fonts.googleapis.com/css2?family=Alex+Brush&family=Pacifico&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&family=Pacifico&display=swap");

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

:root {
  /*Color mode HSL(hue, saturation, lightness)*/
  --first-color: hsl(350, 70%, 65%);
  --first-color-alt: hsl(350, 70%, 62%);
  --second-color: hsl(350, 40%, 20%);
  --title-color: hsl(350, 28%, 15%);
  --text-color: hsl(350, 25%, 28%);
  --white-color: hsl(0, 0%, 100%);
  --body-color: hsl(350, 95%, 90%);
  --container-color: hsl(350, 100%, 97%);

  /*========== Font and typography ==========*/
  --body-font: "Montserrat", sans-serif;
  --second-font: "Pacifico", cursive;
  --biggest-font-size: 3rem;
  --bigger-font-size: 2rem;
  --h1-font-size: 1.5rem;
  --h2-font-size: 1.25rem;
  --h3-font-size: 1rem;
  --normal-font-size: .938rem;
  --small-font-size: .813rem;
  --smaller-font-size: .75rem;

  /*========== Font weight ==========*/
  --font-regular: 400;
  --font-medium: 500;
  --font-semi-bold: 600;
  --font-bold: 700;

  /*========== z index ==========*/
  --z-tooltip: 10;
  --z-fixed: 100;

  /*========== effects ==========*/
  --main-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* --- LE THEME SOMBRE --- */
body.dark-theme {
  --title-color: hsl(350, 28%, 95%);
  --text-color: hsl(350, 25%, 80%);
  --body-color: hsl(350, 20%, 12%);
  --container-color: hsl(350, 20%, 18%);
  --second-color: hsl(350, 20%, 10%);
}

@media (width >=1150px) {
  :root {
    --biggest-font-size: 5rem;
    --bigger-font-size: 4rem;
    --h1-font-size: 2.25rem;
    --h2-font-size: 1.5rem;
    --h3-font-size: 1.25rem;
    --normal-font-size: 1rem;
    --small-font-size: .875rem;
    --smaller-font-size: .813rem;
  }
}

html,
body {
  font-size: 62.5%;
  overflow-x: hidden;
}

body {
  background-color: var(--body-color);
  font-size: 1.6rem;
  font-family: var(--body-font);
  color: var(--text-color);
  transition: background-color 0.4s, color 0.4s;
}

li {
  list-style: none;
}

a {
  text-decoration: none;
  color: var(--title-color);
  transition: color 0.3s ease-in-out;

  &:hover {
    color: var(--first-color);
  }
}

ul li a i {
  margin-right: 4px;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 16px;
}

/* --- Hiérarchie Typographique --- */
h1,
h2,
h3,
.logoText {
  font-family: var(--second-font);
  color: var(--title-color);
  margin-bottom: 16px;
}

h2 {
  font-size: 3.2rem;
  text-align: center;
  margin-bottom: 32px;
}

h3,
.logoText {
  font-size: 2.2rem;
  text-align: center;
}

p {
  line-height: 1.6;
  margin-bottom: 12px;
}

section {
  max-width: 1024px;
  margin: 64px auto;
  padding: 16px;
}

/* --- HEADER & NAV --- */
header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 24px;
  background-color: var(--body-color);
  box-shadow: var(--main-box-shadow);
}

#logoContainer {
  display: flex;
  align-items: center;
  gap: 12px;

  figure img {
    width: 32px;
    height: auto;
    object-fit: fill;
  }

  h1 {
    margin-bottom: 0;
    font-size: var(--h1-font-size);
  }
}


#navMenu ul {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  gap: 24px;

  li {
    font-weight: 600;
  }
}

#burgerIcon {
  display: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--title-color);

  .fa-xmark {
    display: none;
  }
}

@media screen and (width <=768px) {

  #navMenu ul {
    display: none;

    &.show-menu {
      display: flex;
      opacity: 1;
      visibility: visible;
      border-top: 2px solid #39222E;
      background-color: var(--body-color);
      box-shadow: var(--main-box-shadow);
    }
  }

  #burgerIcon {
    &.active-icon .fa-bars {
      display: none;
    }

    &.active-icon .fa-xmark {
      display: block;
    }
  }
}

@media screen and (width <=768px) {
  header {
    background-color: hsla(350, 95%, 90%, 0.95);
  }

  #burgerIcon {
    display: block;
  }

  #navMenu ul {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    flex-direction: column;
    align-items: center;
    padding: 32px 0;
    gap: 24px;
    background-color: var(--container-color);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    display: none;
    /* Rendu visible via JS plus tard */
  }
}

/* --- BUTTON CTA --- */
.cta {
  /*background-color: var(--first-color);*/
  background-color: #E4677C;
  width: fit-content;
  border: none;
  padding: 12px 24px;
  border-radius: 16px;
  box-shadow: var(--main-box-shadow);
  cursor: pointer;
  transition: all 0.3s ease;
  /*color: var(--text-color);*/
  color: #39222E;
  font-size: 1.6rem;
  font-weight: 700;
  font-family: var(--body-font);

  &:hover {
    background-color: var(--first-color-alt);
    color: var(--white-color);
    transform: translateY(-3px);
  }
}

/* --- HERO SECTION --- */
#hero {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-items: center;
  justify-content: space-evenly;
  gap: 24px;
  margin-top: 120px;

  @media screen and (width <=768px) {
    grid-template-columns: 1fr;
  }
}

#content {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: flex-start;
  text-align: left;
}

#carrousel {
  overflow: hidden;
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;

  input[type="radio"] {
    display: none;
  }

  .slider-track {
    display: flex;
    width: 500%;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
  }

  .slide {
    width: 20%;
    flex-shrink: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    gap: 16px;
    padding: 16px;

    .bg-text {
      position: absolute;
      transform: translate(-50%, -50%);
      font-size: var(--biggest-font-size);
      font-weight: 700;
      opacity: 0.15;
      text-transform: uppercase;
      color: var(--text-color);
      pointer-events: none;
      z-index: 1;

      &.top {
        top: 5%;
        left: 50%;
      }

      &.bottom {
        bottom: 20%;
        left: 50%;
      }
    }

    .cake-img {
      position: relative;
      z-index: 2;
      width: 250px;
      transition: transform 0.4s ease;
    }

    .mintLeaf {
      position: absolute;
      width: 60px;
      z-index: 3;
      transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);

      &.first {
        top: 5%;
        left: 10%;
        transform: rotate(20deg);
      }

      &.second {
        top: 5%;
        right: 10%;
        transform: rotate(-15deg);
      }

      &.third {
        bottom: 5%;
        left: 10%;
        transform: rotate(-20deg);
      }
    }

    &:has(.cake-img:hover) {
      .mintLeaf.first {
        transform: translate(-15px, -15px) rotate(45deg) scale(1.1);
      }

      .mintLeaf.second {
        transform: translate(15px, -15px) rotate(5deg) scale(1.1);
      }

      .mintLeaf.third {
        transform: translate(-15px, 15px) rotate(-45deg) scale(1.1);
      }

      .cake-img {
        transform: scale(1.02);
      }
    }
  }

  .logoText {
    position: relative;
    z-index: 3;
    margin-top: 10px;
  }

  /* Moteur du carrousel Hero */
  #slide1:checked~.slider-track {
    transform: translateX(0%);
  }

  #slide2:checked~.slider-track {
    transform: translateX(-20%);
  }

  #slide3:checked~.slider-track {
    transform: translateX(-40%);
  }

  #slide4:checked~.slider-track {
    transform: translateX(-60%);
  }

  #slide5:checked~.slider-track {
    transform: translateX(-80%);
  }

  /* Moteur du carrousel News (basé sur le name slider2) */
  #slide6:checked~.slider-track {
    transform: translateX(0%);
  }

  #slide7:checked~.slider-track {
    transform: translateX(-20%);
  }

  #slide8:checked~.slider-track {
    transform: translateX(-40%);
  }

  #slide9:checked~.slider-track {
    transform: translateX(-60%);
  }

  #slide10:checked~.slider-track {
    transform: translateX(-80%);
  }

  .arrowContainer {
    display: flex;
    gap: 16px;
    z-index: 10;
    margin-top: 16px;

    .arrow {
      background-color: var(--container-color);
      padding: 12px 16px;
      border-radius: 50%;
      box-shadow: var(--main-box-shadow);
      cursor: pointer;
      transition: background-color 0.3s, color 0.3s;
      color: var(--text-color);

      &:hover {
        background-color: var(--first-color);
        color: var(--white-color);
      }
    }
  }
}

/* --- ABOUT SECTION --- */
#about {
  position: relative;

  .blob {
    position: absolute;
    z-index: -1;
    top: 50%;
    right: 0%;
    transform: translateY(-50%);
    width: 60%;
    height: auto;
  }
}

#aboutWrapper {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-items: center;
  justify-content: space-around;
  gap: 32px;
  padding: 32px;
  background-color: var(--second-color);
  border-radius: 16px;

  @media screen and (width <=768px) {
    grid-template-columns: 1fr;
  }

  figure {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;

    .chef {
      position: absolute;
      z-index: 2;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -40%) scale(1.25);
      width: 100%;
      height: auto;
      filter: drop-shadow(0 0 30px rgba(0, 0, 0, 0.3));
    }

    @media screen and (width <=768px) {
      display: none;
    }
  }

  article {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 8px;
    color: var(--white-color);
    z-index: 3;

    h3 {
      color: var(--white-color);
      font-weight: 500;
      text-align: left;
    }
  }
}

/* --- FAMOUS & PRODUCTS CARDS --- */
#gridFamous,
#gridProducts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  align-items: center;
  justify-content: space-evenly;
  gap: 24px;
  padding: 16px 0;
}

.cardFamous,
.cardProduct {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  background-color: var(--container-color);
  gap: 16px;
  padding: 24px 12px 16px 12px;
  border-radius: 16px;
  box-shadow: var(--main-box-shadow);
  transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
  overflow: hidden;

  .blob {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    z-index: 0;

    @media screen and (width <=768px) {
      display: none;
    }
  }

  .cart-icon {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    background-color: var(--first-color-alt);
    color: var(--white-color);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;

    &:hover {
      transform: scale(1.1);
    }
  }

  .card-img,
  article,

  .price {
    position: relative;
    z-index: 1;
  }

  h3 {
    color: var(--white-color);

    @media screen and (width <=768px) {
      color: var(--text-color);
    }

  }

  .cake {
    width: 200px;
    height: 180px;
    object-fit: cover;
    transition: transform 0.3s ease-in-out;
  }

  .price {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--first-color-alt);
  }

  &:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);

    & .cake {
      transform: scale(1.05);
    }
  }
}

/* --- FILTER CATEGORIES --- */
#filterCategories {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;

  p {
    padding: 8px 18px;
    border-radius: 24px;
    background-color: var(--container-color);
    font-weight: 700;
    transition: all 0.2s ease;
    cursor: pointer;

    &:hover,
    &.active {
      /*background-color: var(--first-color-alt);*/
      background-color: #E25A71;
      color: #381A02;
    }
  }
}

/* --- NEWS SECTION --- */
#news {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-items: center;
  justify-content: space-evenly;
  gap: 24px;
  margin-top: 120px;

  @media screen and (width <=768px) {
    grid-template-columns: 1fr;
  }

  .cake-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
  }

  .cake-display .cake-img {
    position: relative;
    z-index: 9;
    width: 250px;
    margin-bottom: -40px;
    transition: transform 0.4s ease;
  }

  .cake-display .plate {
    position: relative;
    z-index: 0;
    width: 280px;
    pointer-events: none;
  }


}

/* --- CONTACT SECTION --- */
#contactGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  align-items: stretch;
  gap: 32px;
  padding: 32px;
  background-color: var(--second-color);
  border-radius: 16px;
  color: var(--white-color);

  h3 {
    color: var(--first-color-alt);
    margin-bottom: 12px;
    text-align: left;
  }

  a {
    color: var(--white-color);
    transition: color 0.3s;

    &:hover {
      color: var(--first-color);
    }
  }

  #companyInformations {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;

    address {
      font-style: normal;
    }

    .map-container img {
      width: 100%;
      height: 200px;
      object-fit: cover;
      border-radius: 12px;
      border: 2px solid var(--first-color-alt);
    }
  }

  #contactFormWrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;

    #contactForm {
      display: flex;
      flex-direction: column;
      gap: 12px;

      .formGroup {
        display: flex;
        flex-direction: column;
        gap: 6px;

        label {
          font-size: var(--body-font);
          font-weight: 500;
          margin-left: 8px;
        }
      }

      button {
        align-self: flex-end;
        margin-top: 8px;
      }
    }
  }
}

/* Inputs globaux */
input,
select,
textarea {
  border: 2px solid var(--first-color);
  border-radius: 12px;
  padding: 12px 16px;
  width: 100%;
  box-sizing: border-box;
  background-color: var(--container-color);
  color: var(--text-color);
  font-size: var(--body-font);
  font-family: var(--body-font);
  transition: border-color 0.3s, box-shadow 0.3s;
  margin-bottom: 0;

  &::placeholder {
    color: var(--text-color);
    opacity: 0.5;
  }

  &:focus {
    outline: none;
    border-color: var(--first-color-alt);
    box-shadow: 0 0 8px rgba(212, 139, 85, 0.3);
  }
}

textarea {
  min-height: 120px;
  resize: vertical;
}

/* --- FOOTER --- */
footer {
  margin-top: 64px;

  #footerGrid {
    background-image: url("/public/images/assets/footer/blob.webp");
    background-repeat: no-repeat;
    background-position: bottom;
    background-size: 100% auto;
    background-color: var(--title-color);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    padding: 90px 16px 45px 16px;
    border-radius: 16px 16px 0 0;

    h3,
    p,
    address,
    a,
    i {
      color: var(--container-color);
    }

    h3 {
      text-align: left;
    }

    a:hover {
      color: var(--first-color);
    }

    .footer-column {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 16px;
      padding: 8px;

      ul {
        display: flex;
        flex-direction: column;
        gap: 16px;
        padding: 0;

        li {
          display: flex;
          align-items: center;

          i {
            margin-right: 8px;
            width: 20px;
            text-align: center;
          }
        }
      }
    }
  }

  .copyright {
    padding: 16px;
    background-color: var(--second-color);
    text-align: center;
    color: var(--white-color);

    a {
      color: var(--white-color);
      font-weight: bold;
    }
  }
}
