/* ==========================================================================
   Storefront theme
   A livelier home page: colour-coded departments, one horizontal shelf per
   department, and a bit of motion. Everything is scoped to .storefront so the
   rest of the site (listing, product, seller and admin pages) keeps the
   calmer base stylesheet untouched.
   ========================================================================== */

.storefront {
  --sf-ink: #14152a;
  --sf-muted: #6b7186;
  --sf-line: #ececf7;
  --sf-radius: 18px;
  --sf-accent: #6d4bf6;
  --sf-accent-soft: #f1edff;
  --sf-shadow: 0 10px 28px rgba(24, 20, 70, .10);
}

/* --------------------------------------------------------- accent palette */
.cat-accent-0 { --sf-accent: #7c5cff; --sf-accent-soft: #efeaff; --sf-grad: linear-gradient(140deg, #8b6bff, #5b3df0); }
.cat-accent-1 { --sf-accent: #ff4d6d; --sf-accent-soft: #ffe9ee; --sf-grad: linear-gradient(140deg, #ff8a5c, #ff3f6c); }
.cat-accent-2 { --sf-accent: #0ca678; --sf-accent-soft: #e2f8f1; --sf-grad: linear-gradient(140deg, #22d3a5, #0b9c73); }
.cat-accent-3 { --sf-accent: #f08c00; --sf-accent-soft: #fff3dd; --sf-grad: linear-gradient(140deg, #ffc94d, #f5871f); }
.cat-accent-4 { --sf-accent: #1c7ed6; --sf-accent-soft: #e5f1fd; --sf-grad: linear-gradient(140deg, #59b0ff, #1a72c9); }
.cat-accent-5 { --sf-accent: #e64980; --sf-accent-soft: #ffe8f2; --sf-grad: linear-gradient(140deg, #ff9ecb, #e03f7c); }
.cat-accent-6 { --sf-accent: #0ca7a0; --sf-accent-soft: #e0f7f6; --sf-grad: linear-gradient(140deg, #45d9cf, #0b9a95); }
.cat-accent-7 { --sf-accent: #6f42c1; --sf-accent-soft: #f0e9ff; --sf-grad: linear-gradient(140deg, #9d7bff, #6a3fd0); }

/* ------------------------------------------------------------------- hero */
.storefront .hero-v2 {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  padding: 58px 42px 46px;
  margin-block: 10px 34px;
  color: #fff;
  background: linear-gradient(115deg, #5b3df0 0%, #8b5cf6 38%, #e8568c 72%, #f59e0b 108%);
  background-size: 220% 220%;
  box-shadow: 0 26px 60px rgba(91, 61, 240, .30);
  animation: sfPan 18s ease-in-out infinite;
}

.storefront .hero-copy {
  position: relative;
  z-index: 2;
  max-width: 620px;
}

.storefront .hero-v2 h1 {
  font-size: clamp(2rem, 4vw, 2.9rem);
  line-height: 1.15;
  margin-block-end: 8px;
  letter-spacing: -.5px;
  text-shadow: 0 2px 18px rgba(40, 20, 90, .28);
}

.storefront .hero-sub {
  margin: 0 0 24px;
  font-size: 1.05rem;
  opacity: .94;
}

.storefront .hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.storefront .hero-v2 .btn {
  background: #fff;
  color: #4b2fd8;
  border: 0;
  border-radius: 14px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(30, 10, 80, .22);
  transition: transform .18s ease, box-shadow .18s ease;
}

.storefront .hero-v2 .btn:hover {
  background: #fff;
  color: #3a20c0;
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(30, 10, 80, .28);
  text-decoration: none;
}

.storefront .hero-v2 .btn-ghost {
  background: rgba(255, 255, 255, .16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .55);
  box-shadow: none;
  backdrop-filter: blur(6px);
}

.storefront .hero-v2 .btn-ghost:hover {
  background: rgba(255, 255, 255, .28);
  color: #fff;
}

/* three floating colour blobs behind the copy */
.storefront .hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(34px);
  opacity: .55;
  z-index: 1;
  pointer-events: none;
}

.storefront .hero-blob.b1 {
  width: 300px; height: 300px;
  inset-block-start: -80px; inset-inline-end: -40px;
  background: #ffd166;
  animation: sfFloat 13s ease-in-out infinite;
}

.storefront .hero-blob.b2 {
  width: 240px; height: 240px;
  inset-block-end: -110px; inset-inline-start: 18%;
  background: #22d3ee;
  animation: sfFloat 17s ease-in-out infinite reverse;
}

.storefront .hero-blob.b3 {
  width: 200px; height: 200px;
  inset-block-start: 20px; inset-inline-start: -60px;
  background: #ff5fa2;
  animation: sfFloat 21s ease-in-out infinite;
}

/* product cards floating on the empty side of the hero */
.storefront .hero-art {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  width: 46%;
  z-index: 1;
  pointer-events: none;
  display: none;
}

@media (min-width: 900px) {
  .storefront .hero-art { display: block; }
}

.storefront .hero-card {
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 22px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 20px 44px rgba(24, 8, 70, .30);
  animation: sfBob 11s ease-in-out infinite;
}

.storefront .hero-card img { width: 100%; height: 100%; object-fit: cover; }

.storefront .hero-card.hc-1 {
  inset-inline-start: 6%;
  inset-block-start: 9%;
  width: 164px;
  height: 164px;
  rotate: -7deg;
}

.storefront .hero-card.hc-2 {
  inset-inline-start: 33%;
  inset-block-start: 34%;
  width: 176px;
  height: 176px;
  rotate: 5deg;
  animation-delay: -3.5s;
}

.storefront .hero-card.hc-3 {
  inset-inline-start: 2%;
  inset-block-end: 6%;
  width: 132px;
  height: 132px;
  rotate: 10deg;
  animation-delay: -7s;
}

@keyframes sfBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-14px); }
}

/* the small counters under the buttons */
.storefront .hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-block-start: 26px;
}

.storefront .hero-stat {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .17);
  border: 1px solid rgba(255, 255, 255, .28);
  backdrop-filter: blur(8px);
  animation: sfPop .5s ease both;
}

.storefront .hero-stat:nth-child(2) { animation-delay: .08s; }
.storefront .hero-stat:nth-child(3) { animation-delay: .16s; }
.storefront .hero-stat strong { font-size: 1.15rem; }
.storefront .hero-stat span { font-size: .82rem; opacity: .9; }

/* --------------------------------------------------------- section heads */
.storefront .section { margin-block: 40px; }

.storefront .section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.32rem;
  letter-spacing: -.2px;
}

.storefront .section-title::after { content: none; }

.storefront .row-icon {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  background: var(--sf-accent-soft);
  box-shadow: inset 0 0 0 1px rgba(20, 20, 60, .05);
}

.storefront .row-count {
  font-size: .78rem;
  font-weight: 700;
  color: var(--sf-accent);
  background: var(--sf-accent-soft);
  border-radius: 999px;
  padding: 2px 10px;
}

.storefront .row-more {
  color: var(--sf-accent);
  font-weight: 600;
  white-space: nowrap;
}

.storefront .row-more:hover { text-decoration: none; opacity: .8; }

/* ------------------------------------------------------- department tiles */
.storefront .cat-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 900px) {
  .storefront .cat-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .storefront .cat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.storefront .cat-tile {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 18px 16px 16px;
  border-radius: 18px;
  color: #fff;
  background: var(--sf-grad, linear-gradient(140deg, #8b6bff, #5b3df0));
  box-shadow: 0 10px 22px rgba(24, 20, 70, .16);
  transition: transform .22s cubic-bezier(.2, .8, .3, 1), box-shadow .22s ease;
  animation: sfPop .5s cubic-bezier(.2, .8, .3, 1) both;
}

.storefront .cat-tile:nth-child(1) { animation-delay: .02s; }
.storefront .cat-tile:nth-child(2) { animation-delay: .06s; }
.storefront .cat-tile:nth-child(3) { animation-delay: .10s; }
.storefront .cat-tile:nth-child(4) { animation-delay: .14s; }
.storefront .cat-tile:nth-child(5) { animation-delay: .18s; }
.storefront .cat-tile:nth-child(6) { animation-delay: .22s; }
.storefront .cat-tile:nth-child(7) { animation-delay: .26s; }
.storefront .cat-tile:nth-child(8) { animation-delay: .30s; }

.storefront .cat-tile:hover {
  transform: translateY(-5px) scale(1.015);
  box-shadow: 0 18px 36px rgba(24, 20, 70, .26);
  text-decoration: none;
  color: #fff;
}

/* a light sweep crosses the tile when you hover it */
.storefront .cat-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, .45) 50%, transparent 68%);
  transform: translateX(-130%);
  pointer-events: none;
}

.storefront .cat-tile:hover::after { animation: sfShine .85s ease; }

.storefront .cat-icon {
  font-size: 1.6rem;
  line-height: 1;
  margin-block-end: 6px;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .18));
}

.storefront .cat-name { font-weight: 700; font-size: 1rem; }
.storefront .cat-count { font-size: .76rem; opacity: .88; }

/* --------------------------------------------------- horizontal shelves */
.storefront .h-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.storefront .h-track {
  display: flex;
  gap: 14px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px 2px 16px;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: #d8d8ea transparent;
  -webkit-overflow-scrolling: touch;
}

.storefront .h-track::-webkit-scrollbar { height: 6px; }
.storefront .h-track::-webkit-scrollbar-track { background: transparent; }
.storefront .h-track::-webkit-scrollbar-thumb { background: #dcdcee; border-radius: 3px; }
.storefront .h-track:hover::-webkit-scrollbar-thumb { background: var(--sf-accent); opacity: .6; }

.storefront .h-track > * {
  flex: 0 0 212px;
  scroll-snap-align: start;
}

.storefront .h-arrow {
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--sf-line);
  background: #fff;
  color: var(--sf-accent);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 18px rgba(24, 20, 70, .12);
  transition: transform .16s ease, opacity .16s ease, box-shadow .16s ease;
}

.storefront .h-arrow:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 24px rgba(24, 20, 70, .18);
}

.storefront .h-prev::before { content: '›'; }
.storefront .h-next::before { content: '‹'; }
html[dir="ltr"] .storefront .h-prev::before { content: '‹'; }
html[dir="ltr"] .storefront .h-next::before { content: '›'; }

.storefront .at-start .h-prev,
.storefront .at-end .h-next { opacity: .3; pointer-events: none; box-shadow: none; }
.storefront .no-scroll .h-arrow { display: none; }

/* --------------------------------------------------- cards inside a shelf */
.storefront .h-track .product-card {
  border-radius: 16px;
  border-color: var(--sf-line);
  box-shadow: 0 2px 10px rgba(24, 20, 70, .05);
  transition: transform .22s cubic-bezier(.2, .8, .3, 1), box-shadow .22s ease;
}

.storefront .h-track .product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 34px rgba(30, 20, 90, .16);
}

.storefront .h-track .product-thumb { background: linear-gradient(150deg, #f4f1ff, #fdfbff); }
.storefront .h-track .product-thumb img { transition: transform .5s ease; }
.storefront .h-track .product-card:hover .product-thumb img { transform: scale(1.06); }

.storefront .h-track .product-name { min-height: 2.6em; }

.storefront .h-track .tag-sale {
  background: linear-gradient(135deg, #ff4d6d, #f5871f);
  box-shadow: 0 6px 14px rgba(255, 77, 109, .35);
}

.storefront .h-track .product-price strong { color: var(--sf-accent); }

.storefront .h-track .add-to-cart .btn {
  background: linear-gradient(135deg, #6d4bf6, #a855f7);
  border: 0;
  border-radius: 12px;
  font-weight: 700;
  transition: filter .18s ease, transform .18s ease;
}

.storefront .h-track .add-to-cart .btn:hover { filter: brightness(1.08); transform: translateY(-1px); }

/* --------------------------------------------------------------- stores */
.storefront .store-grid { gap: 12px; }

.storefront .store-card {
  border-radius: 16px;
  border-color: var(--sf-line);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.storefront .store-card:hover {
  transform: translateY(-3px);
  border-color: #d9d0ff;
  box-shadow: var(--sf-shadow);
}

.storefront .store-logo {
  background: linear-gradient(140deg, #f1edff, #e7f6ff);
  font-size: 1.6rem;
}

/* ------------------------------------------------------------ keyframes */
@keyframes sfPan {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

@keyframes sfFloat {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(-26px, 22px, 0) scale(1.12); }
}

@keyframes sfPop {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

@keyframes sfShine {
  from { transform: translateX(-130%); }
  to   { transform: translateX(130%); }
}

/* -------------------------------------------------------------- mobile */
@media (max-width: 720px) {
  .storefront .hero-v2 { padding: 40px 22px 34px; border-radius: 24px; }
  .storefront .hero-sub { font-size: .98rem; }
  .storefront .h-track > * { flex-basis: 168px; }
  .storefront .h-arrow { display: none; }
  .storefront .section { margin-block: 30px; }
}

/* ------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  .storefront .hero-v2,
  .storefront .hero-blob,
  .storefront .hero-stat,
  .storefront .cat-tile { animation: none !important; }
  .storefront .cat-tile:hover::after { animation: none !important; }
  .storefront .h-track { scroll-behavior: auto; }
  .storefront .h-track .product-card:hover { transform: none; }
}
