/* Digital Shop — FSUB-inspired storefront theme */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --ds-primary: #007bff;
  --ds-primary-dark: #0062cc;
  --ds-primary-soft: rgba(0, 123, 255, 0.1);
  --ds-accent: #20c997;
  --ds-sidebar: #1a1d2e;
  --ds-bg: #f4f6fb;
  --ds-card-radius: 16px;
  --ds-shadow: 0 2px 16px rgba(26, 29, 46, 0.06);
  --ds-shadow-hover: 0 12px 32px rgba(26, 29, 46, 0.12);
  --ds-text: #1e293b;
  --ds-muted: #64748b;
  --ds-border: #e2e8f0;
  --ds-hero: linear-gradient(135deg, #007bff 0%, #20c997 100%);
  --ds-radius-pill: 999px;
  --mobile-nav-h: 64px;
}

body.store-body,
body {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--ds-bg);
  color: var(--ds-text);
}

main.flex-grow-1 {
  flex: 1 0 auto;
}

/* Store layout */
.store-layout {
  display: flex;
  gap: 0;
  min-height: calc(100vh - 64px);
}

.store-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--ds-border);
  padding: 1.25rem 0;
  display: none;
}

@media (min-width: 992px) {
  .store-sidebar {
    display: block;
  }
}

.store-sidebar-title {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ds-muted);
  padding: 0 1.25rem 0.5rem;
}

.store-sidebar .nav-link {
  color: var(--ds-text);
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
  border-radius: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.store-sidebar .nav-link:hover {
  background: var(--ds-primary-soft);
  color: var(--ds-primary);
}

.store-sidebar .nav-link.active {
  background: var(--ds-primary-soft);
  color: var(--ds-primary);
  font-weight: 600;
  border-right: 3px solid var(--ds-primary);
}

.store-content {
  flex: 1;
  min-width: 0;
  padding: 1.5rem;
}

@media (max-width: 991.98px) {
  .store-content {
    padding: 1rem;
  }
}

/* Navbar */
.store-navbar {
  background: var(--ds-sidebar) !important;
  height: 64px;
}

.store-navbar .navbar-brand {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.store-navbar .nav-link {
  font-size: 0.9rem;
  padding: 0.5rem 0.85rem !important;
  border-radius: 8px;
}

.store-navbar .nav-link.active,
.store-navbar .nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
}

.balance-widget {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  color: #fff;
}

.balance-widget .balance-value {
  font-weight: 700;
  color: #7dd3fc;
}

/* Hero */
.hero-banner {
  background: var(--ds-hero);
  border-radius: var(--ds-card-radius);
  color: #fff;
  padding: 2.5rem 2rem;
  box-shadow: var(--ds-shadow);
}

/* Cards */
.ds-card,
.category-card,
.product-card {
  border: none;
  border-radius: var(--ds-card-radius);
  box-shadow: var(--ds-shadow);
  background: #fff;
}

.category-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  height: 100%;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--ds-shadow-hover);
}

.product-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--ds-shadow-hover);
}

.product-card .card-img-top {
  height: 160px;
  object-fit: cover;
  background: linear-gradient(145deg, #eef2ff, #e0f2fe);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-thumb {
  position: relative;
}

.product-thumb-inner {
  width: 100%;
  height: 100%;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #eef2ff 0%, #e0f2fe 50%, #ecfdf5 100%);
}

.product-thumb-inner i {
  font-size: 2.75rem;
  color: var(--ds-primary);
  opacity: 0.45;
}

.product-card .placeholder-icon {
  font-size: 3rem;
  color: #adb5bd;
}

.price-tag {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ds-primary);
}

.btn-primary {
  background: var(--ds-primary);
  border-color: var(--ds-primary);
}

.btn-primary:hover {
  background: #0069d9;
  border-color: #0062cc;
}

/* Order timeline */
.order-timeline .timeline-item {
  position: relative;
  padding-left: 2rem;
  padding-bottom: 1.25rem;
  border-left: 2px solid var(--ds-border);
  margin-left: 0.5rem;
}

.order-timeline .timeline-item:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.order-timeline .timeline-item::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ds-primary);
  border: 2px solid #fff;
}

.order-timeline .timeline-item.done::before {
  background: #198754;
}

.order-timeline .timeline-item.pending::before {
  background: #ffc107;
}

.qr-img {
  max-width: 280px;
  border-radius: 0.75rem;
  border: 1px solid var(--ds-border);
}

/* Footer */
footer.store-footer {
  background: var(--ds-sidebar);
  color: #94a3b8;
}

footer.store-footer a {
  color: #cbd5e1;
  text-decoration: none;
}

footer.store-footer a:hover {
  color: #fff;
}

/* HTMX */
.htmx-request .htmx-indicator {
  display: inline-block !important;
}

.htmx-indicator {
  display: none;
}

@media (max-width: 767.98px) {
  .cart-summary-sticky {
    position: static !important;
  }
}

/* Admin legacy hooks (shared custom.css) */
.admin-sidebar {
  min-height: 100vh;
  background: var(--ds-sidebar);
}

.row-loss {
  --bs-table-bg: #fff5f5;
}

/* ============================================================
   UI/UX polish — micro-interactions & motion (2026 refresh)
   ============================================================ */

/* Smoother, springier card motion */
.category-card,
.product-card,
.ds-card {
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.category-card:hover {
  transform: translateY(-6px);
}

.product-card:hover {
  transform: translateY(-6px);
}

/* Image zoom inside product cards on hover */
.product-card .card-img-top {
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.product-card:hover .card-img-top {
  transform: scale(1.06);
}

/* Category icon pop */
.category-card .rounded-circle {
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.25s ease;
}

.category-card:hover .rounded-circle {
  transform: scale(1.12) rotate(-4deg);
}

/* Price tag: gradient text for a premium feel */
.price-tag {
  background: var(--ds-hero);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.01em;
}

/* Buttons: subtle lift + shadow on hover */
.btn {
  transition: transform 0.15s ease, box-shadow 0.15s ease,
    background-color 0.15s ease, border-color 0.15s ease;
}

.btn-primary:hover,
.btn-light:hover,
.btn-outline-light:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 123, 255, 0.25);
}

.btn:active {
  transform: translateY(0);
}

/* Hero: soft floating accent + entrance */
.hero-banner {
  position: relative;
  overflow: hidden;
}

.hero-banner::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -10%;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* Sidebar links slide accent */
.store-sidebar .nav-link {
  transition: background-color 0.18s ease, color 0.18s ease, padding-left 0.18s ease;
}

.store-sidebar .nav-link:hover {
  padding-left: 1.6rem;
}

/* Stock/status badges: gentle entrance */
.badge {
  transition: transform 0.15s ease;
}

/* Skeleton shimmer utility (usable for loading states) */
.ds-skeleton {
  background: linear-gradient(90deg, #eef1f5 25%, #f6f8fa 37%, #eef1f5 63%);
  background-size: 400% 100%;
  animation: ds-shimmer 1.4s ease infinite;
  border-radius: 8px;
}

@keyframes ds-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* Fade-in for content swapped by HTMX */
.htmx-added {
  animation: ds-fade-in 0.35s ease both;
}

@keyframes ds-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Feature / trust strip (FSUB-style) */
.feature-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #fff;
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-card-radius);
  padding: 0.85rem 1rem;
  height: 100%;
  box-shadow: var(--ds-shadow);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.feature-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--ds-shadow-hover);
}

.feature-ico {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.feature-title {
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.2;
}

.feature-desc {
  font-size: 0.78rem;
  color: var(--ds-muted);
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .feature-item {
    transition: none !important;
  }
  .category-card,
  .product-card,
  .ds-card,
  .product-card .card-img-top,
  .category-card .rounded-circle,
  .btn,
  .store-sidebar .nav-link {
    transition: none !important;
  }
  .ds-skeleton,
  .htmx-added {
    animation: none !important;
  }
}

/* ============================================================
   Storefront UX refresh — navigation, forms, mobile (2026)
   ============================================================ */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  padding: 0.5rem 1rem;
  background: var(--ds-primary);
  color: #fff;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  left: 0;
}

.store-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.store-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(0, 123, 255, 0.2);
  color: #7dd3fc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.btn-store-cart {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: var(--ds-radius-pill);
  padding: 0.4rem 1rem;
  font-weight: 600;
  font-size: 0.875rem;
  transition: background 0.2s ease, transform 0.15s ease;
}

.btn-store-cart:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: translateY(-1px);
}

.cart-badge,
.mobile-nav-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--ds-radius-pill);
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  line-height: 1;
}

.category-pills-wrap {
  background: #fff;
  border-bottom: 1px solid var(--ds-border);
  padding: 0.65rem 0;
  position: sticky;
  top: 64px;
  z-index: 1020;
}

.category-pills {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0 1rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.category-pills::-webkit-scrollbar {
  display: none;
}

.category-pill {
  flex-shrink: 0;
  padding: 0.4rem 0.9rem;
  border-radius: var(--ds-radius-pill);
  background: var(--ds-bg);
  color: var(--ds-text);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.category-pill:hover {
  background: var(--ds-primary-soft);
  color: var(--ds-primary);
}

.category-pill.active {
  background: var(--ds-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--mobile-nav-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--ds-border);
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  z-index: 1030;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  color: var(--ds-muted);
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 600;
  position: relative;
  transition: color 0.15s ease;
}

.mobile-nav-item i {
  font-size: 1.25rem;
}

.mobile-nav-item.active {
  color: var(--ds-primary);
}

@media (max-width: 991.98px) {
  body.store-body {
    padding-bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0));
  }
}

.btn-scroll-top {
  position: fixed;
  right: 1rem;
  bottom: calc(var(--mobile-nav-h) + 1rem);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--ds-primary);
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 123, 255, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 1025;
}

.btn-scroll-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@media (min-width: 992px) {
  .btn-scroll-top {
    bottom: 1.5rem;
  }
}

.page-header {
  margin-bottom: 1.5rem;
}

.page-header .breadcrumb {
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

.breadcrumb-item a {
  color: var(--ds-muted);
  text-decoration: none;
}

.breadcrumb-item a:hover {
  color: var(--ds-primary);
}

.breadcrumb-item.active {
  color: var(--ds-text);
  font-weight: 600;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title i {
  color: var(--ds-primary);
}

.ds-card {
  border: 1px solid var(--ds-border);
}

.form-control,
.form-select {
  border-radius: 12px;
  border-color: var(--ds-border);
  padding: 0.65rem 0.9rem;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--ds-primary);
  box-shadow: 0 0 0 3px var(--ds-primary-soft);
}

.form-floating > .form-control {
  border-radius: 12px;
}

.input-group .form-control {
  border-radius: 12px 0 0 12px;
}

.input-group .btn {
  border-radius: 0 12px 12px 0;
}

.btn-primary {
  border-radius: 12px;
  font-weight: 600;
  padding: 0.55rem 1.25rem;
}

.btn-lg {
  border-radius: 14px;
}

.btn-rounded {
  border-radius: var(--ds-radius-pill) !important;
}

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}

.empty-state-icon {
  width: 88px;
  height: 88px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--ds-primary-soft);
  color: var(--ds-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.empty-state-title {
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.checkout-card {
  border: 2px solid var(--ds-primary) !important;
  overflow: hidden;
}

.checkout-card .card-header {
  background: var(--ds-hero) !important;
  border: none;
}

.product-detail-media {
  border-radius: var(--ds-card-radius);
  background: linear-gradient(145deg, #eef2ff, #e0f2fe);
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-detail-media i {
  font-size: 5rem;
  color: var(--ds-primary);
  opacity: 0.35;
}

.buy-box {
  position: sticky;
  top: 5.5rem;
}

.product-card .card-title a {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}

.stock-pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35em 0.75em;
  border-radius: var(--ds-radius-pill);
}

.stock-pill.in-stock {
  background: rgba(25, 135, 84, 0.12);
  color: #198754;
}

.stock-pill.low-stock {
  background: rgba(255, 193, 7, 0.15);
  color: #b45309;
}

.stock-pill.out-stock {
  background: rgba(220, 53, 69, 0.12);
  color: #dc3545;
}

.stock-pill.unlimited {
  background: rgba(0, 123, 255, 0.1);
  color: var(--ds-primary);
}

.lookup-card {
  border: none;
  border-radius: var(--ds-card-radius);
  overflow: hidden;
  box-shadow: var(--ds-shadow-hover);
}

.lookup-card-header {
  background: var(--ds-hero);
  color: #fff;
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
}

.footer-brand {
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
}

.footer-heading {
  color: #e2e8f0;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}

.footer-text {
  color: #94a3b8;
}

.footer-links a {
  color: #cbd5e1;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: #fff;
}

.footer-divider {
  border-color: rgba(255, 255, 255, 0.1) !important;
}

.footer-copy {
  color: #64748b;
}

.status-badge {
  font-weight: 600;
  padding: 0.45em 0.75em;
}

body.htmx-loading {
  cursor: wait;
}

body.htmx-loading .store-content {
  opacity: 0.72;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
