@font-face {
  font-family: "Vazirmatn";
  src: url("fonts/Vazirmatn-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vazirmatn";
  src: url("fonts/Vazirmatn-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 220px;
}
body {
  margin: 0;
  font-family: "Vazirmatn", Tahoma, sans-serif;
  line-height: 1.8;
  color: #222;
  background-color: #f3f5ef;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input {
  font: inherit;
}
button,
summary {
  cursor: pointer;
}
img {
  max-width: 100%;
}
.wrap {
  width: 92%;
  max-width: 1200px;
  margin: 0 auto;
}

:focus-visible {
  outline: 3px solid #397341;
  outline-offset: 4px;
}
header :focus-visible,
footer :focus-visible {
  outline-color: #facc15;
}

.skip-link {
  position: fixed;
  top: -100px;
  inset-inline-start: 16px;
  padding: 12px;
  background: #facc15;
  color: #222;
  z-index: 100;
}
.skip-link:focus {
  top: 10px;
}
section:target h2 {
  text-decoration: underline;
  text-underline-offset: 8px;
}
.product-card:target {
  outline: 3px solid #856900;
  outline-offset: -3px;
}

.announcement {
  padding: 8px;
  text-align: center;
  font-size: 14px;
  background: #facc15;
}
.announcement span {
  margin-inline-start: 20px;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #222;
  color: white;
}
.header-top {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #facc15;
}
.brand strong {
  display: block;
  color: white;
  font-size: 26px;
}
.brand small {
  display: block;
  color: white;
  white-space: nowrap;
}
.search-box {
  flex: 1;
  min-width: 0;
}
.search-box label {
  display: block;
  font-size: 14px;
}
.search-box input {
  width: 100%;
  padding: 10px;
  border: 1px solid #aaa;
  border-radius: 8px;
}
.cart-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: #facc15;
  color: #222;
}
.cart-button img {
  width: 24px;
  height: 24px;
}
.desktop-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px 0;
}
.desktop-nav a {
  color: #facc15;
}

.category-menu {
  position: relative;
}
.category-trigger {
  padding: 10px;
  border: none;
  border-radius: 6px;
  background: #facc15;
  color: #222;
}
.category-links {
  position: absolute;
  top: 100%;
  inset-inline-start: 0;
  width: 220px;
  display: flex;
  flex-direction: column;
  padding: 12px;
  background: #222;
  border: 1px solid #facc15;
  border-radius: 8px;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.category-links a {
  padding: 8px;
}
.category-menu:hover .category-links,
.category-menu:focus-within .category-links {
  visibility: visible;
  opacity: 1;
}
.mobile-menu {
  display: none;
}

.hero {
  margin: 24px 0;
  padding: 24px;
  background: #e4ebdc;
  border-radius: 12px;
}
.hero h1 {
  margin: 0 0 16px;
  font-size: 34px;
}
.primary-link {
  display: inline-block;
  margin-top: 16px;
  padding: 12px 20px;
  border-radius: 8px;
  background: #222;
  color: white;
  transition: transform 0.2s ease;
}
.primary-link:hover,
.primary-link:focus-visible {
  transform: translateY(-3px);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.section-heading h2 {
  font-size: 24px;
}
.categories {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}
.category-tile {
  padding: 16px 8px;
  border: 1px solid #ddd;
  border-radius: 10px;
  text-align: center;
  background: white;
}
.category-tile img {
  display: block;
  margin: 0 auto 12px;
}
.category-tile strong {
  font-size: 14px;
}

.product-section {
  margin: 32px 0;
}
.products {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 10px 4px 20px;
}
.product-card {
  display: flex;
  flex-direction: column;
  flex: 0 0 220px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 12px;
  background: white;
  scroll-snap-align: start;
  transition: transform 0.2s ease;
}
.product-card:hover,
.product-card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 4px 8px #0002;
}
.product-image {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 140px;
  background: #fff6d7;
  border-radius: 8px;
}
.product-image img {
  width: 72px;
  height: 72px;
}
.discount-badge {
  align-self: flex-start;
  margin-top: 8px;
  padding: 2px 8px;
  background: #facc15;
  border-radius: 8px;
  font-size: 13px;
}
.product-card h3 {
  margin: 14px 0 4px;
  font-size: 16px;
}
.unit {
  margin: 0 0 12px;
  color: #555;
  font-size: 14px;
}
.price {
  display: flex;
  flex-direction: column;
  margin-top: auto;
  margin-bottom: 12px;
}
.price del {
  min-height: 25px;
  color: #666;
  font-size: 14px;
}
.product-card button {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  min-height: 44px;
  border: none;
  border-radius: 8px;
  background: #facc15;
  color: #222;
}
.product-card button:hover {
  background: #eab308;
}
.carousel-controls {
  display: flex;
  gap: 8px;
}
.carousel-controls a {
  padding: 8px 12px;
  border: 1px solid #aaa;
  border-radius: 6px;
  background: white;
  font-size: 14px;
}

footer {
  margin-top: 40px;
  padding: 32px 0;
  background: #222;
  color: white;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 30px;
}
footer h2 {
  font-size: 20px;
}
footer address {
  font-style: normal;
}
footer a {
  color: #facc15;
}
footer nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  border-top: 1px solid #666;
}

@media (max-width: 700px) {
  html {
    scroll-padding-top: 210px;
  }
  .announcement span {
    display: none;
  }
  .header-top {
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 0;
  }
  .brand {
    margin-inline-end: auto;
  }
  .brand svg {
    width: 36px;
  }
  .brand strong {
    font-size: 20px;
  }
  .brand small,
  .cart-button > span {
    display: none;
  }
  .search-box {
    flex: 0 0 100%;
    order: 1;
  }
  .desktop-nav {
    display: none;
  }
  .mobile-menu {
    display: block;
  }
  .mobile-menu summary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    list-style: none;
    border: 1px solid #aaa;
    border-radius: 6px;
  }
  .mobile-menu summary::-webkit-details-marker {
    display: none;
  }
  .mobile-menu summary img {
    display: block;
    width: 26px;
    height: 26px;
    filter: invert(1);
  }
  .mobile-menu nav {
    position: absolute;
    top: 100%;
    inset-inline: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px;
    background: #222;
    border-top: 1px solid #aaa;
  }
  .mobile-menu nav a {
    padding: 8px;
    color: #facc15;
    font-size: 14px;
  }

  html:has(.mobile-menu[open]) {
    scroll-padding-top: 430px;
  }
  .hero {
    padding: 20px;
  }
  .hero h1 {
    font-size: 28px;
  }
  .categories {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .category-tile {
    padding: 12px 4px;
  }
  .category-tile img {
    width: 36px;
    height: 36px;
  }
  .category-tile strong {
    font-size: 13px;
  }
  .section-heading > p {
    display: none;
  }
  .section-heading h2 {
    font-size: 20px;
  }
  .carousel-controls a {
    padding: 8px;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html,
  .products {
    scroll-behavior: auto;
  }
  .product-card,
  .category-links,
  .primary-link {
    transition: none;
  }
  .product-card:hover,
  .product-card:focus-within,
  .primary-link:hover,
  .primary-link:focus-visible {
    transform: none;
  }
}

.sample-products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  padding: 10px 4px 20px;
}
