/* ===========================
   CSS VARIABLES - ESP PRODUCT CARD
=========================== */
:root {
  --pc-primary: #37383F;
  --pc-secondary: var(--ast-global-color-0, #9C0002);
  --pc-accent:    var(--ast-global-color-0, #9C0002);
  --pc-hover-bg: #DFE9F0;
  --pc-card-bg: #fff;
  --pc-content-bg: #f8f9fa;
  --pc-shadow: rgba(0, 0, 0, 0.08);
  --pc-text-light: #FFF;
  --pc-text-light2: #8B93B2;
  --pc-text-dark: #1F2937;
  
  --pc-font-title: clamp(14px, 2.4vw, 22px);
  --pc-font-tag: clamp(12px, 1.5vw, 14px);
  --pc-font-button: 14px;
  
  --pc-padding: 10px;
  --pc-gap: 8px;
}

/* ===========================
   MAIN CARD CONTAINER
=========================== */
.animate-on-hover {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  box-shadow: 0 0 0px 1px #e9ecef;
  background-color: var(--pc-card-bg);
  border: 1px solid #e2e8f0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none !important;
  cursor: pointer;
  position: relative;
  margin: 0 !important;
  padding: 0 !important;
  height: 100%;
  min-height: 100%;
  justify-content: space-between;
  align-items: stretch;
  overflow: hidden;
  direction: ltr;
  text-align: left;
}

html[dir="rtl"] .animate-on-hover {
  direction: rtl;
  text-align: right;
}

.animate-on-hover:hover,
.animate-on-hover.hover-active {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  background-color: #F9F9FA;
  border-color: transparent;
  transform: translateY(-3px);
  z-index: 2;
}

/* ===========================
  FEATURED IMAGE
=========================== */
.animate-on-hover .featured-image {
  aspect-ratio: 1/1;
  width: clamp(160px, 25vw, 300px);
  height: auto;
  object-fit: contain;
  object-position: center;
  display: block;
  background-color: transparent;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 0 auto;
  padding: 24px;
  flex-shrink: 0;
  align-self: center;
}

.animate-on-hover:hover .featured-image {
  transform: scale(1.05);
}

/* ===========================
   CONTENT CONTAINER
=========================== */
.animate-on-hover .content-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
  flex-grow: 1;
  align-items: flex-start;
  background: linear-gradient(180deg, transparent 0%, rgba(248, 249, 250, 0.3) 25%, #f8f9fa 50%, #f8f9fa 100%);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-top: none;
}

html[dir="rtl"] .content-container {
  text-align: right;
}

.animate-on-hover:hover .content-container,
.animate-on-hover.hover-active .content-container {
  background: linear-gradient(145deg, #DFE9F0 0%, #E3ECF3 25%, #EBF2F7 50%, #F0F5F9 75%, #D5E1EB 100%);
}

/* ===========================
   TAG FIELD
=========================== */
.animate-on-hover .tag-field {
  padding: 4px 12px !important;
  margin: 10px var(--pc-padding) 12px var(--pc-padding);
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: var(--pc-font-tag);
  color: var(--pc-text-dark);
  background-color: #f1f5f9;
  border-radius: 4px;
  transition: all 0.3s ease;
  text-transform: uppercase;
  width: fit-content;
  box-sizing: border-box;
  letter-spacing: 0.5px;
}

html[dir="rtl"] .animate-on-hover .tag-field {
  text-align: right;
  font-family: 'Shabnam', sans-serif;
}

.animate-on-hover:hover .tag-field {
  color: #202020;
}

/* ===========================
   TITLE FIELD
=========================== */
.animate-on-hover .title-field {
  font-family: 'Noto Serif', serif !important;
  overflow-wrap: break-word;
  padding: 0 var(--pc-padding) var(--pc-gap) var(--pc-padding) !important;
  font-size: var(--pc-font-title) !important;
  font-weight: 600;
  line-height: 1.4 !important;
  margin-bottom: var(--pc-gap) !important;
  color: var(--pc-text-dark);
  text-transform: capitalize;
  width: 100%;
  transition: color 0.3s ease;
  
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  height: 2.8em;
  min-height: 2.8em;
}

html[dir="rtl"] .animate-on-hover .title-field {
  text-align: right;
  font-family: 'Shabnam', sans-serif !important;
}

.animate-on-hover:hover .title-field {
  color: var(--pc-accent);
}

/* ===========================
   LISTING GRID
=========================== */
.animate-on-hover .listing-grid {
  padding: 0 var(--pc-padding);
  margin: 0 0 var(--pc-gap) 15px !important;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.animate-on-hover .listing-item {
  font-family: 'Rajdhani', 'Shabnam', sans-serif !important;
  font-size: clamp(0.8rem, 1.5vw + 0.2rem, 0.9rem);
  color: var(--pc-text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

html[dir="rtl"] .animate-on-hover .listing-grid {
  text-align: right;
  direction: rtl;
}

/* ===========================
   PLACE HOLDER
=========================== */
.animate-on-hover .place-holder {
  flex-grow: 1; 
  width: 100%;
}

/* ===========================
   ANIMATED BUTTON
=========================== */
.animate-on-hover .animated-text {
  font-family: "Rajdhani", sans-serif;
  font-size: var(--pc-font-button);
  line-height: 1.4;
  color: #202020 !important;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: var(--pc-padding);
  padding: 5px 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 5;
  background: transparent;
  border: 1px solid transparent;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  overflow: hidden;
}

html[dir="rtl"] .animate-on-hover .animated-text {
  font-family: "Shabnam", sans-serif;
  letter-spacing: 0;
}

.animate-on-hover .animated-text::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background-color: var(--pc-accent);
  transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
}

.animate-on-hover:hover .animated-text::before {
  height: 100%;
}

.animate-on-hover:hover .animated-text {
  color: #fff !important;
  padding: 5px 10px;
  margin: var(--pc-padding) 0;
  border-color: transparent;
}

html[dir="ltr"] .animate-on-hover:hover .animated-text {
  transform: translateX(var(--pc-padding));
}

html[dir="rtl"] .animate-on-hover:hover .animated-text {
  transform: translateX(calc(var(--pc-padding) * -1));
}

/* ===========================
   RESPONSIVE DESIGN
=========================== */
@media (max-width: 767px) {
  :root {
    --pc-padding: 12px;
    --pc-gap: 10px;
  }
  .animate-on-hover .featured-image {
    width: clamp(200px, 60vw, 300px);
    padding: 10px;
  }
  .animate-on-hover .title-field {
    font-size: clamp(16px, 4vw, 18px) !important;
  }
  .animate-on-hover .tag-field {
    font-size: clamp(13px, 3vw, 15px);
  }
  .animate-on-hover .animated-text {
    font-size: 13px;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .animate-on-hover .featured-image {
    width: clamp(150px, 35vw, 240px);
  }
}

/* ===========================
   ACCESSIBILITY
=========================== */
@media (prefers-reduced-motion: reduce) {
  .animate-on-hover,
  .animated-text,
  .animated-text::before,
  .animated-text::after,
  .featured-image,
  .tag-field,
  .title-field,
  .content-container {
    transition-duration: 0.01ms !important;
  }

  .animate-on-hover:hover .featured-image {
    transform: none !important;
  }
}

.animate-on-hover:focus {
  outline: 1px solid var(--pc-accent);
  outline-offset: 1px;
}

/* ===========================
   TOUCH DEVICES (NO HOVER)
=========================== */
@media (hover: none) {
  .animate-on-hover .animated-text {
    background-color: #DFE9F0;
    color: var(--pc-accent) !important;
    padding: 6px 12px !important;
    border-radius: 4px;
    border: none !important;
  }
  .animate-on-hover .animated-text::before {
    display: none !important;
  }
  
  /* Disable hover transforms that cause double-tap on iOS */
  .animate-on-hover:hover {
    transform: none !important;
  }
  .animate-on-hover:hover .animated-text {
    transform: none !important;
    padding: 6px 12px !important;
  }
  .animate-on-hover:hover .featured-image {
    transform: none !important;
  }
  
  /* Simple click animation */
  .animate-on-hover:active {
    transform: scale(0.98) !important;
    transition: transform 0.1s !important;
  }
}
