/*!
Theme Name: Atr Perfume
Theme URI: https://atr.eg
Author: Atr Team
Description: High-converting Arabic RTL perfume e-commerce theme for the Egyptian market. Built for WooCommerce with WPML support, COD badge, WhatsApp ordering, countdown timers, and bundle deals.
Version: 1.0.2
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 8.0
WC requires at least: 8.0
WC tested up to: 9.3
Text Domain: atr-perfume
Domain Path: /languages
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Tags: rtl-language, arabic, woocommerce, e-commerce, full-width-template, custom-colors, custom-menu
*/

/* WooCommerce RTL notices: coupon + checkout errors */
/* WooCommerce RTL notices: coupon + checkout errors + empty cart */
ul.products[class*="columns-"] li.product {
	width: 100% !important;
}
.woocommerce-form-coupon-toggle .woocommerce-info,
.woocommerce-NoticeGroup-checkout .woocommerce-error,
.cart-empty.woocommerce-info {
  position: relative !important;
  display: block !important;
  direction: rtl !important;
  text-align: right !important;
  padding-right: 3.5em !important;
  padding-left: 1.5em !important;
}

.woocommerce-form-coupon-toggle .woocommerce-info::before,
.woocommerce-NoticeGroup-checkout .woocommerce-error::before,
.cart-empty.woocommerce-info::before {
  position: absolute !important;
  right: 1.2em !important;
  left: auto !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
}

.woocommerce-form-coupon-toggle .woocommerce-info::before,
.cart-empty.woocommerce-info::before {
  font-family: WooCommerce !important;
  content: "\e028" !important;
}

.woocommerce-NoticeGroup-checkout .woocommerce-error li {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  text-align: right !important;
}

.woocommerce-NoticeGroup-checkout .woocommerce-error li a {
  display: inline !important;
  text-align: right !important;
}
/* --------------------Icons----------------------------- */

.atr-icon-btn .badge {
	font-size: 15px !important;
    top: -7px !important;
    width: 17px !important;
    height: 20px !important;
    align-items: normal !important;
}

/* --------------------Icons----------------------------- */

.wishlist-btn, .icon-circle{
	display: none !important;
}
/* -------------------------------------------------- */
#add_payment_method #payment,
.woocommerce-cart #payment,
.woocommerce-checkout #payment {
    background: transparent !important;
}
/* -------------------------------------------------- */
.atr-gallery-main {
  padding: 0 !important;
}

.atr-gallery-img-wrap {
  position: absolute !important;
  inset: 0 !important;
  transform: none !important;
  width: 100% !important;
  height: 100% !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  padding: 0 !important;
}

.atr-gallery-img-wrap img,
.atr-gallery-product-img {
  width: auto !important;
  height: auto !important;

  max-width: 100% !important;
  max-height: 100% !important;

  object-fit: contain !important;
  mix-blend-mode: multiply !important;
}
/* ---------------------------------- */
.wc-proceed-to-checkout .checkout-button {
    display: none !important;
}

/* Hero timer + valU offer row.
   Kept in the final stylesheet intentionally to win the theme cascade. */
.atr-hero-offer-row {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 0 20px !important;
}

.atr-hero-offer-row > * {
  box-sizing: border-box !important;
  min-width: 0 !important;
}

.atr-hero-offer-row .atr-countdown-wrap {
  display: inline-flex !important;
  flex: 1 1 260px !important;
  max-width: 100% !important;
  margin: 0 !important;
}

.atr-hero-valu-promo {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 1 1 220px !important;
  gap: 8px !important;
  max-width: 100% !important;
  min-height: 44px !important;
  padding: 8px 12px !important;
  border: 1px solid rgba(212, 184, 122, .34) !important;
  border-radius: 12px !important;
  background: rgba(212, 184, 122, .12) !important;
  color: var(--cream-50) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.5 !important;
  text-align: center !important;
}

.atr-hero-valu-brand {
  flex-shrink: 0 !important;
  padding: 2px 8px !important;
  border-radius: 999px !important;
  background: var(--gold-500) !important;
  color: var(--emerald-900) !important;
  font-size: 12px !important;
  font-weight: 900 !important;
}

.atr-hero-valu-promo span {
  min-width: 0 !important;
  overflow-wrap: anywhere !important;
}

.atr-hero-offer-row[hidden],
.atr-hero-offer-row .atr-countdown-wrap[hidden] {
  display: none !important;
}

/* ==================================================
   Homepage WooCommerce category cards
   Mobile: 1 column
   Tablet: 2 columns
   Desktop: 4 columns
   ================================================== */

.atr-category-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 16px !important;
  width: 100% !important;
}

/* Card */
.atr-category-card {
  position: relative !important;
  isolation: isolate !important;
  display: block !important;
  min-width: 0 !important;
  min-height: 0 !important;
  aspect-ratio: 4 / 3 !important;
  overflow: hidden !important;
  padding: 0 !important;

  border: none !important;
  border-radius: 16px !important;

  background-color: var(--emerald-900) !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-size: cover !important;

  box-shadow: 0 10px 24px rgba(10, 24, 19, 0.08) !important;
  transform: translateZ(0) !important;

  transition:
    transform 0.32s ease,
    box-shadow 0.32s ease,
    border-color 0.32s ease !important;
}

.atr-category-card-image {
  position: absolute !important;
  z-index: -1 !important;
  inset: 0 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover !important;
  object-position: center !important;
}
/* Light bottom gradient only for text readability */
.atr-category-card::before {
  content: "" !important;
  position: absolute !important;
  z-index: 0 !important;
  inset: 0 !important;
  pointer-events: none !important;

  background:
    linear-gradient(
      180deg,
      rgba(5, 16, 13, 0) 30%,
      rgba(5, 16, 13, 0.06) 55%,
      rgba(5, 16, 13, 0.48) 100%
    ) !important;

  transition: opacity 0.32s ease !important;
}

/* Remove the previous inner double border */
.atr-category-card::after {
  content: none !important;
  display: none !important;
}

/* Full-card clickable link */
.atr-category-card-link {
  position: absolute !important;
  z-index: 1 !important;
  inset: 0 !important;

  display: flex !important;
  align-items: flex-end !important;
  justify-content: flex-start !important;

  padding: 22px !important;
  border-radius: inherit !important;

  color: #fff !important;
  text-align: right !important;
  text-decoration: none !important;
}

/* Text at bottom-right in RTL */
.atr-category-card-content {
  position: relative !important;
  z-index: 1 !important;

  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;

  gap: 6px !important;
  min-width: 0 !important;
  width: 100% !important;

  color: #fff !important;
  direction: rtl !important;
  text-align: right !important;

  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45) !important;
}

.atr-category-card-title {
  margin: 0 !important;
  color: #fff !important;

  font-size: clamp(25px, 7vw, 32px) !important;
  font-weight: 700 !important;
  line-height: clamp(1, calc(var(--line-height-heading) + .05), 1.6) !important;
}

.atr-category-card-count {
  margin: 0 !important;
  color: rgba(255, 255, 255, 0.86) !important;

  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.5 !important;
}

/* Restrained keyboard focus without touch-device hover movement. */
.atr-category-card:focus-within {
  z-index: 2 !important;
  box-shadow: 0 16px 32px rgba(10, 24, 19, 0.14) !important;
}

.atr-category-card:focus-within::before {
  opacity: 0.9 !important;
}

@media (hover: hover) and (pointer: fine) {
  .atr-category-card:hover {
    z-index: 2 !important;
    box-shadow: 0 16px 32px rgba(10, 24, 19, 0.14) !important;
    transform: translateY(-4px) scale(1.02) !important;
  }

  .atr-category-card:hover::before { opacity: 0.9 !important; }
}

/* Keyboard accessibility */
.atr-category-card-link:focus-visible {
  outline: 3px solid var(--gold-400) !important;
  outline-offset: -6px !important;
}

@media (max-width: 767px) {
  .atr-product-grid > .atr-product-card {
    width: 100%;
    max-width: 360px;
    margin-inline: auto;
  }

  .atr-section[data-atr-bestsellers],
  .atr-category-section {
    padding-block: 36px;
  }

  .atr-section[data-atr-bestsellers] > .atr-section-head,
  .atr-category-section > .atr-section-head {
    margin-bottom: 18px;
  }

  .atr-category-card {
    height: clamp(200px, 60vw, 340px) !important;
    aspect-ratio: auto !important;
  }

  .atr-category-grid > .atr-category-card {
    width: 100% !important;
    max-width: 380px !important;
    margin-inline: auto !important;
  }

  .atr-category-card-link {
    padding: 18px !important;
  }

  .atr-category-card-title {
    font-size: clamp(22px, 6.5vw, 28px) !important;
  }
}

/* Tablet: 2 cards */
@media (min-width: 768px) and (max-width: 1024px) {
  .atr-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 18px !important;
  }

  .atr-category-grid--count-1 {
    max-width: calc(50% - 9px) !important;
    margin-inline: auto !important;
  }

  .atr-category-grid--count-3 > .atr-category-card:last-child {
    grid-column: 1 / -1 !important;
    width: calc(50% - 9px) !important;
    justify-self: center !important;
  }

  .atr-category-card {
    min-height: 0 !important;
    border-radius: 16px !important;
  }

  .atr-category-card-link {
    padding: 26px !important;
  }

  .atr-category-card-title {
    font-size: 32px !important;
  }

  .atr-category-card-count {
    font-size: 13px !important;
  }
}

/* Desktop: 4 cards */
@media (min-width: 1025px) {
  .atr-category-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 18px !important;
  }

  .atr-category-grid--count-1 {
    grid-template-columns: minmax(0, 1fr) !important;
    max-width: calc(25% - 13.5px) !important;
    margin-inline: auto !important;
  }

  .atr-category-grid--count-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    max-width: calc(50% - 9px) !important;
    margin-inline: auto !important;
  }

  .atr-category-grid--count-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    max-width: calc(75% - 4.5px) !important;
    margin-inline: auto !important;
  }

  .atr-category-card {
    min-height: 0 !important;
    border-radius: 16px !important;
  }

  .atr-category-card-link {
    padding: 26px !important;
  }

  .atr-category-card-title {
    font-size: 32px !important;
  }

  .atr-category-card-count {
    font-size: 13px !important;
  }
}

.atr-pay-opt[data-payment="cod"] .atr-pay-icon {
  display: none;
}
