/* ============================================================
   AgniFood Shop — Additional styles
   Extends main style.css design system
   ============================================================ */

/* ── Shop split hero ── */
.shop-hero {
  position: relative;
  min-height: clamp(500px, 66vh, 780px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  margin-top: var(--nav-h);
  background: var(--bg);
}
.shop-hero__media {
  position: absolute;
  inset: 0;
}
.shop-hero__image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
}
.shop-hero__image--pastries {
  background-image: url('/assets/Parduotuve/hero-pyragaiciai.jpg');
  background-position: center 58%;
}
.shop-hero__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(10,8,6,0.42), rgba(10,8,6,0.48) 45%, rgba(10,8,6,0.9)),
    linear-gradient(to right, rgba(10,8,6,0.3), rgba(10,8,6,0.08) 58%, rgba(10,8,6,0.38));
}
.shop-hero__content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: calc(var(--max) + var(--gut) * 2);
  margin: 0 auto;
  padding: 0 var(--gut) clamp(56px, 8vw, 96px);
}
.shop-hero .t-label { margin-bottom: 10px; }

/* ── Compact shop intro ── */
.shop-intro {
  padding: clamp(54px, 7vw, 86px) var(--gut) clamp(28px, 4vw, 52px);
}
.shop-intro .intro {
  padding: 0;
  max-width: 780px;
}
.shop-intro .intro__quote {
  margin: 20px 0 18px;
  font-size: clamp(1.12rem, 2vw, 1.62rem);
  line-height: 1.55;
}
.shop-intro .intro__body {
  max-width: 680px;
  margin: 0 auto;
  font-size: 0.9rem;
  line-height: 1.78;
}

/* ── Category sections ── */
.shop-filter {
  position: sticky;
  top: calc(var(--nav-h) + 10px);
  z-index: 15;
  display: flex;
  justify-content: center;
  gap: 6px;
  width: max-content;
  max-width: 100%;
  margin: 0 auto clamp(38px, 5vw, 58px);
  padding: 6px;
  background: rgba(24, 20, 16, 0.88);
  border: 1px solid var(--gold-border);
  backdrop-filter: blur(14px);
}

.shop-filter__btn {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--cream-dim);
  cursor: pointer;
  font-family: var(--ff-sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: background 0.22s, border-color 0.22s, color 0.22s;
}

.shop-filter__btn:hover,
.shop-filter__btn.is-active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--bg);
}

.shop-category { margin-bottom: clamp(48px, 7vw, 80px); }

.shop-category[hidden] { display: none; }

.shop-category__header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gold-border);
}

.shop-advance-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--gold);
  letter-spacing: 0.06em;
}
.shop-advance-note svg { flex-shrink: 0; stroke: var(--gold); }

/* ── Product grid ── */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2px;
  background: var(--gold-border);
  outline: 1px solid var(--gold-border);
}

.shop-card {
  background: var(--surface);
  overflow: hidden;
  transition: background 0.28s;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}
.shop-card:hover,
.shop-card:focus-visible {
  background: var(--surface-2);
  outline: 1px solid var(--gold-border-h);
  outline-offset: -1px;
}
.shop-card--soldout .shop-card__img img {
  filter: grayscale(0.25);
  opacity: 0.58;
}
.shop-card--soldout .shop-card__price {
  color: var(--muted);
}

.shop-card__img {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--surface-2);
}
.shop-card__img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.65s var(--ease-out);
}
.shop-card:hover .shop-card__img img { transform: scale(1.06); }
.shop-card__placeholder,
.product-modal__placeholder {
  width: 100%;
  height: 100%;
  min-height: 180px;
  display: grid;
  place-items: center;
  padding: 28px;
  color: var(--gold);
  background:
    linear-gradient(135deg, rgba(196,150,58,0.08), rgba(240,234,224,0.025)),
    var(--surface-2);
  border: 1px solid rgba(196,150,58,0.16);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1.5;
  text-align: center;
  text-transform: uppercase;
}

.shop-card__soldout {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  background: rgba(10,8,6,0.78);
  border: 1px solid rgba(196,150,58,0.45);
  color: var(--gold);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.shop-card__body {
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.shop-card__name {
  font-family: var(--ff-serif);
  font-size: 1.05rem;
  color: var(--cream);
  margin-bottom: 8px;
  line-height: 1.35;
}
.shop-card__desc {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 18px;
  flex: 1;
}
.shop-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}
.shop-card__price {
  font-family: var(--ff-serif);
  font-size: 1.2rem;
  color: var(--gold);
}

/* ── Product select button ── */
.btn-open-product {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--ff-sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 10px 18px;
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold-border-h);
  cursor: pointer;
  user-select: none;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}
.btn-open-product:hover {
  background: var(--gold);
  color: var(--bg);
  border-color: var(--gold);
}
.btn-open-product svg { flex-shrink: 0; transition: transform 0.25s; }
.btn-open-product:hover svg { transform: scale(1.1); }

/* ── Product modal ── */
.product-modal {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: grid;
  place-items: center;
  padding: clamp(10px, 1.4vw, 24px);
  pointer-events: none;
}

.product-modal__overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 35%, rgba(196,150,58,0.08), transparent 42%),
    rgba(10, 8, 6, 0.78);
  opacity: 0;
  transition: opacity 0.28s var(--ease-out);
}

.product-modal__panel {
  position: relative;
  z-index: 1;
  width: min(1480px, calc(100vw - 32px));
  height: min(1020px, calc(100dvh - 32px));
  max-height: calc(100dvh - 32px);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--gold-border);
  box-shadow: 0 28px 90px rgba(0,0,0,0.55);
  opacity: 0;
  transform: translateY(18px) scale(0.975);
  transition:
    opacity 0.28s var(--ease-out),
    transform 0.34s var(--ease-out);
}

.product-modal.is-open {
  pointer-events: auto;
}
.product-modal.is-open .product-modal__overlay {
  opacity: 1;
}
.product-modal.is-open .product-modal__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.product-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(240,234,224,0.16);
  background: rgba(10,8,6,0.54);
  color: var(--cream);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.product-modal__close:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--bg);
}

.product-modal__grid {
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(320px, 0.9fr);
  height: 100%;
  min-height: 0;
}

.product-modal__media {
  display: grid;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: 4px;
  background: var(--surface-2);
  min-height: 0;
}
.product-modal__visual {
  min-height: 0;
  overflow: hidden;
}
.product-modal__visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  background: #050403;
}
.product-modal__visual--prepared {
  border-top: 1px solid var(--gold-border);
  background: #050403;
}
.product-modal__visual--prepared img {
  object-fit: contain;
  object-position: center;
}

.product-modal__content {
  overflow-y: auto;
  min-width: 0;
  padding: clamp(44px, 4.8vw, 76px);
  scrollbar-width: thin;
  scrollbar-color: var(--faint) transparent;
}

.product-modal__eyebrow {
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.product-modal__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.product-modal__tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--gold-border);
  color: var(--gold-light);
  background: rgba(196,150,58,0.055);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.product-modal__title {
  color: var(--cream);
  font-family: var(--ff-serif);
  max-width: 22ch;
  overflow-wrap: break-word;
  hyphens: auto;
  font-size: clamp(2rem, 2.6vw, 3.45rem);
  font-weight: 400;
  line-height: 1.12;
  margin-bottom: 16px;
}
.product-modal__price {
  color: var(--gold);
  font-family: var(--ff-serif);
  font-size: 1.55rem;
  margin-bottom: 20px;
}
.product-modal__desc {
  color: var(--cream-dim);
  font-size: 1rem;
  line-height: 1.72;
  overflow-wrap: break-word;
  margin-bottom: 28px;
}
.product-modal__status {
  margin: -8px 0 24px;
  padding: 13px 15px;
  border: 1px solid rgba(196,150,58,0.32);
  background: rgba(196,150,58,0.065);
  color: var(--gold);
  font-size: 0.86rem;
  line-height: 1.55;
}

.product-modal__qty {
  display: inline-flex;
  align-items: center;
  margin-bottom: 18px;
  border: 1px solid var(--gold-border);
}
.product-modal__qty button,
.product-modal__qty span {
  width: 48px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--cream);
}
.product-modal__qty button {
  border: 0;
  background: transparent;
  color: var(--cream-dim);
  cursor: pointer;
  font-size: 1.1rem;
  transition: background 0.2s, color 0.2s;
}
.product-modal__qty button:hover {
  background: var(--gold);
  color: var(--bg);
}
.product-modal__qty span {
  border-left: 1px solid var(--gold-border);
  border-right: 1px solid var(--gold-border);
}

.product-modal__add {
  width: 100%;
  justify-content: center;
  margin-bottom: 30px;
}
.product-modal__add.adding {
  pointer-events: none;
  opacity: 0.78;
}
.product-modal__add.is-disabled,
.product-modal__add:disabled {
  cursor: not-allowed;
  background: transparent;
  border-color: var(--faint);
  color: var(--muted);
}

.product-modal__info {
  display: grid;
  gap: 20px;
  padding-top: 26px;
  border-top: 1px solid var(--gold-border);
}
.product-modal__info h3 {
  color: var(--gold);
  font-family: var(--ff-sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.product-modal__info p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.72;
  max-width: 66ch;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* ── Cart FAB (floating action button) ── */
.cart-fab {
  position: fixed;
  bottom: 32px;
  right: 28px;
  z-index: 90;
  width: 56px;
  height: 56px;
  background: var(--gold);
  color: var(--bg);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(196,150,58,0.35);
  transition: background 0.25s, transform 0.2s;
}
.cart-fab:hover { background: var(--gold-light); transform: scale(1.06); }
.cart-fab__count {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  background: var(--cream);
  color: var(--bg);
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.cart-fab__count[data-count="0"] { display: none; }

/* ── Cart drawer overlay ── */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,8,6,0.7);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s;
}
.cart-overlay.is-open { opacity: 1; pointer-events: all; }

/* ── Cart drawer ── */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100vw);
  background: var(--surface);
  border-left: 1px solid var(--gold-border);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s var(--ease-out);
}
.cart-drawer.is-open { transform: translateX(0); }

.cart-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 20px;
  border-bottom: 1px solid var(--gold-border);
  flex-shrink: 0;
}
.cart-drawer__title {
  font-family: var(--ff-serif);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--cream);
}
.cart-drawer__close {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  border: 1px solid var(--faint);
  border-radius: 2px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  background: none;
}
.cart-drawer__close:hover { color: var(--cream); border-color: var(--muted); }

.cart-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--faint) transparent;
}

/* ── Empty state ── */
.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  height: 100%;
  min-height: 220px;
  color: var(--muted);
  text-align: center;
}
.cart-empty p { font-size: 0.9rem; }

/* ── Cart item row ── */
.cart-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--faint);
}
.cart-item__img {
  width: 64px; height: 64px;
  object-fit: cover;
  background: var(--surface-2);
}
.cart-item__name {
  font-family: var(--ff-serif);
  font-size: 0.9rem;
  color: var(--cream);
  margin-bottom: 4px;
  line-height: 1.3;
}
.cart-item__price { font-size: 0.82rem; color: var(--gold); }
.cart-item__qty {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 8px;
}
.cart-item__qty button {
  width: 28px; height: 28px;
  border: 1px solid var(--faint);
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.2s, border-color 0.2s;
}
.cart-item__qty button:hover { color: var(--cream); border-color: var(--muted); }
.cart-item__qty span {
  width: 32px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--cream);
  border-top: 1px solid var(--faint);
  border-bottom: 1px solid var(--faint);
  height: 28px;
  line-height: 26px;
}
.cart-item__remove {
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
  display: flex; align-items: center;
}
.cart-item__remove:hover { color: #c0392b; }

/* ── Cart footer ── */
.cart-drawer__footer {
  padding: 20px 24px;
  border-top: 1px solid var(--gold-border);
  flex-shrink: 0;
  background: var(--surface-2);
}
.cart-drawer__total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.cart-drawer__total strong {
  font-family: var(--ff-serif);
  font-size: 1.3rem;
  color: var(--cream);
  font-weight: 400;
}
.cart-drawer__clear {
  width: 100%;
  margin-bottom: 12px;
  padding: 0 0 2px;
  border: 0;
  border-bottom: 1px solid rgba(240,234,224,0.18);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--ff-sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: color 0.2s, border-color 0.2s;
}
.cart-drawer__clear:hover {
  color: var(--gold);
  border-color: var(--gold-border-h);
}
.cart-drawer__clear:disabled {
  opacity: 0.55;
  cursor: wait;
}
.cart-drawer__checkout {
  width: 100%;
  justify-content: center;
}

/* ── Add to cart feedback ── */
@keyframes aCartPop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}
.cart-fab.pop { animation: aCartPop 0.3s var(--ease-out); }

/* ── Responsive ── */
@media (max-width: 600px) {
  .shop-hero {
    min-height: 520px;
    align-items: flex-end;
  }
  .shop-hero__content {
    padding-bottom: 52px;
  }
  .shop-intro {
    padding-top: 48px;
  }
  .shop-filter {
    width: calc(100vw - 32px);
    justify-content: flex-start;
    overflow-x: auto;
    margin-bottom: 34px;
    scrollbar-width: none;
  }
  .shop-filter::-webkit-scrollbar { display: none; }
  .shop-filter__btn {
    flex: 0 0 auto;
    padding: 0 16px;
  }
  .shop-grid { grid-template-columns: 1fr; }
  .cart-drawer { width: 100vw; }
  .cart-fab { bottom: 20px; right: 16px; }
  .product-modal {
    align-items: end;
    padding: 0;
  }
  .product-modal__panel {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    transform: translateY(100%);
    overflow-y: auto;
  }
  .product-modal.is-open .product-modal__panel {
    transform: translateY(0);
  }
  .product-modal__grid {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .product-modal__media {
    min-height: 0;
    grid-template-rows: minmax(220px, 34vh) minmax(220px, 34vh);
    aspect-ratio: auto;
  }
  .product-modal__content {
    padding: 26px 20px 30px;
    max-height: none;
  }
  .product-modal__title {
    max-width: 22ch;
    font-size: clamp(1.65rem, 8vw, 2.25rem);
  }
  .product-modal__close {
    top: 12px;
    right: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-modal__overlay,
  .product-modal__panel {
    transition: none;
  }
}
