/* Global */
:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --primary: #d23b35;
  --primary-strong: #c12925;
  --text: #0f1728;
  --muted: #5a6573;
  --stroke: #e3e6eb;
  --pill-bg: #f0f2f6;
  --shadow: 0 12px 30px rgba(28, 44, 64, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: 0;
  overflow-x: hidden;
}

html {
  overflow-x: hidden;
}

main, .page-shell, .home-layout, .add-product-shell, .product-detail {
  max-width: 100%;
}

/* Cropper modal */
.btn {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 9px 14px;
  font-weight: 700;
  background: #fff;
  cursor: pointer;
}
.btn.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--primary);
}

/* Layout */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fff;
  display: grid;
  grid-template-columns: 260px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--stroke);
  box-shadow: 0 6px 16px rgba(15, 23, 40, 0.06);
}

.brand {
  display: inline-flex;
  align-items: center;
  position: relative;
}
.brand-icon {
  width: 44px;
  height: 44px;
  margin-right: 12px;
  border-radius: 14px;
  background: #fceeee;
  border: 1px solid #f2d8d8;
  display: grid;
  place-items: center;
  color: var(--primary);
  flex-shrink: 0;
}
.brand-icon svg {
  width: 22px;
  height: 22px;
}
.brand-logo {
  height: 52px;
  max-width: 180px;
  object-fit: contain;
  transform: scale(0.9);
  transform-origin: left center;
}

.search-bar {
  width: 100%;
  position: relative;
}

.search-bar input {
  width: 100%;
  padding: 12px 44px 12px 46px;
  background: #f3f3f3;
  border: 2px solid #3b3b3b;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 500;
  color: #333;
  outline: none;
  position: relative;
}
.search-bar input::placeholder {
  color: #555;
  font-weight: 500;
}
.search-bar::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  background: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='11' cy='11' r='6.5' stroke='%233b3b3b' stroke-width='2'/%3E%3Cpath d='M16 16l4 4' stroke='%233b3b3b' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center center;
  pointer-events: none;
}

.search-bar input:focus {
  border-color: #3b3b3b;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(59, 59, 59, 0.1);
}

@media (max-width: 768px) {
  .home-reel-col {
    display: none;
  }
}

.search-suggestions {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 5;
}

.search-bar.open .search-suggestions {
  display: block;
}

.suggestion-head {
  padding: 8px 12px;
  font-weight: 700;
  border-bottom: 1px solid var(--stroke);
}

.suggestion-item {
  display: block;
  padding: 10px 12px;
  border-bottom: 1px solid var(--stroke);
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item strong {
  display: block;
  font-weight: 600;
}

.suggestion-item span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.suggestion-empty {
  padding: 10px 12px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: inherit;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.icon-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pill-link {
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: #fff;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.15s ease;
}

.pill-link:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pill-link.solid {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.pill-link.solid:hover {
  background: var(--primary-strong);
}

.badge-dot.inline {
  position: static;
  margin-left: 4px;
}

.store-chip {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--stroke);
  display: inline-flex;
}

.store-chip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff7262, #e53935);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
}

.user-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-links select {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: #fff;
}

.user-links .logout {
  color: var(--primary);
  font-weight: 600;
}

.dropdown {
  position: relative;
}

.dropdown-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 260px;
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: none;
  flex-direction: column;
  z-index: 10;
}

.dropdown:hover .dropdown-panel {
  display: flex;
}

.dropdown-head {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--stroke);
  font-weight: 700;
}

.dropdown-body {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.dropdown-item {
  padding: 10px 12px;
  border-bottom: 1px solid var(--stroke);
  display: flex;
  align-items: center;
  gap: 10px;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-empty {
  padding: 12px;
  color: var(--muted);
}

.note-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1a73e8;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  overflow: hidden;
}

.note-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
}

.page-shell {
  max-width: 1500px;
  margin: 24px auto 60px;
  padding: 0 24px;
  overflow-x: hidden;
}

.flash {
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-weight: 600;
}

.flash.success {
  background: #e9f9f0;
  color: #17603a;
  border: 1px solid #cceedd;
}

/* Category pills */
.category-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0 24px;
}

.filters-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}
.filters-row.left {
  justify-content: flex-start;
}

.filter-card {
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shadow);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 340px;
}

#priceForm.filter-card {
  flex-direction: column;
  align-items: stretch;
  max-width: 520px;
  width: 100%;
  box-sizing: border-box;
}
.price-slider-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.price-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.price-label {
  font-weight: 500;
  white-space: nowrap;
}

.price-inputs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.price-inputs input {
  width: 90px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
}

.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: #fff;
  color: var(--muted);
  font-weight: 600;
  transition: all 0.15s ease;
}

.category-pill.active {
  background: rgba(210, 59, 53, 0.12);
  color: var(--primary);
  border-color: rgba(210, 59, 53, 0.3);
}

.category-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Section headers */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.section-sub {
  color: var(--muted);
  margin-top: 4px;
  font-weight: 500;
}

.sort-menu {
  position: relative;
  margin-left: auto;
}

.sort-btn {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: #fff;
  font-weight: 600;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.sort-btn svg {
  width: 16px;
  height: 16px;
}

.sort-options {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px;
  display: none;
  flex-direction: column;
  min-width: 190px;
  z-index: 5;
}

.sort-menu.open .sort-options {
  display: flex;
}

.sort-option {
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
  font-weight: 600;
}

.sort-option:hover {
  background: var(--pill-bg);
}

.sort-option.active {
  background: rgba(210, 59, 53, 0.1);
  color: var(--primary);
}

/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.product-card .product-meta {
  white-space: normal;
}

.product-card {
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--stroke);
  display: flex;
  flex-direction: column;
}

.product-card[data-product-url] {
  cursor: pointer;
}

.product-card[data-product-url]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.product-media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #f0f2f6;
  overflow: hidden;
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #f5f7fb;
  color: #1d2a3c;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--stroke);
}

.badge-row {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.heart {
  position: absolute;
  top: 12px;
  right: 12px;
  min-width: 36px;
  height: 36px;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.92);
  display: grid;
  place-items: center;
  font-size: 16px;
  color: #c23a2f;
  cursor: pointer;
  padding: 0;
}

.heart.active {
  background: rgba(210, 59, 53, 0.12);
  color: var(--primary);
  border-color: rgba(210, 59, 53, 0.3);
}

.product-body {
  padding: 14px 14px 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.product-name {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.product-store {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.store-mini {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.store-mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-meta {
  display: flex;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  align-items: center;
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px 14px;
}

.price {
  color: #c23a2f;
  font-weight: 800;
  font-size: 17px;
}

.cart-btn {
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.cart-btn:hover {
  background: var(--primary-strong);
}

.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 520px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  min-width: 0;
  width: 100%;
  overflow-x: hidden;
}

.product-detail-media {
  position: relative;
}

.media-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 90vh;
  background: #000;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  overflow: hidden;
}

.media-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.media-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.media-slide img,
.media-slide video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.media-nav.prev { left: 10px; }
.media-nav.next { right: 10px; }

.media-dots {
  display: inline-flex;
  gap: 6px;
  margin-top: 10px;
}

.media-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid var(--stroke);
  background: #e7e9ee;
  cursor: pointer;
}

.media-dot.active {
  background: var(--primary);
  border-color: var(--primary);
}

@media (max-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
  }
  .product-card {
    border-radius: 14px;
  }
  .product-media {
    aspect-ratio: 4 / 5;
  }
  .product-body {
    padding: 10px 10px 6px;
    gap: 4px;
  }
  .product-name {
    font-size: 14px;
  }
  .product-store {
    font-size: 12px;
  }
  .product-footer {
    padding: 10px;
  }
  .price-slider-row {
    flex-direction: column;
    align-items: stretch;
  }
.price-slider-row input[type="range"] {
  width: 100%;
}
  .price-slider-row #priceSliderLabel {
    text-align: right;
  }
  .store-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
  }
  .store-card {
    border-radius: 14px;
  }
  .store-thumb {
    height: 90px;
  }
  .store-card-body {
    gap: 10px;
    padding: 10px;
  }
  .store-card-logo {
    width: 52px;
    height: 52px;
  }
  .store-card-text h4 {
    font-size: 14px;
  }
  .store-card-text p {
    font-size: 12px;
  }
  .product-detail {
    grid-template-columns: 1fr;
  }
  .media-frame {
    max-height: 80vh;
  }
}

.product-detail-info h2 {
  margin: 0 0 6px;
}

.detail-price {
  font-size: 24px;
  font-weight: 800;
  color: #c23a2f;
  margin: 4px 0 10px;
}

.detail-meta {
  color: var(--muted);
  margin: 4px 0;
}

.detail-desc {
  margin: 12px 0;
  line-height: 1.5;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 18px;
}

.detail-actions .heart {
  position: relative;
  top: 0;
  right: 0;
}

.detail-store-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: #fff;
}

/* Store page */
.store-hero {
  background: #fff;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 20px;
}

.store-banner {
  height: 220px;
  background-size: cover;
  background-position: center;
}

.store-hero-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 50px 18px 18px;
  margin-top: 0;
  align-items: flex-start;
  flex-wrap: wrap;
}

.store-hero-left {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex: 1;
  min-width: 280px;
}

.store-hero-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: 260px;
}

.store-logo {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 5px solid #fff;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(15, 23, 40, 0.2);
  background: #fff;
  transform: translateY(-40px);
}

.store-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.store-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.store-name {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
}

.store-meta {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-weight: 600;
  flex-wrap: wrap;
}

.store-description {
  margin: 6px 0 0;
  max-width: 720px;
  color: var(--text);
  line-height: 1.5;
}

.store-meta.stats {
  gap: 10px;
}

.store-actions-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
  justify-content: flex-end;
}

.tab-row {
  display: flex;
  gap: 10px;
  margin: 18px 0 12px;
}

.tab {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: #fff;
  font-weight: 700;
}

.tab.active {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(210, 59, 53, 0.08);
}

.inline-form {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.store-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: inherit;
}

.store-thumb {
  height: 120px;
  background-size: cover;
  background-position: center;
}

.store-card-body {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
}

.store-card-logo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #fff;
  box-shadow: 0 6px 16px rgba(15, 23, 40, 0.18);
}

.store-card-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.store-card-text h4 {
  margin: 0;
  font-size: 16px;
}

.store-card-text p {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 600;
}

.store-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
}

/* Cart */
.cart-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
}

.cart-thumb img {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  object-fit: cover;
}
.cart-thumb video {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  object-fit: cover;
}

.cart-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cart-name {
  font-weight: 700;
}

.cart-meta {
  color: var(--muted);
  font-weight: 600;
}

.cart-subtotal {
  color: #c23a2f;
  font-weight: 700;
}

.remove-link {
  color: var(--primary);
  font-weight: 700;
}

/* Messages */
.messages-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
}

.messages-list {
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 12px;
}

.message-thread {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
}

.message-thread.active {
  background: var(--pill-bg);
}

.thread-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #1a73e8;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.thread-name {
  font-weight: 700;
}

.thread-preview {
  color: var(--muted);
  font-size: 13px;
}

.messages-pane {
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 12px;
}

.messages-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message-bubble {
  max-width: 70%;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--pill-bg);
}

.message-bubble.me {
  align-self: flex-end;
  background: rgba(210, 59, 53, 0.12);
}

.message-time {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.comment-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #1a73e8;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  flex-shrink: 0;
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feed-card {
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 12px;
}

.feed-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.feed-title {
  font-weight: 800;
}

.feed-meta {
  color: var(--muted);
  font-weight: 600;
}

.feed-media {
  margin: 10px 0;
}

.feed-media img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 12px;
}

.feed-body {
  color: var(--text);
}

.sold-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Forms */
form input:not([type="checkbox"]):not([type="radio"]),
form select,
form textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: #fff;
  font-size: 15px;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  height: auto;
  padding: 0;
  border: none;
  box-shadow: none;
}

form button,
button,
input[type="submit"] {
  padding: 12px 16px;
  border-radius: 12px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

form button:hover,
button:hover,
input[type="submit"]:hover {
  background: var(--primary-strong);
}

.form-card {
  background: #fff;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
}

/* Add product experience */
.add-product-shell {
  display: grid;
  grid-template-columns: minmax(0, 640px) 1fr;
  gap: 24px;
  align-items: start;
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.add-form-pane .field-row {
  margin-bottom: 12px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.field-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.field-note {
  color: var(--muted);
  font-size: 12px;
}

.checkbox-row {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 12px;
}
.checkbox-row.fulfillment-row {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.checkbox-label {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  font-weight: 600;
  line-height: 1.3;
  word-break: normal;
  white-space: nowrap;
  padding: 10px 12px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: #fff;
}
.checkbox-label input[type="checkbox"],
.checkbox-label input[type="radio"] {
  flex-shrink: 0;
  justify-self: start;
}
.checkbox-label span {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.presale-fields {
  flex: 1 1 auto;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.presale-fields label {
  font-weight: 600;
}
.presale-fields input {
  flex: 1;
  min-width: 0;
}

.media-picker {
  border: 1px dashed var(--stroke);
  border-radius: 16px;
  padding: 12px;
  background: #f9fafc;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  align-items: start;
}

.media-preview {
  margin: 8px 0 12px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: #fff;
  padding: 10px;
}
.media-preview-label {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 8px;
  color: #475569;
}
.media-preview-visual {
  width: 100%;
  height: 200px;
  border-radius: 12px;
  overflow: hidden;
  background: #f1f4f9;
  display: flex;
  align-items: center;
  justify-content: center;
}
.media-preview-visual img,
.media-preview-visual video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-picker.dragging {
  border-color: var(--primary);
  background: rgba(210, 59, 53, 0.06);
}

.add-media-card {
  border: 1px dashed var(--stroke);
  border-radius: 14px;
  min-height: 150px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  width: 100%;
}

.add-card-plus {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #f1f4fa;
  color: var(--primary);
  font-size: 24px;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.add-card-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.add-card-text strong {
  color: var(--text);
}

.add-card-text small {
  color: var(--muted);
}

.media-thumb {
  position: relative;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.media-thumb .thumb-visual {
  width: 100%;
  height: 170px;
  background: #000;
}

.media-thumb img,
.media-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-meta {
  padding: 8px 10px;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--stroke);
  background: #fafbff;
}

.remove-thumb {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  z-index: 2;
}

.add-feed-pane {
  position: sticky;
  top: 84px;
}

.feed-panel {
  background: #ff4d4f;
  border: 1px solid #d23232;
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 40px);
  align-self: flex-start;
  width: 100%;
}

.feed-panel .feed-title {
  color: #fff;
}

.feed-panel .section-sub {
  color: rgba(255, 255, 255, 0.9);
}

.feed-title {
  font-weight: 800;
  font-size: 16px;
}

.feed-panel-body {
  margin-top: 12px;
  display: block;
  overflow-y: auto;
  scroll-behavior: smooth;
}
.feed-panel-body .feed-item {
  margin-bottom: 12px;
}
.feed-panel-body .feed-item:last-child {
  margin-bottom: 0;
}

.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
  gap: 120px;
  align-items: start;
  justify-content: space-between;
  padding-right: 8px;
  min-width: 0;
  overflow-x: hidden;
}

.home-reel-col {
  position: sticky;
  top: 90px;
  max-width: 440px;
  justify-self: end;
  width: 100%;
  margin-left: auto;
  margin-right: 4px;
}

.home-main {
  min-width: 0;
}

.reel-section {
  margin: 18px 0;
}

.reel-feed {
  max-height: calc(100vh - 70px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.25) transparent;
}

.reel-feed::-webkit-scrollbar {
  width: 6px;
}
.reel-feed::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.25);
  border-radius: 999px;
}
.reel-feed::-webkit-scrollbar-track {
  background: transparent;
}
.feed-item {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--stroke);
  min-height: clamp(720px, 92vh, 820px);
}

.fresh-item {
  min-height: auto;
}

.reel-media {
  display: block;
  background: #000;
  aspect-ratio: 9 / 16;
  height: clamp(360px, 70vh, 700px);
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  border-radius: 14px;
  overflow: hidden;
}

.fresh-media {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 4 / 5;
  height: auto;
  min-height: 320px;
  max-height: 520px;
}

.fresh-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  height: auto;
  min-height: 320px;
  max-height: 520px;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  margin: 0 auto;
}
.fresh-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.fresh-slide.active {
  opacity: 1;
  pointer-events: auto;
}
.fresh-slide img,
.fresh-slide video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.fresh-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.55);
  color: #fff;
  cursor: pointer;
}
.fresh-prev { left: 10px; }
.fresh-next { right: 10px; }
.fresh-dots {
  display: inline-flex;
  gap: 6px;
  margin: 10px auto 4px;
  justify-content: center;
  width: 100%;
}
.fresh-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid var(--stroke);
  background: #e7e9ee;
  cursor: pointer;
}
.fresh-dot.active {
  background: var(--primary);
  border-color: var(--primary);
}

.reel-media img,
.reel-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feed-item img,
.feed-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.reel-item {
  min-height: auto;
  flex: 0 0 auto;
  display: block;
  opacity: 0.9;
  pointer-events: auto;
  transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.reel-item.active {
  opacity: 1;
  transform: translateX(4px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
}

.reel-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.65) 60%, rgba(0,0,0,0.82) 100%);
  color: #fff;
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.reel-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.2);
}

.reel-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.reel-meta-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.reel-store {
  font-weight: 700;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: #fff;
}

.reel-product {
  font-weight: 800;
  color: #fff;
}

.reel-product:hover {
  color: #f3dede;
}

.reel-desc {
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-caption {
  position: absolute;
  left: 12px;
  bottom: 12px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 6px 10px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
}

.feed-item.active {
  outline: 2px solid var(--primary);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.feed-empty {
  border: 1px dashed var(--stroke);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 1024px) {
  .add-product-shell {
    grid-template-columns: 1fr;
  }
  .add-feed-pane {
    position: static;
  }
  .feed-panel {
    max-height: none;
  }

  .home-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .home-reel-col {
    position: static;
    max-width: none;
  }
}

@media (max-width: 820px) {
  .category-row {
    gap: 8px;
    margin-top: 10px;
  }
  .category-pill {
    padding: 8px 12px;
    font-size: 13px;
  }
  .filters-row {
    flex-direction: column;
    gap: 10px;
  }
  .filter-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 10px;
  }
  .filter-card label {
    font-size: 13px;
  }
  .price-inputs input,
  #zipInput {
    height: 32px;
    font-size: 13px;
    padding: 6px 8px;
  }
  .filters-row .slider-row input[type="range"] {
    width: 100%;
  }
  #priceForm,
  #zipForm {
    min-width: 0 !important;
  }
  .filter-card small,
  .filter-card .field-note {
    font-size: 12px;
  }
  .filters-row .button-row .pill-link,
  .filters-row .button-row .pill-link.solid {
    padding: 7px 12px;
    font-size: 13px;
  }
}

.mobile-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: -80px;
  background: #ffffff;
  box-shadow: 0 -8px 20px rgba(15, 23, 42, 0.08);
  border-top: 1px solid var(--stroke);
  display: none;
  justify-content: space-around;
  padding: 10px 0 12px;
  z-index: 900;
}
.mobile-nav a {
  flex: 1;
  text-align: center;
  color: #7a8594;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.mobile-nav a svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}
.mobile-nav button.mobile-nav-btn {
  flex: 1;
  text-align: center;
  background: none;
  border: none;
  color: #7a8594;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0;
}
.mobile-account-toggle {
  flex: 1;
  text-align: center;
  background: none;
  border: none;
  color: #7a8594;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0;
  position: relative;
}
.mobile-account-toggle svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}
.mobile-account-toggle.active,
.mobile-account-toggle:focus {
  color: var(--text);
  font-weight: 600;
}
.mobile-nav button.mobile-nav-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}
.mobile-nav button.mobile-nav-btn.active {
  color: var(--text);
  font-weight: 600;
}
.mobile-nav a.active {
  color: var(--text);
  font-weight: 600;
}

.mobile-account-panel {
  position: fixed;
  bottom: 76px;
  left: 12px;
  right: 12px;
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  padding: 12px;
  display: none;
  z-index: 1100;
}
.mobile-account-panel.open {
  display: block;
}
.mobile-account-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mobile-account-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}
.mobile-account-title .chevron {
  font-size: 14px;
}
.mobile-account-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
}
.mobile-account-actions a {
  position: relative;
  color: var(--text);
}
.mobile-account-actions .badge-dot {
  position: absolute;
  top: -2px;
  right: -6px;
}
.mobile-account-close {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.mobile-account-links {
  display: flex;
  flex-direction: column;
  margin-top: 10px;
  gap: 8px;
}
.mobile-account-links a {
  color: var(--text);
  font-weight: 600;
}

@media (max-width: 1024px) {
  body {
    padding-bottom: 90px;
  }
  .mobile-nav {
    display: flex;
    bottom: 0;
  }
}

@media (max-width: 768px) {
  .topbar {
    background: #d23b35;
    border-bottom-color: rgba(255,255,255,0.25);
  }
  .checkbox-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .checkbox-row.fulfillment-row {
    grid-template-columns: 1fr;
  }
  .presale-fields {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .presale-fields input {
    width: 100%;
  }
  #pickupLocationWrapper .stacked {
    gap: 6px;
  }
  #pickupLocationWrapper input[type="text"] {
    padding: 10px 12px;
  }
  .checkbox-row.fulfillment-row .checkbox-label {
    flex: 1 1 100%;
    justify-content: flex-start;
    width: 100%;
  }
  .topbar {
    grid-template-columns: 1fr;
    padding: 10px 14px;
    gap: 8px;
  }
  .brand {
    display: none;
  }
  .nav-right {
    display: none;
  }
  .search-bar {
    display: none;
  }
  body.home-page .search-bar {
    display: block;
    width: 100%;
  }
  #notifToggle {
    display: none;
  }
  body.home-page .nav-right .auth-cta {
    display: none;
  }
  .section-title {
    font-size: 20px;
  }
  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .filters-row {
    margin-bottom: 12px;
  }
  .filter-card {
    padding: 8px 10px;
  }
  .filter-card .slider-row {
    gap: 8px;
  }
  .filter-card .slider-row input[type="range"] {
    height: 6px;
  }
  .category-row {
    gap: 6px;
  }
  .category-pill {
    padding: 6px 10px;
    font-size: 12px;
  }
  .page-shell {
    margin-top: 12px;
    padding: 0 16px;
  }
  .filters-row .button-row .pill-link {
    padding: 7px 10px;
    font-size: 12px;
  }
  .mobile-nav .badge-dot {
    position: absolute;
    top: 4px;
    right: 30%;
  }
  .add-product-shell {
    gap: 14px;
  }
  .form-card {
    padding: 14px;
  }
  .media-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
  }
  .media-thumb .thumb-visual {
    height: 140px;
  }
  .add-card-plus {
    width: 38px;
    height: 38px;
    font-size: 20px;
  }
}

body.mobile-search-open {
  overflow: hidden;
}

.mobile-search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(210, 59, 53, 0.72);
  display: none;
  z-index: 1200;
  padding: 16px;
}
.mobile-search-overlay.open {
  display: flex;
}
.mobile-search-panel {
  background: linear-gradient(180deg, #d23b35 0%, #c12925 60%, #fff 100%);
  border-radius: 18px;
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.mobile-search-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.mobile-search-close {
  border: none;
  background: rgba(255,255,255,0.9);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
}
.mobile-search-form {
  flex: 1;
}
.mobile-search-form input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  font-size: 16px;
  background: #fff;
}
.mobile-search-results {
  flex: 1;
  overflow-y: auto;
}
.mobile-search-helper {
  text-align: center;
  color: #6b7280;
  font-size: 14px;
  padding: 40px 0;
}
.mobile-search-list {
  display: flex;
  flex-direction: column;
}
.mobile-search-item {
  display: flex;
  gap: 12px;
  padding: 10px 6px;
  border-bottom: 1px solid var(--stroke);
  color: var(--text);
}
.mobile-search-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  overflow: hidden;
  background: #eef1f6;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mobile-search-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mobile-search-avatar.placeholder span {
  font-weight: 600;
  color: #3b82f6;
}
.mobile-search-text {
  display: flex;
  flex-direction: column;
}
.mobile-search-title {
  font-weight: 600;
}
.mobile-search-sub {
  font-size: 12px;
  color: #6b7280;
}
@media (min-width: 769px) {
  .mobile-search-overlay {
    display: none !important;
  }
  .topbar .search-trigger {
    display: none;
  }
}
