/* Catalog page — Lavka-style layout */

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.catalog-layout {
  display: block;
  width: 100%;
  min-height: 100vh;
}

#catalog-main {
  display: block;
  margin-left: calc(var(--sidebar-w) + var(--nav-content-gap));
  margin-right: var(--cart-w);
  padding: 8px 16px 48px 0;
  max-width: none;
  min-width: 0;
  min-height: calc(100vh - var(--header-h));
  box-sizing: border-box;
}

.catalog-page-head {
  margin-bottom: 12px;
}

.catalog-page-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0;
  color: var(--lavka-text);
}

.catalog-subcategories {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.catalog-subcategories::-webkit-scrollbar {
  display: none;
}

.catalog-subcategories[hidden] {
  display: none !important;
}

.catalog-subcategory-chip {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: var(--lavka-radius-pill);
  border: 1px solid var(--lavka-divider);
  background: var(--lavka-surface);
  color: var(--lavka-text);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--lavka-duration) var(--lavka-ease),
    border-color var(--lavka-duration) var(--lavka-ease);
}

.catalog-subcategory-chip:hover {
  border-color: var(--lavka-border);
}

.catalog-subcategory-chip.is-active {
  background: var(--lavka-text);
  border-color: var(--lavka-text);
  color: #fff;
}

/* Catalog nav menu (shared with home) */
.catalog-nav-inner {
  padding: 8px 6px 12px;
}

.catalog-nav-label {
  display: block;
  padding: 4px 14px 14px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1a1c1b;
}

.menu-entry {
  margin-bottom: 2px;
}

.menu-entry-top {
  width: 100%;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
  color: #21201f;
  text-decoration: none;
  transition: background var(--lavka-duration) var(--lavka-ease);
}

.menu-entry-top:hover,
.menu-entry.is-open > .menu-entry-toggle {
  background: #f5f4f2;
}

.menu-entry-top.is-active,
.menu-sublist a.is-active {
  background: var(--lavka-accent-soft);
  color: var(--lavka-accent-dark);
  font-weight: 600;
}

.menu-chevron {
  color: #9e9b98;
  font-size: 22px;
  transition: transform var(--lavka-duration) var(--lavka-ease);
  flex-shrink: 0;
}

.menu-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
}

.menu-icon .material-symbols-outlined {
  font-size: 24px;
  overflow: hidden;
  max-width: 24px;
  text-overflow: clip;
}

.menu-entry-label {
  flex: 1;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 400;
}

.menu-entry.is-open .menu-chevron {
  transform: rotate(180deg);
}

.menu-sublist {
  list-style: none;
  margin: 0;
  padding: 0 10px 6px 66px;
  display: none;
}

.menu-entry.is-open .menu-sublist {
  display: block;
}

.menu-sublist a {
  display: block;
  padding: 7px 10px;
  margin: 0 -10px;
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.35;
  color: #1a1c1b;
  text-decoration: none;
}

.menu-sublist a:hover {
  color: var(--lavka-accent);
}

.catalog-footer-links {
  margin-top: auto;
  padding: 12px 8px 16px;
  border-top: 1px solid #ebe9e4;
}

.catalog-footer-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  color: #706f6c;
  text-decoration: none;
  font-size: 16px;
}

.catalog-footer-links a:hover {
  background: #f5f4f2;
}

/* Filters & product grid */
.catalog-filters-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.catalog-filter-chip {
  padding: 10px 16px;
  background: var(--lavka-surface);
  border: 1px solid var(--lavka-divider);
  border-radius: var(--lavka-radius-pill);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--lavka-duration) var(--lavka-ease);
  white-space: nowrap;
  font-family: inherit;
  color: inherit;
}

.catalog-filter-chip:hover {
  border-color: var(--lavka-border);
  box-shadow: var(--lavka-shadow-card);
}

.catalog-filter-chip.is-active {
  background: var(--lavka-text);
  color: #fff;
  border-color: var(--lavka-text);
}

.catalog-filter-chip.is-saby {
  background: var(--lavka-saby);
  color: #fff;
  border-color: var(--lavka-saby);
}

.products-grid,
.catalog-product-grid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  font-family: 'YS Text', 'Helvetica Neue', Arial, sans-serif;
}

.catalog-product-grid--lavka-cards {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  width: 100%;
  max-width: none;
}

@media (min-width: 1280px) {
  .products-grid,
  .catalog-product-grid,
  .catalog-product-grid--lavka-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13px;
  }
}

/* Internal catalog product cards (Lavka grocery layout) */
.catalog-product-grid--lavka-cards .product-card,
.products-grid .product-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: 26px;
  background: #ffffff;
  overflow: visible;
  padding: 0;
  margin: 0;
  border: 0;
  -webkit-tap-highlight-color: transparent;
}

.catalog-product-grid--lavka-cards .product-image-wrapper,
.products-grid .product-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 26px;
  overflow: hidden;
  background: #f3f3f3;
}

.catalog-product-grid--lavka-cards .product-image,
.products-grid .product-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.catalog-product-grid--lavka-cards .badge-discount,
.products-grid .badge-discount {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 2;
  background: #ff3d00;
  color: #ffffff;
  font-weight: 700;
  font-size: 12px;
  padding: 3px 7px;
  border-radius: 7px;
  line-height: 1;
}

.catalog-product-grid--lavka-cards .btn-add-to-cart,
.products-grid .btn-add-to-cart {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 0.1s ease;
}

.catalog-product-grid--lavka-cards .btn-add-to-cart:hover,
.products-grid .btn-add-to-cart:hover {
  transform: scale(1.05);
}

.catalog-product-grid--lavka-cards .btn-add-to-cart svg,
.products-grid .btn-add-to-cart svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #000000;
  stroke-width: 2.5;
  stroke-linecap: round;
}

.catalog-product-grid--lavka-cards .product-info,
.products-grid .product-info {
  padding: 10px 3px 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.catalog-product-grid--lavka-cards .product-price-block,
.products-grid .product-price-block {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.catalog-product-grid--lavka-cards .price-current,
.products-grid .price-current {
  color: #21201f;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
}

.catalog-product-grid--lavka-cards .price-current--sale,
.products-grid .price-current--sale {
  color: #ff3d00;
}

.catalog-product-grid--lavka-cards .price-old,
.products-grid .price-old {
  color: #9e9b98;
  font-size: 12px;
  position: relative;
  display: inline-block;
}

.catalog-product-grid--lavka-cards .price-old::after,
.products-grid .price-old::after {
  content: '';
  position: absolute;
  left: -2px;
  right: -2px;
  top: 50%;
  height: 1px;
  background: #9e9b98;
  transform: rotate(-12deg);
}

.catalog-product-grid--lavka-cards .product-link,
.products-grid .product-link {
  text-decoration: none;
  color: #000000;
}

.catalog-product-grid--lavka-cards .product-name,
.products-grid .product-name {
  font-size: 14px;
  line-height: 17px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.catalog-product-grid--lavka-cards .product-weight,
.products-grid .product-weight {
  color: #9e9b98;
}

.catalog-product-grid--lavka-cards .product-card.product-card--skeleton .product-image-wrapper,
.catalog-product-grid--lavka-cards .product-card.product-card--skeleton .price-current,
.catalog-product-grid--lavka-cards .product-card.product-card--skeleton .product-name,
.products-grid .product-card.product-card--skeleton .product-image-wrapper,
.products-grid .product-card.product-card--skeleton .price-current,
.products-grid .product-card.product-card--skeleton .product-name {
  background: linear-gradient(90deg, #f0efed 25%, #faf9f7 50%, #f0efed 75%);
  background-size: 200% 100%;
  animation: catalog-skeleton 1.2s ease-in-out infinite;
  border-radius: 12px;
  color: transparent;
}

.catalog-product-grid--lavka-cards .product-card.product-card--skeleton .product-image-wrapper,
.products-grid .product-card.product-card--skeleton .product-image-wrapper {
  border-radius: 26px;
  min-height: 0;
}

.catalog-product-grid--lavka-cards .product-card.product-card--skeleton .price-current,
.products-grid .product-card.product-card--skeleton .price-current {
  display: inline-block;
  width: 60px;
  height: 15px;
}

.catalog-product-grid--lavka-cards .product-card.product-card--skeleton .product-name,
.products-grid .product-card.product-card--skeleton .product-name {
  display: block;
  width: 100%;
  height: 34px;
}

/* Lavka-style portrait cards (recipes section) */
.catalog-recipe-card {
  position: relative;
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  border-radius: 24px;
  height: 328px;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.catalog-recipe-card__link {
  display: block;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.catalog-recipe-card__add {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--lavka-accent);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 179, 65, 0.35);
  z-index: 2;
}

.catalog-recipe-card__add .material-symbols-outlined {
  font-size: 22px;
}

.catalog-recipe-card--skeleton {
  background: linear-gradient(90deg, #f0efed 25%, #faf9f7 50%, #f0efed 75%);
  background-size: 200% 100%;
  animation: catalog-skeleton 1.2s ease-in-out infinite;
}

@keyframes catalog-skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.catalog-empty-state {
  grid-column: 1 / -1;
  padding: 48px 24px;
  text-align: center;
}

.catalog-empty-state__title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--lavka-text);
}

.catalog-empty-state__hint {
  font-size: 15px;
  margin: 0;
  color: var(--lavka-text-secondary);
}

.catalog-recipe-card__visual {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  width: 100%;
  height: 328px;
  border-radius: 24px;
  background-color: var(--lavka-bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-sizing: border-box;
}

.catalog-recipe-card__content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px 16px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.9) 30%,
    #fff 100%
  );
}

.catalog-recipe-card__name {
  font-size: 16px;
  font-weight: 500;
  line-height: 17px;
  letter-spacing: -0.005em;
  color: var(--lavka-text);
}

.catalog-recipe-card__meta {
  font-size: 16px;
  font-weight: 500;
  line-height: 17px;
  letter-spacing: -0.005em;
  color: var(--lavka-text);
}

.catalog-recipe-card:hover .catalog-recipe-card__visual {
  filter: brightness(0.98);
}

.catalog-product-card {
  background: var(--lavka-surface);
  border-radius: var(--lavka-radius-md);
  padding: 12px;
  border: 1px solid var(--lavka-divider);
  display: flex;
  flex-direction: column;
  transition: border-color var(--lavka-duration) var(--lavka-ease);
}

.catalog-product-card:hover {
  border-color: var(--lavka-border);
}

.catalog-product-card .product-media {
  position: relative;
  aspect-ratio: 1;
  margin-bottom: 12px;
  border-radius: var(--lavka-radius-sm);
  overflow: hidden;
  background: var(--lavka-bg);
}

.catalog-product-card .product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.catalog-product-card .product-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--lavka-saby);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--lavka-radius-pill);
  display: flex;
  align-items: center;
  gap: 4px;
}

.catalog-product-card .add-btn {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: var(--lavka-radius-pill);
  background: var(--lavka-accent);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 179, 65, 0.35);
}

.catalog-product-card .product-price {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.catalog-product-card .product-weight {
  font-size: 13px;
  color: var(--lavka-text-tertiary);
  margin-bottom: 8px;
}

.catalog-product-card .product-name {
  font-size: 14px;
  line-height: 1.35;
  margin: 0;
}

@media (max-width: 1023px) {
  #catalog-nav,
  #cart-preview {
    display: none !important;
  }

  #catalog-main {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    padding: 16px;
    padding-bottom: 80px;
  }

  .products-grid,
  .catalog-product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .catalog-product-grid--lavka-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
    max-width: 100%;
  }

  .catalog-product-grid--lavka-cards .btn-add-to-cart,
  .products-grid .btn-add-to-cart {
    width: 36px;
    height: 36px;
  }

  .catalog-product-grid--lavka-cards .btn-add-to-cart svg,
  .products-grid .btn-add-to-cart svg {
    width: 19px;
    height: 19px;
  }

  .catalog-recipe-card,
  .catalog-recipe-card__visual {
    height: auto;
    aspect-ratio: 392 / 588;
    min-height: 220px;
  }

  .catalog-page-title {
    font-size: 26px;
  }
}

.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Cart panel (shared with home) */
#cart-preview {
  width: 320px;
}

.cart-delivery-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 16px;
}

.cart-delivery-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  color: #1a1c1b;
}

.cart-delivery-sub {
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.35;
  color: #8a8a8a;
}

.cart-info-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 0;
  background: #f3f3f3;
  color: #8a8a8a;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.cart-empty-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 28px 24px;
  text-align: center;
}

.cart-empty-illustration {
  width: 220px;
  height: 220px;
  object-fit: contain;
  margin-bottom: 8px;
}

.cart-empty-text {
  font-size: 16px;
  line-height: 1.45;
  color: #1a1c1b;
}

.cart-empty-cta {
  padding: 0 16px 20px;
}

.cart-empty-cta button {
  width: 100%;
  border: 0;
  border-radius: 16px;
  background: #f3f3f3;
  color: #9a9a9a;
  font-size: 16px;
  font-weight: 600;
  padding: 16px 20px;
  cursor: default;
}

.cart-filled-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 12px;
}

.cart-filled-header h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
}

.cart-clear-btn {
  border: 0;
  background: transparent;
  color: #8a8a8a;
  cursor: pointer;
  padding: 4px;
}

.cart-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #faf9f7;
  border-radius: 16px;
  padding: 12px;
}

.cart-item-row img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  background: #fff;
}

.cart-qty {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #ebe9e4;
  border-radius: 999px;
  padding: 0 4px;
}

.cart-qty button {
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  color: var(--lavka-accent);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.cart-footer {
  padding: 16px;
  border-top: 1px solid #ebe9e4;
}

.cart-checkout-btn {
  width: 100%;
  border: 0;
  border-radius: 16px;
  background: var(--lavka-accent);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  padding: 16px;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.flex {
  display: flex;
}

.flex-1 {
  flex: 1;
}

.flex-col {
  flex-direction: column;
}

.min-h-0 {
  min-height: 0;
}

.overflow-y-auto {
  overflow-y: auto;
}

.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}

.space-y-3 > * + * {
  margin-top: 0.75rem;
}

.justify-between {
  justify-content: space-between;
}

.items-center {
  align-items: center;
}

.items-end {
  align-items: flex-end;
}

.mb-3 {
  margin-bottom: 0.75rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mt-1 {
  margin-top: 0.25rem;
}

.w-6 {
  width: 1.5rem;
}

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

.font-bold {
  font-weight: 700;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.min-w-0 {
  min-width: 0;
}

.text-\[14px\] {
  font-size: 14px;
}

.text-\[13px\] {
  font-size: 13px;
}

.text-\[18px\] {
  font-size: 18px;
}

/* Product page — full width, no sidebars (Lavka /good) */
body.has-product-page {
  --header-h: var(--header-toolbar-block-h);
}

body.has-product-page #product-main.product-layout-main {
  display: block;
  margin: 0 auto;
  padding: 8px clamp(1rem, 2vw, 2rem) 48px;
  max-width: 1040px;
  min-height: calc(100vh - var(--header-h) - var(--breadcrumbs-bar-h));
  box-sizing: border-box;
}

body.has-product-page #catalog-nav,
body.has-product-page #cart-preview {
  display: none !important;
}

/* Product detail (Next.js /product/[slug]) */
.product-detail-page {
  padding: 8px 0 48px;
  box-sizing: border-box;
}

.product-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  max-width: 960px;
}

.product-detail-image {
  aspect-ratio: 1;
  border-radius: 24px;
  background-size: cover;
  background-position: center;
  background-color: var(--lavka-bg);
}

.product-detail-title {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  color: var(--lavka-text);
}

.product-detail-price {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--lavka-text);
}

.product-detail-weight,
.product-detail-seller {
  color: var(--lavka-text-secondary);
  margin: 0 0 8px;
  font-size: 16px;
}

.product-detail-desc {
  line-height: 1.5;
  margin: 16px 0 24px;
  font-size: 16px;
  color: var(--lavka-text);
}

.product-detail-add {
  max-width: 280px;
  width: 100%;
}

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

  .product-detail-page {
    padding-right: 16px;
  }
}
