/* GreenVet — Inventory UI (RTL / Cairo) */

:root {
  --color-primary: #1b5e20;
  --color-accent: #69f0ae;
  --color-bg: #f5f7f5;
  --color-card: #ffffff;
  --color-text: #1a1a2e;
  --color-muted: #6b7280;
  --color-border-soft: #e8f5e9;
  --shadow-green: rgba(27, 94, 32, 0.12);
  --shadow-green-strong: rgba(27, 94, 32, 0.45);
  --radius-sm: 16px;
  --radius-md: 20px;
  --radius-lg: 24px;
  --header-offset: 158px;
  --nav-offset: 88px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  font-family: "Cairo", sans-serif;
  background: #fff;
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ——— Phone frame ——— */
#app-wrapper {
  position: relative;
  width: 100%;
  max-width: 430px;
  min-width: 320px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--color-bg);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.15);
  overflow-x: visible;
  overflow-y: visible;
}

/* ——— Fixed header ——— */
.app-header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 430px;
  max-width: 100%;
  z-index: 1000;
  padding: 14px 14px 14px;
  padding-top: 18px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 12px 40px var(--shadow-green);
}

.app-header::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  pointer-events: none;
}

.app-header__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.app-header__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1; /* ← المهم */
}

.app-header__logo {
  flex-shrink: 0;
  display: block;
}

.app-header__logo-img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: contain;
  background: #fff;
  padding: 5px;
  box-shadow: 0 2px 8px rgba(27, 94, 32, 0.15);
  display: block;
  vertical-align: middle;
}

.app-header__titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.app-header__name {
  font-weight: 800;
  font-size: 0.78rem;
  color: var(--color-primary);
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis; /* لو الاسم طويل مش هيتكسر */
}

.app-header__tagline {
  font-size: 0.68rem;
  color: var(--color-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-header__icon-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 14px;
  background: rgba(232, 245, 233, 0.85);
  color: var(--color-primary);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.app-header__icon-btn .ph {
  font-size: 22px;
}

.app-header__icon-btn:active {
  transform: scale(0.94);
}

.app-header__icon-btn:hover {
  box-shadow: 0 4px 14px var(--shadow-green);
}

.app-header__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid #fff;
}

.app-header__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
}

.app-header__search-wrap {
  width: 100%;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 14px;
  background: var(--color-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-soft);
  box-shadow: 0 4px 18px var(--shadow-green);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.search-field:focus-within {
  border-color: rgba(105, 240, 174, 0.65);
  box-shadow: 0 6px 24px rgba(27, 94, 32, 0.18);
}

.search-field__icon {
  font-size: 18px;
  color: var(--color-primary);
  flex-shrink: 0;
}

.search-field__input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--color-text);
  min-width: 0;
}

.search-field__input::placeholder {
  color: #9ca3af;
}

/* ——— Main ——— */
.main-screen {
  padding-top: var(--header-offset);
  padding-bottom: var(--nav-offset);
  padding-right: 12px;
  padding-left: 12px;
  margin: 0;
  overflow: visible;
}

.section-head-block {
  margin: 20px 0;
  box-sizing: border-box;
  width: 100%;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin: 0;
  box-sizing: border-box;
}

.section-head__text {
  flex: 1;
  min-width: 0;
}

.section-head__text h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-primary);
}

.section-head__stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 10px 0 0;
  padding: 0;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.section-head__stats:not(:has(.section-head__inventory-sum)) {
  justify-content: flex-end;
}

.section-head__inventory-sum {
  font-weight: 700;
  color: var(--color-primary);
  font-size: 0.82rem;
  white-space: nowrap;
}

.filter-btn {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(232, 245, 233, 0.95);
  color: var(--color-primary);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.25s ease;
}

.filter-btn .ph {
  font-size: 20px;
}

.filter-btn:hover {
  box-shadow: 0 8px 22px var(--shadow-green);
}

.filter-btn:active {
  transform: scale(0.95);
}

/* ——— Pills ——— */
.pills-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 22px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

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

.pill {
  flex-shrink: 0;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-border-soft);
  background: var(--color-card);
  color: var(--color-muted);
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.2s ease, box-shadow 0.25s ease, color 0.2s ease,
    background 0.25s ease, border-color 0.2s ease;
}

.pill:hover {
  transform: translateY(-1px);
}

.pill:active {
  transform: scale(0.97);
}

.pill--active {
  background: linear-gradient(135deg, var(--color-primary), #2e7d32);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(27, 94, 32, 0.35);
}

.pill__count {
  font-weight: 700;
  opacity: 0.92;
  margin-inline-start: 0.45em;
  padding-inline-start: 0.1em;
}

/* ——— Product grid ——— */
.products-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  overflow: visible;
}

.product-card {
  position: relative;
  z-index: 1;
  min-width: 0;
  background: var(--color-card);
  border-radius: var(--radius-md);
  overflow: visible !important;
  box-shadow: 0 4px 16px var(--shadow-green), 0 2px 6px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.35s ease;
}

.product-card:has(.product-card__menu-wrap--open) {
  z-index: 10050;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(27, 94, 32, 0.2), 0 8px 16px rgba(0, 0, 0, 0.06);
}

.product-card--hidden {
  display: none;
}

.gv-bulk-img-bar {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-offset) + 4px);
  width: min(430px, 100%);
  max-width: calc(100% - 16px);
  z-index: 10040;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 -4px 24px rgba(27, 94, 32, 0.12), 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--color-border-soft);
  font-family: inherit;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(calc(100% + 20px));
  transition:
    opacity 0.28s ease,
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.28s;
}

.gv-bulk-img-bar--visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .gv-bulk-img-bar,
  .product-card__more,
  .product-card__bulk-slot,
  .product-card__bulk-face {
    transition-duration: 0.01ms !important;
  }
}

.gv-bulk-img-bar__count {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-text);
  flex: 1;
  text-align: center;
  min-width: 0;
}

.gv-bulk-img-bar__btn {
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.gv-bulk-img-bar__btn--ghost {
  background: #f3f4f6;
  color: #374151;
}

.gv-bulk-img-bar__btn--danger {
  background: linear-gradient(135deg, #c62828, #e53935);
  color: #fff;
}

.product-card__media {
  position: relative;
  height: 140px;
  background: #e8f5e9;
  overflow: visible;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.product-card__media-inner {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 16px 16px 0 0;
  background: #f0f5f0;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 0;
  pointer-events: none;
}

.product-card__media .product-card__media-icon {
  font-size: 40px;
  color: var(--color-primary);
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.product-card:hover .product-card__media .product-card__media-icon {
  transform: scale(1.12);
}

.stock-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
}

.qtyt-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 900;
  color: #1565c0;
  background: transparent;
  padding: 0;
}



.stock-badge--ok {
  background: linear-gradient(135deg, #2e7d32, #43a047);
}

.stock-badge--okx {
  background: rgba(0,0,0,0.5);
}

.stock-badge--low {
  background: linear-gradient(135deg, #f59e0b, #fb923c);
}

.stock-badge--out {
  background: #e53935;
  color: #fff;
}

.stock-badge--price {
  padding:5px 10px;
  font-weight: 800;
  white-space: nowrap;
}

.product-card__menu-wrap {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 9999 !important;
  overflow: visible;
}

.product-card__menu-slot {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.product-card__more {
  position: absolute;
  inset: 0;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
  color: #9ca3af;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 2;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: scale(1);
  transition:
    opacity 0.24s ease,
    transform 0.26s cubic-bezier(0.34, 1.15, 0.64, 1),
    visibility 0.24s,
    background 0.2s,
    color 0.2s;
}

.products-grid--multi-select .product-card__more {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.86);
  z-index: 1;
}

/* ===== Multi-select toggle ===== */

/* افتراضي: ظاهر الـ 3 نقاط، مخفي الـ checkbox */
.product-card__more {
  display: grid; /* كان موجود أصلاً، متغيرش */
}

.product-card__bulk-slot {
  display: none;
}

/* لما يدخل multi-select: الـ 3 نقاط تختفي */
.products-grid--multi-select .product-card__more {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.86);
}

.products-grid--multi-select .product-card__bulk-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  cursor: pointer;
}

/* الـ input الفعلي شفاف بس clickable */
.product-card__bulk-cb {
  position: absolute;
  opacity: 0;
  width: 44px;
  height: 44px;
  top: 0;
  left: 0;
  margin: 0;
  cursor: pointer;
  z-index: 2;
}

/* تصميم الـ checkbox المخصص */
.product-card__bulk-face {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid #ccc;
  background: #fff;
  display: block;
  transition: all 0.2s ease;
  position: relative;
}

/* لما يتحدد */
.product-card__bulk-cb:checked + .product-card__bulk-face {
  background: #2E7D32;
  border-color: #2E7D32;
}

/* علامة الصح */
.product-card__bulk-cb:checked + .product-card__bulk-face::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 6px;
  width: 5px;
  height: 10px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

/* الـ checkbox slot: مخفي افتراضياً بـ opacity */
.product-card__bulk-slot {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 2px 10px rgba(27, 94, 32, 0.1);
  -webkit-tap-highlight-color: transparent;
  z-index: 1;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.86);
  transition: opacity 0.24s ease, transform 0.26s cubic-bezier(0.34, 1.15, 0.64, 1), visibility 0.24s;
}

/* لما يدخل multi-select: الـ checkbox يظهر */
.products-grid--multi-select .product-card__bulk-slot {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: scale(1);
  z-index: 2;
}

.product-card__bulk-cb {
  position: absolute;
  opacity: 0;
  width: 44px;
  height: 44px;
  top: 0;
  left: 0;
  margin: 0;
  cursor: pointer;
  z-index: 2;
}

/* شكل الـ checkbox */
.product-card__bulk-face {
  position: relative;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 2.5px solid #b0c4b1;
  background: linear-gradient(165deg, #ffffff 0%, #f0f7f0 100%);
  box-shadow: 0 2px 6px rgba(27, 94, 32, 0.12), inset 0 1px 0 rgba(255,255,255,0.95);
  pointer-events: none;
  z-index: 1;
  transition: transform 0.22s ease, border-color 0.2s ease, background 0.2s ease;
}

.product-card__bulk-slot:active .product-card__bulk-face {
  transform: scale(0.92);
}

/* لما يتحدد */
.product-card__bulk-cb:checked + .product-card__bulk-face {
  border-color: #2e7d32;
  background: linear-gradient(145deg, #2e7d32, #43a047);
  box-shadow: 0 4px 14px rgba(46,125,50,0.38);
}

/* علامة الصح */
.product-card__bulk-cb:checked + .product-card__bulk-face::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 45%;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: translate(-50%, -50%) rotate(45deg);
  box-sizing: border-box;
}

.product-card--bulk-selected .product-card__bulk-face {
  border-color: #2e7d32;
  box-shadow:
    0 0 0 2px rgba(67, 160, 71, 0.35),
    0 2px 8px rgba(27, 94, 32, 0.15);
}

.product-card--bulk-selected .product-card__bulk-cb:checked + .product-card__bulk-face {
  box-shadow:
    0 4px 14px rgba(46, 125, 50, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

/* كمية: قاع منطقة الصورة (يمين)، حبة زجاجية — منفصلة عن ⋮ */
.product-card__media > .product-card__qty-chip {
  position: absolute;
  bottom: 8px;
  right: 8px;
  left: auto;
  top: auto;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: calc(100% - 16px);
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
  line-height: 1.2;
  box-sizing: border-box;
  isolation: isolate;
  color: #14532d;
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 10px rgba(27, 94, 32, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.product-card__media > .product-card__qty-chip--out {
  color: #7f1d1d;
  background: rgba(254, 226, 226, 0.58);
  border-color: rgba(252, 165, 165, 0.75);
  box-shadow: 0 2px 10px rgba(185, 28, 28, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.product-card__more .ph {
  font-size: 20px;
}

.product-card__more:hover {
  background: #fff;
  color: var(--color-muted);
}

.product-card__more:active {
  transform: scale(0.92);
}

.product-card__body {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  overflow: hidden;
  min-width: 0;
}

.product-card__title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;        /* ← سطر واحد */
  overflow: hidden;
  text-overflow: ellipsis;    /* ← ... لو طال */
  display: block;  
  text-align:center;
}

.product-card__title--en {
  text-align:center;
}

.products-grid--multi-select .product-card:hover {
  transform: none;
  box-shadow: 0 4px 16px var(--shadow-green), 0 2px 6px rgba(0, 0, 0, 0.04);
}

.product-card__meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.product-card__meta-start {
  flex: 1 1 auto;
  min-width: 0;
}

.product-card__meta-end {
  flex: 0 0 auto;
  min-width: 0;
}

.product-card__meta-row .product-card__qty {
  margin-top: 0;
}

.product-card__meta-row .cat-tag {
  align-self: center;
}

.product-card__sku {
  margin: 0;
  font-size: 11px;
  color: var(--color-muted);
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.01em;
  text-align: left;
  align-self: stretch;
}

.product-card__balance {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--color-muted);
  text-align: right;
  align-self: stretch;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.product-card__balance-label {
  font-weight: 700;
  color: #64748b;
}

.cat-tag {
  align-self: flex-start;
  padding: 4px 6px;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 700;
}

.cat-tag--antibiotic {
  background: #e3f2fd;
  color: #1565c0;
}

.cat-tag--vaccine {
  background: #f3e5f5;
  color: #6a1b9a;
}

.cat-tag--pain {
  background: #fff3e0;
  color: #e65100;
}

.cat-tag--vitamin {
  background: #e8f5e9;
  color: var(--color-primary);
}

.cat-tag--disinfectant {
  background: #e0f7fa;
  color: #00838f;
}

.cat-tag--other {
  background: #f3f4f6;
  color: #4b5563;
}

.product-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.product-card__price {
  font-size: 15px;
  font-weight: 800;
  color: var(--color-primary);
}

.product-card__qty {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
  font-weight: 600;
}

.product-card__qty .ph {
  font-size: 12px;
  color: var(--color-primary);
}

.product-card__qty--out {
  color: #e53935;
}

.product-card__qty--out .ph {
  color: #e53935;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* ——— Bottom nav ——— */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 430px;
  max-width: 100%;
  z-index: 1000;
  height: 65px;
  background: #fff;
  border-top: 1px solid var(--color-border-soft);
  box-shadow: 0 -4px 20px rgba(27, 94, 32, 0.08);
}

.bottom-nav__inner {
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  padding: 0 6px 10px;
  width: 100%;
  position: relative;
}

.bottom-nav__fab-slot {
  width: 56px;
  flex-shrink: 0;
}

.bottom-nav__item {
  flex: 1;
  max-width: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-height: 44px;
  padding: 4px 0 0;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  color: var(--color-muted);
  text-decoration: none;
  position: relative;
  transition: color 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

a.bottom-nav__item,
a.bottom-nav__item:visited {
  color: inherit;
}

.bottom-nav__item:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: 8px;
}

.bottom-nav__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: transparent;
  margin-bottom: 2px;
  transition: background 0.25s ease;
}

.bottom-nav__icon {
  font-size: 24px;
}

.bottom-nav__label {
  font-size: 0.65rem;
  font-weight: 700;
}

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

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

/* FAB */
.fab-add {
  position: absolute;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  width: 60px;
  height: 60px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--color-primary), #43a047);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 25px var(--shadow-green-strong);
  z-index: 2;
  animation: fab-pulse 2.4s ease-in-out infinite;
  transition: transform 0.2s ease;
}

.fab-add .ph {
  font-size: 30px;
  color: #fff;
}

.fab-add:active {
  transform: translateX(-50%) scale(0.94);
}

@keyframes fab-pulse {
  0%,
  100% {
    box-shadow: 0 8px 25px var(--shadow-green-strong), 0 0 0 0 rgba(105, 240, 174, 0.45);
  }
  50% {
    box-shadow: 0 10px 30px rgba(27, 94, 32, 0.55), 0 0 0 12px rgba(105, 240, 174, 0);
  }
}

.fab-add::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  padding: 8px 12px;
  background: var(--color-text);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  border-radius: 10px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.fab-add:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* ——— Card ⋮ dropdown ——— */
.product-card__dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: auto;
  width: min(150px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  padding: 6px;
  margin: 0;
  list-style: none;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 9999 !important;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 150ms ease, transform 150ms ease, visibility 150ms ease;
  pointer-events: none;
}

.product-card__menu-wrap--open .product-card__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.product-card__dropdown-item {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  text-align: right;
  transition: background 0.15s ease;
}

.product-card__dropdown-item .ph {
  flex-shrink: 0;
  font-size: 18px;
}

.product-card__dropdown-item--edit {
  color: #1a1a2e;
}

.product-card__dropdown-item--edit .ph {
  color: #1b5e20;
}

.product-card__dropdown-item--edit:hover {
  background: #f1f8f1;
}

.product-card__dropdown-item--delete {
  color: #e53935;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid #f5f5f5;
  border-radius: 10px;
}

.product-card__dropdown-item--delete .ph {
  color: #e53935;
}

.product-card__dropdown-item--delete:hover {
  background: #fff5f5;
}

.product-card__dropdown-item--edit {
  border-radius: 10px;
}

/* ——— Sort modal (bottom sheet) ——— */
.sort-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  pointer-events: none;
}

.sort-modal.active {
  pointer-events: auto;
}

.sort-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sort-modal.active .sort-modal__backdrop {
  opacity: 1;
}

.sort-modal__sheet {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 430px;
  max-width: 100%;
  transform: translate(-50%, 100%);
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 24px;
  padding-top: 20px;
  transition: transform 0.35s ease;
  max-height: 85vh;
  overflow-y: auto;
}

.sort-modal.active .sort-modal__sheet {
  transform: translate(-50%, 0);
}

.sort-modal__handle {
  width: 40px;
  height: 4px;
  margin: 0 auto 16px;
  background: #e0e0e0;
  border-radius: 999px;
}

.sort-modal__close {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 40px;
  height: 40px;
  border: none;
  padding: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s ease, color 0.2s ease;
}

.sort-modal__close:hover {
  background: #f5f5f5;
  color: var(--color-text);
}

.sort-modal__close .ph {
  font-size: 22px;
}

.sort-modal__title {
  margin: 0 0 8px;
  padding-left: 44px;
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text);
  text-align: right;
}

.sort-modal__options {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sort-modal__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 10px 0;
  border-bottom: 1px solid #f5f5f5;
  cursor: pointer;
  transition: background 0.15s ease;
  position: relative;
}

.sort-modal__option:last-child {
  border-bottom: none;
}

.sort-modal__sr-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sort-modal__option-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  font-size: 14px;
  color: var(--color-text);
}

.sort-modal__option-main .ph {
  font-size: 20px;
  color: var(--color-primary);
  flex-shrink: 0;
}

.sort-modal__radio-ui {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.sort-modal__option:has(.sort-modal__sr-input:checked) {
  background: #f1f8f1;
}

.sort-modal__option:has(.sort-modal__sr-input:checked) .sort-modal__option-text {
  font-weight: 700;
  color: var(--color-primary);
}

.sort-modal__option:has(.sort-modal__sr-input:checked) .sort-modal__radio-ui {
  border-color: #1b5e20;
  background: #1b5e20;
  box-shadow: inset 0 0 0 3px #fff;
}

.sort-modal__apply {
  width: 100%;
  height: 50px;
  margin-top: 20px;
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, var(--color-primary), #43a047);
  box-shadow: 0 6px 18px rgba(27, 94, 32, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sort-modal__apply:active {
  transform: scale(0.98);
}

/* ——— Barcode screen ——— */
.barcode-screen {
  background: #f5f7f5;
  padding-left: 20px !important;
  padding-right: 20px !important;
}

.barcode-screen__intro {
  text-align: center;
  padding-top: 8px;
}

.barcode-screen__title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 800;
  color: var(--color-text);
}

.barcode-screen__subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--color-muted);
}

.scanner-wrapper {
  margin: 20px auto;
  width: 100%;
  max-width: 320px;
}

.scanner-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 24px;
  overflow: hidden;
  background: #1a1a2e;
}

#scanner-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.scanner-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scanner-overlay .corner {
  position: absolute;
  width: 32px;
  height: 32px;
  border-color: #69f0ae;
  border-style: solid;
}

.scanner-overlay .corner.top-right {
  top: 16px;
  right: 16px;
  border-width: 3px 3px 0 0;
  border-radius: 0 6px 0 0;
}

.scanner-overlay .corner.top-left {
  top: 16px;
  left: 16px;
  border-width: 3px 0 0 3px;
  border-radius: 6px 0 0 0;
}

.scanner-overlay .corner.bottom-right {
  bottom: 16px;
  right: 16px;
  border-width: 0 3px 3px 0;
  border-radius: 0 0 6px 0;
}

.scanner-overlay .corner.bottom-left {
  bottom: 16px;
  left: 16px;
  border-width: 0 0 3px 3px;
  border-radius: 0 0 0 6px;
}

.scanner-overlay .scan-line {
  position: absolute;
  left: 16px;
  right: 16px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #69f0ae, transparent);
  animation: scanMove 2s ease-in-out infinite;
  box-shadow: 0 0 8px #69f0ae;
}

@keyframes scanMove {
  0% {
    top: 15%;
  }

  50% {
    top: 80%;
  }

  100% {
    top: 15%;
  }
}

.scanner-status {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #69f0ae;
  font-family: "Cairo", sans-serif;
  font-size: 13px;
  background: rgba(26, 26, 46, 0.85);
  transition: opacity 0.4s;
}

.scanner-status i {
  font-size: 40px;
}

.scanner-status.hidden {
  opacity: 0;
  pointer-events: none;
}

.scanner-hint {
  text-align: center;
  color: #6b7280;
  font-size: 12px;
  margin-top: 12px;
}

.barcode-manual {
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  margin-top: 8px;
}

.barcode-manual__title {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  text-align: right;
}

.barcode-manual__input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 2px solid #e8f5e9;
  border-radius: 14px;
  font-family: "Cairo", sans-serif;
  font-size: 15px;
  color: var(--color-text);
  background: #fff;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.barcode-manual__input::placeholder {
  color: #9ca3af;
}

.barcode-manual__input:focus {
  border-color: #1b5e20;
  box-shadow: 0 0 0 3px rgba(27, 94, 32, 0.1);
}

.barcode-manual__submit {
  width: 100%;
  height: 50px;
  margin-top: 12px;
  border: none;
  border-radius: 14px;
  font-family: "Cairo", sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--color-primary), #43a047);
  box-shadow: 0 6px 18px rgba(27, 94, 32, 0.35);
}

.barcode-manual__submit .ph {
  font-size: 20px;
  color: #fff;
}

.barcode-recent {
  margin-top: 24px;
}

.barcode-recent__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.barcode-recent__head-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
}

.barcode-recent__clear {
  border: none;
  background: none;
  padding: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
  cursor: pointer;
}

.barcode-recent__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  margin-bottom: 8px;
  background: #fff;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.barcode-recent__row:hover {
  background: #f9fff9;
}

.barcode-recent__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(27, 94, 32, 0.12);
  display: grid;
  place-items: center;
  color: #1b5e20;
}

.barcode-recent__icon .ph {
  font-size: 22px;
}

.barcode-recent__meta {
  flex: 1;
  min-width: 0;
  text-align: right;
}

.barcode-recent__name {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
}

.barcode-recent__code {
  font-size: 12px;
  color: var(--color-muted);
  margin-top: 2px;
}

.barcode-recent__time {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--color-muted);
}

/* ——— Placeholder screens (search / profile) ——— */
.placeholder-screen {
  text-align: center;
  padding: 40px 16px;
}

.placeholder-screen__title {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-primary);
}

.placeholder-screen__text {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-muted);
}

/* ——— FAB submit (add item) ——— */
.fab-add-form {
  position: absolute;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  z-index: 2;
  display: inline;
}

.fab-add-form .fab-add {
  position: relative;
  left: auto;
  bottom: auto;
  transform: none;
}

.fab-add-form .fab-add:active {
  transform: scale(0.94);
}

/* ——— Toast ——— */
.gv-toast {
  position: fixed;
  bottom: calc(var(--nav-offset) + 16px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 11000;
  max-width: min(380px, calc(100vw - 32px));
  padding: 14px 20px;
  border-radius: 14px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #2e7d32, #43a047);
  box-shadow: 0 10px 28px rgba(27, 94, 32, 0.35);
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
}

.gv-toast--hide {
  opacity: 0;
  transform: translateX(-50%) translateY(12px);
}

@media (max-width: 430px) {
  .gv-toast {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }
}

/* ——— Add item flow ——— */
body.step-scanner,
body.step-camera {
  background: #0d1117 !important;
  margin: 0;
  padding: 0;
  overflow: hidden;
  display: block !important;
}

body.step-scanner #app-wrapper,
body.step-camera #app-wrapper {
  background: #0d1117;
  height: 100vh;
  max-width: 430px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: none;
}

body.step-camera #app-wrapper {
  overflow: hidden;
}

/* Step 3 camera — compact single-screen layout */
body.step-camera {
  height: 100vh;
}

.camera-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}

.camera-topbar.add-item-fs-topbar {
  flex-shrink: 0;
  height: 56px;
  box-sizing: border-box;
}

.camera-viewfinder {
  flex-shrink: 0;
  height: 42vh;
  max-height: 300px;
  position: relative;
  background: #000;
  overflow: hidden;
}

.camera-viewfinder video,
#cameraVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.camera-container {
  position: relative;
  width: 100%;
  height: 45vh;
  max-height: 320px;
  overflow: hidden;
  background: #000;
  border-radius: 0;
}

.camera-bottom {
  flex: 1;
  min-height: 0;
  background: #0d1117;
  display: flex;
  flex-direction: column;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  overflow: hidden;
  gap: 10px;
}

.thumbnail-strip {
  display: flex;
  flex-direction: row;
  gap: 8px;
  overflow-x: auto;
  flex-shrink: 0;
  padding-bottom: 4px;
  min-height: 75px;
  align-items: center;
}

.capture-btn {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: white;
  border: 4px solid rgba(255, 255, 255, 0.4);
  cursor: pointer;
  flex-shrink: 0;
  align-self: center;
  margin: 0 auto;
  display: block;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.continue-btn {
  width: 100%;
  height: 50px;
  background: linear-gradient(135deg, #1b5e20, #43a047);
  border: none;
  border-radius: 14px;
  color: white;
  font-family: Cairo, sans-serif;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.add-item-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.add-item-fs-topbar {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 10px;
  height: 60px;
  padding: 0 16px;
  flex-shrink: 0;
  background: transparent;
}

.add-item-fs-back {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: grid;
  place-items: center;
  color: #fff;
  text-decoration: none;
}

.add-item-fs-back .ph {
  font-size: 20px;
}

.add-item-fs-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  font-family: "Cairo", sans-serif;
}

.add-item-fs-skip {
  font-size: 14px;
  font-weight: 700;
  color: #69f0ae;
  text-decoration: none;
  white-space: nowrap;
}

body.step-scanner .add-item-screen--scanner {
  flex: 0 1 auto;
  overflow-y: auto;
}

body.step-scanner .add-item-screen__scanner--square {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

body.step-scanner .scanner-container {
  width: 100%;
  max-width: 320px;
  height: 320px;
  margin: 0 auto;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  background: #111;
}

body.step-scanner #scanner-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.add-item-screen__footer--scanner {
  flex-shrink: 0;
  background: #0d1117;
  padding: 16px 16px 32px;
}

.add-item-barcode-form--fullscreen {
  padding: 0 !important;
  gap: 12px;
}

.add-item-screen__camera {
  flex: 1;
  min-height: 0;
  position: relative;
  background: #000;
}

.add-item-capture-video--fill {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.add-item-camera-counter--overlay {
  position: absolute;
  top: 12px;
  right: 12px;
  left: auto;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  font-size: 13px;
  z-index: 2;
}

.add-item-screen__camera .add-item-shutter {
  z-index: 2;
}

.add-item-screen__camera-bottom {
  flex-shrink: 0;
  background: #000;
  padding: 12px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.add-item-screen__camera-bottom .add-item-thumbs-strip {
  padding: 4px 0;
}

.add-item-steps {
  position: fixed;
  top: calc(var(--header-offset) + 4px);
  left: 50%;
  transform: translateX(-50%);
  width: 430px;
  max-width: 100%;
  z-index: 999;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  pointer-events: none;
}

.add-item-steps__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e0e0e0;
  transition:
    width 0.25s ease,
    border-radius 0.25s ease,
    background 0.25s ease;
}

.add-item-steps__dot--active {
  width: 28px;
  border-radius: 999px;
  background: #1b5e20;
}

.add-item-form-screen {
  width: 100%;
  min-height: 100vh;
  background: var(--color-bg);
  padding-bottom: 24px;
}

.add-item-form-topbar {
  height: 56px;
  background: #1b5e20;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
}

.add-item-form-topbar__back,
.add-item-form-topbar__refresh {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: grid;
  place-items: center;
  color: #fff;
  text-decoration: none;
}

.add-item-form-topbar__refresh {
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

.add-item-form-topbar__back .ph,
.add-item-form-topbar__refresh .ph {
  font-size: 20px;
}

.add-item-form-topbar__title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  font-family: "Cairo", sans-serif;
}



.add-item-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px 16px;
}

.add-item-toolbar__spacer {
  width: 40px;
  flex-shrink: 0;
}

.add-item-toolbar__titles {
  flex: 1;
  text-align: center;
  min-width: 0;
}

.add-item-toolbar__title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.add-item-toolbar__subtitle {
  margin: 6px 0 0;
  font-size: 13px;
  color: #9ca3af;
}

.add-item-toolbar--dark .add-item-toolbar__title {
  color: #fff;
}

.add-item-toolbar--dark .add-item-toolbar__subtitle {
  color: #9ca3af;
}

.add-item-back {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
  flex-shrink: 0;
}

.add-item-back .ph {
  font-size: 22px;
}

.add-item-back--light {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.9);
}

.add-item-skip-link {
  font-size: 14px;
  font-weight: 700;
  color: #69f0ae;
  text-decoration: none;
  flex-shrink: 0;
}

.add-item-scanner-wrap {
  padding: 0 16px;
}

.add-item-scanner-box {
  position: relative;
  width: 100%;
  height: 300px;
  border-radius: 20px;
  overflow: hidden;
  background: #000;
}

.add-item-scanner-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.add-item-barcode-form {
  padding: 20px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.add-item-input {
  width: 100%;
  height: 52px;
  border: 2px solid #e8f5e9;
  border-radius: 14px;
  padding: 0 16px;
  font-family: "Cairo", sans-serif;
  font-size: 15px;
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.add-item-input:focus {
  border-color: #1b5e20;
  box-shadow: 0 0 0 3px rgba(27, 94, 32, 0.1);
}

.add-item-input--light {
  background: #fff;
  color: var(--color-text);
}

.add-item-btn-primary {
  width: 100%;
  height: 52px;
  border: none;
  border-radius: 14px;
  font-family: "Cairo", sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, var(--color-primary), #43a047);
  box-shadow: 0 8px 22px rgba(27, 94, 32, 0.35);
}

.add-item-btn-primary--wide {
  margin-top: 8px;
}

.add-item-btn-primary.is-disabled,
.add-item-btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.add-item-barcode-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.add-item-live-feedback {
  min-height: 1.25em;
  font-size: 13px;
  font-weight: 600;
  font-family: "Cairo", sans-serif;
  padding: 0 4px;
}

.add-item-live-feedback--error {
  color: #c62828;
}

.add-item-live-feedback--ok {
  color: #2e7d32;
}

.add-item-live-feedback--loading {
  color: #5f6368;
}

.add-item-input.is-invalid {
  border-color: #c62828 !important;
  box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.12) !important;
}

.add-item-input.is-valid {
  border-color: #2e7d32 !important;
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.12) !important;
}

/* Camera step */
.add-item-main--camera {
  background: #0d1117;
  padding-left: 0;
  padding-right: 0;
}

.add-item-toolbar--camera .add-item-toolbar__title {
  color: #fff;
}

.add-item-camera-counter {
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  padding: 0 16px 12px;
}

.add-item-viewfinder {
  position: relative;
  width: 100%;
  height: 55vh;
  min-height: 220px;
  background: #000;
  overflow: hidden;
}

.add-item-capture-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.add-item-shutter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.35);
  background: #fff;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.add-item-thumbs-strip {
  display: flex;
  flex-direction: row;
  gap: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 76px;
}

.add-item-thumb {
  position: relative;
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.add-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.add-item-thumb__del {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.92);
  color: #fff;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.add-item-thumb__del .ph {
  font-size: 12px;
}

.add-item-camera-actions {
  padding: 12px 16px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}

.add-item-skip-inline {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #9ca3af;
  text-decoration: none;
}

/* Form step */
.add-item-main--form {
  background: var(--color-bg);
}

.add-item-toolbar--form .add-item-toolbar__title {
  color: var(--color-text);
}

.add-item-toolbar--form .add-item-back {
  color: var(--color-text);
  background: rgba(27, 94, 32, 0.08);
}

.add-item-slider-wrap {
  padding: 8px 0 4px;
}

.add-item-slider {
  width: 100%;
  height: 220px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.add-item-slider::-webkit-scrollbar {
  display: none;
}

.add-item-slider__slides {
  display: flex;
  height: 100%;
}

.add-item-slide {
  flex: 0 0 100%;
  width: 100%;
  max-width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  height: 220px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  box-sizing: border-box;
}

.add-item-slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.add-item-slider__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 10px 0 4px;
}

.add-item-slider__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: #e0e0e0;
  cursor: pointer;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.add-item-slider__dot.is-active {
  background: #1b5e20;
  transform: scale(1.15);
}

.add-item-detail-form {
  padding: 0 16px 24px;
  overflow: visible;
}

.add-item-detail-form-inner {
  overflow: visible;
}

.add-item-fields-card {
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 4px 16px var(--shadow-green);
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: visible;
}

.add-item-fields-card input[type="number"]::-webkit-inner-spin-button,
.add-item-fields-card input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.add-item-fields-card input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.add-item-price-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 12px;
  width: 100%;
}

.add-item-field--half {
  flex: 1;
  min-width: 0;
}

.add-item-field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}

.add-item-field__label {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-muted);
  padding-inline-start: 4px;
}

.add-item-field__icon {
  position: absolute;
  left: 14px;
  bottom: 11px;
  font-size: 20px;
  color: var(--color-primary);
  pointer-events: none;
  z-index: 1;
}

.add-item-field__suffix {
  position: absolute;
  right: 14px;
  left: auto;
  bottom: 17px;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-muted);
  pointer-events: none;
  z-index: 1;
}

.add-item-field__input {
  width: 100%;
  height: 52px;
  border: 2px solid #e8f5e9;
  border-radius: 14px;
  padding-inline-start: 44px;
  padding-inline-end: 16px;
  font-family: "Cairo", sans-serif;
  font-size: 15px;
  color: var(--color-text);
  background: #fff;
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.add-item-field__input--ltr {
  direction: ltr;
  text-align: left;
}

.add-item-field__input--has-suffix {
  padding-inline-end: 48px;
}

.add-item-field__input:focus {
  border-color: #1b5e20;
  box-shadow: 0 0 0 3px rgba(27, 94, 32, 0.1);
}

.add-item-field__input::placeholder {
  color: #9ca3af;
}

.add-item-field__error {
  display: none;
  font-size: 12px;
  font-weight: 600;
  color: #c62828;
  margin-top: 2px;
  padding-inline-start: 4px;
}

.add-item-field__error.is-visible {
  display: block;
}

.add-item-field__error.add-item-field__success {
  color: #2e7d32;
}

.add-item-field__error--qty {
  margin-top: 8px;
}

.add-item-field__input.is-invalid {
  border-color: #c62828 !important;
  box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.12) !important;
}

.add-item-field__input.is-valid {
  border-color: #2e7d32 !important;
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.12) !important;
}

.add-item-field--combo {
  position: relative;
}

.add-item-field__caret {
  position: absolute;
  inset-inline-end: 14px;
  bottom: 17px;
  font-size: 18px;
  color: var(--color-muted);
  pointer-events: none;
  z-index: 2;
}

.add-item-combo {
  position: relative;
}

.add-item-field__input--combo {
  padding-inline-start: 44px;
  padding-inline-end: 40px;
}

/* قائمة التصنيفات تُعرض position:fixed وتُنقل إلى body من JS حتى لا يقصّها overflow */
.add-item-combo__panel {
  position: fixed;
  box-sizing: border-box;
  max-height: min(220px, 40vh);
  overflow-y: auto;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: #fff;
  border: 2px solid #2d6a4f;
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(45, 106, 79, 0.2);
  z-index: 10050;
  display: none;
  direction: rtl;
  text-align: right;
  -webkit-overflow-scrolling: touch;
}

.add-item-combo__panel.is-open {
  display: block;
}

.add-item-combo__option {
  padding: 12px 16px;
  font-size: 15px;
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.15s ease;
  direction: rtl;
  text-align: right;
}

.add-item-combo__option:hover,
.add-item-combo__option:focus {
  background: rgba(45, 106, 79, 0.12);
  outline: none;
}

.add-item-qty-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.add-item-qty-field__top-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-inline-start: 4px !important;
}

.add-item-qty-field__top-label .ph {
  font-size: 18px;
  color: var(--color-primary);
}

.qty-input-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  border: 2px solid #e8f5e9;
  border-radius: 14px;
  overflow: hidden;
  height: 52px;
}

.qty-btn {
  width: 52px;
  height: 52px;
  background: #f1f8f1;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: #1b5e20;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}

.qty-btn:active {
  background: #c8e6c9;
}

.qty-input {
  flex: 1;
  border: none !important;
  border-radius: 0 !important;
  text-align: center !important;
  font-size: 20px !important;
  font-weight: 800 !important;
  color: #1a1a2e;
  outline: none;
  padding: 0 !important;
  height: 48px;
  font-family: "Cairo", sans-serif;
  background: #fff;
}

.add-item-submit-btn {
  width: 100%;
  height: 56px;
  margin-top: 18px;
  border: none;
  border-radius: 16px;
  font-family: "Cairo", sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--color-primary), #43a047);
  box-shadow: 0 10px 26px rgba(27, 94, 32, 0.38);
}

.add-item-submit-btn .ph {
  font-size: 24px;
}

.add-item-submit-btn.is-loading {
  opacity: 0.85;
  cursor: wait;
  pointer-events: none;
}

.gv-spin {
  animation: gv-spin-rotate 0.75s linear infinite;
}

@keyframes gv-spin-rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ——— GreenVet add item — Swiper (step 4) ——— */
.product-swiper-wrap {
  position: relative;
  width: 100%;
  margin-bottom: 12px;
  overflow: visible;
}


.add-item-swiper-fab-stack {
  position: absolute;
  bottom: 12px;
  right: 12px;
  left: auto;
  top: auto;
  z-index: 15;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.add-item-swiper-fab-stack .add-item-swiper-fab,
.add-item-swiper-fab-stack .add-item-swiper-fab-menu:not([hidden]) {
  pointer-events: auto;
}

.add-item-swiper-fab {
  width: 50px;
  height: 50px;
  border-radius: 50% !important;
  border: 2.5px solid rgba(255,255,255,0.35) !important;
  background: linear-gradient(135deg, var(--color-primary), #43a047) !important;
  color: #fff !important;
  box-shadow: 0 6px 20px rgba(27, 94, 32, 0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 0.18s ease;
}

.add-item-swiper-fab:active {
  transform: scale(0.92);
}


.add-item-swiper-fab .ph {
  font-size: 22px;
  color: #fff;
}


.add-item-swiper-fab-menu[hidden] {
  display: none !important;
}

.add-item-swiper-fab-menu:not([hidden]) {
  position: absolute;
  bottom: calc(100% + 8px);  /* ← فوق الـ FAB بـ 8px */
  right: 0;
  left: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 168px;
  padding: 8px;
  background: #fff;
  border: 2px solid var(--color-primary);
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(27, 94, 32, 0.2);
  direction: rtl;
}

.add-item-swiper-fab-menu__btn {
  font-family: "Cairo", sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  background: #f1f8f1;
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  text-align: right;
}

.add-item-swiper-fab-menu__btn:active {
  background: #e8f5e9;
}

.add-item-photo-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
}

.product-swiper {
  width: 100%;
  height: 260px;
  border-radius: 16px;
  overflow: hidden;  /* يفضل hidden */
  background: #f0f5f0;
  margin-bottom: 0;
}



.product-swiper .swiper-slide {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f5f0;
  height: 260px;
}

.add-item-slide-del {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 999;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4);      /* ← أبيض شفاف */
  background: rgba(198, 40, 40, 0.88);           /* ← أحمر */
  color: #fff;
  box-shadow: 0 4px 14px rgba(185,28,28,0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 0.18s ease;
}

.add-item-slide-del:active {
  transform: scale(0.9);
  background: rgba(183, 28, 28, 1);
}

.add-item-slide-del .ph {
  font-size: 18px;
  pointer-events: none;
}


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

.product-swiper .swiper-pagination-bullet {
  background: #1b5e20;
  opacity: 0.3;
  width: 8px;
  height: 8px;
}

.product-swiper .swiper-pagination-bullet-active {
  opacity: 1;
  width: 20px;
  border-radius: 4px;
  background: #1b5e20;
  transition: width 0.3s;
}

/* ——— خطوة 4: نافذة قص الصورة (Cropper.js) ——— */
.gv-crop-modal[hidden] {
  display: none !important;
}

.gv-crop-modal:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 10070;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  box-sizing: border-box;
}

.gv-crop-modal__backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: rgba(0, 0, 0, 0.72);
  cursor: pointer;
}

.gv-crop-modal__sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  max-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gv-crop-modal__stage {
  flex: 1;
  min-height: 200px;
  max-height: min(62vh, 440px);
  background: #0f172a;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid rgba(105, 240, 174, 0.45);
}

.gv-crop-modal__img {
  display: block;
  max-width: 100%;
}

.gv-crop-modal__actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
}

.gv-crop-modal__btn {
  flex: 1;
  min-width: 140px;
  font-family: "Cairo", sans-serif;
  font-size: 15px;
  font-weight: 800;
  padding: 14px 12px;
  border-radius: 14px;
  cursor: pointer;
}

.gv-crop-modal__btn--primary {
  background: linear-gradient(135deg, var(--color-primary), #43a047);
  color: #fff;
  border: none;
  box-shadow: 0 8px 22px rgba(27, 94, 32, 0.38);
}

.gv-crop-modal__btn--secondary {
  background: #f1f8f1;
  color: var(--color-text);
  border: 2px solid var(--color-primary);
}

.gv-crop-modal .cropper-view-box,
.gv-crop-modal .cropper-face {
  border-radius: 0;
}
