/* ============================================
   Adera Product Card — Global Component
   Loaded on all pages: homepage, shop, archive, single
   ============================================ */

/* Grid wrapper used on homepage */
.adera-products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: 25px;
  row-gap: 30px;
  overflow: visible;
}

/* WooCommerce shop/archive grid reset */
.woocommerce ul.products,
.woocommerce-page ul.products {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  column-gap: 25px !important;
  row-gap: 30px !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  float: none !important;
  width: 100% !important;
}

.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  overflow: visible !important;
  position: relative;
  z-index: 0;
  display: flex !important;
  flex-direction: column !important;
  min-width: 0;
}

/* ---- Outer wrapper (card + button together) ---- */
.adera-product-card-outer {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

/* ---- Card ---- */
.adera-product-card {
  background: #FFFFFF;
  border: 1px solid rgba(71, 0, 115, 0.18);
  border-radius: 14px;
  overflow: visible;
  position: relative;
  z-index: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
  box-sizing: border-box;
  padding: 11px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
}

.adera-product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(71, 0, 115, 0.12);
}

/* ---- Button row (full-width gradient CTA, inside card) ---- */
.adera-product-btn-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 14px;
  background: var(--brand-gradient);
  border: none;
  border-radius: 10px;
  padding: 0;
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  transition: background 0.2s ease, filter 0.2s ease;
  cursor: pointer;
  overflow: hidden;
}

.adera-product-btn-row:hover {
  background: var(--brand-gradient-hover);
}

/* ---- Category Badges ---- */
.adera-product-badges {
  position: absolute;
  top: 20px;
  left: 20px;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4px;
  z-index: 2;
}

.adera-product-badge {
  background: #670EAA14;
  color: #670EAA;
  font-family: 'Poppins', sans-serif;
  font-size: 9px;
  font-weight: 500;
  line-height: 100%;
  letter-spacing: 0.5px;
  padding: 5px 10px;
  border-radius: 10px;
  white-space: nowrap;
  text-transform: capitalize;
  vertical-align: middle;
  display: inline-flex;
  align-items: center;
}

.adera-out-of-stock-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #670EAA;
  color: #FFFFFF;
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-align: center;
  padding: 6px 0;
  border-radius: 0 0 10px 10px;
  pointer-events: none;
}

/* ---- Image Area ---- */
.adera-product-img-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  aspect-ratio: 1 / 1;          /* always square (1:1) */
  background: #f4f4f4;          /* fills letterbox so every card is uniform */
}

.adera-product-sub {
  display: none;
}

.adera-product-img {
  width: 100%;
  height: 100%;
  object-fit: contain;          /* show the full product inside the 1:1 box */
  display: block;
  transition: transform 0.25s ease;
}

.adera-product-card:hover .adera-product-img {
  transform: scale(1.06);
}

/* WooCommerce default thumbnail inside our wrapper */
.adera-product-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;          /* show the full product inside the 1:1 box */
  display: block;
  transition: transform 0.25s ease;
}

.adera-product-card:hover .adera-product-img-wrapper img {
  transform: scale(1.06);
}

/* ---- Info Area ---- */
.adera-product-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  margin-top: 25px;
  min-width: 0;
}

.adera-product-title,
.woocommerce .adera-product-title,
.woocommerce-page .adera-product-title {
  font-family: 'Poppins', sans-serif !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  color: #494949 !important;
  margin: 0 0 11px !important;
  line-height: 100% !important;
  letter-spacing: 0 !important;
  text-decoration: none !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.adera-product-sub {
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: rgba(0, 0, 0, 0.45);
  margin: 0 0 12px;
}

.adera-product-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.adera-product-price {
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #670EAA;
  line-height: 100%;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.adera-product-price ins {
  order: 1;
  text-decoration: none;
  font-weight: 500;
}

.adera-product-price del {
  order: 2;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 400;
  font-style: normal;
  color: #9C9C9D;
  text-decoration: line-through;
  line-height: 25px;
  letter-spacing: 0;
  text-align: center;
}

/* WooCommerce price override inside our card — strengthened for shop page */
.adera-product-card .price,
.woocommerce .adera-product-card .price,
.woocommerce-page .adera-product-card .price {
  font-family: 'Poppins', sans-serif !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #670EAA !important;
  line-height: 100% !important;
  letter-spacing: -0.5px !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-wrap: wrap !important;
}

.adera-product-card .price ins,
.woocommerce .adera-product-card .price ins,
.woocommerce-page .adera-product-card .price ins {
  text-decoration: none !important;
  font-weight: 500 !important;
  order: 1 !important;
  color: #670EAA !important;
}

.adera-product-card .price del,
.woocommerce .adera-product-card .price del,
.woocommerce-page .adera-product-card .price del {
  order: 2 !important;
  font-family: 'Poppins', sans-serif !important;
  font-size: 10px !important;
  font-weight: 400 !important;
  font-style: normal !important;
  color: #9C9C9D !important;
  text-decoration: line-through !important;
  line-height: 25px !important;
  letter-spacing: 0 !important;
  text-align: center !important;
}

/* Regular price (no sale) and ins price — red */
.adera-product-card .price > .woocommerce-Price-amount,
.adera-product-card .price ins .woocommerce-Price-amount,
.woocommerce .adera-product-card .price > .woocommerce-Price-amount,
.woocommerce .adera-product-card .price ins .woocommerce-Price-amount,
.woocommerce-page .adera-product-card .price > .woocommerce-Price-amount,
.woocommerce-page .adera-product-card .price ins .woocommerce-Price-amount {
  color: #670EAA !important;
  font-family: 'Poppins', sans-serif !important;
  font-size: 14px !important;
  font-weight: 500 !important;
}

/* Del (crossed) price — muted gray */
.adera-product-card .price del .woocommerce-Price-amount,
.woocommerce .adera-product-card .price del .woocommerce-Price-amount,
.woocommerce-page .adera-product-card .price del .woocommerce-Price-amount {
  color: #9C9C9D !important;
  font-family: 'Poppins', sans-serif !important;
  font-size: 10px !important;
  font-weight: 400 !important;
}

.adera-product-oldprice {
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  font-weight: 400;
  color: #9C9C9D;
  text-decoration: line-through;
  line-height: 25px;
  letter-spacing: 0;
}

/* ---- Add to Cart link (transparent — visual styling is on .adera-product-btn-row) ---- */
.adera-add-to-cart,
.adera-product-card .button,
.adera-product-card .add_to_cart_button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: transparent;
  color: #FFFFFF;
  border: none;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-decoration: none;
  cursor: pointer;
  padding: 10px 16px;
  position: relative;
  box-sizing: border-box;
}

.adera-product-btn-row:hover .adera-add-to-cart,
.adera-product-btn-row:hover .button,
.adera-product-btn-row:hover .add_to_cart_button {
  color: #FFFFFF;
}

/* ---- Hide WooCommerce "View cart" link ---- */
a.added_to_cart {
  display: none !important;
}

/* ---- Hide WLR loyalty rewards message on product cards ---- */
.wlr-product-message {
  display: none !important;
}

/* ---- Spinner keyframes (transform only rotates — no translate conflict) ---- */
@keyframes adera-cart-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ---- Loading: spinner appears to the right of the text ---- */
.adera-add-to-cart.loading {
  pointer-events: none;
}

.adera-add-to-cart.loading::after {
  content: '';
  position: absolute;
  right: 10px;
  top: calc(50% - 7px);
  width: 14px;
  height: 14px;
  border: 2px solid rgba(71, 0, 115, 0.2);
  border-top-color: #494949;
  border-radius: 50%;
  box-sizing: border-box;
  animation: adera-cart-spin 0.65s linear infinite;
}

.adera-product-btn-row:hover .adera-add-to-cart.loading::after {
  border-color: rgba(255, 255, 255, 0.25);
  border-top-color: #FFFFFF;
}

/* ---- Added: tick mark appears to the right of the text ---- */
.adera-add-to-cart.added {
  pointer-events: none;
}

.adera-add-to-cart.added::after {
  content: '';
  position: absolute;
  right: 12px;
  top: calc(50% - 7px);
  width: 5px;
  height: 10px;
  border-right: 2px solid #494949;
  border-bottom: 2px solid #494949;
  box-sizing: border-box;
  /* Only rotation — no translate conflict */
  transform: rotate(45deg);
}

.adera-product-btn-row:hover .adera-add-to-cart.added::after {
  border-color: #FFFFFF;
}

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .adera-products-grid {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 14px;
    row-gap: 18px;
  }

  .woocommerce ul.products,
  .woocommerce-page ul.products {
    grid-template-columns: repeat(2, 1fr) !important;
    column-gap: 20px !important;
    row-gap: 20px !important;
  }
}

@media (max-width: 600px) {
  .adera-products-grid {
    grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: 14px;
  }

  .woocommerce ul.products,
  .woocommerce-page ul.products {
    grid-template-columns: 1fr !important;
    column-gap: 20px !important;
    row-gap: 20px !important;
  }
}
