/* ================================================
   AMMORIA — Product Card (content-product override)
   Glassmorphism + brand colors
   ================================================ */

/* ── Card reset ── */
.ap-card {
  padding: 0 !important;
  margin-bottom: 30px;
  border: none !important;
  background: #fff8f7!important;
}

.ap-card .content-product,
.ap-card .product-image-wrapper,
.ap-card .product-details,
.ap-card .footer-product,
.ap-card .product-mask,
.ap-card .product-excerpt,
.ap-card .sale-wrapper,
.ap-card .quick-buttons,
.ap-card .swiper-entry,
.ap-card .swiper-container {
  /* Nuke XStore's inner markup styles */
}

.ap-card .show-quickly {
  display: none !important;
}

/* ── Inner card ── */
.ap-card__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 20px;
  overflow: hidden;
  transition:
    transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.ap-card__inner:hover {
  transform: translateY(-4px);
}

/* ── Image area ── */
.ap-card__image-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: #faf5f5;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
}

.ap-card__image-link {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
}

.ap-card__image-link img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.ap-card__inner:hover .ap-card__image-link img {
  transform: scale(1.05);
}

/* Sale flash — pill badge top-left */
.ap-card__inner .onsale {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  background: #d70d18;
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 100px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: 0 2px 10px rgba(215, 13, 24, 0.35);
  line-height: 1.3;
}

/* ── Badges (our custom ones from inc/badges.php) ── */
.ap-card__image-wrap .ammoria-badge,
.ap-card__image-wrap .garantia-badge {
  position: absolute;
  z-index: 3;
}

.ap-card__image-wrap .ammoria-badge {
  bottom: 10px;
  left: 10px;
}

.ap-card__image-wrap .ammoria-badge img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  object-fit: contain;
  transition: transform 0.2s;
}

.ap-card__image-wrap .ammoria-badge img:hover {
  transform: scale(1.1);
}

.ap-card__image-wrap .ammoria-badge--remote {
  left: 60px;
}

.ap-card__image-wrap .garantia-badge {
  bottom: 10px;
  right: 10px;
}

.ap-card__image-wrap .garantia-badge img {
  width: 44px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* ── Stock pill badge ── */
.ap-stock {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 100px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  line-height: 1.4;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ap-stock--in {
  background: #eaf7e0;
  color: #3a6b1e;
  border: 1px solid #b8dc96;
}

.ap-stock--out {
  background: #fde8ea;
  color: #a01010;
  border: 1px solid #f0b8bb;
}

/* ── Body ── */
.ap-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 18px 18px;
  gap: 8px;
  text-align: center;
  background: #fff8f7!important;
}

/* ── Title ── */
.ap-card__title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
}

.ap-card__title a {
  color: #222;
  text-decoration: none;
  transition: color 0.2s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ap-card__title a:hover {
  color: #731d20;
}

/* Keyword highlights (our highlight-keyword class) */
.ap-card__title .highlight-keyword {
  /* Preserved from inc/general.php inline styles */
}

/* ── Price ── */
.woocommerce .ap-card .price,
.ap-card .price {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #731d20;
  line-height: 1.3;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
}

.woocommerce .ap-card .price del,
.ap-card .price del {
  font-size: 0.78rem;
  font-weight: 400;
  color: #a5a5a5;
  margin-right: 4px;
}

.woocommerce .ap-card .price ins,
.ap-card .price ins {
  text-decoration: none;
  background: none;
  font-weight: 700;
  color: #731d20;
}

.woocommerce .ap-card .price small,
.ap-card .price small {
  font-size: 0.7em;
  font-weight: 400;
  color: #888;
}

/* ── Star rating ── */
.ap-card .star-rating {
  margin: 0 auto;
  font-size: 0.72em;
}

/* ── Variable swatches (colors) ── */
.ap-card__swatches {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.ap-card__swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
}

.ap-card__swatch[style=""] {
  background-color: #ddd;
}

.ap-card__swatch-more {
  font-size: 0.68rem;
  font-weight: 600;
  color: #888;
  line-height: 18px;
  flex-shrink: 0;
}

/* ── Variable sizes chips ── */
.ap-card__sizes {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.ap-card__size-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 30px;
  padding: 0 10px;
  border-radius: 100px;
  border: 1.5px solid rgba(115, 29, 32, 0.18);
  background: #fff;
  color: #731d20;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1;
  transition: all 0.2s;
}

.ap-card__size-chip:hover {
  background: #731d20;
  color: #fff;
  border-color: #731d20;
}

/* ── Quantity selector ── */
.ap-card__qty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-top: 2px;
}

.ap-card__qty-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(115, 29, 32, 0.2);
  background: #fff;
  color: #731d20;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  padding: 0;
  line-height: 1;
  font-family: inherit;
}

.ap-card__qty-btn:first-child {
  border-radius: 6px 0 0 6px;
}

.ap-card__qty-btn:last-child {
  border-radius: 0 6px 6px 0;
}

.ap-card__qty-btn:hover {
  background: rgba(115, 29, 32, 0.06);
}

.ap-card__qty-input {
  width: 32px !important;
    height: 26px !important;
    text-align: center !important;
    border: 1px solid rgba(115, 29, 32, 0.2) !important;
    border-left: none;
    border-right: none;
    font-size: 0.78rem !important;
    font-weight: 600;
    color: #731d20 !important;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #fff;
    padding: 0 !important;
  -moz-appearance: textfield;
}

.ap-card__qty-input::-webkit-inner-spin-button,
.ap-card__qty-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ── Add to cart button ── */
.ap-card__actions {
  margin-top: auto;
  padding-top: 4px;
}

.ap-card__actions .button,
.ap-card__actions .add_to_cart_button,
.ap-card__actions .product_type_simple,
.ap-card__actions .product_type_variable,
.ap-card__actions .ajax_add_to_cart {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px 20px !important;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-size: 0.84rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em;
  text-transform: none !important;
  line-height: 1.3 !important;
  height: auto !important;
  min-height: 40px;
  border: 1px solid #731d2029 !important;
  border-radius: 50px !important;
  background: #ffe9ed !important;
  color: #731d20 !important;
  box-shadow: 0 3px 10px rgba(115, 29, 32, 0.08);
  transition: all 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);
  cursor: pointer;
  text-align: center;
}

.ap-card__actions .button:hover,
.ap-card__actions .add_to_cart_button:hover,
.ap-card__actions .product_type_simple:hover,
.ap-card__actions .product_type_variable:hover,
.ap-card__actions .ajax_add_to_cart:hover {
  background: #731d20 !important;
  color: #fff !important;
  box-shadow: 0 5px 16px rgba(115, 29, 32, 0.25);
  transform: translateY(-1px);
}

.ap-card__actions .button.loading::before,
.ap-card__actions .add_to_cart_button.loading::before {
  /* Keep WC spinner */
}

.ap-card__actions .button.added {
  background: #6dab3c !important;
  border-color: #6dab3c !important;
}

.ap-card__actions .added_to_cart {
  display: none;
}

/* ── Out of stock / disabled button ── */
.ap-card__actions .button.disabled,
.ap-card__actions .button[disabled],
.ap-card__actions .add_to_cart_button.disabled,
.ap-card__actions .add_to_cart_button[disabled] {
  background: #e0e0e0 !important;
  border-color: #ccc !important;
  color: #999 !important;
  box-shadow: none;
  cursor: not-allowed;
}

.ap-card__actions .button.disabled:hover,
.ap-card__actions .add_to_cart_button.disabled:hover {
  transform: none;
  box-shadow: none;
}

.ap-card .quantity {
  display: none;
}

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

@media (max-width: 768px) {
  .ap-card {
    margin-bottom: 20px;
  }

  .ap-card__inner {
    border-radius: 16px;
  }

  .ap-card__body {
    padding: 12px 14px 14px;
    gap: 6px;
  }

  .ap-card__title {
    font-size: 0.82rem;
  }

  .ap-card__actions .button,
  .ap-card__actions .add_to_cart_button {
    padding: 8px 16px !important;
    font-size: 0.78rem !important;
    min-height: 36px;
  }

  .woocommerce .ap-card .price,
  .ap-card .price {
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .ap-card__image-wrap .ammoria-badge img {
    width: 36px;
    height: 36px;
  }

  .ap-card__image-wrap .garantia-badge img {
    width: 36px;
  }
}

/* ═══════════════════════════════════════════════════════════
   FORCE 2 COLUMNS ON MOBILE (override XStore / Bootstrap)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
    body .ap-products-grid,
    .ap-products-wrapper .ap-products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    body .ap-products-grid > *,
    .ap-products-grid > .product,
    .ap-products-grid > .ap-card,
    .ap-products-grid > div {
        grid-column: auto !important;
        grid-row: auto !important;
        width: auto !important;
        max-width: none !important;
        flex: 0 0 auto !important;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ap-card__inner,
  .ap-card__image-link img {
    transition: none !important;
  }
}
