/* ==========================================================================
   Popular Choices Smart Carousel — carousel.css  v2.0
   Redesigned to match reference card: inset floating image, compact cards.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

/* ── CSS Custom Properties ────────────────────────────────────────────────── */
.pcsc-widget {
  --pcsc-accent:            #9b1a1a;
  --pcsc-accent-dark:       #7a1414;
  --pcsc-title-color:       #e8845a;
  --pcsc-price-color:       #9b1a1a;
  --pcsc-card-bg:           #ffffff;
  --pcsc-card-radius:       22px;
  --pcsc-card-shadow:       0 4px 20px rgba(0,0,0,.09);
  --pcsc-card-shadow-hover: 0 14px 36px rgba(0,0,0,.15);
  --pcsc-transition:        all .35s cubic-bezier(.25,.8,.25,1);
  --pcsc-font:              'Montserrat', sans-serif;
  --pcsc-img-inset:         12px;
  --pcsc-img-radius:        14px;
}

/* ── Widget Wrapper ───────────────────────────────────────────────────────── */
.pcsc-widget {
  position: relative;
  font-family: var(--pcsc-font);
  box-sizing: border-box;
}
.pcsc-widget *, .pcsc-widget *::before, .pcsc-widget *::after { box-sizing: inherit; }

/* ── Section Header ───────────────────────────────────────────────────────── */
.pcsc-header { margin-bottom: 20px; }

.pcsc-header__title {
  font-family: var(--pcsc-font);
  font-weight: 700;
  font-size: clamp(1.5rem, 2.5vw, 2.2rem);
  color: #1a1a2e;
  margin: 0 0 6px;
  line-height: 1.2;
}

.pcsc-header__subtitle {
  font-family: var(--pcsc-font);
  font-size: .9rem;
  color: #777;
  margin: 0;
}

/* ── Toolbar (tabs + search) ──────────────────────────────────────────────── */
.pcsc-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
}

/* ── Category Tabs ────────────────────────────────────────────────────────── */
.pcsc-tabs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.pcsc-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 18px;
  font-family: var(--pcsc-font);
  font-size: .82rem;
  font-weight: 500;
  color: #555;
  background: transparent;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--pcsc-transition);
  outline: none;
  white-space: nowrap;
  letter-spacing: .01em;
}
.pcsc-tab:hover { color: #111; }
.pcsc-tab.is-active {
  background: var(--pcsc-accent);
  color: #fff;
  box-shadow: 0 3px 12px rgba(155,26,26,.30);
}

/* ── Live Search ──────────────────────────────────────────────────────────── */
.pcsc-search__wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1.5px solid #e0e0e0;
  border-radius: 50px;
  padding: 7px 16px;
  transition: var(--pcsc-transition);
}
.pcsc-search__wrap:focus-within {
  border-color: var(--pcsc-accent);
  box-shadow: 0 0 0 3px rgba(155,26,26,.10);
}
.pcsc-search__icon { color: #bbb; flex-shrink: 0; }
.pcsc-search__input {
  border: none; outline: none; background: transparent;
  font-family: var(--pcsc-font); font-size: .88rem; color: #333; width: 180px;
}
.pcsc-search__input::placeholder { color: #bbb; }

/* ── Carousel Wrapper ─────────────────────────────────────────────────────── */
.pcsc-carousel-wrap { position: relative; }

.pcsc-swiper {
  overflow: hidden;
  padding-bottom: 44px;
}

/* ════════════════════════════════════════════════════════════════════════════
   PRODUCT CARD
   Reference design:
     - White card, large rounded corners
     - Image INSET with padding on top+sides (floating plate look)
     - Image has its own border radius
     - Title (light, orange) + Price (semibold, dark red) below image
     - Add-to-Cart button: bottom-right, asymmetric border-radius shape
   ════════════════════════════════════════════════════════════════════════════ */

.pcsc-card {
  position: relative;
  background: var(--pcsc-card-bg);
  border-radius: var(--pcsc-card-radius);
  box-shadow: var(--pcsc-card-shadow);
  transition: var(--pcsc-transition);
  will-change: transform, box-shadow;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* height: 100% lets Swiper equalise card heights per row */
  height: 100%;
}

.pcsc-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--pcsc-card-shadow-hover);
}

/* ── Image Wrap — INSET / FLOATING ──────────────────────────────────────────
   The image is padded from the card edges on top and sides so it appears
   to "float" inside the card, exactly as shown in the reference.           */
.pcsc-card__image-wrap {
  margin: var(--pcsc-img-inset) var(--pcsc-img-inset) 0;
  border-radius: var(--pcsc-img-radius);
  overflow: hidden;
  aspect-ratio: 1 / 1;   /* square crop — editable via Elementor slider    */
  background: #f0f0f0;
  flex-shrink: 0;
  position: relative;
}

.pcsc-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .45s cubic-bezier(.25,.8,.25,1);
}

/* Lazy-load fade states */
.pcsc-card__image[data-loaded="false"] { opacity: 0; }
.pcsc-card__image[data-loaded="true"]  { opacity: 1; transition: opacity .35s ease; }

.pcsc-card:hover .pcsc-card__image { transform: scale(1.045); }

/* No-image fallback */
.pcsc-card__image-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f5f5f5 0%, #e5e5e5 100%);
}

/* ── Card Body ────────────────────────────────────────────────────────────── */
.pcsc-card__body {
  padding: 14px 16px 54px 16px;  /* bottom gap = space for absolute button  */
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  position: relative;
}

/* ── Product Title ────────────────────────────────────────────────────────── */
.pcsc-card__title {
  font-family: var(--pcsc-font);
  font-weight: 300;          /* Light, per spec */
  font-size: .95rem;
  color: var(--pcsc-title-color);
  margin: 0;
  line-height: 1.35;
  /* Prevent very long names from breaking layout */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ── Product Price ────────────────────────────────────────────────────────── */
.pcsc-card__price {
  font-family: var(--pcsc-font);
  font-weight: 600;          /* Semi-Bold, per spec */
  font-size: 1.1rem;
  color: var(--pcsc-price-color);
  margin: 0;
}

/* WooCommerce price elements */
.pcsc-card__price .woocommerce-Price-amount { font-weight: 600; color: var(--pcsc-price-color); }
.pcsc-card__price del  { opacity: .4; font-size: .85em; }
.pcsc-card__price ins  { text-decoration: none; }

/* ── ADD TO CART BUTTON ───────────────────────────────────────────────────── */
/*
   Position: pinned to the bottom-right corner of the card.
   Shape:  border-radius: TL=55px  TR=0  BR=55px  BL=0
   This creates the "bitten corner" silhouette visible in the reference.
*/
.pcsc-card__btn {
  position: absolute;
  bottom: 0;
  right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 20px;
  font-family: var(--pcsc-font);
  font-size: .82rem;
  font-weight: 600;
  color: #fff;
  background: var(--pcsc-accent);
  border: none;
  /* top-left  top-right  bottom-right  bottom-left */
  border-radius: 55px 0 55px 0;
  cursor: pointer;
  text-decoration: none;
  outline: none;
  letter-spacing: .025em;
  /* Premium multi-layer shadow */
  box-shadow:
    0 6px 18px rgba(155,26,26,.42),
    0 2px 6px  rgba(0,0,0,.12);
  /* Snappy transition per spec */
  transition: all .35s cubic-bezier(.25,.8,.25,1);
  will-change: transform, box-shadow;
  white-space: nowrap;
  line-height: 1;
}

.pcsc-card__btn:hover,
.pcsc-card__btn:focus-visible {
  background: var(--pcsc-accent-dark);
  transform: scale(1.07);
  box-shadow:
    0 10px 26px rgba(155,26,26,.52),
    0 4px 10px  rgba(0,0,0,.16);
  color: #fff;
  text-decoration: none;
}

.pcsc-card__btn:active {
  transform: scale(.95);
  transition-duration: .12s;
}

.pcsc-card__btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pcsc-card__btn-icon svg { display: block; }

/* Icon-only variant — reference shows just "+" with no text */
.pcsc-card__btn--icon-only {
  padding: 13px 16px;
  gap: 0;
}
.pcsc-card__btn--icon-only .pcsc-card__btn-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.5;
}

/* WooCommerce AJAX states */
.pcsc-card__btn.loading .pcsc-card__btn-text { opacity: .55; }
.pcsc-card__btn.loading::after {
  content: '';
  width: 11px;
  height: 11px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: pcsc-spin .7s linear infinite;
  margin-left: 2px;
}
.pcsc-card__btn.added {
  background: #28a745;
  box-shadow: 0 6px 18px rgba(40,167,69,.40);
}

/* ── Navigation Arrows ────────────────────────────────────────────────────── */
.pcsc-arrow {
  position: absolute;
  top: calc(50% - 22px);
  transform: translateY(-50%);
  z-index: 10;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--pcsc-accent);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 14px rgba(155,26,26,.38);
  transition: var(--pcsc-transition);
  outline: none;
}
.pcsc-arrow:hover {
  background: var(--pcsc-accent-dark);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 6px 20px rgba(155,26,26,.55);
}
.pcsc-arrow:active { transform: translateY(-50%) scale(.93); }
.pcsc-arrow--prev { left: -20px; }
.pcsc-arrow--next { right: -20px; }
.pcsc-arrow svg { stroke: #fff; display: block; }

/* ── Pagination Dots ──────────────────────────────────────────────────────── */
.pcsc-swiper .swiper-pagination { bottom: 8px; }

.pcsc-swiper .swiper-pagination-bullet {
  width: 7px;
  height: 7px;
  background: #ccc;
  opacity: 1;
  transition: var(--pcsc-transition);
}
.pcsc-swiper .swiper-pagination-bullet-active {
  background: var(--pcsc-accent);
  width: 20px;
  border-radius: 4px;
}

/* ── No-Results ───────────────────────────────────────────────────────────── */
.pcsc-no-results {
  text-align: center;
  padding: 40px 20px;
  font-family: var(--pcsc-font);
  color: #999;
  font-size: .95rem;
}

/* ── AJAX Transition ──────────────────────────────────────────────────────── */
.pcsc-swiper.is-loading { opacity: 0; pointer-events: none; transition: opacity .15s; }
.pcsc-swiper.is-loaded  { opacity: 1; transition: opacity .3s ease; }

/* ── Lazy Image ───────────────────────────────────────────────────────────── */
.pcsc-card__image.pcsc-lazy        { opacity: 0; transition: opacity .4s ease; }
.pcsc-card__image.pcsc-lazy-loaded { opacity: 1; }

/* ── Keyframes ────────────────────────────────────────────────────────────── */
@keyframes pcsc-spin { to { transform: rotate(360deg); } }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .pcsc-arrow--prev { left: 0; }
  .pcsc-arrow--next { right: 0; }
}

@media (max-width: 768px) {
  .pcsc-toolbar { flex-direction: column; align-items: flex-start; }
  .pcsc-arrow   { display: none; }
  .pcsc-card__title { font-size: .9rem; }
  .pcsc-card__price { font-size: 1rem; }
  .pcsc-search__input { width: 140px; }
}

@media (max-width: 480px) {
  .pcsc-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .pcsc-tabs::-webkit-scrollbar { display: none; }
  .pcsc-card__btn { padding: 11px 16px; font-size: .78rem; }
}
