/*
 Theme Name:   ATTPS
 Theme URI:    https://example.com
 Description:  Thème enfant ATTPS pour Divi 5 – Personnalisations préservées lors des mises à jour.
 Author:       Votre Nom
 Author URI:   https://example.com
 Template:     Divi
 Version:      1.0.0
 License:      GNU General Public License v2 or later
 License URI:  https://www.gnu.org/licenses/gpl-2.0.html
 Text Domain:  attps
*/

/* ==========================================================================
    Vos styles personnalisés ci-dessous
   ========================================================================== */

/* ==========================================================================
    GLOBAL
   ========================================================================== */
a {
  text-decoration: none;
  transition: color 0.3s ease;

  &:hover {
    color: #fb2201;
  }
}

.wpsf-product.swiper-slide {
  height: auto;
  display: flex;
}

/* ==========================================================================
    FOOTER
   ========================================================================== */
.reassurance-logo {
  width: 70px;
  height: 70px;
  background-color: #fb2201;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 30px;
  margin: 0 auto 10px;
}

footer .gform_required_legend {
  display: none;
}

.footer-contact .contact-content {
  display: flex;
  align-items: center;
  text-align: center;
  gap: 5px;
  padding: 5px 0;
  margin-bottom: 5px;

  i {
    font-size: 16px;
    width: 20px;
  }
}

.footer-contact hr {
  margin: 2px 0;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-contact strong {
  text-transform: uppercase;
}

.footer-video::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1;
}

.footer-video .ginput_container input[type="email"] {
  width: 100%;
  padding: 10px;
  border: none;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.footer-video,
.contact-form {
  .gform-footer.gform_footer {
    margin-top: 0;

    input[type="submit"] {
      background-color: #fb2201 !important;
      color: #fff !important;

      &:hover {
        background-color: #e01a00 !important;
      }
    }
  }
}

.footer_menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style-type: none !important;
  padding-left: 0 !important;
  color: #fff;
  font-size: 20px;
}

/* ==========================================================================
    HEADER
   ========================================================================== */
.woocommerce-breadcrumb {
  a:hover {
    color: #fb2201 !important;
  }
}

.dgwt-wcas-suggestion-selected .dgwt-wcas-st-title {
  color: #fb2201 !important;
}

/* ==========================================================================
    PLP
   ========================================================================== */

.woocommerce .products ul,
.woocommerce ul.products {
  display: flex;
  flex-wrap: wrap;
}

.woocommerce ul.products li.product a img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  object-position: center;
}

.woocommerce ul.products li.product {
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  padding-bottom: 0.5em;
  overflow: hidden;
  transition: transform 0.3s ease;
  height: auto !important;
  flex: 1 0 calc(25% - 20px);
  margin: 10px;

  .woocommerce-loop-product__title {
    padding: 0.5em;
    transition: 0.3s ease;

    &:hover {
      color: #fb2201 !important;
    }
  }

  &:hover {
    transform: translateY(-5px);
  }
}

li.product .woocommerce-loop-product__title {
  flex-grow: 1;
}

li.product .woocommerce-loop-product__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  text-decoration: none;
}

.woocommerce ul.products li.product h2,
.woocommerce ul.products li.product .price {
  margin-top: auto;
  text-align: center;
}

/* Cache les sous-menus */
.wc-block-product-categories-list--depth-1 {
  display: none;
  margin-left: 20px !important;
  padding-top: 5px;
}

/* Style du bouton Toggle */
.cat-toggle {
  display: inline-block;
  text-align: center;
  color: #fb2201;
  cursor: pointer;
  font-family: monospace;
  vertical-align: middle;
  position: absolute;
  right: 0;
  top: 8px;
  font-size: 22px;
}

.cat-toggle:hover {
  color: #e01a00;
}

/* Aligner le LI */
.wc-block-product-categories-list-item {
  list-style: none !important;
  margin-bottom: 8px !important;
}

.et_pb_sidebar_0_tb_body {
  background-color: #efefef;
  border-right: 0;
  padding-right: 0;

  li {
    position: relative;
    padding: 10px 15px 10px 0;
    margin: 0 10px;
    border-bottom: 1px solid #ddd;

    &:last-child {
      border-bottom: none;
      margin-bottom: 0 !important;
    }

    a {
      transition: color 0.3s ease;

      &:hover {
        color: #fb2201 !important;
      }
    }

    > span {
      text-transform: lowercase;
      display: inline-block;
      margin-left: 2px;

      &::first-letter {
        text-transform: uppercase;
      }
    }
  }
}
.wc-block-product-categories {
  margin-bottom: 0 !important;
}

.woocommerce-pagination {
  ul {
    border: none !important;

    li {
      border-right: none !important;
    }
  }

  span.current {
    background-color: #fb2201 !important;
    color: #fff !important;
    padding: 8px 12px !important;
    margin: 5px !important;
    font-weight: bold;
  }

  a.page-numbers {
    background-color: #efefef;
    color: #777777;
    border: none !important;
    padding: 8px 12px !important;
    margin: 5px !important;
    transition: background-color 0.3s ease !important;

    &:hover {
      background-color: #ddd;
      color: #fb2201;
    }
  }
}

.chose-cat {
  text-align: center;
  padding: 20px;
  background-color: #efefef;
  color: #fb2201;
  cursor: pointer;
  position: relative;
  user-select: none;

  .et_pb_text_inner > p {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .wc-block-product-categories-list--depth-1 {
    display: block;

    li:last-child {
      padding-bottom: 0;
      margin-bottom: 0 !important;
    }
  }
}

.fake-select-wrapper {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  z-index: 9999;
  background: #fff;
  border: 1px solid #ddd;
  border-top: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  max-height: 400px;
  overflow-y: auto;

  .cat-toggle {
    display: none;
  }
}

.fake-select-wrapper > ul {
  margin: 0 !important;
  padding: 10px !important;
  list-style: none !important;
}

.fake-select-wrapper li {
  padding: 5px 0;
  border-bottom: 1px solid #f5f5f5;

  span {
    text-transform: lowercase;
    display: inline-block;

    &::first-letter {
      text-transform: uppercase;
    }
  }
}

.fake-select-wrapper li:last-child {
  border-bottom: none;
}

.chose-cat.is-active i {
  transform: rotate(180deg);
  transition: transform 0.3s;
}

.woocommerce-price-suffix {
  display: none;
}

.woocommerce-ordering {
  select {
    background-color: #efefef;
    border: none;
    padding: 8px 12px;
    color: #777777;
    transition: background-color 0.3s ease;
    cursor: pointer;

    &:hover {
      background-color: #ddd;
      color: #fb2201 !important;
    }
  }
}

.woocommerce-page.et_pb_button_helper_class a.button:hover {
  background-color: #fb2201 !important;
}

@media screen and (max-width: 980px) {
  ul.products {
    margin: 0;
  }

  #main-content .et_pb_shop .woocommerce ul.products li.product {
    flex: 0 0 calc(50% - 10px) !important;
    width: calc(50% - 10px) !important;
    margin: 5px !important;
  }
}

/* ==========================================================================
    ACCOUNT
   ========================================================================== */

#customer_login {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 40px !important;
  margin: 40px auto;
}

#customer_login .u-column1,
#customer_login .u-column2 {
  flex: 1 !important;
  width: 50% !important;
  float: none !important;
  background: #ffffff;
  padding: 30px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  box-sizing: border-box !important;
}

@media screen and (max-width: 980px) {
  #customer_login {
    flex-direction: column !important;
  }
  #customer_login .u-column1,
  #customer_login .u-column2 {
    width: 100% !important;
  }
}

#customer_login h2 {
  font-size: 1.5rem;
  color: #1a202c;
  margin-top: 0;
  margin-bottom: 24px;
  padding-bottom: 10px;
  border-bottom: 2px solid #edf2f7;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#customer_login label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 8px;
}

#customer_login label .required {
  color: #fb2201;
  text-decoration: none;
}

#customer_login input[type="text"],
#customer_login input[type="email"],
#customer_login input[type="password"] {
  width: 100%;
  padding: 12px 16px;
  font-size: 0.95rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background-color: #fff;
  color: #334155;
  transition: all 0.2s ease-in-out;
  box-sizing: border-box;
}

#customer_login input[type="text"]:focus,
#customer_login input[type="email"]:focus,
#customer_login input[type="password"]:focus {
  outline: none;
  border-color: #fb2201;
  box-shadow: 0 0 0 3px rgba(251, 34, 1, 0.15);
}

#customer_login .password-input {
  display: block;
  position: relative;
}

#customer_login .password-input button.show-password-input {
  position: absolute;
  top: 50%;
  right: 15px;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
}

#customer_login .woocommerce-form-login__rememberme {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: normal;
  margin-bottom: 20px;
}

#customer_login .woocommerce-form-login__rememberme input[type="checkbox"] {
  accent-color: #fb2201;
  width: 16px;
  height: 16px;
}

#customer_login button[type="submit"].button {
  display: block;
  width: 100%;
  background-color: #fb2201;
  color: #ffffff;
  border: none;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    transform 0.1s ease;
  text-align: center;
}

#customer_login button[type="submit"].button:hover {
  background-color: #d61c00;
}

#customer_login button[type="submit"].button:active {
  transform: scale(0.98);
}

#customer_login .lost_password {
  margin-top: 15px;
  text-align: center;
}

#customer_login .lost_password a {
  color: #64748b;
  font-size: 0.85rem;
  text-decoration: underline;
  transition: color 0.2s;
}

#customer_login .lost_password a:hover {
  color: #fb2201;
}

#customer_login .u-column2 p,
#customer_login .woocommerce-privacy-policy-text p {
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 15px;
}

#customer_login .woocommerce-privacy-policy-text a {
  color: #fb2201;
  text-decoration: none;
  font-weight: 500;
}

#customer_login .woocommerce-privacy-policy-text a:hover {
  text-decoration: underline;
}

#customer_login .form-row {
  margin-bottom: 20px;
}

.account-menu {
  background-color: #efefef;

  ul {
    list-style: none !important;
    padding-left: 0 !important;
    padding-bottom: 0;

    li {
      border-bottom: 1px solid #ddd;

      &:last-child {
        border-bottom: none;
      }

      &.is-active a {
        color: #fb2201 !important;
        font-weight: bold;
      }

      a {
        color: #777777 !important;
        font-size: 20px;
        padding: 10px 15px;
        display: block;
        transition: color 0.3s ease;

        &:hover {
          color: #fb2201 !important;
        }
      }
    }
  }
}

.woocommerce-account .addresses .title .edit {
  float: none;
}

address {
  font-style: normal;
  line-height: 1.5;
  background-color: #efefef;
  padding: 15px;
  margin-top: 10px;
}

.woocommerce-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;

  .woocommerce-Button {
    margin-top: 15px !important;
  }
}

.woocommerce-orders-table
  .woocommerce-orders-table__cell
  .woocommerce-button.button {
  padding: 0 5px !important;
  margin-right: 5px !important;

  &:hover {
    padding: 0 5px !important;
  }
}

/* ==========================================================================
    WISHLIST
   ========================================================================== */

.woocommerce-LoopProduct-link.woocommerce-loop-product__link {
  position: relative;
}

.yith-wcwl-add-to-wishlist-button.yith-wcwl-add-to-wishlist-button--icon-button:is(
    button
  ) {
  display: none;
  background-color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: background-color 0.3s ease;

  &:hover {
    background-color: #e5e2e2;
  }
}

.logged-in
  .yith-wcwl-add-to-wishlist-button.yith-wcwl-add-to-wishlist-button--icon-button:is(
    button
  ) {
  display: flex;
}

.wishlist_table.mobile {
  padding-left: 0;
}

.wishlist_table.mobile li {
  background-color: #f7f7f7;
  padding: 20px;
}

.yith-add-to-wishlist-button-block {
  margin: 0;
}

/* ==========================================================================
    ORDERS
   ========================================================================== */

.wc-block-components-button.wp-element-button {
  background-color: #fb2201 !important;
  color: #fff !important;
  border: 1px solid #fb2201 !important;
  padding: 8px 12px !important;
  transition: 0.3s ease !important;

  &:hover {
    background-color: #fff !important;
    color: #fb2201 !important;
  }
}

.wms_pickup_open_modal_mondial_relay,
.page
  .wms_pickup_modal_mondial_relay
  .wms_mondial_relay_sidebar
  .wms_select_pickup_point_button {
  background-color: #fff;
  padding: 10px 20px !important;
  color: #fb2201;
  border-color: #fb2201 !important;
  cursor: pointer;
  transition: all 0.3s ease;

  &:hover {
    background-color: #fb2201;
    color: #fff;
  }
}

/* ==========================================================================
    MENUS
   ========================================================================== */

/* ==========================================================================
    ACTUALITÉS
   ========================================================================== */

.et_pb_blog {
  .et_pb_post {
    overflow: hidden;
    background-color: #efefef;
    transition: transform 0.3s ease;

    &:hover {
      transform: translateY(-5px);
    }

    .post-content-inner p {
      color: #000;
    }

    .entry-title a {
      color: #000 !important;
      font-size: 20px;
      transition: color 0.3s ease;

      &:hover {
        color: #fb2201 !important;
      }
    }

    .more-link {
      margin-top: 10px;
    }
  }
}

/* ==========================================================================
    SLIDERS
   ========================================================================== */
.wps-product-section {
  padding-top: 5px;

  .wpsf-product {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease;

    &:hover {
      transform: translateY(-5px);
    }
  }

  .wpsp-nav i {
    justify-content: center;
  }

  .wpsf-product-title a {
    font-family: "Karla", sans-serif;
  }

  .woocommerce-Price-amount {
    font-family: "Raleway", sans-serif;
  }
}

/* ==========================================================================
    PANIER
   ========================================================================== */

/* --- LE CONTENEUR DE LA GRILLE (GUTENBERG) --- */
.wc-block-grid__products {
  display: flex !important;
  flex-wrap: wrap;
  margin: 0 -15px !important; /* Compense le padding des éléments */
  padding: 0;
  list-style: none;
}

/* --- LA FICHE PRODUIT --- */
.wc-block-grid__product {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: 20px !important;
  margin: 0 15px 30px 15px !important;
  background: #ffffff;
  border: 1px solid #f2ede9; /* Bordure très douce couleur lin */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;

  /* GESTION DE LA HAUTEUR : 4 colonnes sur PC */
  height: auto !important;
  flex: 0 0 calc(25% - 30px) !important;
  width: calc(25% - 30px) !important;
}

/* Effet de survol sur la fiche */
.wc-block-grid__product:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

/* --- LE LIEN ET L'IMAGE --- */
.wc-block-grid__product-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.wc-block-grid__product-image {
  margin-bottom: 15px;
  overflow: hidden;
  background-color: #fcfbfa;
}

.wc-block-grid__product-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover; /* Force les images aux proportions différentes à rester propres */
}

/* --- LE TITRE DU PRODUIT --- */
.wc-block-grid__product-title {
  font-size: 16px !important;
  font-weight: 600 !important;
  color: #333333;
  line-height: 1.4;
  margin: 0 0 10px 0 !important;
}

/* --- LE PRIX (Poussé vers le bas automatiquement) --- */
.wc-block-grid__product-price {
  margin-top: auto !important; /* Le secret pour aligner le prix et le bouton en bas */
  margin-bottom: 15px !important;
  font-size: 18px !important;
  font-weight: 700;
  color: #fb2201; /* Teinte rose/framboise chic pour le prix */
}

.wc-block-grid__product-price small {
  font-size: 12px;
  font-weight: 400;
  color: #888888;
  margin-left: 4px;
}

/* --- LE BOUTON AJOUTER AU PANIER --- */
.wc-block-grid__product-add-to-cart {
  margin: 0 !important;
  padding: 0 !important;
}

.wc-block-grid__product-add-to-cart .wp-block-button__link {
  display: block;
  width: 100%;
  text-align: center;
  background-color: #4a3b32 !important; /* Brun foncé/taupe élégant */
  color: #ffffff !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 20px !important;
  border-radius: 25px !important;
  border: none !important;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

/* Survol du bouton panier */
.wc-block-grid__product-add-to-cart .wp-block-button__link:hover {
  background-color: #fb2201 !important; /* Devient rose au survol */
  color: #ffffff !important;
}

/* --- RESPONSIVE : TABLETTE ET MOBILE --- */
@media screen and (max-width: 981px) {
  /* 2 colonnes sur Tablette */
  .wc-block-grid__product {
    flex: 0 0 calc(50% - 20px) !important;
    width: calc(50% - 20px) !important;
    margin: 0 10px 20px 10px !important;
  }
}

@media screen and (max-width: 580px) {
  /* Ajustement des marges internes pour les petits mobiles */
  .wc-block-grid__product {
    padding: 12px !important;
  }
  .wc-block-grid__product-title {
    font-size: 14px !important;
  }
}
/* ==========================================================================
    AUTRES
   ========================================================================== */
.et_pb_wc_add_to_cart .quantity input.qty {
  max-width: none !important;
  font-size: 16px;
  color: #000;
}

.woocommerce div.product form.cart .variations {
  .value {
    padding-bottom: 0 !important;

    > span::after {
      content: none !important;
    }
  }

  select {
    background-color: #fff !important;
    border: 1px solid black !important;
    font-size: 16px !important;
    color: #000 !important;
  }
}
