/* ========== Wrapper & Header ========== */
.pps-wrapper {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 20px;
  box-sizing: border-box;
}

.pps-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 20px;
}

.pps-header h2 {
  font-size: 52px;
  color: #453795;
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
}

.pps-nav {
  display: flex;
  gap: 10px;
}

.pps-prev,
.pps-next {
  background: #f4f4f4;
  border-radius: 12px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  user-select: none;
}

/* ========== Swiper / Slides ========== */
.swiper.pps-swiper {
  height: auto;
}

.swiper-wrapper {
  display: flex;
  align-items: stretch; /* key: makes slides stretch to equal height */
}

.swiper-slide {
  display: flex;
  align-items: stretch;
  flex-direction: column;
}

/* Make card fill the slide height so all cards have equal height */
.swiper-slide .pps-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  height: 100%;
  box-sizing: border-box;
}

/* ========== Card ========== */
.pps-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  width: 100%;
  overflow: hidden;
}

.pps-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.1);
}

/* ========== Image wrapper & image ========== */
.pps-img-wrapper {
  width: 100%;
  aspect-ratio: 4 / 3;
  position: relative;
  flex: 0 0 auto;
  overflow: hidden;
  background: #f7f7f7;
}

@supports not (aspect-ratio: 4/3) {
  .pps-img-wrapper { height: 220px; }
}

.pps-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  vertical-align: middle;
}

/* ========== Card content ========== */
.pps-card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1 1 auto;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  gap: 10px;
  justify-content: space-between;
}

/* ========== COLORS AREA ========== */
/* Ensure color row always occupies space even if empty */
.pps-colors {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
  align-items: center;
  min-height: 22px; /* reserve space for color dots */
  box-sizing: border-box;
}

/* If .pps-colors exists but is empty, create invisible spacer */
.pps-colors:empty::before {
  content: "";
  display: block;
  height: 22px;
  width: 1px;
  opacity: 0;
}

/* Unified .pps-color style */
.pps-color {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  border: 1px solid #ccc;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  margin-right: 5px;
  box-sizing: border-box;
}
.pps-color:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.06); }
.pps-color.active {
  border: 2px solid #000;
  transform: scale(1.05);
}

/* ========== Name / extra info ========== */
.pps-name {
  font-size: 16px;
  font-weight: 500;
  color: #333;
  margin-bottom: 6px;
  line-height: 1.2;
  word-break: break-word;
}

/* Guarantee a little block for name + extra info so layout is consistent */
.pps-name-wrapper {
  width: 100%;
  box-sizing: border-box;
}

/* Extra info block */
.pps-extra-info {
  font-size: 14px;
  color: #666;
  margin-top: 5px;
  width: 100%;
}

/* Materials / min qty row */
.pps-extra-info .pps-min-qty,
.pps-extra-info .pps-material {
  display: block;
}

/* ========== Price ========== */
.pps-price {
  font-size: 16px;
  font-weight: 600;
  color: #2c2479;
  text-align: left;
}

/* ========== Footer (price + add to cart) ========== */
.pps-footer {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  box-sizing: border-box;
}

/* Cart button */
.pps-cart-btn {
  display: inline-flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 44px !important;
  height: 44px !important;
  background: #fff !important;
  border: 1px solid #e0e0e0 !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08) !important;
  cursor: pointer !important;
  padding: 0 !important;
}

.pps-cart-btn svg {
  width: 24px !important;
  height: 24px !important;
  stroke: #00aaff !important;
  fill: none !important;
  pointer-events: none !important;
  margin: 0 !important;
  vertical-align: middle !important;
  display: block !important;
}

.pps-checkmark-icon svg {
  transform: translateX(0);
  display: block;
}

/* ========== Order button ========== */
.pps-order-btn-wrapper {
  width: 100%;
  margin-top: 5px;
  box-sizing: border-box;
}

/* Initially hidden extra-info & order button (animated on hover of card) */
.pps-extra-info,
.pps-order-btn-wrapper {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transform: translateY(-6px);
  transition: opacity 300ms ease, transform 300ms ease, max-height 450ms ease;
}

/* Reveal on card hover (or focus-within for accessibility) */
.pps-card:hover .pps-extra-info,
.pps-card:hover .pps-order-btn-wrapper,
.pps-card:focus-within .pps-extra-info,
.pps-card:focus-within .pps-order-btn-wrapper {
  opacity: 1;
  max-height: 240px;
  transform: translateY(0);
}

/* Order button visual */
.pps-order-btn {
  display: block;
  width: 100%;
  padding: 10px;
  text-align: center;
  background: #00aaff;
  color: #fff;
  border-radius: 6px;
  font-weight: 600;
  transition: background 0.25s ease, transform 0.12s ease;
  text-decoration: none;
  box-sizing: border-box;
}
.pps-order-btn:hover { transform: translateY(-2px); }

/* ========== Minor adjustments ========== */
.pps-card-content { justify-content: space-between; }

/* Accessibility: focus state for interactive elements */
.pps-cart-btn:focus,
.pps-order-btn:focus,
.pps-prev:focus,
.pps-next:focus,
.pps-color:focus {
  outline: 3px solid rgba(68, 55, 149, 0.12);
  outline-offset: 2px;
}

/* ========== Responsive headings ========== */
@media (max-width: 1024px) { .pps-header h2 { font-size: 40px; } }
@media (max-width: 768px)  { .pps-header h2 { font-size: 32px; } }
@media (max-width: 480px)  {
  .pps-header h2 { font-size: 26px; }
  .pps-card-content { padding: 14px; }
}

/* Optional: minimum card height for larger screens (keeps grid tidy) */
@media (min-width: 640px) {
  .swiper-slide .pps-card { min-height: 360px; }
}

/* Small polish for very small screens */
@media (max-width: 420px) {
  .pps-color { width: 18px; height: 18px; margin-right: 4px; }
}
