:root {
  --brand: #800020;
  --brand2: #a10a35;
  --light: #f7f7f7;
  --soft: #ffeef4;
  --black: #0d0d0d;
  --white: #ffffff;
  --gray: #777;
}

* {
  box-sizing: border-box;
  font-family: Arial, Tahoma, sans-serif;
}

body {
  margin: 0;
  background: var(--light);
  color: var(--black);
}

.app {
  max-width: 520px;
  margin: auto;
  min-height: 100vh;
  background: var(--light);
  padding-bottom: 90px;
}

.topbar {
  background: var(--brand);
  color: white;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}

.topbar h1 {
  margin: 0;
  font-size: 21px;
  letter-spacing: 1px;
  font-weight: 900;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border: none;
  background: rgba(255,255,255,0.14);
  color: white;
  border-radius: 50%;
  font-size: 21px;
  cursor: pointer;
  position: relative;
}

.cart-count {
  position: absolute;
  top: -4px;
  left: -4px;
  min-width: 18px;
  height: 18px;
  border-radius: 20px;
  background: white;
  color: var(--brand);
  font-size: 11px;
  font-weight: 900;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.content {
  padding: 15px;
}

.search-box {
  background: white;
  border: 1px solid rgba(128,0,32,0.16);
  border-radius: 17px;
  height: 54px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  box-shadow: 0 5px 12px rgba(0,0,0,0.05);
  margin-bottom: 22px;
}

.search-box span {
  color: #777;
  font-size: 20px;
  margin-left: 8px;
}

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  background: transparent;
  direction: rtl;
}

.hero {
  height: 190px;
  border-radius: 28px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: white;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(0,0,0,0.13);
  overflow: hidden;
  margin-bottom: 28px;
}

.hero h2 {
  margin: 0;
  font-size: 29px;
  font-weight: 900;
  letter-spacing: 1px;
}

.hero p {
  margin: 8px 0 0;
  color: rgba(255,255,255,0.82);
  font-size: 14px;
  line-height: 1.7;
}

.banner-img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  border-radius: 28px;
  box-shadow: 0 8px 18px rgba(0,0,0,0.13);
  margin-bottom: 28px;
  display: none;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 0 12px;
}

.section-head h3 {
  margin: 0;
  font-size: 21px;
  font-weight: 900;
}

.section-head button {
  border: none;
  background: transparent;
  color: var(--brand);
  font-weight: 900;
  font-size: 14px;
  cursor: pointer;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 13px 9px;
  margin-bottom: 25px;
}

.cat-item {
  text-align: center;
  cursor: pointer;
}

.cat-img {
  width: 76px;
  height: 76px;
  margin: auto;
  background: white;
  border-radius: 20px;
  border: 1px solid rgba(128,0,32,0.16);
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--brand);
  font-size: 30px;
}

.cat-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cat-item p {
  margin: 7px 0 0;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.card {
  background: white;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(128,0,32,0.07);
  box-shadow: 0 7px 14px rgba(0,0,0,0.065);
}

.card-image {
  height: 165px;
  background: #e9e9e9;
  position: relative;
  cursor: pointer;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.img-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 34px;
}

.add-cart {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.94);
  color: var(--brand);
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

.offer-badge {
  position: absolute;
  top: 9px;
  left: 9px;
  background: var(--brand);
  color: white;
  padding: 5px 8px;
  border-radius: 50px;
  font-size: 10px;
  font-weight: 900;
}

.card-body {
  padding: 10px;
  text-align: center;
}

.card-title {
  font-size: 13px;
  font-weight: 900;
  height: 18px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.price {
  direction: ltr;
  color: var(--brand);
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 7px;
}

.buy-btn {
  width: 100%;
  height: 34px;
  border: none;
  border-radius: 12px;
  background: var(--brand);
  color: white;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.page-header {
  margin: 15px 15px 18px;
  padding: 15px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: white;
  border-radius: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 18px rgba(128,0,32,0.22);
}

.back-btn {
  border: none;
  background: rgba(255,255,255,0.16);
  color: white;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.page-icon {
  width: 54px;
  height: 54px;
  background: white;
  color: var(--brand);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 29px;
  flex-shrink: 0;
}

.page-title h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 900;
}

.page-title p {
  margin: 4px 0 0;
  color: rgba(255,255,255,0.75);
  font-size: 12px;
}

.tabs {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding: 0 15px 12px;
}

.tab {
  min-width: 105px;
  height: 44px;
  border-radius: 16px;
  border: 1px solid rgba(128,0,32,0.16);
  background: white;
  color: var(--black);
  font-weight: 900;
  cursor: pointer;
  flex-shrink: 0;
}

.tab.active {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}

.empty {
  text-align: center;
  color: #777;
  padding: 50px 20px;
  font-weight: 700;
  line-height: 1.8;
  grid-column: 1 / -1;
}

.drawer {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 100;
  display: none;
  align-items: flex-end;
}

.drawer-box {
  background: white;
  width: 100%;
  max-width: 520px;
  margin: auto;
  border-radius: 28px 28px 0 0;
  padding: 16px 18px 22px;
  max-height: 90vh;
  overflow-y: auto;
}

.drawer-logo {
  text-align: center;
  color: var(--brand);
  font-weight: 900;
  font-size: 23px;
  margin: 8px 0 4px;
}

.drawer-sub {
  text-align: center;
  color: #666;
  font-size: 13px;
  margin-bottom: 16px;
}

.menu-item {
  background: var(--light);
  border: 1px solid rgba(128,0,32,0.08);
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.menu-ico {
  width: 42px;
  height: 42px;
  background: rgba(128,0,32,0.08);
  border-radius: 13px;
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.menu-text b {
  font-size: 15px;
}

.menu-text p {
  margin: 3px 0 0;
  color: #666;
  font-size: 11.5px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.40);
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal-box {
  width: 100%;
  max-width: 460px;
  background: white;
  border-radius: 24px;
  padding: 18px;
}

.modal-box h3 {
  margin: 0 0 12px;
  color: var(--brand);
  font-size: 21px;
}

.modal-soft {
  background: var(--soft);
  border: 1px solid rgba(128,0,32,0.18);
  border-radius: 16px;
  padding: 14px;
  line-height: 1.7;
  font-size: 14px;
  margin-bottom: 14px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}

.modal-actions button {
  border: none;
  border-radius: 13px;
  padding: 11px 18px;
  font-weight: 900;
  cursor: pointer;
}

.confirm-btn {
  background: var(--brand);
  color: white;
}

.cancel-btn {
  background: #eee;
  color: #555;
}

.details-img {
  width: 100%;
  height: 330px;
  background: white;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(128,0,32,0.08);
  box-shadow: 0 8px 18px rgba(0,0,0,0.08);
  margin-bottom: 18px;
}

.details-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.details-box {
  background: white;
  border-radius: 24px;
  padding: 16px;
  border: 1px solid rgba(128,0,32,0.08);
  box-shadow: 0 6px 14px rgba(0,0,0,0.05);
}

.details-box .cat {
  color: var(--brand);
  font-weight: 900;
  font-size: 13px;
  margin-bottom: 8px;
}

.details-box h2 {
  margin: 0 0 10px;
  font-size: 23px;
  font-weight: 900;
}

.desc {
  background: var(--soft);
  border: 1px solid rgba(128,0,32,0.12);
  border-radius: 18px;
  padding: 14px;
  line-height: 1.7;
  font-size: 14px;
  color: #222;
  margin-top: 15px;
}

.desc p {
  margin-bottom: 0;
}

.big-btn {
  width: 100%;
  height: 54px;
  border-radius: 17px;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  margin-top: 10px;
}

.outline {
  border: 1.5px solid var(--brand);
  background: white;
  color: var(--brand);
}

.filled {
  border: none;
  background: var(--brand);
  color: white;
}

.cart-panel {
  position: fixed;
  inset: 0;
  background: var(--light);
  z-index: 110;
  display: none;
  max-width: 520px;
  margin: auto;
  overflow-y: auto;
}

.cart-item {
  background: white;
  border-radius: 18px;
  padding: 12px;
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.cart-thumb {
  width: 70px;
  height: 70px;
  background: #eee;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
}

.cart-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-info {
  flex: 1;
}

.cart-info b {
  font-size: 14px;
}

.qty {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.qty button {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: var(--brand);
  color: white;
  font-weight: 900;
  cursor: pointer;
}

.toast {
  position: fixed;
  bottom: 18px;
  right: 50%;
  transform: translateX(50%);
  background: var(--brand);
  color: white;
  border-radius: 14px;
  padding: 12px 18px;
  z-index: 200;
  font-weight: 900;
  display: none;
  box-shadow: 0 6px 15px rgba(0,0,0,0.18);
}

.store-address {
  display: inline-block;
  margin-top: 6px;
  font-weight: 700;
  color: #fff;
  opacity: 0.95;
}

#catIcon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}