@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Brand Colors from Our3DStory Logo */
  --bg-page: #FAF7F2;
  --bg-surface: #FFFFFF;
  --bg-surface-soft: #F4EFEA;
  --bg-sand: #EFE8DF;

  --color-sage: #4F6B52;
  --color-sage-dark: #3B523E;
  --color-sage-light: #EBF1EC;

  --color-terracotta: #DE9E62;
  --color-terracotta-dark: #C88A53;
  --color-terracotta-light: #FCF4EB;

  --color-charcoal: #1A1A1A;
  --text-primary: #1A1A1A;
  --text-muted: #666666;
  --text-light: #8E8E8E;

  --border-color: #E6DFD5;
  --border-radius-sm: 6px;
  --border-radius-md: 10px;
  --border-radius-lg: 16px;

  --shadow-sm: 0 2px 8px rgba(26, 26, 26, 0.04);
  --shadow-md: 0 4px 16px rgba(26, 26, 26, 0.06);
  --shadow-lg: 0 10px 30px rgba(26, 26, 26, 0.08);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-page);
  color: var(--color-charcoal);
  line-height: 1.5;
  font-size: 14.5px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-charcoal);
  line-height: 1.25;
}

/* Remove default focus outline on headings caused by Blazor's FocusOnNavigate */
h1:focus, h2:focus, h3:focus, h4:focus, h5:focus, h6:focus,
h1:focus-visible, h2:focus-visible, h3:focus-visible, h4:focus-visible, h5:focus-visible, h6:focus-visible,
[tabindex="-1"]:focus {
  outline: none !important;
  box-shadow: none !important;
}

h1 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
h2 { font-size: clamp(1.3rem, 2.8vw, 1.75rem); }
h3 { font-size: clamp(1.1rem, 2.2vw, 1.35rem); }
h4 { font-size: 1.05rem; }

a {
  color: var(--color-sage);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-sage-dark);
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.header-wrapper {
  background: rgba(250, 247, 242, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.top-bar {
  background: var(--color-sage-dark);
  color: #FFFFFF;
  font-size: 12px;
  padding: 5px 14px;
}

.top-bar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 clamp(18px, 5vw, 28px);
  gap: 8px;
}

.top-bar-badge {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.navbar {
  max-width: 1240px;
  margin: 0 auto;
  padding: 8px clamp(18px, 5vw, 28px) !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo {
  height: 38px;
  width: auto;
  object-fit: contain;
  transition: transform var(--transition-fast);
}

.brand-link:hover .brand-logo {
  transform: scale(1.04);
}

.brand-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--color-charcoal);
  white-space: nowrap;
}

.brand-title .brand-3 {
  color: var(--color-sage);
}

.brand-title .brand-d {
  color: var(--color-terracotta);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  list-style: none;
}

.nav-link {
  font-weight: 500;
  font-size: 14px;
  color: var(--color-charcoal);
  padding: 6px 10px;
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
  color: var(--color-sage);
  background: var(--color-sage-light);
}

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

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13.5px;
  padding: 8px 16px;
  border-radius: var(--border-radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.35;
}

.btn-primary {
  background-color: var(--color-sage);
  color: #FFFFFF;
}

.btn-primary:hover {
  background-color: var(--color-sage-dark);
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 107, 82, 0.25);
}

.btn-accent {
  background-color: var(--color-terracotta);
  color: #FFFFFF;
}

.btn-accent:hover {
  background-color: var(--color-terracotta-dark);
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(222, 158, 98, 0.3);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--border-color);
  color: var(--color-charcoal);
}

.btn-outline:hover {
  background-color: var(--bg-surface-soft);
  border-color: var(--color-sage);
  color: var(--color-sage);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: var(--border-radius-sm);
}

.btn-lg {
  padding: 11px 22px;
  font-size: 15px;
}

/* ==========================================================================
   Layout Containers & Spacing
   ========================================================================== */
.container,
.container-fluid,
.container-sm,
.container-md,
.container-lg,
.container-xl,
.container-xxl {
  max-width: 1240px;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: clamp(18px, 5vw, 28px) !important;
  padding-right: clamp(18px, 5vw, 28px) !important;
}

.main-content {
  width: 100%;
  min-height: calc(100vh - 180px);
  overflow-x: hidden;
}

.section {
  padding: clamp(20px, 4vw, 44px) 0;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  padding: clamp(24px, 5vw, 52px) 0;
  background: linear-gradient(180deg, var(--bg-page) 0%, var(--bg-sand) 100%);
  border-bottom: 1px solid var(--border-color);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: clamp(20px, 4vw, 44px);
}

.hero-badge {
  display: inline-block;
  background: var(--color-sage-light);
  color: var(--color-sage-dark);
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hero-title {
  font-size: clamp(1.8rem, 4.2vw, 2.75rem);
  line-height: 1.15;
  margin-bottom: 14px;
  letter-spacing: -0.6px;
}

.hero-description {
  font-size: clamp(14px, 2.2vw, 16px);
  color: var(--text-muted);
  margin-bottom: 24px;
  max-width: 520px;
  line-height: 1.55;
}

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

.hero-image-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-brand-card {
  background: var(--bg-surface);
  padding: clamp(18px, 3.5vw, 28px);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  text-align: center;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
}

.hero-brand-card img {
  width: 100%;
  max-width: 180px;
  height: auto;
  margin-bottom: 12px;
  object-fit: contain;
}

/* ==========================================================================
   Product Grid & Responsive 2-Column Mobile Standard
   ========================================================================== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}

.product-card {
  background: var(--bg-surface);
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
  display: flex;
  flex-direction: column;
  position: relative;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #D6CBC0;
}

.product-badge-stack {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 2;
}

.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-sale {
  background: var(--color-terracotta);
  color: #fff;
}

.badge-made-to-order {
  background: var(--color-sage);
  color: #fff;
}

.badge-low-stock {
  background: #E57373;
  color: #fff;
}

.product-thumb-link {
  display: block;
  aspect-ratio: 1 / 1;
  background: var(--bg-surface-soft);
  overflow: hidden;
  position: relative;
}

.product-thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
  transition: transform 0.35s ease;
}

.product-card:hover .product-thumb {
  transform: scale(1.05);
}

.product-info {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-category {
  font-size: 11px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  font-weight: 600;
}

.product-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--color-charcoal);
  margin-bottom: 8px;
  line-height: 1.35;
  min-height: 40px;
}

.product-title a {
  color: inherit;
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
  gap: 8px;
}

.product-prices {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.current-price {
  font-size: 16.5px;
  font-weight: 700;
  color: var(--color-sage-dark);
}

.original-price {
  font-size: 13px;
  color: var(--text-light);
  text-decoration: line-through;
}

/* ==========================================================================
   Category Pills (Touch & Scroll Friendly)
   ========================================================================== */
.category-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
  margin-bottom: 24px;
  scrollbar-width: none;
}

.category-pills::-webkit-scrollbar {
  display: none;
}

.category-pill {
  padding: 6px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-charcoal);
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.category-pill:hover, .category-pill.active {
  background: var(--color-sage);
  color: #fff;
  border-color: var(--color-sage);
}

/* ==========================================================================
   Cart & Checkout Form Styles
   ========================================================================== */
.cart-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-surface);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.cart-table th, .cart-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.cart-table th {
  background: var(--bg-surface-soft);
  font-weight: 600;
  font-size: 13px;
  color: var(--text-muted);
}

.summary-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
}

.summary-total {
  border-top: 2px solid var(--border-color);
  margin-top: 10px;
  padding-top: 12px;
  font-size: 17px;
  font-weight: 700;
}

.form-control, .form-select {
  font-size: 14.5px;
  padding: 9px 12px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--color-sage);
  box-shadow: 0 0 0 3px rgba(79, 107, 82, 0.15);
  outline: none;
}

/* ==========================================================================
   Glassmorphic Mobile Bottom Navigation Bar
   ========================================================================== */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 767px) {
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border-color);
    align-items: center;
    justify-content: space-around;
    z-index: 1030;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -2px 12px rgba(26, 26, 26, 0.06);
  }

  .main-content {
    padding-bottom: 64px;
  }

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    flex: 1;
    height: 100%;
    transition: color 0.15s ease;
    user-select: none;
  }

  .bottom-nav-item:hover, .bottom-nav-item.active {
    color: var(--color-terracotta);
    font-weight: 600;
  }

  .bottom-nav-icon {
    width: 20px;
    height: 20px;
    margin-bottom: 2px;
  }

  .bottom-nav-badge {
    position: absolute;
    top: -5px;
    right: -10px;
    background: var(--color-terracotta);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 10px;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
  }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  background: var(--color-charcoal);
  color: #C9C4BE;
  padding: 24px 0 16px;
  margin-top: 36px;
  border-top: 1px solid #2A2A2A;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #2A2A2A;
}

.footer-brand {
  display: flex;
  flex-direction: column;
}

.footer-tagline {
  color: #8E8A84;
  font-size: 12px;
  margin: 0;
}

.footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 20px;
}

.footer-link {
  color: #A9A49E;
  font-size: 13px;
  text-decoration: none;
  transition: color 0.15s ease;
  white-space: nowrap;
}

.footer-link:hover {
  color: var(--color-terracotta);
}

.footer-admin-link {
  color: #DE9E62;
  font-weight: 600;
  padding: 3px 8px;
  background: rgba(222, 158, 98, 0.12);
  border-radius: 6px;
  font-size: 12px;
}

.footer-admin-link:hover {
  background: rgba(222, 158, 98, 0.24);
  color: #FFFFFF;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 14px;
  font-size: 11.5px;
  color: #8E8A84;
}

.footer-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 767px) {
  .footer {
    padding: 18px 0 12px;
    margin-top: 24px;
  }

  .footer-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding-bottom: 14px;
  }

  .footer-links {
    justify-content: center;
    gap: 8px 14px;
    font-size: 12px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding-top: 10px;
  }
}

/* ==========================================================================
   Admin Panel Layout & Styles
   ========================================================================== */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  background: #F7F5F0;
}

.admin-sidebar {
  background: #182319;
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 1040;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-nav-item a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.admin-nav-item a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  transform: translateX(2px);
}

.admin-nav-item a.active {
  background: var(--color-terracotta);
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(222, 158, 98, 0.35);
}

.admin-nav-item .nav-icon {
  font-size: 15px;
  width: 18px;
  text-align: center;
}

.admin-content {
  padding: 24px;
  max-width: 1400px;
  width: 100%;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--color-terracotta);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card:nth-child(2) { border-left-color: var(--color-sage); }
.stat-card:nth-child(3) { border-left-color: #2E7D32; }
.stat-card:nth-child(4) { border-left-color: #1976D2; }

.stat-card-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}

.stat-card-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.admin-mobile-header {
  background: #FFFFFF;
  height: 52px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.admin-menu-toggle {
  background: none;
  border: none;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1A1A1A;
  border-radius: 6px;
  cursor: pointer;
}

.admin-mobile-tabs {
  background: #FFFFFF;
  padding: 6px 14px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 52px;
  z-index: 1020;
  scrollbar-width: none;
}

.admin-mobile-tabs::-webkit-scrollbar {
  display: none;
}

.admin-tab-pill {
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  background: #F2EFE9;
  color: #4A4A4A;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.admin-tab-pill.active {
  background: var(--color-terracotta);
  color: #FFFFFF;
  box-shadow: 0 3px 8px rgba(222, 158, 98, 0.35);
  border-color: var(--color-terracotta);
}

.admin-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1040;
  backdrop-filter: blur(2px);
  animation: fadeIn 0.2s ease;
}

.admin-mobile-save-bar {
  position: fixed;
  bottom: 56px;
  bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 8px clamp(16px, 4.5vw, 22px);
  box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.12);
  z-index: 1035;
  border-top: 1px solid var(--border-color);
}

/* ==========================================================================
   Responsive Breakpoints & Mobile Optimization
   ========================================================================== */

@media (max-width: 991px) {
  .admin-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    height: 100vh;
    z-index: 1050;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .admin-sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.4);
  }

  .admin-content {
    padding: 16px clamp(16px, 4.5vw, 24px) 140px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-description {
    margin: 0 auto 20px;
  }

  .hero-buttons {
    justify-content: center;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
}

@media (max-width: 767px) {
  .container,
  .container-fluid,
  .container-sm,
  .container-md,
  .container-lg,
  .container-xl,
  .container-xxl {
    padding-left: clamp(18px, 5vw, 28px) !important;
    padding-right: clamp(18px, 5vw, 28px) !important;
  }

  /* Prevent negative row margins from pushing items against phone edges */
  .row {
    --bs-gutter-x: 12px;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .row > * {
    padding-left: 6px !important;
    padding-right: 6px !important;
  }

  .section {
    padding: 18px 0;
  }

  /* Responsive 2-Column Product Grid on Mobile Phones with safe breathing room */
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .product-card {
    border-radius: 12px;
  }

  .product-thumb {
    padding: 8px;
  }

  .product-info {
    padding: 10px;
  }

  .product-category {
    font-size: 10px;
    margin-bottom: 2px;
  }

  .product-title {
    font-size: 13px;
    margin-bottom: 6px;
    min-height: unset;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .product-prices {
    gap: 4px;
  }

  .current-price {
    font-size: 14.5px;
  }

  .original-price {
    font-size: 11.5px;
  }

  .product-meta {
    padding-top: 8px;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .product-meta .btn {
    width: 100%;
    padding: 5px 8px;
    font-size: 12px;
    border-radius: 6px;
  }

  .product-badge-stack {
    top: 6px;
    left: 6px;
    gap: 3px;
  }

  .product-badge-stack .badge {
    font-size: 9px;
    padding: 2px 5px;
  }

  /* Stats cards in Admin */
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .stat-card {
    padding: 12px;
    border-radius: 10px;
  }

  .stat-card-title {
    font-size: 10px;
  }

  .stat-card-value {
    font-size: 18px;
  }

  /* Cart table to Card view on Mobile */
  .cart-table, .cart-table tbody, .cart-table tr, .cart-table td {
    display: block;
    width: 100%;
  }

  .cart-table thead {
    display: none;
  }

  .cart-table tr {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
  }

  .cart-table td {
    padding: 4px 0;
    border: none;
  }

  /* Responsive font controls without iOS zoom */
  .form-control, .form-select {
    font-size: 15px !important;
    padding: 8px 10px;
  }
}

@media (max-width: 600px) {
  .top-bar-badge {
    font-size: 11px;
  }

  .navbar {
    padding: 8px clamp(18px, 5vw, 28px) !important;
  }
  .top-bar {
    padding: 6px 0;
  }

  .brand-logo {
    height: 32px;
  }

  .brand-title {
    font-size: 17px;
  }

  .nav-links {
    display: none;
  }
}

@media (max-width: 360px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .product-info {
    padding: 8px 6px;
  }
  .product-title {
    font-size: 12px;
  }
  .current-price {
    font-size: 13.5px;
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Blazor Circuit Reconnect Modal */
#components-reconnect-modal {
  display: none;
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 99999;
}

#components-reconnect-modal.components-reconnect-show {
  display: block;
  animation: fadeIn 0.3s ease;
}

#components-reconnect-modal.components-reconnect-hide {
  display: none !important;
}

#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
  display: block;
}

.reconnect-dialog {
  display: flex;
  align-items: center;
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(8px);
  color: #fff;
  padding: 0.65rem 1.1rem;
  border-radius: 9999px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.875rem;
  font-weight: 500;
}
