/*--------------------------------------------------------------
* WooCommerce Override Custom CSS
>>> TABLE OF CONTENTS:
----------------------------------------------------------------
# GENERAL
	- Buttons
	- Forms : inputs, selects, textarea
	- Messages
  - Prices
	- Separators
# SHOP PAGE
	- Layout
	- Product
# PRODUCT PAGE
	- Layout
	- Left column (infos)
	- Right (images)
# CART PAGE
	- Layout
	- Buttons
# ORDER (SUMMARY) PAGE
	- Layout
	- Buttons
# CHECKOUT PAGE
	- Layout
# RESPONSIVE
  # SHOP PAGE
    - Responsive grid
    - Buttons
  # PRODUCT PAGE
    - Layout
  # CART PAGE
    - Layout
--------------------------------------------------------------*/

/*--------------------------------------------------------------
# GENERAL
--------------------------------------------------------------*/

/* --- Buttons --- */

.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce #content input.button, .wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link {
  display: inline-block;
  width: 100%;
  padding: 16px;
  background-color: var(--color-secondary);
  color: var(--color-accent);
  border: none;
  border-radius: 8px;
  font-size: var(--font-medium) !important;
  font-weight: normal;
  line-height: var(--line-height-medium);
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}
  /* on hover */
  .woocommerce a.button:hover,
  .woocommerce button.button:hover,
  .woocommerce input.button:hover,
  .woocommerce #respond input#submit:hover,
  .woocommerce #content input.button:hover, .wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link:hover {
    background-color: var(--color-accent);
    color: var(--color-primary);
    font-weight: bold;
  }
  /* "Added!" button */
  .ajax-button-text-change.added-state {
    background-color: var(--color-accent);
    color: var(--color-primary);
    opacity: 0.8;
  }

/* --- Forms : inputs, selects, textarea --- */

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="password"],
input[type="search"], input[type="number"],
textarea,
select {
  font-size: var(--font-medium) !important;
  border: 1px solid var(--color-accent) !important;
  border-radius: 8px !important;
  background-color: var(--color-primary) !important;
  color: var(--color-accent) !important;
  width: 100%;
  padding: 12px 8px;
}

.wc-blocks-components-select .wc-blocks-components-select__label, .wc-block-components-form .wc-block-components-text-input label, .wc-block-components-text-input label {
  color: var(--color-accent) !important;
}

/* --- Messages --- */

.wc-block-components-notice-banner {
  background-color: var(--color-secondary) !important;
  border: none !important;
  border-radius: 8px !important;
  color: var(--color-accent) !important;
}

.wc-block-checkout__shipping-option .wc-block-components-shipping-rates-control__no-shipping-address-message {
  background-color: var(--color-secondary) !important;
  color: var(--color-accent) !important;
}

/* --- Prices --- */

.price {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: nowrap;
  font-weight: bold;
}
  .price del,
  .price ins {
    display: inline;
    white-space: nowrap;
  }
    .price del {
      order: 1;
      opacity: 0.6;
      text-decoration: line-through;
      font-weight: normal !important;
    }
    .price ins {
      order: 2;
      text-decoration: none;
      font-weight: bold !important;
    }

/* --- Separators --- */

  /* on checkout page */
  .wc-block-checkout__terms.wc-block-checkout__terms--with-separator {
      border-top: 1px solid var(--color-secondary) !important;
  }

  /* on cart page */
  .is-large.wc-block-cart .wc-block-cart-items td {
      border-top: 1px solid var(--color-secondary) !important;
  }
  .is-large.wc-block-cart .wc-block-cart-items {
      border-bottom: 1px solid var(--color-secondary) !important;
  }
  .wc-block-components-totals-wrapper, .wp-block-woocommerce-cart-order-summary-totals-block, .wc-block-cart .wp-block-woocommerce-cart-order-summary-block, .wp-block-woocommerce-checkout-order-summary-totals-block {
      border-color: var(--color-primary) !important;
  }

/*--------------------------------------------------------------
# SHOP PAGE
--------------------------------------------------------------*/
/* --- LAYOUT --- */

  /* Hide lens icon */
  .woocommerce-product-gallery__trigger {
    display: none;
  }

  /* Hide result count */
  .woocommerce-result-count {
    display: none;
  }

  /* Shop filters */
  .orderby {
    border: none !important;
  }

  /* Hide sale wrapper */
  .onsale {
    display: none;
  }

  p.stock.in-stock, .reset_variations, .single-product th.label {
  display: none !important;
  }

/* --- PRODUCT --- */

/* Grid */
.woocommerce ul.products, .wc-block-grid__products {
  width: 100%;
  box-sizing: border-box;
  display: grid;
  margin: 0 !important;
  padding: 0;
  gap: 8px;
}
  .wc-block-grid__product {
    border-bottom: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
  }

.theme-twentytwenty .wc-block-grid.has-4-columns:not(.alignwide):not(.alignfull) .wc-block-grid__product, .theme-twentytwenty .wc-block-grid.has-5-columns.alignfull .wc-block-grid__product, .wc-block-grid.has-4-columns:not(.alignwide):not(.alignfull) .wc-block-grid__product, .wc-block-grid.has-5-columns.alignfull .wc-block-grid__product {
  font-size: var(--font-small) !important;
  line-height: var(--line-height-small) !important;
}

  /* Product Card */
  .woocommerce-loop-product__title {
    display: flex;
    font-size: var(--font-small);
    font-weight: normal;
    margin: 0;
  }
    /* Thumbnail */
    .product-thumbnail-wrapper {
      position: relative;
      width: 100%;
    }
      .product-thumbnail-wrapper img {
        display: block;
        width: 100%;
        object-fit: cover;
        aspect-ratio: 3 / 4;
      }
        /* on hover */
        .product-thumbnail-wrapper img.hover-image {
          position: absolute;
          top: 0;
          left: 0;
          width: 100%;
          height: auto;
          opacity: 0;
          transition: opacity 0.3s ease-in-out;
        }
        .product-thumbnail-wrapper:hover img.hover-image {
          opacity: 1;
        }
        .product-thumbnail-wrapper:hover img.wp-post-image {
          opacity: 0;
        }
    /* Title & price */
    .product-title-price {
      width: 100%;
      padding: 8px 0 16px;
      display: flex;
      justify-content: space-between;
      align-items: start;
      gap: 12px;
    }

  /* Add to cart button */
  .product-thumbnail-wrapper .hover-add-to-cart .button {
    position: absolute;
    font-size: var(--font-small) !important;
    padding: 12px;
    bottom: 32px;
    left: 50%;
    min-width: 150px;
    width: auto;
    opacity: 0;
    border: solid 1px var(--color-accent);
    pointer-events: none;
    transform: translateX(-50%) translateY(8px);
    transition:
      opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
      transform 0.45s cubic-bezier(0.4, 0, 0.2, 1),
      background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
      color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
    }
      /* on hover */
      .product-thumbnail-wrapper:hover .hover-add-to-cart .button {
        opacity: 1;
        pointer-events: auto;
        transform: translateX(-50%) translateY(0);
      }

/*--------------------------------------------------------------
# PRODUCT PAGE
--------------------------------------------------------------*/
/* --- LAYOUT --- */
.custom-product-layout {
  width: 100%;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

/* --- LEFT COLUMN (INFOS) --- */
.custom-product-sidebar {
  min-width: 40%;
  position: sticky;
  top: 82px;
  align-self: flex-start;
}
  /* Breadcrumb */
  .woocommerce-breadcrumb {
    font-size: var(--font-small);
    line-height: var(--line-height-small);
    padding-bottom: 16px;
  }
  /* Quantity field */
  .quantity {
    margin-bottom: 8px;
  }
    input[type="number"] {
      width: 100%;
      padding: 12px 8px;
      text-align: center;
    }
  /* Short description */
  .woocommerce div.product .woocommerce-product-details__short-description {
    font-size: var(--font-small);
    line-height: var(--line-height-small);
  }

/* --- RIGHT COLUMN (IMAGES) --- */
.custom-product-images {
  width: 70%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
  /* Images wrapper */
  .custom-gallery-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
    /* Images */
    .custom-gallery-wrapper img {
      width: 100%;
      object-fit: cover;
      max-height: 900px;
    }
  /* Other products */
  .related-products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

/*--------------------------------------------------------------
# CART PAGE
--------------------------------------------------------------*/
/* --- LAYOUT --- */

  /* Product name */
  .wc-block-components-product-name, .wc-block-grid__product-title {
    font-weight: normal !important;
  }

  /* "Sale" */
  .wc-block-grid .wc-block-grid__product-onsale, .wc-block-grid__product-image .wc-block-grid__product-onsale {
      background: var(--color-primary) !important;
      border: 1px solid var(--color-accent) !important;
      color: var(--color-accent) !important;
      text-align: center;
  }

  /* Hide packaging in the cart page */
    /* ID 163 (A4 envelope) */
    .woocommerce-cart-form .cart_item.product-163,
    .widget_shopping_cart_content .cart_list .product-163 {
        display: none !important;
    }

/* --- BUTTONS --- */

  /* "Check delivery options" button */
  .wc-block-components-button:not(.is-link).outlined:active, .wc-block-components-button:not(.is-link).outlined:disabled, .wc-block-components-button:not(.is-link).outlined:focus, .wc-block-components-button:not(.is-link).outlined:hover {
      background-color: var(--color-accent) !important;
      color: var(--color-primary) !important;
    }

  /* "Proceed to Checkout" button */
    body:not(.woocommerce-block-theme-has-button-styles) .wc-block-components-button:not(.is-link):focus {
      box-shadow: none !important;
    }

/*--------------------------------------------------------------
# ORDER (SUMMARY) PAGE
--------------------------------------------------------------*/
/* --- LAYOUT --- */

  /* Summary block */
  .wc-block-components-sidebar {
    border: none !important;
    border-radius: 16px !important;
    background-color: var(--color-secondary);
    padding: 16px !important;
  }
    /* Item quantity */
    .wc-block-components-order-summary .wc-block-components-order-summary-item__quantity {
      background-color: var(--color-accent) !important;
      color: var(--color-primary) !important;
      border: none !important;
      box-shadow: 0 0 0 2px var(--color-accent) !important;
    }

/* --- BUTTONS --- */

  /* "Apply" button */
  .wc-block-components-totals-coupon__form .wc-block-components-totals-coupon__button  {
    background-color: var(--color-primary);
    color: var(--color-accent);
    transition: background-color 0.3s ease, color 0.3s ease !important;
  }
    .wc-block-components-totals-coupon__form .wc-block-components-totals-coupon__button:hover,
    .wc-block-components-totals-coupon__form .wc-block-components-totals-coupon__button:active,
    .wc-block-components-totals-coupon__form .wc-block-components-totals-coupon__button:focus  {
      background-color: var(--color-accent);
      color: var(--color-primary);
    }

  /* "Place order" button " */
  .wp-block-woocommerce-checkout-actions-block .wc-block-checkout__actions_row .wc-block-components-checkout-place-order-button {
    background-color: var(--color-secondary);
    color: var(--color-accent);
    transition: background-color 0.3s ease, color 0.3s ease;
  }
    .wp-block-woocommerce-checkout-actions-block .wc-block-checkout__actions_row .wc-block-components-checkout-place-order-button:hover, .wp-block-woocommerce-checkout-actions-block .wc-block-checkout__actions_row .wc-block-components-checkout-place-order-button:active,
    .wp-block-woocommerce-checkout-actions-block .wc-block-checkout__actions_row .wc-block-components-checkout-place-order-button:focus  {
      background-color: var(--color-accent);
      color: var(--color-primary);
    }

/*--------------------------------------------------------------
# CHECKOUT PAGE
--------------------------------------------------------------*/
/* --- LAYOUT --- */

  /* Sticky summary */
    .is-large .wc-block-checkout__sidebar.is-sticky {
      top: 58px;
    }
      /* inner */
      .wp-block-woocommerce-checkout-order-summary-block {
        border: none !important;
      }
  
  /* Address card */
  .wc-block-components-address-card {
    border: 1px solid var(--color-secondary) !important;
  }
    /* Remove italic */
    address {
      font-style: normal;
    }

  /* Table container */
  .woocommerce-table.order_details {
    border-collapse: collapse;
    border-top: 1px solid var(--color-secondary);
    border-bottom: 1px solid var(--color-secondary);
  }

  /* Table header */
    /* row styles */
    .woocommerce-table.order_details thead tr {
      display: flex;
      justify-content: space-between;
      padding-top: 8px;
    }
    /* cells */
    .woocommerce-table.order_details thead th {
      flex: 1;
      white-space: nowrap;
    }
      /* Last header cell alignment */
      .woocommerce-table.order_details thead th:last-child {
        flex: 0 0 auto;
        text-align: right;
      }

  /* Table body */
    /* row styles */
    .woocommerce-table.order_details tbody tr {
      display: flex;
      justify-content: space-between;
      padding: 8px;
      border-bottom: 1px solid var(--color-secondary);
    }
    /* cells */
    .woocommerce-table.order_details tbody td {
      flex: 1;
    }
      /* Last body cell alignment */
      .woocommerce-table.order_details tbody td:last-child {
        flex: 0 0 auto;
        text-align: right;
      }

  /* Table footer */
    .woocommerce-table.order_details tfoot {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      padding: 8px 0;
    }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

/*--------------------------------------------------------------
# SHOP PAGE
--------------------------------------------------------------*/
/* --- RESPONSIVE GRID --- */

  /* 3 columns */
  @media (min-width: 1921px) {
    .woocommerce ul.products, .wc-block-grid__products {
      grid-template-columns: repeat(4, 1fr);
    }
  }

  /* 3 columns */
  @media (min-width: 1399px) and (max-width: 1920px) {
    .woocommerce ul.products, .wc-block-grid__products {
      grid-template-columns: repeat(3, 1fr);
    }
  }

  /* 2 columns */
  @media (min-width: 768px) and (max-width: 1399px) {
    .woocommerce ul.products, .wc-block-grid__products {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  /* 1 columns (mobile) */
  @media (max-width: 767px) {
    .woocommerce ul.products, .wc-block-grid__products {
      grid-template-columns: 1fr;
    }
  }

/* --- BUTTONS --- */

  /* Mobile */
  @media screen and (max-width: 768px) {
    /* "Add to cart" button */
    .product-thumbnail-wrapper .hover-add-to-cart .button {
      opacity: 0;
      pointer-events: none;
      transform: translateX(-50%) translateY(20px);
      transition: opacity 0.5s ease 0.5s, transform 0.5s ease 0.5s;
    }
      .product-thumbnail-wrapper .hover-add-to-cart .button.visible {
        opacity: 1;
        pointer-events: auto;
        transform: translateX(-50%) translateY(0);
      }
  }

/*--------------------------------------------------------------
# PRODUCT PAGE
--------------------------------------------------------------*/
/* --- LAYOUT --- */

  /* Mobile */
  @media screen and (max-width: 768px) {
  
    /* Columns layout */
    .custom-product-layout {
      flex-direction: column;
      gap: 8px;
    }
      .custom-product-sidebar,
      .custom-product-images {
        width: 100%;
        flex: 1 1 100%;
        top: 0;
      }

    /* Breadcrumb */
    .woocommerce-breadcrumb {
      padding-bottom: 8px;
    }
  }

/*--------------------------------------------------------------
# CART PAGE
--------------------------------------------------------------*/
/* --- LAYOUT --- */

  /* Mobile */
  @media screen and (max-width: 768px) {
    /* Sticky container */
    .wc-block-components-sidebar {
      background-color: var(--color-main);
      padding: 8px !important;
    }
  }