:root {
  --green-900: #043f22;
  --green-800: #07532b;
  --green-700: #0b662f;
  --green-600: #147a36;
  --green-200: #dceadf;
  --red-600: #ed001b;
  --red-700: #cf0017;
  --cream: #f7faf6;
  --card: #ffffff;
  --text: #102115;
  --muted: #65736a;
  --border: rgba(4, 63, 34, 0.12);
  --shadow-soft: 0 14px 35px rgba(3, 45, 25, 0.12);
  --shadow-card: 0 12px 28px rgba(8, 55, 28, 0.10);
  --radius-lg: 30px;
  --radius-md: 22px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 18%, rgba(237, 0, 27, 0.06), transparent 24%),
    radial-gradient(circle at 86% 10%, rgba(7, 83, 43, 0.08), transparent 32%),
    linear-gradient(180deg, #ffffff 0%, #f1f6f0 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(130deg, transparent 0 68%, rgba(237, 0, 27, 0.055) 68% 69.2%, transparent 69.2%),
    linear-gradient(128deg, transparent 0 64%, rgba(7, 83, 43, 0.05) 64% 65.4%, transparent 65.4%);
}

button,
a,
input,
select {
  font: inherit;
}

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

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

.site-shell {
  width: min(1500px, calc(100% - 34px));
  margin: 18px auto;
  overflow: hidden;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 24px 80px rgba(6, 44, 23, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 104px;
  padding: 12px 42px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
  border-bottom: 5px solid var(--red-600);
  box-shadow: 0 8px 28px rgba(7, 83, 43, 0.08);
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.brand img {
  display: block;
  width: 135px;
  height: auto;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 3vw, 44px);
  flex: 1 1 auto;
  color: var(--green-900);
  font-weight: 800;
}

.main-nav a,
.nav-dropdown {
  position: relative;
  white-space: nowrap;
}

.main-nav a::after,
.nav-dropdown::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-inline-end: 0;
  bottom: -12px;
  height: 3px;
  border-radius: 99px;
  transform: scaleX(0);
  background: var(--red-600);
  transition: transform 0.18s ease;
}

.main-nav a:hover::after,
.nav-dropdown:hover::after {
  transform: scaleX(1);
}

.nav-dropdown {
  display: flex;
  align-items: center;
  gap: 7px;
}

.nav-dropdown button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-weight: 800;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 0 0 auto;
}

.lang-switch {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 138px;
  padding: 5px;
  border-radius: 15px;
  background: #edf3ee;
  border: 1px solid var(--border);
}

.language-select {
  width: 100%;
  height: 42px;
  padding: 0 38px 0 14px;
  border: 0;
  border-radius: 11px;
  background: var(--green-700);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
  outline: none;
  box-shadow: 0 6px 18px rgba(7, 83, 43, 0.24);
  appearance: none;
}

html[dir="rtl"] .language-select {
  padding: 0 14px 0 38px;
}

.lang-switch::after {
  content: "⌄";
  position: absolute;
  inset-inline-end: 17px;
  top: 50%;
  transform: translateY(-54%);
  color: #fff;
  font-weight: 950;
  pointer-events: none;
}

.language-select option {
  color: var(--text);
  background: #fff;
  font-weight: 800;
}

.cart-button {
  position: relative;
  width: 58px;
  height: 58px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 26px rgba(7, 83, 43, 0.12);
}

.cart-icon {
  font-size: 25px;
  line-height: 1;
}

.cart-count {
  position: absolute;
  top: -9px;
  inset-inline-end: -9px;
  min-width: 25px;
  height: 25px;
  padding: 0 7px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  background: var(--red-600);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  border: 3px solid #fff;
}

.hero-section {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(105deg, rgba(255, 255, 255, 0.96) 0 42%, rgba(224, 236, 224, 0.84) 42% 100%),
    var(--cream);
}

.hero-section::after {
  content: "";
  position: absolute;
  inset-inline-start: -8%;
  bottom: -165px;
  width: 122%;
  height: 260px;
  border-radius: 50% 50% 0 0;
  background: linear-gradient(90deg, var(--green-900), var(--green-700));
  opacity: 0.98;
}

.hero-ribbon {
  position: absolute;
  pointer-events: none;
  border-radius: 999px;
  transform: rotate(-8deg);
  transform-origin: center;
  opacity: 0.95;
}

.ribbon-red {
  top: 28px;
  inset-inline-end: -180px;
  width: 620px;
  height: 34px;
  background: var(--red-600);
}

.ribbon-white {
  top: 58px;
  inset-inline-end: -155px;
  width: 610px;
  height: 34px;
  background: #fff;
}

.ribbon-green {
  top: 88px;
  inset-inline-end: -170px;
  width: 650px;
  height: 38px;
  background: var(--green-900);
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 42px;
  min-height: 440px;
  padding: 58px 70px 68px;
}

.hero-copy {
  width: min(560px, 47%);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--red-600);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

html[dir="rtl"] .eyebrow {
  letter-spacing: 0;
}

.eyebrow.small {
  margin-bottom: 8px;
  font-size: 13px;
}

.hero-copy h1 {
  margin: 0;
  color: var(--green-900);
  font-size: clamp(46px, 5vw, 76px);
  line-height: 0.98;
  font-weight: 950;
  letter-spacing: -0.045em;
}

html[dir="rtl"] .hero-copy h1 {
  letter-spacing: 0;
}

.hero-copy h1 span,
.hero-copy h1 strong {
  display: block;
}

.hero-copy h1 strong {
  color: var(--red-600);
  font-weight: inherit;
}

.hero-text {
  max-width: 440px;
  margin: 22px 0 28px;
  color: #26382d;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.55;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  height: 52px;
  padding: 0 26px;
  border-radius: 999px;
  background: var(--red-600);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 13px 25px rgba(237, 0, 27, 0.25);
}

.hero-visual {
  position: relative;
  flex: 1 1 auto;
  min-height: 330px;
  max-width: 760px;
}

.sun {
  position: absolute;
  inset-inline-end: 18%;
  top: 6%;
  width: 255px;
  height: 255px;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 38%, rgba(255,255,255,0.75), rgba(255,255,255,0.12) 35%, rgba(20,122,54,0.12) 60%, transparent 70%);
}

.hero-watermelon {
  position: absolute;
  z-index: 2;
  inset-inline-start: 50%;
  top: 42%;
  width: min(430px, 72%);
  transform: translate(-50%, -50%) scale(1.12);
  filter: drop-shadow(0 25px 30px rgba(0, 0, 0, 0.20));
}

html[dir="rtl"] .hero-watermelon {
  transform: translate(50%, -50%) scale(1.12);
}

.hero-watermelon img {
  width: 100%;
  display: block;
}

.field {
  position: absolute;
  bottom: 4px;
  height: 130px;
  border-radius: 65% 65% 0 0;
  box-shadow: inset 0 12px 0 rgba(255, 255, 255, 0.8);
}

.field-1 {
  inset-inline-start: 3%;
  width: 88%;
  background: linear-gradient(135deg, #0a4c26, #0f7938);
}

.field-2 {
  z-index: 1;
  inset-inline-start: 17%;
  bottom: -8px;
  width: 70%;
  background: linear-gradient(135deg, #145f2f, #4d9a2e);
}

.field-3 {
  z-index: 1;
  inset-inline-start: 35%;
  bottom: -18px;
  width: 56%;
  background: linear-gradient(135deg, #fff 0 8%, var(--red-600) 8% 17%, #fff 17% 28%, #0b5629 28% 100%);
  opacity: 0.92;
}

.catalog-section {
  position: relative;
  z-index: 2;
  padding: 0 60px 52px;
  background: #fff;
  border-radius: 36px 36px 0 0;
  margin-top: -36px;
}

.category-row {
  position: relative;
  top: -26px;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
  padding: 5px 0 10px;
  scrollbar-width: none;
}

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

.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 45px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--green-900);
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 9px 20px rgba(7, 83, 43, 0.08);
  cursor: pointer;
}

.category-chip.is-active {
  border-color: var(--red-600);
  background: var(--red-600);
  color: #fff;
  box-shadow: 0 12px 25px rgba(237, 0, 27, 0.20);
}

.category-chip span {
  font-size: 19px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin: -10px 0 26px;
}

.section-head h2 {
  margin: 0;
  color: var(--green-900);
  font-size: 36px;
  line-height: 1.1;
  font-weight: 950;
}

.view-all {
  color: var(--green-700);
  font-weight: 950;
}

.view-all::after {
  content: " →";
}

html[dir="rtl"] .view-all::after {
  content: " ←";
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.product-card {
  display: flex;
  flex-direction: column;
  min-height: 410px;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: var(--shadow-card);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px rgba(8, 55, 28, 0.16);
}

.product-image {
  display: grid;
  place-items: center;
  height: 168px;
  margin-bottom: 11px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 72%, rgba(7, 83, 43, 0.09), transparent 42%),
    linear-gradient(180deg, #fff, #f7faf6);
  overflow: hidden;
}

.product-image img {
  display: block;
  max-width: 94%;
  max-height: 150px;
  object-fit: contain;
  filter: drop-shadow(0 14px 12px rgba(14, 46, 22, 0.15));
}

.product-card h3 {
  margin: 0 0 8px;
  color: var(--green-900);
  font-size: 19px;
  font-weight: 950;
}

.product-card p {
  min-height: 47px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
}

.product-price {
  margin-top: 14px;
  color: var(--green-900);
  font-size: 20px;
  font-weight: 950;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
}

.qty-box {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 7px;
}

.qty-box input,
.qty-box select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-weight: 850;
  text-align: center;
  outline: none;
}

.qty-box select {
  padding: 0 8px;
}

.add-button {
  height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 13px;
  background: var(--red-600);
  color: #fff;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 11px 20px rgba(237, 0, 27, 0.18);
}

.add-button:hover,
.primary-button:hover {
  background: var(--red-700);
}

.site-footer {
  color: #fff;
  background:
    radial-gradient(circle at 50% -30%, rgba(255,255,255,0.12), transparent 36%),
    linear-gradient(135deg, var(--green-800), var(--green-900));
  border-top: 5px solid var(--red-600);
  padding: 38px 60px 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr 1.6fr;
  gap: 34px;
  align-items: start;
}

.footer-col,
.newsletter {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.site-footer h3 {
  margin: 0 0 7px;
  font-size: 18px;
  font-weight: 950;
}

.site-footer a,
.site-footer p,
.footer-bottom {
  color: rgba(255, 255, 255, 0.86);
  font-size: 14px;
  font-weight: 650;
}

.footer-logo-block {
  text-align: center;
}

.footer-logo-block img {
  width: 150px;
  max-width: 100%;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 18px;
  padding: 7px;
}

.socials {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

.socials a {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  font-weight: 950;
}

.newsletter form {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 460px;
  padding: 6px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
}

.newsletter input {
  flex: 1 1 auto;
  min-width: 0;
  height: 42px;
  border: 0;
  border-radius: 12px;
  padding: 0 16px;
  outline: none;
}

.newsletter button {
  height: 42px;
  border: 0;
  border-radius: 12px;
  padding: 0 18px;
  background: var(--red-600);
  color: #fff;
  font-weight: 950;
  cursor: pointer;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 32px;
  padding: 18px 0;
  border-top: 1px solid rgba(255,255,255,0.2);
}

html[dir="rtl"] body {
  text-align: right;
}

html[dir="ltr"] body {
  text-align: left;
}

html[dir="rtl"] .hero-copy,
html[dir="rtl"] .product-card,
html[dir="rtl"] .site-footer {
  direction: rtl;
}

html[dir="ltr"] .hero-copy,
html[dir="ltr"] .product-card,
html[dir="ltr"] .site-footer {
  direction: ltr;
}

@media (max-width: 1180px) {
  .site-header {
    padding: 12px 22px;
    gap: 18px;
  }

  .main-nav {
    gap: 18px;
  }

  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 940px) {
  .site-header {
    position: relative;
    flex-wrap: wrap;
  }

  .main-nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  html[dir="rtl"] .main-nav {
    justify-content: flex-end;
  }

  .header-actions {
    margin-inline-start: auto;
  }

  .hero-inner {
    flex-direction: column;
    align-items: stretch;
    padding: 45px 28px 68px;
  }

  .hero-copy {
    width: 100%;
  }

  .catalog-section,
  .site-footer {
    padding-inline: 28px;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .site-shell {
    width: 100%;
    margin: 0;
    border-radius: 0;
  }

  .brand img {
    width: 112px;
  }

  .site-header {
    min-height: auto;
  }

  .lang-switch {
    min-width: 116px;
  }

  .language-select {
    height: 38px;
    padding-inline-start: 12px;
  }

  .cart-button {
    width: 48px;
    height: 48px;
  }

  .hero-copy h1 {
    font-size: 42px;
  }

  .product-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .card-actions,
  .newsletter form,
  .footer-bottom {
    flex-direction: column;
    display: flex;
    align-items: stretch;
  }
}

/* PHP version additions */
.category-chip {
  text-decoration: none;
}

.product-category {
  margin: 0 0 5px;
  font-size: 12px;
  color: var(--green-700);
  font-weight: 800;
}

.qty-control input {
  width: 54px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 7px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
}

.empty-state {
  padding: 38px;
  background: #fff;
  border-radius: 22px;
  border: 1px solid var(--border);
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.admin-link {
  position: fixed;
  bottom: 14px;
  inset-inline-end: 14px;
  z-index: 10;
  background: var(--green-800);
  color: #fff;
  padding: 8px 12px;
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  font-size: 12px;
}

@media (max-width: 980px) {
  .site-header,
  .hero-inner,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .main-nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .header-actions {
    justify-content: center;
  }
}

.product-card .product-category {
  min-height: 0;
  margin-bottom: 6px;
}

.product-card .product-desc {
  min-height: 48px;
}

.product-actions {
  display: grid;
  grid-template-columns: minmax(122px, 1fr) auto;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
  align-items: center;
}

.qty-control {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 7px;
}

.qty-control input,
.qty-control select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-weight: 850;
  text-align: center;
  outline: none;
}

.footer-brand {
  text-align: center;
}

.footer-brand img {
  width: 150px;
  max-width: 100%;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 18px;
  padding: 7px;
}

.socials span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  font-weight: 950;
}

.site-footer h4 {
  margin: 0 0 7px;
  font-size: 18px;
  font-weight: 950;
}

.site-footer div > a {
  display: block;
  margin: 7px 0;
}

.newsletter {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 460px;
  padding: 6px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
}

@media (max-width: 760px) {
  .product-actions {
    grid-template-columns: 1fr;
  }
}


.cart-toast {
  position: fixed;
  top: 22px;
  inset-inline-end: 22px;
  z-index: 120;
  min-width: 320px;
  max-width: 420px;
  background: #ffffff;
  border: 1px solid rgba(6, 75, 34, 0.12);
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
  padding: 14px;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-14px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.cart-toast.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.cart-toast-icon {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #064b22;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 900;
}

.cart-toast-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cart-toast-text strong {
  color: #064b22;
  font-size: 15px;
  font-weight: 900;
}

.cart-toast-text span {
  color: #6b7280;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-toast-button {
  border: 0;
  border-radius: 12px;
  background: #ef0015;
  color: #ffffff;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.cart-count.is-bumped {
  transform: scale(1.22);
}

.add-button.is-added {
  transform: translateY(-1px) scale(0.98);
  opacity: 0.88;
}

.cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 40, 18, 0.45);
  z-index: 80;
}

.cart-panel {
  position: fixed;
  top: 0;
  bottom: 0;
  inset-inline-end: 0;
  width: min(430px, 92vw);
  background: #ffffff;
  z-index: 90;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transform: translateX(110%);
  transition: transform 0.25s ease;
}

[dir="rtl"] .cart-panel {
  transform: translateX(-110%);
}

.cart-panel.is-open {
  transform: translateX(0);
}

/* =========================
   Cart toast
========================= */

.cart-toast {
  position: fixed;
  top: 22px;
  inset-inline-end: 22px;
  z-index: 10020;
  min-width: 320px;
  max-width: 440px;
  background: #ffffff;
  border: 1px solid rgba(6, 75, 34, 0.12);
  border-radius: 20px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.18);
  padding: 14px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-14px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.cart-toast.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.cart-toast-icon {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: var(--green-900);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 950;
}

.cart-toast-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cart-toast-text strong {
  color: var(--green-900);
  font-size: 15px;
  font-weight: 950;
}

.cart-toast-text span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-toast-button {
  border: 0;
  border-radius: 13px;
  background: var(--red-600);
  color: #ffffff;
  padding: 10px 13px;
  font-size: 13px;
  font-weight: 950;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 10px 20px rgba(237, 0, 27, 0.18);
}

.cart-toast-button:hover {
  background: var(--red-700);
}

.cart-count {
  transition: transform 0.18s ease;
}

.cart-count.is-bumped {
  transform: scale(1.22);
}

.add-button.is-added {
  transform: translateY(-1px) scale(0.98);
  opacity: 0.88;
}


/* =========================
   Cart side panel
========================= */

.cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 40, 18, 0.48);
  backdrop-filter: blur(3px);
  z-index: 10000;
}

.cart-panel {
  position: fixed;
  top: 0;
  bottom: 0;
  inset-inline-end: 0;
  width: min(460px, 94vw);
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fbf8 100%);
  z-index: 10010;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.30);
  padding: 0;
  display: flex;
  flex-direction: column;
  transform: translateX(110%);
  transition: transform 0.26s ease;
  border-inline-start: 5px solid var(--red-600);
}

html[dir="rtl"] .cart-panel {
  inset-inline-end: auto;
  inset-inline-start: 0;
  transform: translateX(-110%);
  border-inline-start: 0;
  border-inline-end: 5px solid var(--red-600);
}

.cart-panel.is-open {
  transform: translateX(0);
}

.cart-panel-head {
  position: relative;
  padding: 24px 24px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  background:
    radial-gradient(circle at 90% 0%, rgba(237, 0, 27, 0.08), transparent 34%),
    linear-gradient(135deg, #ffffff, #f3f8f3);
  border-bottom: 1px solid rgba(4, 63, 34, 0.12);
}

.cart-panel-head::after {
  content: "";
  position: absolute;
  inset-inline-start: 24px;
  inset-inline-end: 24px;
  bottom: -1px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green-900), var(--red-600));
}

.cart-panel-head .eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--red-600);
}

.cart-panel-head h3 {
  margin: 0;
  color: var(--green-900);
  font-size: 30px;
  line-height: 1.1;
  font-weight: 950;
}

.cart-close {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  color: var(--green-900);
  font-size: 30px;
  line-height: 1;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(7, 83, 43, 0.12);
}

.cart-close:hover {
  background: var(--red-600);
  color: #ffffff;
}


/* =========================
   Cart content
========================= */

.cart-empty {
  margin: 22px 24px;
  padding: 28px 18px;
  text-align: center;
  color: var(--muted);
  border: 2px dashed rgba(4, 63, 34, 0.16);
  border-radius: 22px;
  background: #ffffff;
  font-weight: 800;
}

.cart-items {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px 20px 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-items::-webkit-scrollbar {
  width: 8px;
}

.cart-items::-webkit-scrollbar-thumb {
  background: rgba(4, 63, 34, 0.24);
  border-radius: 999px;
}

.cart-line {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(4, 63, 34, 0.12);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(8, 55, 28, 0.08);
}

html[dir="rtl"] .cart-line {
  grid-template-columns: auto minmax(0, 1fr) 78px;
}

.cart-line-image {
  width: 78px;
  height: 68px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 70%, rgba(7, 83, 43, 0.08), transparent 42%),
    linear-gradient(180deg, #ffffff, #f3f7f3);
  border: 1px solid rgba(4, 63, 34, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cart-line-image img {
  display: block;
  max-width: 92%;
  max-height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 8px 10px rgba(14, 46, 22, 0.12));
}

.cart-line-info {
  min-width: 0;
}

.cart-line-title {
  margin-bottom: 4px;
  color: var(--green-900);
  font-size: 15px;
  font-weight: 950;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-line-meta {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.cart-line-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cart-line-controls button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 10px;
  background: var(--green-900);
  color: #ffffff;
  font-size: 16px;
  font-weight: 950;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.cart-line-controls button:hover {
  background: var(--green-700);
}

.cart-line-controls .cart-remove {
  background: var(--red-600);
}

.cart-line-controls .cart-remove:hover {
  background: var(--red-700);
}

.cart-line-controls input {
  width: 58px;
  height: 30px;
  border: 1px solid rgba(4, 63, 34, 0.16);
  border-radius: 10px;
  background: #ffffff;
  color: var(--green-900);
  text-align: center;
  font-size: 13px;
  font-weight: 900;
  outline: none;
}

.cart-line-total {
  color: var(--red-600);
  font-size: 15px;
  font-weight: 950;
  white-space: nowrap;
}


/* =========================
   Cart summary
========================= */

.cart-summary {
  flex: 0 0 auto;
  margin: 0 20px;
  padding: 16px 4px 12px;
  border-top: 1px solid rgba(4, 63, 34, 0.12);
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.cart-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--green-900);
  font-size: 15px;
  font-weight: 850;
}

.cart-summary-row strong {
  font-size: 18px;
  font-weight: 950;
}

.cart-total-row {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px dashed rgba(4, 63, 34, 0.18);
  font-size: 20px;
  font-weight: 950;
}

.cart-total-row strong {
  color: var(--red-600);
  font-size: 27px;
  font-weight: 950;
}

.checkout-button {
  flex: 0 0 auto;
  height: 54px;
  margin: 8px 20px 0;
  border: 0;
  border-radius: 18px;
  background: var(--red-600);
  color: #ffffff;
  font-size: 17px;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(237, 0, 27, 0.24);
}

.checkout-button:hover {
  background: var(--red-700);
}

.checkout-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.clear-cart-button {
  flex: 0 0 auto;
  height: 46px;
  margin: 10px 20px 22px;
  border: 1px solid rgba(4, 63, 34, 0.16);
  border-radius: 16px;
  background: #ffffff;
  color: var(--green-900);
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}

.clear-cart-button:hover {
  border-color: var(--red-600);
  color: var(--red-600);
}


/* =========================
   Small screens
========================= */

@media (max-width: 520px) {
  .cart-toast {
    top: 12px;
    inset-inline-start: 12px;
    inset-inline-end: 12px;
    min-width: 0;
    max-width: none;
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .cart-toast-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .cart-panel {
    width: 100vw;
  }

  .cart-line {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  html[dir="rtl"] .cart-line {
    grid-template-columns: minmax(0, 1fr) 68px;
  }

  .cart-line-total {
    grid-column: 1 / -1;
    text-align: end;
  }
}

/* FIX: cart panel must always slide from the right side, even in Hebrew RTL */

.cart-backdrop {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(0, 40, 18, 0.48) !important;
  backdrop-filter: blur(3px);
  z-index: 10000 !important;
}

.cart-panel {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  left: auto !important;
  bottom: 0 !important;

  width: min(460px, 94vw) !important;
  height: 100vh !important;

  background: linear-gradient(180deg, #ffffff 0%, #f8fbf8 100%) !important;
  z-index: 10010 !important;

  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.30);
  padding: 0 !important;

  display: flex !important;
  flex-direction: column !important;

  transform: translateX(110%) !important;
  transition: transform 0.26s ease !important;

  border-left: 5px solid var(--red-600);
  border-right: 0 !important;

  overflow: hidden;
}

html[dir="rtl"] .cart-panel {
  right: 0 !important;
  left: auto !important;
  transform: translateX(110%) !important;
  border-left: 5px solid var(--red-600) !important;
  border-right: 0 !important;
}

.cart-panel.is-open,
html[dir="rtl"] .cart-panel.is-open {
  transform: translateX(0) !important;
}

.cart-panel[aria-hidden="true"] {
  pointer-events: none;
}

.cart-panel[aria-hidden="false"] {
  pointer-events: auto;
}

/* =========================================================
   FINAL CART POSITION FIX
   RU / EN = right side
   HE / RTL = left side
========================================================= */

/* backdrop */
.cart-backdrop[hidden] {
  display: none !important;
}

.cart-backdrop {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(0, 40, 18, 0.48) !important;
  backdrop-filter: blur(3px);
  z-index: 10000 !important;
}

/* default: LTR languages, RU / EN — from RIGHT */
html[dir="ltr"] body .cart-panel {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  left: auto !important;
  bottom: 0 !important;

  width: min(460px, 94vw) !important;
  height: 100vh !important;

  transform: translate3d(110%, 0, 0) !important;
  direction: ltr !important;
  text-align: left !important;

  z-index: 10010 !important;
  visibility: hidden !important;
  pointer-events: none !important;

  border-left: 5px solid var(--red-600) !important;
  border-right: 0 !important;
}

/* Hebrew RTL — from LEFT */
html[dir="rtl"] body .cart-panel {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: auto !important;
  bottom: 0 !important;

  width: min(460px, 94vw) !important;
  height: 100vh !important;

  transform: translate3d(-110%, 0, 0) !important;
  direction: rtl !important;
  text-align: right !important;

  z-index: 10010 !important;
  visibility: hidden !important;
  pointer-events: none !important;

  border-right: 5px solid var(--red-600) !important;
  border-left: 0 !important;
}

/* open state */
html[dir="ltr"] body .cart-panel.is-open,
html[dir="rtl"] body .cart-panel.is-open {
  transform: translate3d(0, 0, 0) !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* Hebrew header inside cart */
html[dir="rtl"] body .cart-panel-head {
  direction: rtl !important;
  text-align: right !important;
}

/* In Hebrew close button should be on the opposite side */
html[dir="rtl"] body .cart-panel-head {
  flex-direction: row-reverse !important;
}

/* Cart line RTL */
html[dir="rtl"] body .cart-line {
  direction: rtl !important;
  text-align: right !important;
}

/* Summary RTL */
html[dir="rtl"] body .cart-summary-row {
  direction: rtl !important;
}

/* Toast RTL */
html[dir="rtl"] body .cart-toast {
  direction: rtl !important;
  text-align: right !important;
}

/* Block page scroll while cart is open */
html.cart-scroll-locked,
body.cart-scroll-locked {
  overflow: hidden !important;
}

/* Checkout form inside cart */

.checkout-form {
  flex: 0 0 auto;
  margin: 4px 20px 0;
  padding: 16px;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid rgba(4, 63, 34, 0.14);
  box-shadow: 0 10px 24px rgba(8, 55, 28, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkout-form[hidden] {
  display: none !important;
}

.checkout-form-title {
  color: var(--green-900);
  font-size: 18px;
  font-weight: 950;
  margin-bottom: 2px;
}

.checkout-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.checkout-field span {
  color: var(--green-900);
  font-size: 13px;
  font-weight: 900;
}

.checkout-field input {
  width: 100%;
  height: 42px;
  border: 1px solid rgba(4, 63, 34, 0.16);
  border-radius: 13px;
  background: #ffffff;
  color: var(--text);
  padding: 0 13px;
  font-size: 15px;
  font-weight: 750;
  outline: none;
}

.checkout-field input:focus {
  border-color: var(--green-700);
  box-shadow: 0 0 0 3px rgba(7, 83, 43, 0.10);
}

.checkout-finish-button {
  height: 48px;
  border: 0;
  border-radius: 16px;
  background: var(--green-900);
  color: #ffffff;
  font-size: 16px;
  font-weight: 950;
  cursor: pointer;
}

.checkout-finish-button:hover {
  background: var(--green-700);
}

.checkout-finish-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

html[dir="rtl"] .checkout-form,
html[dir="rtl"] .checkout-field,
html[dir="rtl"] .checkout-field input {
  direction: rtl;
  text-align: right;
}

/* =========================
   Checkout loader
========================= */

.checkout-finish-button,
.checkout-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.checkout-finish-button.is-loading,
.checkout-button.is-loading {
  pointer-events: none;
  opacity: 0.85;
}

.checkout-finish-button.is-loading::after,
.checkout-button.is-loading::after {
  content: "";
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: checkoutButtonSpin 0.75s linear infinite;
}

@keyframes checkoutButtonSpin {
  to {
    transform: rotate(360deg);
  }
}


/* =========================
   Order result modal
========================= */

html.order-modal-locked,
body.order-modal-locked {
  overflow: hidden !important;
}

.order-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: rgba(0, 40, 18, 0.55);
  backdrop-filter: blur(5px);
}

.order-modal-backdrop[hidden],
.order-modal[hidden] {
  display: none !important;
}

.order-modal {
  position: fixed;
  inset: 0;
  z-index: 20010;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.order-modal-card {
  position: relative;
  width: min(440px, 100%);
  border-radius: 28px;
  background: #ffffff;
  padding: 34px 28px 28px;
  text-align: center;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(4, 63, 34, 0.12);
  animation: orderModalIn 0.22s ease;
}

@keyframes orderModalIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.order-modal-close {
  position: absolute;
  top: 14px;
  inset-inline-end: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: #f2f4f3;
  color: var(--green-900);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.order-modal-close:hover {
  background: var(--red-600);
  color: #ffffff;
}

.order-modal-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 999px;
  background: var(--green-900);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  font-weight: 950;
  box-shadow: 0 14px 28px rgba(4, 63, 34, 0.24);
}

.order-modal.is-error .order-modal-icon {
  background: var(--red-600);
}

.order-modal h3 {
  margin: 0 0 10px;
  color: var(--green-900);
  font-size: 26px;
  line-height: 1.15;
  font-weight: 950;
}

.order-modal p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
}

.order-modal-receipt {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #f7faf6;
  color: var(--green-900);
  font-size: 15px;
  font-weight: 900;
  border: 1px solid rgba(4, 63, 34, 0.12);
}

.order-modal-pdf {
  margin-top: 12px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 15px;
  background: var(--red-600);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 950;
  box-shadow: 0 12px 24px rgba(237, 0, 27, 0.22);
}

.order-modal-pdf:hover {
  background: var(--red-700);
}

.order-modal-ok {
  width: 100%;
  height: 48px;
  margin-top: 18px;
  border: 0;
  border-radius: 16px;
  background: var(--green-900);
  color: #ffffff;
  font-size: 16px;
  font-weight: 950;
  cursor: pointer;
}

.order-modal-ok:hover {
  background: var(--green-700);
}

html[dir="rtl"] .order-modal-card {
  direction: rtl;
  text-align: center;
}
