/*
 * Flat, borderless product card (see components/product/ProductCard.tsx) —
 * image on plain white, small hover-revealed wishlist/quick-view icons, and
 * a small circular add-to-cart icon button bottom-right. Scoped under its
 * own classes (not the vendor theme's product-item-container rules) so it
 * doesn't fight home3.css; the outer `.product-layout` class stays for
 * sw-product-grid.css's column widths.
 */
.sw-card {
  background: #fff;
  overflow: visible;
  border: 1px solid #ececec;
  border-radius: 10px;
  padding: 0 14px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  text-align: left;
}
.sw-card:hover {
  border-color: var(--sw-primary);
  box-shadow: 0 14px 28px rgba(30, 158, 92, 0.16);
}

.sw-card-media {
  position: relative;
  overflow: visible;
  background: #fff;
  aspect-ratio: 1 / 1;
  /* With overflow:visible (needed so the cart-fab button can hang below the
     edge), a block box's automatic minimum size still lets tall content
     (a portrait product photo) grow the box past its aspect-ratio — this
     forces the square ratio to actually hold regardless of photo shape. */
  min-height: 0;
  margin: 0 -14px;
}
.sw-card-image-link {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 8px 8px 0 0;
}
.sw-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.sw-card:hover .sw-card-image {
  transform: scale(1.04);
}

/* Branded placeholder shown by ProductImage.tsx when a product has no image
   or the image fails to load — replaces the bare browser broken-image icon
   with a small on-brand mark instead. */
.sw-product-image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  min-height: 120px;
  background: linear-gradient(160deg, #f3f6fa 0%, #eef1f5 100%);
  color: var(--sw-primary);
}
.sw-product-image-placeholder i {
  font-size: 26px;
  opacity: 0.6;
}
.sw-product-image-placeholder span:not(.sr-only) {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9aabc0;
}

.sw-card-actions {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sw-card-action-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #eee;
  background: #fff;
  color: #333;
  box-shadow: 0 2px 8px rgba(17, 24, 39, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.sw-card-action-btn:hover:not(:disabled) {
  background: var(--sw-primary);
  border-color: var(--sw-primary);
  color: #fff;
}
.sw-card-action-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.sw-card-action-btn.in-wishlist {
  background: var(--sw-primary);
  border-color: var(--sw-primary);
  color: #fff;
}
.sw-card-action-btn.in-wishlist:hover:not(:disabled) {
  background: var(--sw-primary-hover);
  border-color: var(--sw-primary-hover);
}

.sw-card-cart-fab {
  position: absolute;
  right: 14px;
  bottom: -22px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: #f0f0f0;
  color: #555;
  box-shadow: 0 4px 10px rgba(17, 24, 39, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  z-index: 2;
  transition: background 0.15s ease, color 0.15s ease;
}
.sw-card:hover .sw-card-cart-fab:not(:disabled) {
  background: var(--sw-primary);
  color: #fff;
}
.sw-card-cart-fab:disabled {
  background: #f2f2f2;
  color: #bbb;
  cursor: not-allowed;
}
.sw-card-qty-stepper {
  position: absolute;
  right: 14px;
  bottom: -18px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--sw-success, #1e9e5c);
  color: #fff;
  box-shadow: 0 4px 10px rgba(17, 24, 39, 0.14);
}
.sw-card-qty-stepper button {
  width: 20px;
  height: 20px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.sw-card-qty-stepper button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.35);
}
.sw-card-qty-stepper button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.sw-card-qty-stepper span {
  min-width: 14px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.sw-card-body {
  padding: 26px 0 2px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sw-card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  /* Clamped to 2 lines max, but no longer forced to always reserve that
     much height — cards aren't stretched to a shared row height anymore
     (see .sw-product-grid's align-items: start), so a short title can just
     take less room instead of padding every card out to match. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sw-card-title a {
  color: #333;
}
.sw-card:hover .sw-card-title a {
  color: var(--sw-primary);
}
.sw-card-desc {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: #939393;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sw-card-category {
  margin: 0;
  font-size: 12px;
  line-height: 1.3;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sw-card-price {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
}
.sw-card-price-old {
  margin-left: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #999;
  text-decoration: line-through;
}
.sw-card-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 1;
  background: var(--sw-error, #c0392b);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}
.sw-card-badge-stock {
  background: #222;
}
.sw-card-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #999;
  margin-top: 4px;
  /* Reserved even with no reviews yet (ProductCard always renders this row)
     so price/button don't shift up a few pixels on cards that happen to
     have zero reviews, next to ones that do. */
  min-height: 16px;
}
.sw-card-rating.is-empty {
  color: #ccc;
}

/* ---------- Notify Me (out-of-stock replacement for the cart fab) ---------- */
.sw-notify-me-fab-wrap {
  position: absolute;
  right: 14px;
  bottom: -22px;
  z-index: 2;
}
.sw-card-cart-fab.sw-notify-me-fab {
  position: static;
  background: #222;
  color: #fff;
}
.sw-card-cart-fab.sw-notify-me-fab:hover:not(:disabled) {
  background: var(--sw-primary);
}
.sw-card-cart-fab.sw-notify-me-fab:disabled {
  background: var(--sw-success, #1e9e5c);
  color: #fff;
}
.sw-notify-me-popover {
  position: absolute;
  right: 0;
  bottom: 52px;
  width: 220px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(20, 30, 50, 0.14);
  padding: 10px;
}
