/* صفحة الأصناف — تكميلي بعد ../style.css (هيدر مطابق للرئيسية) */

:root {
  --red: #991b1b;
  --red-bright: #c41e22;
  --yellow: #ffcc00;
  --cream-pill: #fff8f0;
  --beige-card: #f3eadc;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --font: "Cairo", system-ui, sans-serif;
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --radius: 1.1rem;
  --shadow-card: 0 8px 28px rgba(26, 26, 26, 0.1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--color-cream, #f9f4f0);
  line-height: 1.55;
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

.container {
  width: min(1120px, 100% - 1.5rem);
  margin-inline: auto;
}

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

.cat-main {
  padding: 1.4rem 0 3rem;
}

.cat-title {
  margin: 0 0 1.1rem;
  font-size: clamp(1.3rem, 2.2vw, 1.8rem);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.cat-categories-view,
.cat-products-view {
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(255, 204, 0, 0.14) 0%, transparent 45%),
    radial-gradient(130% 120% at 0% 100%, rgba(196, 30, 34, 0.14) 0%, transparent 52%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.97) 0%, rgba(248, 242, 235, 0.95) 100%);
  border-radius: 1.55rem;
  border: 1px solid rgba(196, 30, 34, 0.16);
  box-shadow:
    0 14px 34px rgba(26, 26, 26, 0.08),
    0 34px 58px rgba(26, 26, 26, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  padding: 1.25rem;
}

.cat-categories-view::before,
.cat-products-view::before {
  content: "";
  display: block;
  width: 86px;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--yellow), var(--red-bright));
  margin-bottom: 0.9rem;
}

.cat-categories-view .menu-category-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 900px) {
  .cat-categories-view .menu-category-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.1rem;
  }
}

.cat-categories-view .menu-category-tile {
  min-height: 150px;
  height: auto;
  aspect-ratio: auto;
  border-radius: 1.2rem;
  border: 1px solid rgba(26, 26, 26, 0.08);
  box-shadow: 0 12px 30px rgba(26, 26, 26, 0.12);
  transition: none;
}

.cat-categories-view .menu-category-tile::after {
  content: none;
}

.cat-categories-view .menu-category-tile__overlay {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.42) 0%, rgba(0, 0, 0, 0.62) 100%);
}

.cat-categories-view .menu-category-tile__title {
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  font-weight: 900;
  letter-spacing: normal;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.cat-categories-view .menu-category-tile__image {
  position: static;
  width: 100%;
  height: 100%;
  min-height: 150px;
  object-fit: cover;
  transition: transform 0.35s var(--ease-smooth);
}

.cat-categories-view .menu-category-tile:hover,
.cat-categories-view .menu-category-tile:focus-visible {
  box-shadow: 0 12px 30px rgba(26, 26, 26, 0.12);
}

.cat-categories-view .menu-category-tile:hover .menu-category-tile__image,
.cat-categories-view .menu-category-tile:focus-visible .menu-category-tile__image {
  transform: scale(1.05);
}

@media (min-width: 900px) {
  .cat-categories-view .menu-category-tile {
    min-height: 185px;
  }

  .cat-categories-view .menu-category-tile__image {
    min-height: 185px;
  }
}

/* انيميشن دخول خفيف للكروت عند فتح الصفحة */
@keyframes catCardIntro {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.cat-categories-view .menu-category-tile,
.cat-products-view .product-card {
  opacity: 0;
  animation: catCardIntro 420ms cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.cat-categories-view .menu-category-tile:nth-child(1),
.cat-products-view .product-card:nth-child(1) { animation-delay: 40ms; }
.cat-categories-view .menu-category-tile:nth-child(2),
.cat-products-view .product-card:nth-child(2) { animation-delay: 90ms; }
.cat-categories-view .menu-category-tile:nth-child(3),
.cat-products-view .product-card:nth-child(3) { animation-delay: 140ms; }
.cat-categories-view .menu-category-tile:nth-child(4),
.cat-products-view .product-card:nth-child(4) { animation-delay: 190ms; }
.cat-categories-view .menu-category-tile:nth-child(5),
.cat-products-view .product-card:nth-child(5) { animation-delay: 240ms; }
.cat-categories-view .menu-category-tile:nth-child(6),
.cat-products-view .product-card:nth-child(6) { animation-delay: 290ms; }
.cat-categories-view .menu-category-tile:nth-child(n + 7),
.cat-products-view .product-card:nth-child(n + 7) { animation-delay: 320ms; }

@media (prefers-reduced-motion: reduce) {
  .cat-categories-view .menu-category-tile,
  .cat-products-view .product-card {
    opacity: 1;
    animation: none;
  }
}

.cat-products-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.cat-products-head .cat-title {
  margin: 0;
}

.cat-back-btn {
  padding: 0.5rem 1.05rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.85rem;
  color: #fff;
  background: var(--red-bright);
  box-shadow: 0 8px 20px rgba(196, 30, 34, 0.25);
}

.cat-back-btn:hover {
  filter: brightness(1.06);
}

.cat-main .product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.95rem;
}

@media (max-width: 767px) {
  .cat-main .product-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .cat-main a.product-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-height: 96px;
    border-radius: 0.9rem;
    overflow: visible;
    padding: 0.45rem;
    gap: 0.55rem;
  }

  .cat-main .product-card__visual {
    flex: 0 0 84px;
    width: 84px;
    aspect-ratio: 1 / 1;
    border-radius: 0.75rem;
    overflow: hidden;
  }

  .cat-main .product-card__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .cat-main .product-card__badge {
    display: none;
  }

  .cat-main .product-card__content {
    flex: 1;
    min-width: 0;
    padding: 0.2rem 0.15rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.25rem;
  }

  .cat-main .product-card__title {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.35;
  }

  .cat-main .product-card__footer {
    margin: 0;
    padding: 0;
    border-top: 0;
    flex-shrink: 0;
    align-self: flex-start;
  }

  .cat-main .product-card__price {
    font-size: 0.92rem;
    white-space: nowrap;
  }
}

@media (min-width: 768px) {
  .cat-main .product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.1rem;
  }
}

/* كروت المنتجات: الأنماط الأساسية في ../style.css */
.cat-main a.product-card:focus-visible {
  outline-color: var(--red-bright);
}

.empty-state {
  text-align: center;
  color: var(--muted);
  font-weight: 600;
  padding: 2rem 1rem;
  margin: 0;
}
