/* ============================================================
   SHOP PAGE OVERRIDE — Sweet Squishies
   Enqueued after style.css to override shop-specific rules.
   ============================================================ */

/* ---- Shop Hero (Redesigned) ---- */
.shop-hero {
  background: var(--brand-gradient);
  text-align: center;
  padding: var(--space-4xl) 0 var(--space-3xl);
  position: relative;
  overflow: hidden;
}

.shop-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 40%);
  pointer-events: none;
}

/* Decorative floating shapes */
.shop-hero__deco {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.shop-hero__shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.12;
  background: white;
}

.shop-hero__shape--1 {
  width: 300px;
  height: 300px;
  top: -80px;
  left: -60px;
  animation: sq-float-slow 8s ease-in-out infinite;
}

.shop-hero__shape--2 {
  width: 180px;
  height: 180px;
  bottom: -40px;
  right: -30px;
  animation: sq-float-slow 6s ease-in-out infinite reverse;
}

.shop-hero__shape--3 {
  width: 100px;
  height: 100px;
  top: 30%;
  right: 15%;
  animation: sq-float-slow 10s ease-in-out infinite;
  animation-delay: -3s;
}

@keyframes sq-float-slow {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(5deg); }
}

.shop-hero__content {
  position: relative;
  z-index: 1;
}

/* Eyebrow label above title */
.shop-hero__eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.15);
  padding: 6px 18px;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-md);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.shop-hero__title {
  color: var(--color-text-on-gradient);
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  margin-bottom: var(--space-md);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  line-height: 1.15;
}

.shop-hero__subtitle {
  color: rgba(255, 255, 255, 0.92);
  font-size: 1.1rem;
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ---- Shop Section ---- */
.shop-section {
  background: var(--color-off-white);
}

/* ---- Toolbar ---- */
.shop-toolbar::after {
  content: "";
  display: table;
  clear: both;
}

.shop-toolbar {
  margin-bottom: var(--space-2xl);
}

/* ---- Category Filter Pills ---- */
.shop-categories-wrapper {
  margin-bottom: var(--space-xl);
}

.shop-categories {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
  margin-bottom: 0;
}

.shop-categories--sub {
  margin-top: var(--space-sm);
  animation: sq-subcat-fade-in 0.25s ease-out;
}

@keyframes sq-subcat-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.shop-categories__pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-white);
  border: 2px solid var(--color-lavender);
  border-radius: var(--radius-full);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease-out;
}

.shop-categories__pill:hover {
  color: var(--color-pink);
  border-color: var(--color-pink);
  background: var(--color-cream);
}

.shop-categories__pill--active {
  color: var(--color-white);
  background: var(--brand-gradient);
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(255, 107, 157, 0.3);
}

.shop-categories__pill--active:hover {
  color: var(--color-white);
  background: var(--brand-gradient);
  border-color: transparent;
}

.shop-categories__pill--sub {
  padding: 6px 16px;
  font-size: 0.82rem;
  font-weight: 500;
  border-width: 1.5px;
  background: var(--color-cream);
}

.shop-categories__pill--sub:hover {
  background: var(--color-white);
}

.shop-categories__pill--sub.shop-categories__pill--active {
  color: var(--color-white);
  background: var(--brand-gradient);
  border-color: transparent;
  box-shadow: 0 2px 6px rgba(255, 107, 157, 0.25);
}

.shop-categories__pill--sub.shop-categories__pill--active:hover {
  color: var(--color-white);
  background: var(--brand-gradient);
}

.shop-categories__pill--sub.shop-categories__pill--active .shop-categories__count {
  background: rgba(255, 255, 255, 0.25);
  color: var(--color-white);
}

.shop-categories__pill--all {
  border-style: dashed;
}

.shop-categories__pill--all.shop-categories__pill--active {
  border-style: solid;
}

.shop-categories__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-full);
}

.shop-categories__pill--active .shop-categories__count {
  background: rgba(255, 255, 255, 0.25);
  color: var(--color-white);
}

/* ---- Shop Meta ---- */
.shop-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 2px solid var(--color-lavender);
  margin-bottom: var(--space-xl);
}

.woocommerce-result-count {
  font-family: var(--font-display) !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  color: var(--color-text-secondary) !important;
  margin: 0 !important;
}

/* Ordering dropdown */
.woocommerce-ordering {
  margin: 0 !important;
}

.woocommerce-ordering select.orderby {
  padding: 8px 36px 8px 16px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  background: var(--color-white);
  border: 2px solid var(--color-lavender);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237B6089' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  transition: border-color 0.2s ease-out;
}

.woocommerce-ordering select.orderby:focus {
  border-color: var(--color-pink);
}

/* ---- Product Grid: 4 desktop, 3 tablet, 2 mobile ---- */
.woocommerce ul.products {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: var(--space-xl) !important;
  margin: 0 !important;
  padding: 0 !important;
}

.woocommerce ul.products::before,
.woocommerce ul.products::after,
.woocommerce-page ul.products::before,
.woocommerce-page ul.products::after {
  content: none !important;
  display: none !important;
}

.woocommerce ul.products li.product {
  list-style: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
}

/* Product card */
.woocommerce ul.products li.product {
  background: var(--color-white) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-card) !important;
  overflow: hidden !important;
  transition: transform 0.25s ease-out, box-shadow 0.25s ease-out !important;
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
}

.woocommerce ul.products li.product:hover {
  transform: translateY(-4px) !important;
  box-shadow: var(--shadow-card-hover) !important;
}

/* Product card image area — constrained height, zooms on hover */
.woocommerce ul.products li.product .woocommerce-LoopProduct-link {
  display: block !important;
  position: relative !important;
  overflow: hidden !important;
  text-decoration: none !important;
  color: inherit !important;
}

/* Image — fixed height, full width, cover crop */
.woocommerce ul.products li.product img {
  width: 100% !important;
  height: 280px !important;
  object-fit: cover !important;
  display: block !important;
  transition: transform 0.4s ease-out !important;
}

.woocommerce ul.products li.product:hover img {
  transform: scale(1.05) !important;
}

/* Title — inside the <a> below image */
.woocommerce ul.products li.product h2 {
  font-family: var(--font-display) !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  color: var(--color-text) !important;
  margin: 12px 16px 4px !important;
  padding: 0 !important;
  line-height: 1.35 !important;
  display: block !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.woocommerce ul.products li.product h2 a {
  color: inherit !important;
  text-decoration: none !important;
}

/* Price — inside the <a> below title */
.woocommerce ul.products li.product .price {
  font-family: var(--font-display) !important;
  font-size: 1.05rem !important;
  font-weight: 800 !important;
  color: var(--color-pink) !important;
  margin: 4px 16px 12px !important;
  padding: 0 !important;
}

/* Sale price styling */
.woocommerce ul.products li.product .price del {
  color: var(--color-text-muted) !important;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  text-decoration: line-through !important;
  margin-right: 6px;
}

.woocommerce ul.products li.product .price ins {
  text-decoration: none !important;
}

.woocommerce ul.products li.product .woocommerce-Price-amount {
  font-family: inherit !important;
  color: inherit !important;
}

/* Hide screen-reader-only text visually */
.woocommerce ul.products li.product .screen-reader-text {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

/* Add to cart button */
.woocommerce ul.products li.product .button.add_to_cart_button {
  margin: 0 var(--space-md) var(--space-md) !important;
  border-radius: var(--radius-full) !important;
  font-family: var(--font-display) !important;
  font-weight: 700 !important;
  padding: 10px 20px !important;
  transition: all 0.2s ease-out !important;
}

/* Custom theme add-to-cart wrapper */
.sq-add-to-cart-wrapper {
  padding: 0 var(--space-md) var(--space-md) !important;
  margin-top: auto !important;
}

.sq-add-to-cart {
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 10px 20px !important;
  border-radius: var(--radius-full) !important;
  font-family: var(--font-display) !important;
  font-weight: 700 !important;
  font-size: 0.9rem !important;
  text-decoration: none !important;
  cursor: pointer !important;
  border: none !important;
  background: var(--brand-gradient) !important;
  color: var(--color-white) !important;
  transition: all 0.2s ease-out !important;
}

.sq-add-to-cart:hover {
  opacity: 0.9 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(255, 107, 157, 0.3) !important;
}


/* Depleted product: override this archive stylesheet's active button treatment. */
.sq-add-to-cart.sq-add-to-cart--depleted,
.sq-add-to-cart.sq-add-to-cart--depleted:hover,
.sq-add-to-cart.sq-add-to-cart--depleted:focus,
.sq-add-to-cart.sq-add-to-cart--depleted:active {
  background: #e8dc9a !important;
  color: #5a4510 !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  opacity: 1 !important;
  transform: none !important;
}

/* SALE badge */
.woocommerce ul.products li.product .onsale {
  position: absolute !important;
  top: var(--space-md) !important;
  left: var(--space-md) !important;
  z-index: 3 !important;
  background: var(--brand-gradient) !important;
  color: var(--color-white) !important;
  font-family: var(--font-display) !important;
  font-size: 0.75rem !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  padding: 8px 14px !important;
  border-radius: var(--radius-full) !important;
  box-shadow: 0 3px 10px rgba(255, 107, 157, 0.4) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  transform: rotate(-12deg) !important;
  border: 2px solid rgba(255, 255, 255, 0.6) !important;
  min-width: auto !important;
  height: auto !important;
  width: auto !important;
}

/* Add to cart button in loop */
.woocommerce ul.products li.product .button.add_to_cart_button {
  margin: 0 var(--space-md) var(--space-md) !important;
  border-radius: var(--radius-full) !important;
  font-family: var(--font-display) !important;
  font-weight: 700 !important;
  padding: 10px 20px !important;
  transition: all 0.2s ease-out !important;
}

/* Pagination */
.woocommerce nav.woocommerce-pagination {
  margin-top: var(--space-2xl);
  text-align: center;
}

.woocommerce nav.woocommerce-pagination ul {
  display: inline-flex !important;
  gap: 6px;
  justify-content: center;
  margin: 0 !important;
  padding: 0 !important;
}

.woocommerce nav.woocommerce-pagination li {
  margin: 0 !important;
  display: inline-block !important;
}

.woocommerce nav.woocommerce-pagination li a,
.woocommerce nav.woocommerce-pagination li span {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-lavender);
  color: var(--color-text-secondary);
  background: var(--color-white);
  text-decoration: none;
  transition: all 0.2s ease-out;
}

.woocommerce nav.woocommerce-pagination li a:hover {
  border-color: var(--color-pink);
  color: var(--color-pink);
  background: var(--color-cream);
}

.woocommerce nav.woocommerce-pagination li span.current {
  background: var(--brand-gradient);
  color: var(--color-white);
  border-color: transparent;
}

/* ---- Shop Empty State ---- */
.shop-empty {
  text-align: center;
  padding: var(--space-4xl) var(--space-xl);
}

.shop-empty__icon {
  color: var(--color-lavender);
  margin-bottom: var(--space-md);
}

.shop-empty__title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.shop-empty__text {
  color: var(--color-text-muted);
  margin-bottom: var(--space-xl);
}

/* ---- Shop CTA (Redesigned) ---- */
.shop-cta {
  background: var(--color-off-white) !important;
}

.shop-cta__inner {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  background: var(--color-white);
  border-radius: var(--radius-xl);
  padding: var(--space-3xl) var(--space-2xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.shop-cta__deco {
  position: absolute;
  top: -20px;
  right: -20px;
  width: 120px;
  height: 120px;
  background: var(--brand-gradient);
  border-radius: 50%;
  opacity: 0.08;
  pointer-events: none;
}

.shop-cta__emoji {
  position: absolute;
  top: -18px;
  right: 30px;
  font-size: 3.5rem;
  transform: rotate(12deg);
  opacity: 0.15;
  pointer-events: none;
}

.shop-cta__content {
  position: relative;
  z-index: 1;
}

.shop-cta__title {
  font-family: var(--font-display) !important;
  font-size: clamp(1.5rem, 3vw, 2rem) !important;
  color: var(--color-text) !important;
  margin-bottom: var(--space-sm) !important;
}

.shop-cta__text {
  color: var(--color-text-secondary) !important;
  font-size: 1.05rem !important;
  line-height: 1.7 !important;
  margin-bottom: var(--space-xl) !important;
}

.shop-cta__actions {
  display: flex !important;
  justify-content: center !important;
  gap: var(--space-md) !important;
  flex-wrap: wrap !important;
}

/* ---- Responsive: Tablet (769-1024px) ---- */
@media (min-width: 769px) and (max-width: 1024px) {
  .woocommerce ul.products {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  .woocommerce ul.products li.product img {
    height: 240px !important;
  }
}

/* ---- Responsive: Mobile (up to 768px) ---- */
@media (max-width: 768px) {
  .shop-hero {
    padding: var(--space-3xl) 0 var(--space-2xl);
  }

  .shop-hero__shape--1 {
    width: 180px;
    height: 180px;
  }

  .shop-hero__shape--2 {
    width: 120px;
    height: 120px;
  }

  .shop-categories-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .shop-categories {
    flex-wrap: wrap;
  }

  .shop-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  .woocommerce ul.products {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: var(--space-md) !important;
  }

  .woocommerce ul.products li.product img {
    height: 200px !important;
  }

  .shop-cta__inner {
    padding: var(--space-2xl) var(--space-xl);
  }

  .shop-cta__actions {
    flex-direction: column;
  }

  .shop-cta__actions .btn {
    width: 100%;
    text-align: center;
  }
}

/* ---- Large screens (1200px+) ---- */
@media (min-width: 1200px) {
  .woocommerce ul.products {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}
/* ---- Shop Alignment Refinement ---- */
/* One shared toolbar-to-results interval keeps filtering and sorting visually connected. */
.shop-toolbar {
  margin-bottom: var(--space-xl);
}

.shop-meta {
  margin-bottom: 0;
}

/* ---- Product Card Action Alignment ---- */
/* Preserve the fixed card rhythm while giving the purchase action one clean inset. */
.woocommerce ul.products li.product {
  align-self: stretch !important;
  box-sizing: border-box !important;
}

.woocommerce ul.products li.product .sq-add-to-cart-wrapper {
  width: 100% !important;
  box-sizing: border-box !important;
  margin: auto 0 var(--space-lg) !important;
  padding: 0 var(--space-md) var(--space-md) !important;
}

.woocommerce ul.products li.product .sq-add-to-cart {
  min-height: 48px !important;
  box-sizing: border-box !important;
}

/* ---- Product Card Density Refinement ---- */
/* Wider card columns and a compact action finish keep the product grid crisp. */
.woocommerce ul.products {
  gap: var(--space-lg) !important;
}

.woocommerce ul.products li.product .sq-add-to-cart-wrapper {
  margin: auto 0 0 !important;
}

@media (max-width: 768px) {
  .woocommerce ul.products {
    gap: var(--space-md) !important;
  }
}

/* ---- Product Grid Row Alignment ---- */
/* Keep the second product row just 5px below the row above it. */
.woocommerce ul.products {
  column-gap: var(--space-lg) !important;
  row-gap: 10px !important;
}

@media (max-width: 768px) {
  .woocommerce ul.products {
    column-gap: var(--space-md) !important;
    row-gap: 10px !important;
  }
}

/* ---- Toolbar-to-Product Alignment ---- */
/* Start the individual product grid 10px below the purple toolbar divider. */
.shop-toolbar {
  margin-bottom: 10px;
}

/* ---- Product Image Top Alignment ---- */
/* Remove the internal gap above each individual-product image. */
.woocommerce ul.products li.product img {
  margin-top: 0 !important;
}

/* ---- Product Image Frame Buffer ---- */
/* Keep a precise 10px frame at the card top and sides. */
.woocommerce ul.products li.product img {
  width: calc(100% - 20px) !important;
  margin: 10px 10px 0 !important;
}

/* ---- Sale Sticker Corner Alignment ---- */
/* Anchor the angled sale sticker cleanly to the product image frame. */
.woocommerce ul.products li.product .onsale {
  top: 16px !important;
  left: 12px !important;
  transform: rotate(-8deg) !important;
}

@media (max-width: 768px) {
  .woocommerce ul.products li.product .onsale {
    top: 14px !important;
    left: 11px !important;
  }
}

/* ---- Sale Sticker Corner Placement ---- */
/* Compact sticker, anchored at the card's outer upper-left image corner. */
.woocommerce ul.products li.product .onsale {
  top: 10px !important;
  left: 8px !important;
  padding: 4px 8px !important;
  font-size: 0.64rem !important;
  transform: rotate(-8deg) !important;
}

@media (max-width: 768px) {
  .woocommerce ul.products li.product .onsale {
    top: 8px !important;
    left: 7px !important;
    padding: 3px 7px !important;
    font-size: 0.58rem !important;
  }
}

/* ---- Sale Sticker Final Alignment ---- */
/* Center the label and anchor the compact angled sticker to the image frame. */
.woocommerce ul.products li.product .onsale {
  top: 14px !important;
  left: 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  line-height: 1 !important;
  transform: rotate(-6deg) !important;
}

@media (max-width: 768px) {
  .woocommerce ul.products li.product .onsale {
    top: 12px !important;
    left: 10px !important;
  }

  /* Preserve full product names on compact cards instead of clipping them. */
  .woocommerce ul.products li.product h2.woocommerce-loop-product__title {
    overflow: visible !important;
    overflow-wrap: anywhere;
    text-overflow: clip !important;
    white-space: normal !important;
  }
}
