/* ============================================
   PRODUCT CARD (Reusable Component)
   Premium Rose Gold Design System
   ============================================ */

:root {
  /* Responsive Theme Scaling Extensions */
  --kosmetix-badge-font-size: clamp(8px, 2vw, 11px);
  --kosmetix-info-min-font-size: clamp(11px, 2.5vw, 14px);
  --kosmetix-title-font-size: clamp(13px, 3.5vw, 1rem);
  --kosmetix-btn-size: clamp(44px, 10vw, 48px);
  --kosmetix-icon-size: clamp(18px, 5vw, 22px);
}

.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: var(--wp--custom--radius--lg);
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--wp--custom--shadow--glow-lg);
}

/* ============================================
   SECTION 1: IMAGE
   ============================================ */
.card-image-section {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
  overflow: hidden;
  background: linear-gradient(
    135deg,
    var(--wp--preset--color--blush-light) 0%,
    white 100%
  );
  border-radius: var(--wp--custom--radius--lg) var(--wp--custom--radius--lg) 0 0;
}

.card-image-section a,
.card-image-section img {
  grid-area: 1 / 1 / -1 / -1;
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.card-image-section img {
  margin: 0 !important;
  object-fit: cover !important;
  transition: transform 0.5s ease;
}

.product-card:hover .card-image-section img {
  transform: scale(1.08);
}

/* ============================================
   BADGES - Grid Positioned Top Left
   ============================================ */
.product-badges {
  grid-area: 1 / 1;
  justify-self: start;
  align-self: start;
  margin: 12px;
  display: flex;
  flex-direction: row; /* Horizontal */
  flex-wrap: wrap; /* Wrap to new line */
  gap: clamp(4px, 1vw, 6px);
  z-index: 10;
  pointer-events: none; /* Let clicks pass through gaps */
  width: 100%;
}

/* ============================================
   ACTIONS - Grid Positioned Bottom Right
   ============================================ */
.card-actions {
  grid-area: 1 / 1;
  justify-self: end;
  align-self: end;
  margin: 12px;
  display: flex;
  flex-direction: row;
  gap: clamp(4px, 1vw, 8px);
  z-index: 10;
}

.card-actions .icon-action-btn {
  position: static; /* Reset absolute */
  width: var(--kosmetix-btn-size);
  height: var(--kosmetix-btn-size);
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--wp--preset--color--rose-gold);
  padding: 0;
}

.card-actions .icon-action-btn:hover {
  background: var(--wp--preset--color--blush);
  transform: scale(1.1);
  color: var(--wp--preset--color--rose-gold-dark);
}

.card-actions .icon-action-btn.active {
  color: var(--wp--preset--color--rose-gold-dark);
}

.card-actions .icon-action-btn .material-symbols-outlined {
  font-size: var(--kosmetix-icon-size);
}

.badge {
  position: static !important; /* Override main.css absolute positioning */
  padding: clamp(3px, 1vw, 6px) clamp(6px, 1.5vw, 12px);
  font-size: var(--kosmetix-badge-font-size);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: white;
  border-radius: var(--wp--custom--radius--sm);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(4px);
  margin: 0 !important; /* Reset any inherited margins */
  transform: none !important; /* Reset default hover scales if any */
}

/* Sale = Rose Gold */
.badge-sale {
  background: linear-gradient(
    135deg,
    var(--wp--preset--color--rose-gold) 0%,
    var(--wp--preset--color--rose-gold-dark) 100%
  );
}

/* Hit = Dark Rose Gold */
.badge-hot {
  background: linear-gradient(
    135deg,
    var(--wp--preset--color--rose-gold-dark) 0%,
    var(--wp--preset--color--rose-gold-dark) 100%
  );
}

/* New = Soft Blush with Rose Gold text */
.badge-new {
  background: linear-gradient(
    135deg,
    var(--wp--preset--color--blush) 0%,
    var(--wp--preset--color--rose-gold-light) 100%
  );
  color: var(--wp--preset--color--rose-gold-dark);
}

/* ============================================
   SECTION 2: INFO (Title + Brand + Price)
   ============================================ */
.card-info-section {
  display: flex;
  flex-direction: column;
  padding: var(--wp--preset--spacing--md);
  flex-grow: 1;
  text-align: center;
}

/* Brand Subtitle (ACF) */
.product-brand {
  font-size: var(--kosmetix-info-min-font-size);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--wp--preset--color--rose-gold);
  margin-bottom: 4px;
  font-weight: 500;
}

/* Product Title */
.product-title {
  font-family: var(--wp--preset--font-family--heading);
  font-weight: 500;
  line-height: 1.35;
  margin: 0 0 0.75rem 0;
  font-size: var(--kosmetix-title-font-size);
  min-height: 2.7em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 767px) {
  .product-title {
    font-size: var(--kosmetix-title-font-size);
    min-height: 2.5em;
  }
}

.product-title a {
  text-decoration: none;
  color: var(--wp--preset--color--charcoal);
  transition: color 0.2s ease;
}

.product-title a:hover {
  color: var(--wp--preset--color--rose-gold);
}

/* Price Styling */
.price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--wp--preset--color--rose-gold-dark);
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.price del {
  color: var(--wp--preset--color--slate);
  font-weight: 400;
  font-size: 0.85em;
  text-decoration: line-through;
  opacity: 0.7;
}

.price ins {
  text-decoration: none;
  font-weight: 700;
}

/* Discount Percentage */
.price .discount-percent {
  font-size: var(--kosmetix-info-min-font-size);
  font-weight: 600;
  background: var(--wp--preset--color--blush);
  color: var(--wp--preset--color--rose-gold-dark);
  padding: 2px 6px;
  border-radius: var(--wp--custom--radius--sm);
}

/* ============================================
   SECTION 3: ACTIONS
   ============================================ */
.card-action-section {
  padding: 0 var(--wp--preset--spacing--md) var(--wp--preset--spacing--md);
  margin-top: auto;
}

/* Button Styles */
.card-action-section .button,
.card-action-section .btn-add-to-cart,
.add_to_cart_button {
  width: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 12px 20px;
  background: linear-gradient(
    135deg,
    var(--wp--preset--color--rose-gold) 0%,
    var(--wp--preset--color--rose-gold-dark) 100%
  );
  color: white !important;
  text-decoration: none;
  border-radius: var(--wp--custom--radius--sm);
  font-size: 0.8rem !important;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: none;
  transition: all 0.3s ease;
  box-shadow: var(--wp--custom--shadow--glow);
}

.card-action-section .button:hover,
.add_to_cart_button:hover {
  background: linear-gradient(
    135deg,
    var(--wp--preset--color--rose-gold-dark) 0%,
    var(--wp--preset--color--rose-gold-dark) 100%
  );
  transform: translateY(-2px);
  box-shadow: var(--wp--custom--shadow--glow);
}

.card-action-section .button:active {
  transform: translateY(0);
}

/* Loading State */
.card-action-section .button.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* Mobile Icon Button Transformation */
@media (max-width: 767px) {
  .card-action-section .button,
  .card-action-section .btn-add-to-cart,
  .add_to_cart_button {
    padding: 0 !important;
    font-size: 0 !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    margin: 0 auto;
  }

  .card-action-section .button::before,
  .add_to_cart_button::before {
    content: '\e8cc';
    font-family: 'Material Symbols Outlined';
    font-size: 22px !important;
    line-height: 1;
    color: white;
  }

  .card-action-section .button.loading::before {
    content: '\e86a';
    animation: spin 1s linear infinite;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================
   WISHLIST BUTTON (Optional)
   ============================================ */
.product-wishlist {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.product-wishlist:hover {
  background: var(--wp--preset--color--blush);
  transform: scale(1.1);
}

.product-wishlist .material-symbols-outlined {
  font-size: 20px;
  color: var(--wp--preset--color--rose-gold);
}

.product-wishlist.active .material-symbols-outlined {
  font-variation-settings: 'FILL' 1;
  color: var(--wp--preset--color--rose-gold-dark);
}

/* ============================================
   INFINITE LOADER
   ============================================ */
.infinite-loader {
  display: block;
  width: 100%;
  text-align: center;
  padding: 30px 0;
  clear: both;
  min-height: 20px;
  opacity: 0;
  transition: opacity 0.3s;
}

.infinite-loader.visible {
  opacity: 1;
}

.infinite-loader .spinner {
  display: inline-block;
  width: 44px;
  height: 44px;
  border: 3px solid var(--wp--preset--color--blush);
  border-top-color: var(--wp--preset--color--rose-gold);
  border-radius: 50%;
  animation: infinite-spin 0.7s linear infinite;
}

@keyframes infinite-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================
   TOOLTIPS (Product Card)
   ============================================ */
/* Tooltips are now handled by Tippy.js */
.card-actions .icon-action-btn {
  /* overflow handled by Tippy (appended to body) */
}

/* Old CSS Tooltips - Removed for Tippy.js integration */
/*
.card-actions .icon-action-btn[data-tooltip]::before { ... }
*/
