/*
Theme Name: StickerJaki
Theme URI: https://github.com/coder0205/stickerjaki
Author: StickerJaki
Description: An innocent childhood captured in high-quality, durable stickers.
Version: 1.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: stickerjaki
*/

/* ===== CUSTOM CLASSES FROM ORIGINAL DESIGN ===== */

/* Global belt-and-braces: prevent any single rogue element from causing
   horizontal scroll on the document. `clip` is preferred over `hidden`
   because it does NOT establish a scroll container, so it doesn't break
   position:sticky on descendants. */
html, body { overflow-x: clip; }

/* Tiny label utility — clamped to 11px so it stays readable on
   high-DPI small phones (replaces ad-hoc text-[9px]/text-[10px]).
   Sets font-size + line-height only; callers keep their own
   tracking-widest / tracking-[0.2em] without conflict. */
.sj-label-xs {
  font-size: max(11px, 0.6875rem);
  line-height: 1.2;
}

#cart-rec-track::-webkit-scrollbar { display: none; }

/* ========================================================================
 * Custom page — interactive sticker finish demo (Plan B, 3-layer CSS)
 * ======================================================================== */
.sj-finish-demo .sticker-container {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1 / 1;
  border-radius: 2rem;
  overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.25),
              0 10px 20px -10px rgba(0, 0, 0, 0.1);
  cursor: crosshair;
  --mx: 50%;
  --my: 50%;
}
.sj-finish-demo .bg-layer {
  position: absolute; inset: 0;
  background: linear-gradient(-135deg, #fafafa 0%, #e9ecef 100%);
  z-index: 0;
}
.sj-finish-demo .sticker-image {
  position: absolute; inset: 10%;
  width: 80%; height: 80%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  z-index: 1;
  transition: filter 0.4s ease, transform 0.4s ease;
  /* Stacked drop-shadows: a tight contact shadow + a wide soft cast for real depth */
  filter:
    drop-shadow(0 6px 8px rgba(0, 0, 0, 0.25))
    drop-shadow(0 22px 35px rgba(0, 0, 0, 0.35));
}
.sj-finish-demo .effect-overlay {
  position: absolute; inset: 10%;        /* match the sticker-image's inset */
  width: 80%; height: 80%;               /* match the sticker-image's size */
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.4s ease;
  /* Clip the overlay to the opaque pixels of the sticker PNG so the
   * holographic/glossy/etc. effects only show on the artwork, never on
   * the surrounding background. --sticker-mask is set via inline style
   * on .sticker-container with the same image URL as the <img> below. */
  -webkit-mask-image: var(--sticker-mask);
          mask-image: var(--sticker-mask);
  -webkit-mask-size: contain;
          mask-size: contain;
  -webkit-mask-position: center;
          mask-position: center;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
}

/* --- A. GLOSSY: 45° white light sweep, follows mouse --- */
.sj-finish-demo [data-finish="glossy"] .effect-overlay {
  background: linear-gradient(
    -105deg,
    transparent 30%,
    rgba(255, 255, 255, 0.75) 50%,
    transparent 70%
  );
  background-size: 250% 250%;
  background-position: calc(100% - (100% - var(--mx))) calc(100% - var(--my));
  mix-blend-mode: soft-light;
  opacity: 1;
}
.sj-finish-demo [data-finish="glossy"] .sticker-image {
  filter:
    drop-shadow(0 6px 8px rgba(0, 0, 0, 0.28))
    drop-shadow(0 22px 35px rgba(0, 0, 0, 0.38))
    brightness(1.05) contrast(1.05);
}

/* --- B. HOLOGRAPHIC: 2.5 rainbow cycles in one seamless gradient, mouse-tracked --- */
.sj-finish-demo [data-finish="holographic"] .effect-overlay {
  background:
    linear-gradient(
      -115deg,
      rgba(255, 0,   128, 0.6) 0%,
      rgba(255, 180, 0,   0.6) 10%,
      rgba(0,   220, 150, 0.6) 20%,
      rgba(0,   150, 255, 0.6) 30%,
      rgba(180, 0,   255, 0.6) 40%,
      rgba(255, 0,   128, 0.6) 50%,
      rgba(255, 180, 0,   0.6) 60%,
      rgba(0,   220, 150, 0.6) 70%,
      rgba(0,   150, 255, 0.6) 80%,
      rgba(180, 0,   255, 0.6) 90%,
      rgba(255, 0,   128, 0.6) 100%
    );
  background-size: 180% 180%;          /* > 100% so position can pan smoothly */
  background-repeat: no-repeat;         /* one continuous gradient, no tile seams */
  background-position: var(--mx) var(--my);
  mix-blend-mode: color-dodge;
  opacity: 1;
}
.sj-finish-demo [data-finish="holographic"] .sticker-image {
  /* brightness(0.88) drops pure whites to ~225/225/225 so color-dodge can
   * actually push them toward the rainbow tint. contrast(1.05) keeps the
   * artwork crisp; saturate(1.2) makes the underlying logo stay punchy. */
  filter:
    drop-shadow(0 6px 8px rgba(0, 0, 0, 0.3))
    drop-shadow(0 22px 35px rgba(0, 0, 0, 0.4))
    brightness(0.88) contrast(1.05) saturate(1.2);
}

/* --- C. MATTE: low contrast, paper-like, almost no reflection --- */
.sj-finish-demo [data-finish="matte"] .sticker-image {
  /* Matte = paper-like, softer & wider cast but still deep so the sticker feels solid on the surface */
  filter:
    drop-shadow(0 4px 6px rgba(0, 0, 0, 0.22))
    drop-shadow(0 16px 28px rgba(0, 0, 0, 0.3))
    contrast(0.92) brightness(1.03) saturate(0.85);
}
.sj-finish-demo [data-finish="matte"] .effect-overlay {
  background: radial-gradient(
    circle at center,
    rgba(255, 255, 255, 0.05),
    transparent 70%
  );
  mix-blend-mode: multiply;
  opacity: 1;
}

/* --- D. SPOT UV / FOIL: concentrated reflection that follows the cursor --- */
.sj-finish-demo [data-finish="spotuv"] .effect-overlay {
  background:
    radial-gradient(
      circle at var(--mx) var(--my),
      rgba(255, 255, 255, 0.7) 0%,
      rgba(255, 255, 255, 0.2) 15%,
      transparent 35%
    );
  mix-blend-mode: screen;
  opacity: 1;
}
.sj-finish-demo [data-finish="spotuv"] .sticker-image {
  filter:
    drop-shadow(0 6px 8px rgba(0, 0, 0, 0.3))
    drop-shadow(0 22px 35px rgba(0, 0, 0, 0.4))
    contrast(1.08) saturate(1.1);
}

/* --- Right-side finish selector buttons --- */
.sj-finish-demo .finish-btn {
  background: #ffffff;
  border-color: #e5e7eb;
}
.sj-finish-demo .finish-btn:hover {
  border-color: rgba(160, 58, 87, 0.4);
  transform: translateX(-4px);
}
.sj-finish-demo .finish-btn.is-active {
  background: #fde9f3;
  border-color: #a03a57;
}
.sj-finish-demo .finish-btn.is-active::after {
  content: '✓';
  float: left;
  margin-top: -36px;
  color: #a03a57;
  font-weight: 900;
  font-size: 1.4rem;
}

/* Product thumbnail — selected state gets a light-pink border */
.dp-thumb-sel { border-color: #ffb0c5; }

/* Rich product description (short + long) — restore formatting Tailwind preflight resets */
.sj-rich strong, .sj-rich b { font-weight: 700; }
.sj-rich em, .sj-rich i { font-style: italic; }
.sj-rich p { margin: 0.6rem 0; }
.sj-rich ul { list-style: disc;  padding-right: 1.5rem; margin: 0.6rem 0; }
.sj-rich ol { list-style: decimal; padding-right: 1.5rem; margin: 0.6rem 0; }
.sj-rich li { margin: 0.25rem 0; }
.sj-rich a  { color: #a03a57; text-decoration: underline; }
.sj-rich h2, .sj-rich h3, .sj-rich h4 { font-weight: 800; color: #1f2937; margin: 0.9rem 0 0.4rem; }
.sj-rich h2 { font-size: 1.25rem; }
.sj-rich h3 { font-size: 1.1rem; }

/* Footer top: brand block + link columns side by side on desktop, stacked on mobile */
.sj-footer-top {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}
.sj-footer-brand { max-width: 24rem; }
@media (min-width: 1024px) {
  .sj-footer-top { flex-direction: row; align-items: flex-start; gap: 3.5rem; }
  .sj-footer-brand { flex: 0 0 18rem; }
  .sj-footer-top > .sj-footer-cols { flex: 1 1 0; min-width: 0; }
}

/* Footer link columns — main nav + 4 product categories (2 cols mobile, 3 tablet, 5 desktop) */
.sj-footer-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.5rem 2rem;
}
@media (min-width: 768px)  { .sj-footer-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .sj-footer-cols { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* Volume-pricing tier buttons (product detail) — compact grid, fits 7 in a row */
.sj-tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  gap: 0.375rem;
}
.sj-tier-grid .dp-tier-btn { padding: 0.4rem 0.2rem; }
.sj-tier-grid .dp-tier-btn span:first-child { font-size: 0.72rem; }
.sj-tier-grid .dp-tier-btn span:last-child  { font-size: 0.62rem; }

/* Product Showcase Gallery — infinite polaroid marquee on /custom */
.showcase-marquee {
  overflow: hidden;
  width: 100%;
  padding: 2.5rem 0;
  -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
          mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}
.showcase-track {
  display: flex;
  gap: 1.75rem;
  width: max-content;
  animation: showcase-scroll 45s linear infinite;
}
.showcase-marquee:hover .showcase-track {
  animation-play-state: paused;
}
.showcase-card {
  flex-shrink: 0;
  width: 280px;
  height: 320px;
  background: white;
  padding: 14px 14px 50px 14px;
  border-radius: 6px;
  box-shadow: 0 10px 25px -8px rgba(0,0,0,0.18),
              0 4px 8px -2px rgba(0,0,0,0.08);
  transform: rotate(var(--rot, 0deg));
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.showcase-card:hover {
  transform: rotate(0deg) scale(1.04);
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.25),
              0 6px 12px -3px rgba(0,0,0,0.1);
  z-index: 10;
}
.showcase-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
  display: block;
}
@keyframes showcase-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(50%); }
}
@media (max-width: 640px) {
  .showcase-card { width: 220px; height: 260px; padding: 10px 10px 40px 10px; }
  .showcase-track { animation-duration: 35s; }
}

/* Stacked testimonial cards on homepage — default tight stack, spread on hover via JS */
.testimonial-stack {
  position: relative;
  /* Cap at 320px but never wider than viewport minus a small gutter, so
     extra-small phones (<320px) never get a horizontal scrollbar. */
  width: min(320px, calc(100vw - 2rem));
  height: calc(540px * var(--fan-k));
  margin: 5rem auto;
  --fan-k: 1; /* horizontal shrink factor: scales card width + fan spread only */
}
.testimonial-stack .testimonial-card {
  position: absolute;
  top: 0;
  right: 50%;
  width: calc(540px * var(--fan-k));
  aspect-ratio: 1 / 1;
  margin-right: calc(-270px * var(--fan-k));
  transform: translateX(calc(-1*(var(--x, 0px) * var(--fan-k)))) rotate(var(--rot, 0deg));
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.4s ease;
  will-change: transform;
}
/* Shrink the card width (and the square height that tracks it) plus the fan
   offsets as the viewport narrows. The left-most card edge sits ~910px from
   centre at full size, so the fan needs ~1820px to clear. Each step's
   --fan-k is sized to the NARROW end of its range (910*k <= vw/2 - 55px) so
   the fan never exceeds the page width anywhere inside the range. Base k=1
   only applies above ~1930px where the full fan genuinely fits. */
@media (max-width: 1930px) { .testimonial-stack { --fan-k: 0.93; } }
@media (max-width: 1810px) { .testimonial-stack { --fan-k: 0.86; } }
@media (max-width: 1690px) { .testimonial-stack { --fan-k: 0.80; } }
@media (max-width: 1570px) { .testimonial-stack { --fan-k: 0.73; } }
@media (max-width: 1450px) { .testimonial-stack { --fan-k: 0.67; } }
@media (max-width: 1330px) { .testimonial-stack { --fan-k: 0.60; } }
@media (max-width: 1210px) { .testimonial-stack { --fan-k: 0.53; } }
@media (max-width: 1090px) { .testimonial-stack { --fan-k: 0.47; } }
@media (max-width:  970px) { .testimonial-stack { --fan-k: 0.40; } }
@media (max-width:  850px) { .testimonial-stack { --fan-k: 0.36; } }
@media (max-width: 767px) {
  .testimonial-stack {
    width: 100%;
    height: auto;
    margin: 2rem auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
  }
  .testimonial-stack .testimonial-card {
    position: static;
    transform: none !important;
    margin: 0;
    width: 100%;
    max-width: 420px;
    height: auto;
    aspect-ratio: 1 / 1;
  }
}


.hero-title {
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.soft-card-shadow {
  box-shadow: 0 10px 40px -10px rgba(0,0,0,0.06), 0 4px 12px -4px rgba(0,0,0,0.02);
}

.sticker-card {
  background: white;
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: 1.5rem;
  transition: all 0.3s ease;
}
.sticker-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px -12px rgba(160, 58, 87, 0.12);
}

.btn-pill {
  border-radius: 9999px;
  transition: all 0.2s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-pill:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn-pill:active { transform: translateY(0) scale(0.95); }

input[type=range].price-range-slider {
  -webkit-appearance: none;
  height: 6px;
  border-radius: 9999px;
  background: #f7e4e6;
  outline: none;
  cursor: pointer;
  width: 100%;
}
input[type=range].price-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #a03a57;
  border: 4px solid white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  cursor: pointer;
}

.hide-scroll::-webkit-scrollbar { display: none; }
.hide-scroll { -ms-overflow-style: none; scrollbar-width: none; }

.peel-container { position: relative; overflow: hidden; }
.peel-container::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 0;
  transition: all 0.5s ease-in-out;
  z-index: 20;
  pointer-events: none;
  background: linear-gradient(-135deg, transparent 48%, rgba(0,0,0,0.08) 50%, #ffffff 52%);
  box-shadow: 4px -4px 12px rgba(0,0,0,0.05);
  border-radius: 0 4px 0 0;
}
.group:hover .peel-container::after { width: 48px; height: 48px; }

/* Navbar */
#main-navbar {
  transition: transform 0.3s ease, background 0.3s ease;
  position: fixed; top: 0; right: 0; left: 0; z-index: 50;
}
#main-navbar.scrolled { background: rgba(255,248,247,0.97); backdrop-filter: blur(12px); box-shadow: 0 2px 20px rgba(0,0,0,0.06); }
#main-navbar.hidden-nav { transform: translateY(-100%); }

/* Mobile menu */
#mobile-menu {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s ease;
}
#mobile-menu.open { max-height: 600px; }

/* Category dropdown */
.cat-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 50%;
  transform: translateX(50%);
  /* Hug content but never exceed the viewport on tiny phones. */
  width: max-content;
  max-width: min(280px, calc(100vw - 2rem));
  z-index: 100;
  border-radius: 1rem;
  background: white;
  box-shadow: 0 8px 32px rgba(160,58,87,0.12);
  padding: 0.5rem;
}
.cat-dropdown.open { display: block; }
.cat-dropdown a {
  display: block;
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
  color: #23191b;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.15s;
}
.cat-dropdown a:hover { background: #fff0f1; color: #a03a57; }

/* Cart drawer */
#cart-drawer {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 380px; max-width: 95vw;
  background: white;
  z-index: 200;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  display: flex; flex-direction: column;
  box-shadow: 8px 0 40px rgba(0,0,0,0.12);
}
#cart-drawer.open { transform: translateX(0); }

#cart-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
#cart-overlay.open { opacity: 1; pointer-events: all; }

/* Accordion */
.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.accordion-body.open { max-height: 400px; }
.accordion-icon { transition: transform 0.3s ease; }
.accordion-icon.open { transform: rotate(-180deg); }

/* Outline variant */
.outline-variant { border-color: #dbc0c4; }

/* Section spacing */
.section-py { padding-top: 5rem; padding-bottom: 5rem; }
@media (max-width: 768px) { .section-py { padding-top: 3rem; padding-bottom: 3rem; } }

/* Product card image */
.product-img-wrap {
  position: relative;
  padding-top: 100%;
  overflow: hidden;
  border-radius: 0.5rem;
}
.product-img-wrap img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.sticker-card:hover .product-img-wrap img { transform: scale(1.06); }

/* Star rating */
.stars { color: #FBBF24; letter-spacing: 1px; }

/* MOQ badge */
.moq-badge {
  position: fixed;
  bottom: 2rem; right: 2rem;
  background: #a03a57; color: white;
  border-radius: 1rem;
  padding: 0.75rem 1.25rem;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 8px 24px rgba(160,58,87,0.3);
  z-index: 100;
}

/* Page hero */
.page-hero {
  padding: 7rem 1.5rem 3rem;
  text-align: center;
}
@media (max-width: 768px) { .page-hero { padding-top: 5.5rem; } }

/* Home accordion (Application Scenarios) */
.sj-accordion-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  height: auto;
}
@media (min-width: 1024px) {
  .sj-accordion-container {
    flex-direction: row;
    height: 600px;
  }
}
.sj-accordion-item {
  min-width: 0;
}
@media (min-width: 1024px) {
  .sj-accordion-item {
    flex: 1;
    transition: flex 0.5s cubic-bezier(0.4,0,0.2,1);
  }
  .sj-accordion-item:hover { flex: 3; }
  .sj-accordion-item .sj-acc-desc { display: none; }
  .sj-accordion-item:hover .sj-acc-desc { display: block; }
}
.sj-accordion-item .sj-acc-desc { display: block; }

/* Social icon: flip glyph to white when the chip turns primary on hover */
.sj-social-icon img { transition: filter 0.2s ease; }
.sj-social-icon:hover img { filter: brightness(0) invert(1); }

/* Products mega-menu (navbar) — 4 equal parent columns of subcategory links */
.sj-mega-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem;
}

/* Collapsible category filter (products page sidebar) */
.sj-cat-children {
  display: none;
  flex-direction: column;
  gap: 0.125rem;
  padding-right: 1.25rem;
  margin-top: 0.125rem;
}
.sj-cat-group.open .sj-cat-children { display: flex; }
.sj-cat-chevron { transition: transform 0.2s ease; }
.sj-cat-group.open .sj-cat-chevron { transform: rotate(-180deg); }

/* FAQ accordion */
.sj-faq-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}
.sj-faq-body.open { max-height: 400px; opacity: 1; }

/* Contact country dropdown */
#country-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  /* Cap at 220px but shrink on phones <240px so the dropdown can't
     spill off the left edge of the viewport (RTL). */
  width: min(220px, calc(100vw - 2rem));
  max-height: 300px;
  overflow-y: auto;
  background: white;
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: 1rem;
  box-shadow: 0 25px 50px rgba(0,0,0,0.12);
  z-index: 50;
  padding: 0.5rem;
}
.chevron { transition: transform 0.2s ease; }

/* Blog pagination — style WordPress paginate_links() into brand pill buttons */
.sj-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.sj-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 0.85rem;
  border-radius: 9999px;
  background: #ffffff;
  border: 1px solid rgba(160, 58, 87, 0.15);
  color: #a03a57;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.sj-pagination a.page-numbers:hover {
  background: #ff85a2;
  border-color: #ff85a2;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 133, 162, 0.35);
}
.sj-pagination .page-numbers.current {
  background: #a03a57;
  border-color: #a03a57;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(160, 58, 87, 0.3);
}
.sj-pagination .page-numbers.dots {
  background: transparent;
  border-color: transparent;
  color: #a03a57;
  opacity: 0.45;
  min-width: 28px;
  padding: 0 0.25rem;
}
.sj-pagination .prev.page-numbers,
.sj-pagination .next.page-numbers {
  padding: 0 1rem;
}
/* RTL: flip the prev/next chevrons so they point the correct direction */
.sj-pagination .prev.page-numbers svg,
.sj-pagination .next.page-numbers svg {
  transform: scaleX(-1);
}
