/* ============================================
   SIDO TRANG TRÍ TẾT — WHOLESALE CATALOG CSS
   Mobile-first · Clean · Fast · Tet Theme
   ============================================ */

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* --- CSS Custom Properties --- */
:root {
  /* Colors */
  --red-primary: #E53935;
  --red-dark: #C62828;
  --red-light: #FFEBEE;
  --red-50: #FFF5F5;
  --gold-accent: #FFD54F;
  --gold-dark: #F9A825;
  --gold-light: #FFF8E1;
  --white: #FFFFFF;
  --bg-main: #F5F5F5;
  --bg-card: #FFFFFF;
  --text-primary: #1A1A1A;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border-color: #EEEEEE;
  --border-light: #F0F0F0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.06);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-xs: 11px;
  --font-sm: 12px;
  --font-base: 14px;
  --font-md: 15px;
  --font-lg: 16px;
  --font-xl: 18px;
  --font-2xl: 20px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 50%;

  /* Layout */
  --header-height: 52px;
  --category-height: 44px;
  --bottom-nav-height: 56px;
  --content-top: calc(var(--header-height) + var(--category-height));

  /* Transition */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.modal-open {
  overflow: hidden;
}

body.cart-open {
  overflow: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: var(--font-family);
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
  -webkit-tap-highlight-color: transparent;
}

input {
  font-family: var(--font-family);
  outline: none;
  border: none;
}

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

ul, ol {
  list-style: none;
}

/* --- Utility --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ============================================
   HEADER
   ============================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--white);
  display: flex;
  align-items: center;
  padding: 0 var(--space-md);
  z-index: 100;
  border-bottom: 1px solid var(--border-light);
}

.header__back {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-primary);
  border-radius: var(--radius-full);
  transition: background var(--transition-fast);
  flex-shrink: 0;
}

.header__back:active {
  background: var(--bg-main);
}

.header__title {
  flex: 1;
  text-align: center;
  font-size: var(--font-lg);
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 var(--space-sm);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-shrink: 0;
}

.header__btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  transition: background var(--transition-fast);
  position: relative;
}

.header__btn:active {
  background: var(--bg-main);
}

.header__btn svg {
  width: 22px;
  height: 22px;
  color: var(--text-primary);
}

.header__badge,
.bottom-nav__badge {
  position: absolute;
  top: 2px;
  right: 0px;
  min-width: 18px;
  height: 18px;
  background: var(--red-primary);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 0 4px;
  line-height: 1;
  border: 2px solid var(--white);
}

/* ============================================
   SEARCH BAR
   ============================================ */
.search-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--white);
  display: flex;
  align-items: center;
  padding: 0 var(--space-md);
  gap: var(--space-sm);
  z-index: 110;
  transform: translateY(-100%);
  transition: transform var(--transition-slow);
  border-bottom: 1px solid var(--border-light);
}

.search-bar.active {
  transform: translateY(0);
}

.search-bar__input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--bg-main);
  border-radius: 24px;
  padding: 0 var(--space-md);
  height: 38px;
  gap: var(--space-sm);
}

.search-bar__input-wrap svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-bar__input {
  flex: 1;
  height: 100%;
  background: transparent;
  font-size: var(--font-base);
  color: var(--text-primary);
}

.search-bar__input::placeholder {
  color: var(--text-muted);
}

.search-bar__cancel {
  font-size: var(--font-base);
  color: var(--red-primary);
  font-weight: 600;
  padding: var(--space-sm);
  white-space: nowrap;
}

/* ============================================
   CATEGORY NAVIGATION
   ============================================ */
.category-nav-wrapper {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  z-index: 99;
  background: var(--white);
}

.category-nav {
  height: var(--category-height);
  background: var(--white);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 0;
  padding: 0 var(--space-sm);
}

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

.category-nav__filter {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 6px 12px;
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-primary);
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-right: var(--space-sm);
  transition: all var(--transition-fast);
}

.category-nav__filter svg {
  width: 14px;
  height: 14px;
}

.category-nav__filter:active {
  background: var(--bg-main);
}

.category-nav__item {
  padding: 6px 14px;
  font-size: var(--font-base);
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
  transition: color var(--transition-fast);
}

.category-nav__item.active {
  color: var(--red-primary);
  font-weight: 700;
}

.category-nav__item.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--red-primary);
  border-radius: 2px;
}

/* Arrow indicator for parent categories */
.category-nav__arrow {
  font-size: 10px;
  margin-left: 2px;
  display: inline-block;
  transition: transform var(--transition-fast);
}

.category-nav__item.active .category-nav__arrow {
  transform: rotate(180deg);
}

/* Subcategory Row */
.category-sub {
  display: flex;
  align-items: center;
  max-height: 0;
  overflow: hidden;
  background: var(--bg-main);
  border-bottom: 1px solid transparent;
  transition: max-height var(--transition-base), padding var(--transition-base), border-color var(--transition-base);
  padding: 0 var(--space-sm);
  gap: var(--space-sm);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

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

.category-sub.active {
  max-height: 44px;
  padding: var(--space-sm) var(--space-sm);
  border-bottom-color: var(--border-light);
}

.category-sub__item {
  padding: 5px 14px;
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  border-radius: 20px;
  background: var(--white);
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
  flex-shrink: 0;
  cursor: pointer;
}

.category-sub__item:active {
  transform: scale(0.96);
}

.category-sub__item.active {
  color: var(--white);
  background: var(--red-primary);
  border-color: var(--red-primary);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  padding-top: var(--content-top);
  padding-bottom: calc(var(--bottom-nav-height) + 16px);
  min-height: 100vh;
}

/* ============================================
   PRODUCT GRID
   ============================================ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
  padding: var(--space-sm);
}

/* ============================================
   PRODUCT CARD
   ============================================ */
.product-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.product-card:active {
  transform: scale(0.98);
}

/* Image */
.product-card__image-wrap {
  position: relative;
  width: 100%;
  padding-top: 100%;
  overflow: hidden;
  background: var(--bg-main);
  cursor: pointer;
}

.product-card__image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
  transition: transform var(--transition-base);
}

.product-card__image-wrap:active .product-card__image {
  transform: scale(1.03);
}

/* Image placeholder */
.product-card__img-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  line-height: 1;
  user-select: none;
}

/* Body */
.product-card__body {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  flex: 1;
}

/* Tags */
.product-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.product-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: var(--font-xs);
  font-weight: 600;
  border-radius: 4px;
  line-height: 1.4;
}

.product-tag--primary {
  color: var(--red-primary);
  background: var(--red-light);
  border: 1px solid rgba(229, 57, 53, 0.2);
}

.product-tag--secondary {
  color: var(--gold-dark);
  background: var(--gold-light);
  border: 1px solid rgba(249, 168, 37, 0.25);
}

/* Name */
.product-card__name {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card__sku {
  font-weight: 800;
}

/* Price */
.product-card__price {
  font-size: var(--font-md);
  font-weight: 800;
  color: var(--red-primary);
  line-height: 1.3;
}

.product-card__unit {
  font-size: var(--font-xs);
  font-weight: 500;
  color: var(--text-secondary);
}

/* Quantity Controls */
.qty-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: var(--space-xs);
}

.qty-controls__stepper {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.qty-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-lg);
  font-weight: 500;
  color: var(--text-primary);
  background: var(--white);
  transition: background var(--transition-fast);
}

.qty-btn:active {
  background: var(--bg-main);
}

.qty-btn--minus {
  border-right: 1px solid var(--border-color);
}

.qty-btn--plus {
  border-left: 1px solid var(--border-color);
}

.qty-display {
  width: 36px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-sm);
  font-weight: 700;
  color: var(--text-primary);
  background: var(--white);
}

.qty-quick {
  display: flex;
  gap: 4px;
  flex: 1;
}

.qty-quick__btn {
  flex: 1;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-sm);
  font-weight: 700;
  color: var(--red-primary);
  background: var(--white);
  border: 1px solid var(--red-primary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.qty-quick__btn:active {
  background: var(--red-light);
}

.qty-quick__btn.selected {
  background: var(--red-primary);
  color: var(--white);
}

/* Add to Cart */
.product-card__add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  width: 100%;
  padding: 10px;
  margin-top: var(--space-sm);
  font-size: var(--font-sm);
  font-weight: 700;
  color: var(--red-primary);
  background: var(--white);
  border: 1.5px solid var(--red-primary);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.product-card__add-btn:active {
  background: var(--red-primary);
  color: var(--white);
}

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

.product-card__add-btn.added {
  background: var(--red-primary);
  color: var(--white);
  animation: addedPulse 0.4s ease;
}

@keyframes addedPulse {
  0% { transform: scale(1); }
  50% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

/* ============================================
   PRODUCT DETAIL MODAL
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-slow), visibility var(--transition-slow);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--white);
  z-index: 201;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal.active {
  transform: translateY(0);
}

/* Close button */
.modal__close {
  position: fixed;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border-radius: var(--radius-full);
  z-index: 210;
  color: var(--text-primary);
  transition: background var(--transition-fast);
}

.modal__close svg {
  width: 24px;
  height: 24px;
}

.modal__close:active {
  background: rgba(0,0,0,0.06);
}

/* Scrollable body */
.modal__scroll-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 80px;
}

/* Image Gallery */
.modal__gallery {
  position: relative;
  width: 100%;
  background: var(--white);
}

.modal__main-image {
  width: 100%;
  aspect-ratio: 4 / 3.5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--white);
}

.modal__main-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
}

.modal__main-image .product-card__img-placeholder {
  position: static;
  width: 100%;
  height: 100%;
  font-size: 100px;
  background: var(--white) !important;
}

.modal__image-counter {
  position: absolute;
  bottom: 12px;
  right: 16px;
  background: var(--white);
  color: var(--text-primary);
  font-size: var(--font-sm);
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

/* Thumbnails */
.modal__thumbnails {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  justify-content: center;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--border-light);
}

.modal__thumbnails::-webkit-scrollbar {
  display: none;
}

.modal__thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid var(--border-color);
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color var(--transition-fast);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.modal__thumb.active {
  border-color: var(--red-primary);
  border-width: 2px;
}

.modal__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Modal Content */
.modal__content {
  padding: var(--space-lg) var(--space-lg) 0;
}

/* Tags in modal */
.modal__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.modal__tags .product-tag {
  padding: 3px 10px;
  font-size: var(--font-sm);
  border-radius: 4px;
}

/* Name row with actions */
.modal__name-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-xs);
}

.modal__name {
  font-size: var(--font-xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  flex: 1;
}

.modal__name-actions {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-shrink: 0;
  padding-top: 2px;
}

.modal__action-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.modal__action-btn svg {
  width: 22px;
  height: 22px;
}

.modal__action-btn:active {
  background: var(--bg-main);
  color: var(--red-primary);
}

/* Price — italic style per reference */
.modal__price {
  font-size: 22px;
  font-weight: 800;
  font-style: italic;
  color: var(--red-primary);
  margin-bottom: var(--space-lg);
  line-height: 1.3;
}

.modal__price-unit {
  font-size: var(--font-base);
  font-weight: 500;
  font-style: italic;
  color: var(--red-primary);
}

/* Product Specs — bordered box matching reference */
.modal__specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
  overflow: hidden;
}

.modal__spec {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
}

/* Grid lines between specs */
.modal__spec:nth-child(1) {
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}
.modal__spec:nth-child(2) {
  border-bottom: 1px solid var(--border-color);
}
.modal__spec:nth-child(3) {
  border-right: 1px solid var(--border-color);
}

.modal__spec-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.modal__spec-icon svg {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  stroke: currentColor;
}

.modal__spec-info {
  display: flex;
  flex-direction: column;
}

.modal__spec-label {
  font-size: var(--font-xs);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1.3;
}

.modal__spec-value {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

/* Modal Quantity */
.modal__qty-section {
  margin-bottom: var(--space-lg);
  padding-top: var(--space-sm);
}

.modal__qty-label {
  font-size: var(--font-sm);
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-sm);
}

/* All controls in one row — matches reference */
.modal__qty-controls {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.modal__qty-controls .qty-controls__stepper {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.modal__qty-controls .qty-btn {
  width: 44px;
  height: 44px;
  font-size: var(--font-xl);
  font-weight: 400;
  color: var(--text-primary);
  background: var(--white);
}

.modal__qty-controls .qty-btn:active {
  background: var(--bg-main);
}

.modal__qty-controls .qty-display {
  width: 64px;
  height: 44px;
  font-size: var(--font-lg);
  font-weight: 700;
  color: var(--text-primary);
  background: var(--white);
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal__qty-controls .qty-quick {
  display: flex;
  gap: var(--space-sm);
}

.modal__qty-controls .qty-quick__btn {
  height: 44px;
  min-width: 52px;
  padding: 0 12px;
  font-size: var(--font-base);
  font-weight: 700;
  color: var(--red-primary);
  background: var(--white);
  border: 1px solid var(--red-primary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.modal__qty-controls .qty-quick__btn:active {
  background: var(--red-light);
}

.modal__qty-controls .qty-quick__btn.selected {
  background: var(--red-primary);
  color: var(--white);
}

/* Custom qty button */
.modal__qty-controls .qty-custom-btn {
  height: 44px;
  padding: 0 14px;
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.modal__qty-controls .qty-custom-btn:active {
  background: var(--bg-main);
}

.modal__qty-hint {
  font-size: var(--font-xs);
  color: var(--text-muted);
  margin-top: var(--space-sm);
}

/* Modal Sticky CTA */
.modal__cta {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-md) var(--space-lg);
  padding-bottom: calc(var(--space-md) + env(safe-area-inset-bottom, 0px));
  background: var(--white);
  border-top: 1px solid var(--border-light);
  z-index: 10;
  flex-shrink: 0;
}

.modal__add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  width: 100%;
  padding: 14px;
  font-size: var(--font-lg);
  font-weight: 700;
  color: var(--white);
  background: var(--red-primary);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal__add-btn:active {
  background: var(--red-dark);
  transform: scale(0.98);
}

.modal__add-btn svg {
  width: 22px;
  height: 22px;
}

/* ============================================
   CART SIDEBAR
   ============================================ */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-slow), visibility var(--transition-slow);
}

.cart-overlay.active {
  opacity: 1;
  visibility: visible;
}

.cart-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 400px;
  background: var(--white);
  z-index: 301;
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  display: flex;
  flex-direction: column;
}

.cart-sidebar.active {
  transform: translateX(0);
}

.cart-sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.cart-sidebar__title {
  font-size: var(--font-xl);
  font-weight: 700;
}

.cart-sidebar__close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  font-size: 18px;
  color: var(--text-secondary);
  transition: background var(--transition-fast);
}

.cart-sidebar__close:active {
  background: var(--bg-main);
}

.cart-sidebar__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg);
  -webkit-overflow-scrolling: touch;
}

.cart-sidebar__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  gap: var(--space-md);
}

.cart-sidebar__empty-icon {
  font-size: 48px;
  opacity: 0.5;
}

.cart-sidebar__empty-text {
  font-size: var(--font-base);
  font-weight: 500;
}

/* Cart Item */
.cart-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border-light);
}

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

.cart-item__image {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
}

.cart-item__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cart-item__name {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.cart-item__sku {
  font-size: var(--font-xs);
  color: var(--text-muted);
}

.cart-item__price {
  font-size: var(--font-sm);
  font-weight: 700;
  color: var(--red-primary);
}

.cart-item__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-xs);
}

.cart-item__qty {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.cart-item__qty .qty-btn {
  width: 28px;
  height: 28px;
  font-size: var(--font-sm);
}

.cart-item__qty .qty-display {
  width: 32px;
  height: 28px;
  font-size: var(--font-xs);
}

.cart-item__remove {
  font-size: var(--font-xs);
  color: var(--text-muted);
  padding: 4px 8px;
  transition: color var(--transition-fast);
}

.cart-item__remove:active {
  color: var(--red-primary);
}

/* Cart Footer */
.cart-sidebar__footer {
  padding: var(--space-lg);
  border-top: 1px solid var(--border-light);
  background: var(--white);
  flex-shrink: 0;
}

.cart-sidebar__total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.cart-sidebar__total-label {
  font-size: var(--font-base);
  font-weight: 600;
  color: var(--text-secondary);
}

.cart-sidebar__total-value {
  font-size: var(--font-xl);
  font-weight: 800;
  color: var(--red-primary);
}

.cart-sidebar__checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px;
  font-size: var(--font-lg);
  font-weight: 700;
  color: var(--white);
  background: var(--red-primary);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.cart-sidebar__checkout:active {
  background: var(--red-dark);
}

/* ============================================
   BOTTOM NAVIGATION
   ============================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 90;
  border-top: 1px solid var(--border-light);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1;
  height: 100%;
  position: relative;
  transition: color var(--transition-fast);
  color: var(--text-muted);
}

.bottom-nav__item.active {
  color: var(--red-primary);
}

.bottom-nav__item svg {
  width: 22px;
  height: 22px;
}

.bottom-nav__label {
  font-size: 10px;
  font-weight: 600;
}

.bottom-nav__badge {
  top: 4px;
  right: calc(50% - 20px);
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  pointer-events: none;
}

.toast {
  background: var(--text-primary);
  color: var(--white);
  padding: 10px 20px;
  border-radius: 24px;
  font-size: var(--font-sm);
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-10px);
  transition: all var(--transition-base);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast__icon {
  font-size: 16px;
}

/* ============================================
   LOADING / SKELETON
   ============================================ */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-main) 25%, #e8e8e8 50%, var(--bg-main) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ============================================
   SCROLL-TO-TOP
   ============================================ */
.scroll-top {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 16px);
  right: 16px;
  width: 40px;
  height: 40px;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all var(--transition-base);
  box-shadow: var(--shadow-md);
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top:active {
  transform: scale(0.9);
}

.scroll-top svg {
  width: 18px;
  height: 18px;
  color: var(--text-primary);
}

/* ============================================
   RESPONSIVE — TABLET
   ============================================ */
@media (min-width: 600px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    padding: var(--space-md);
  }

  .product-card__body {
    padding: var(--space-lg);
  }

  .product-card__name {
    font-size: var(--font-base);
  }

  .product-card__price {
    font-size: var(--font-lg);
  }
}

/* ============================================
   RESPONSIVE — SMALL DESKTOP
   ============================================ */
@media (min-width: 900px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
    padding: var(--space-lg);
    max-width: 1200px;
    margin: 0 auto;
  }
}

/* ============================================
   RESPONSIVE — DESKTOP
   ============================================ */
@media (min-width: 1100px) {
  :root {
    --header-height: 56px;
    --category-height: 48px;
  }

  .product-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-lg);
    padding: var(--space-xl);
    max-width: 1400px;
  }

  .header {
    padding: 0 var(--space-xl);
  }

  .header__title {
    font-size: var(--font-xl);
  }

  .category-nav {
    padding: 0 var(--space-xl);
    justify-content: center;
    gap: var(--space-sm);
  }

  .category-nav__item {
    font-size: var(--font-md);
    padding: 8px 20px;
  }

  .product-card {
    transition: box-shadow var(--transition-base), transform var(--transition-base);
  }

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

  .product-card:active {
    transform: translateY(0);
  }

  .product-card__add-btn:hover {
    background: var(--red-primary);
    color: var(--white);
  }

  .qty-quick__btn:hover {
    background: var(--red-light);
  }

  .modal {
    top: 50%;
    left: 50%;
    bottom: auto;
    right: auto;
    width: 520px;
    max-width: 90vw;
    max-height: 90vh;
    border-radius: var(--radius-xl);
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.3s ease;
  }

  .modal.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }

  .modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
  }

  .bottom-nav {
    display: none;
  }

  .main-content {
    padding-bottom: var(--space-2xl);
  }

  .scroll-top {
    bottom: 24px;
    right: 24px;
  }
}

/* ============================================
   ANIMATION KEYFRAMES
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-card {
  animation: fadeInUp 0.4s ease backwards;
}

.product-card:nth-child(1) { animation-delay: 0.02s; }
.product-card:nth-child(2) { animation-delay: 0.06s; }
.product-card:nth-child(3) { animation-delay: 0.10s; }
.product-card:nth-child(4) { animation-delay: 0.14s; }
.product-card:nth-child(5) { animation-delay: 0.18s; }
.product-card:nth-child(6) { animation-delay: 0.22s; }
.product-card:nth-child(7) { animation-delay: 0.26s; }
.product-card:nth-child(8) { animation-delay: 0.30s; }
.product-card:nth-child(9) { animation-delay: 0.34s; }
.product-card:nth-child(10) { animation-delay: 0.38s; }
