/* =====================================================
   FINCHI – Offer (Kínálat)
   Világos szekció, prémium, mobile-first
   ===================================================== */

.offer {
  position: relative;
  padding: 88px 0;
  background-image: url("../assets/images/offer/offer-bg-mobile.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.offer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.7) 0%,
    rgba(255, 255, 255, 0.62) 45%,
    rgba(255, 255, 255, 0.52) 100%
  );
  pointer-events: none;
}

.offer > .container {
  position: relative;
  z-index: 1;
}

.offer-header {
  margin-bottom: 28px;
}

.section-title {
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: #121212;
}

.offer-lead {
  margin-top: 10px;
  color: #5a5a5a;
  font-size: 15px;
  line-height: 1.55;
  max-width: 56ch;
}

/* -------------------------
   OVERVIEW CARDS
-------------------------- */

.offer-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.offer-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  text-align: left;

  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(18, 18, 18, 0.08);
  border-radius: 18px;

  cursor: pointer;

  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.1), 0 2px 10px rgba(0, 0, 0, 0.06);

  transition: transform 220ms ease, box-shadow 220ms ease,
    border-color 220ms ease, background 220ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .offer-card:hover {
    transform: translateY(-3px);
    background: #ffffff;
    border-color: rgba(217, 176, 116, 0.32);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.14), 0 6px 16px rgba(0, 0, 0, 0.08);
  }
}

.offer-card-media {
  width: 76px;
  height: 76px;
  border-radius: 14px;
  overflow: hidden;
  background: #eee8de;
  flex-shrink: 0;
}

.offer-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.offer-card-title {
  display: block;
  font-size: 18px;
  font-weight: 650;
  color: #121212;
  margin-bottom: 4px;
}

.offer-card-desc {
  display: block;
  font-size: 14px;
  color: #5a5a5a;
  line-height: 1.4;
}

/* tablet */
@media (min-width: 768px) {
  .offer-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }
}

/* desktop */
@media (min-width: 1024px) {
  .offer {
    padding: 88px 0;
  }

  .offer-cards {
    /* 3 cards on the first row, then 2 cards nicely centered on the second row */
    grid-template-columns: repeat(6, 1fr);
    gap: 22px;
  }

  /* all cards stay the SAME size on desktop */
  .offer-card {
    grid-column: span 2;
    flex-direction: column;
    align-items: flex-start;
    padding: 18px;
  }

  /* ✅ center the last 2 cards WITHOUT resizing them */
  .offer-card:nth-child(4) {
    grid-column: 2 / span 2;
  }

  .offer-card:nth-child(5) {
    grid-column: 4 / span 2;
  }

  .offer-card-media {
    width: 100%;
    height: 150px;
  }
}

/* -------------------------
   CATEGORY VIEW
-------------------------- */

.offer-category {
  padding-top: 10px;
}

.offer-category-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}

.offer-back {
  width: fit-content;
  background: none;
  border: none;
  padding: 0;
  color: #6b6b6b;
  cursor: pointer;
  font-size: 14px;
}

.offer-back:hover {
  color: #121212;
}

.offer-category-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #121212;
}

/* -------------------------
   PRODUCT CARDS
-------------------------- */

.offer-products {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.offer-product {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(18, 18, 18, 0.08);
  border-radius: 18px;

  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;

  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.09), 0 2px 10px rgba(0, 0, 0, 0.05);

  transition: transform 220ms ease, box-shadow 220ms ease,
    border-color 220ms ease, background 220ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .offer-product:hover {
    transform: translateY(-2px);
    border-color: rgba(217, 176, 116, 0.22);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.07);
  }
}

.offer-product-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #121212;
}

.offer-product-desc {
  margin: 0;
  font-size: 14px;
  color: #5a5a5a;
  line-height: 1.45;
}

/* qty controls */
.offer-qty {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 999px;
  padding: 6px 10px;
  background: #ffffff;
}

.offer-qty button {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: none;
  background: #121212;
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.offer-qty button:active {
  transform: scale(0.98);
}

.offer-qty span {
  min-width: 20px;
  text-align: center;
  font-weight: 700;
  color: #121212;
}

/* mode pills */
.offer-mode {
  display: inline-flex;
  gap: 10px;
  width: fit-content;
}

.offer-mode button {
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #ffffff;
  color: #121212;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
}

.offer-mode button.active {
  background: #121212;
  color: #ffffff;
  border-color: #121212;
}

/* footer */
.offer-product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}

.offer-product-price {
  font-size: 16px;
  font-weight: 800;
  color: #121212;
}

.offer-product-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  background: #25d366;
  color: #ffffff;
  transition: transform 180ms ease, filter 180ms ease;
}

.offer-product-cta:hover {
  filter: brightness(0.95);
  transform: translateY(-1px);
}

/* tablet/desktop product grids */
@media (min-width: 768px) {
  .offer-products {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }
}

@media (min-width: 1024px) {
  .offer-products {
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
  }
}

.offer-product-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #121212;
  color: #fff;
  cursor: pointer;
  transition: transform 180ms ease, filter 180ms ease;
}

.offer-product-add:hover {
  filter: brightness(0.95);
  transform: translateY(-1px);
}

.offer-product-add:active {
  transform: translateY(0);
}

/* -------------------------
   CART BAR (sticky) + DRAWER
-------------------------- */

.finchi-cartbar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 9999;
  display: none;
}

.finchi-cartbar.is-visible {
  display: block;
}

.finchi-cartbar__btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.finchi-cartbar__left {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.finchi-cartbar__title {
  font-weight: 800;
  color: #121212;
}

.finchi-cartbar__count {
  color: #5a5a5a;
  font-weight: 700;
}

.finchi-cartbar__total {
  margin-left: auto;
  color: #121212;
  font-weight: 800;
  font-size: 14px;
}

.finchi-cartbar__open {
  background: #121212;
  color: #fff;
  font-weight: 800;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
}

/* drawer */
.finchi-cart {
  position: fixed;
  inset: 0;
  z-index: 30000;
}

.finchi-cart__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.finchi-cart__panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border-radius: 18px 18px 0 0;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.2);
}

.finchi-cart__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  position: relative;
  z-index: 2;
}

.finchi-cart__title {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  color: #121212;
}

.finchi-cart__x {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #fff;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.finchi-cart__body {
  padding: 14px 16px;
  overflow: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.finchi-cart__empty {
  padding: 16px;
  border: 1px dashed rgba(0, 0, 0, 0.18);
  border-radius: 14px;
  color: #5a5a5a;
  text-align: center;
}

.finchi-cart__items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.finchi-cartitem {
  display: flex;
  gap: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: #fbfaf8;
  border-radius: 16px;
  padding: 12px;
}

.finchi-cartitem__media {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  overflow: hidden;
  background: #eee8de;
  flex-shrink: 0;
}

.finchi-cartitem__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.finchi-cartitem__main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.finchi-cartitem__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.finchi-cartitem__name {
  font-weight: 900;
  color: #121212;
  font-size: 14px;
  line-height: 1.2;
}

.finchi-cartitem__remove {
  border: none;
  background: transparent;
  color: #6b6b6b;
  cursor: pointer;
  font-weight: 800;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 10px;
}

.finchi-cartitem__remove:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #121212;
}

.finchi-cartitem__desc {
  color: #5a5a5a;
  font-size: 13px;
  line-height: 1.3;
}

.finchi-cartitem__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.finchi-cartitem__qty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
}

.finchi-cartitem__minus,
.finchi-cartitem__plus {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: #121212;
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.finchi-cartitem__qtyVal {
  min-width: 18px;
  text-align: center;
  font-weight: 900;
  color: #121212;
}

.finchi-cartitem__mode {
  display: inline-flex;
  gap: 8px;
}

.finchi-cartitem__pill {
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
  color: #121212;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 800;
}

.finchi-cartitem__pill.active {
  background: #121212;
  color: #fff;
  border-color: #121212;
}

.finchi-cartitem__price {
  font-weight: 900;
  color: #121212;
}

.finchi-cart__noteLabel {
  display: block;
  font-weight: 900;
  color: #121212;
  margin-bottom: 8px;
  font-size: 13px;
}

.finchi-cart__noteInput {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  padding: 12px;
  font: inherit;
  resize: vertical;
}

.finchi-cart__summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.finchi-cart__total {
  font-weight: 900;
  color: #121212;
}

.finchi-cart__tbd {
  color: #6b6b6b;
  font-weight: 800;
  font-size: 12px;
}

.finchi-cart__footer {
  display: flex;
  gap: 10px;
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
}

.finchi-cart__clear {
  flex: 1;
  border-radius: 14px;
  border: none;
  background: var(--c-black);
  color: var(--c-gold);
  font-weight: 900;
  padding: 12px 12px;
  cursor: pointer;
}

.finchi-cart__checkout {
  flex: 1.2;
  border-radius: 14px;
  border: none;
  background: #25d366;
  color: #fff;
  font-weight: 900;
  padding: 12px 12px;
  cursor: pointer;
}

.finchi-cart__checkout:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Toast */
.finchi-toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 84px;
  z-index: 11000;
  background: rgba(18, 18, 18, 0.94);
  color: #fff;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
  opacity: 0;
  transition: opacity 200ms ease, transform 200ms ease;
}

.finchi-toast.is-in {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* Desktop: drawer is a side panel */
@media (min-width: 900px) {
  .finchi-cart__panel {
    left: auto;
    top: 0;
    bottom: 0;
    right: 0;
    width: 420px;
    max-height: 100vh;
    border-radius: 18px 0 0 18px;
  }
  .finchi-cartbar {
    left: auto;
    right: 18px;
    bottom: 18px;
    width: 420px;
  }
}

@media (min-width: 768px) {
  .offer {
    background-image: url("../assets/images/offer/offer-bg-tablet.webp");
  }
}

@media (min-width: 1024px) {
  .offer {
    background-image: url("../assets/images/offer/offer-bg-desktop.webp");
  }
}

/* === CART CLOSE (X) FIX – DESKTOP & ANDROID === */
.finchi-cart__x {
  position: relative;
  z-index: 5;
  background: transparent;
  border: none;

  font-size: 22px;
  line-height: 1;
  font-weight: 600;

  color: #000; /* FEKETE, ne inherit */
  cursor: pointer;

  padding: 6px 8px;
}

/* hover / tap feedback */
@media (hover: hover) {
  .finchi-cart__x:hover {
    opacity: 0.6;
  }
}

/* =========================
   VISUAL TUNING (offer cards)
   ========================= */
.offer-card {
  border-radius: var(--finchi-radius-lg);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: var(--finchi-shadow-1);
}
.offer-card:hover {
  transform: translateY(-3px);
  border-color: rgba(214, 181, 106, 0.28);
  box-shadow: var(--finchi-shadow-2);
}
.offer-card-media {
  border-radius: calc(var(--finchi-radius-lg) - 8px);
  overflow: hidden;
}
.offer-card-title {
  letter-spacing: -0.015em;
}

/* =====================================================
   Stock sync (sold out state)
   - Used by js/stock-sync.js
===================================================== */
.offer-product.is-soldout {
  opacity: 0.92;
}

.offer-product.is-soldout .offer-product-media img,
.offer-product-media.is-soldout img {
  filter: grayscale(1) contrast(1.05);
  opacity: 0.72;
}

.offer-product.is-soldout .offer-product-add,
.offer-product-add.is-soldout {
  background: #9a9a9a;
  border-color: #9a9a9a;
  cursor: not-allowed;
}

.offer-product .finchi-soldout-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 5;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: #ffffff;
  background: rgba(18, 18, 18, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.offer-product-media {
  position: relative;
}

/* Mobile: Kínálat cím középre */
@media (max-width: 767px) {
  .offer .section-title {
    text-align: center;
  }
}

.finchi-cart__footerMessenger {
  padding: 0 16px 16px;
  background: #fff;
}

.finchi-cart__checkoutMessenger {
  display: block;
  margin: 10px auto 0;
  width: min(260px, 100%);
  border-radius: 14px;
  border: none;
  background: #0084ff;
  color: #fff;
  font-weight: 900;
  padding: 12px 12px;
  cursor: pointer;
}

.finchi-cart__checkoutMessenger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
