/**
 * The product page (single-product, #102): spacing, type size and the
 * wine-colour dots.
 *
 * The base rules are innowine's, in the Etch global stylesheet ("Mega menu"
 * sheet). Everything here is scoped under `.single-product` (the WooCommerce
 * body class, also on the section) so it is two classes deep and wins over those
 * one-class rules whichever sheet prints first. That also means the sheet's
 * own mobile overrides lose to the desktop rules here, so the media queries
 * below repeat them.
 */

/* ------------------------------------------------------------ top row */

/*
 * One page width for every block, so the photo, "A borról", the winery band's
 * content and the recommended row share both edges. Was 1300px.
 */
.single-product {
  --innowine-oldal: 1140px;
}

/*
 * The text column stops at 550px and the photo takes the rest of the row. Both
 * bases add up to the page width, so on a narrower screen they give way in
 * proportion. WooCommerce's gallery block caps the picture at 512px, which
 * would leave a gap beside it, so the cap goes on desktop.
 */
.single-product .single-product__inner {
  gap: var(--space-m, 3rem);
  max-inline-size: var(--innowine-oldal);
}

.single-product .single-product__media {
  flex: 1 1 560px;
  inline-size: auto;
  min-inline-size: 0;
  max-inline-size: none;
  align-items: stretch;
}

.single-product .single-img .wp-block-woocommerce-product-image-gallery {
  max-inline-size: none;
}

.single-product .single-product__info {
  flex: 0 1 550px;
  inline-size: auto;
  min-inline-size: 0;
  max-inline-size: 550px;
}

@media (width <= 991px) {
  .single-product .single-product__inner {
    gap: var(--space-s, 2rem);
  }

  .single-product .single-product__media {
    flex: none;
    inline-size: 100%;
    align-items: center;
  }

  /* Stacked, the photo is back to WooCommerce's size, centred. */
  .single-product .single-img .wp-block-woocommerce-product-image-gallery {
    max-inline-size: 512px;
    margin-inline: auto;
  }

  .single-product .single-product__info {
    flex: none;
    inline-size: 100%;
    max-inline-size: none;
  }
}

/*
 * WooCommerce puts `single-product` on the body too, so the global
 * `.single-product { padding-block }` meant for the section also padded the
 * page: a white band above the header and under the footer.
 */
body.single-product {
  padding-block: 0;
}

/* Same corners as the winery banner below. */
.single-product .single-img .woocommerce-product-gallery__image {
  border-radius: 4px;
}

/* ------------------------------------------------------- title area */

/*
 * Winery · region in red, a light large title, the key facts as chips, then
 * the short description and a rule under it. The column spaces its children
 * var(--space-m) apart; these sit closer.
 */
.single-product .termek-felirat {
  color: #b4161b;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
}

.single-product .single-product__info > .product_title {
  font-size: 44px;
  font-weight: 400;
  line-height: 1.15;
}

.single-product .single-product__info > .termek-felirat + .product_title {
  margin-block-start: 10px;
}

.single-product .single-product__info > .termek-cimkek {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.single-product .termek-cimke {
  margin: 0;
  padding: 6px 12px;
  border: 1px solid #e3e3e3;
  border-radius: 2px;
  color: #2d2d2d;
  font-size: 13px;
  line-height: 1.4;
}

.single-product .single-product__info > :is(.product_title, .termek-cimkek) + .single-desc-group {
  margin-block-start: 18px;
}

.single-product .single-desc-group {
  gap: 6px;
  padding-block-end: var(--space-s, 2rem);
  border-block-end: 1px solid #e6e6e6;
}

/* The short description, a step up from the 15px body. */
.single-product .short-desc {
  color: #3a3a3a;
  font-size: 17px;
  line-height: 1.7;
}

/*
 * "Teljes leírás" runs on straight after the text rather than on a line of
 * its own: the group, the text and its paragraph all go inline.
 */
.single-product .single-desc-group {
  display: block;
}

.single-product .short-desc,
.single-product .short-desc p {
  display: inline;
  margin: 0;
  font-size: inherit;
  line-height: inherit;
}

.single-product .single-leiras-link {
  display: inline;
  margin-inline-start: 6px;
  color: var(--black, #000);
  font-size: 15px;
  line-height: 1.7;
  white-space: nowrap;
  text-underline-offset: 0.2em;
}

/* Each half of the red line goes to its archive. */
.single-product .termek-felirat__link {
  color: inherit;
  font-weight: inherit;
  text-decoration: none;
}

.single-product .termek-felirat__link:is(:hover, :focus-visible) {
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

/* ------------------------------------------------------- buy area */

.single-product .single-vasarlas {
  gap: 0;
  inline-size: 100%;
}

/* "Klubtag vagy? Jelentkezz be a klubárért · Még nem? Regisztrálj ingyen" */
/* Under the cart row (and its backorder notice) rather than above the stock
   line; the column is a flex column, so `order` moves it without touching
   the template. */
.single-product .single-vasarlas > .klub-sor {
  order: 1;
  margin: 14px 0 0;
}

.single-product .klub-sor {
  margin: 0 0 16px;
  color: #6b6b6b;
  font-size: 15px;
  line-height: 1.5;
}

.single-product .klub-sor a {
  color: var(--black, #000);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.single-product .klub-sor a:hover {
  text-decoration-thickness: 2px;
}

/* Stock and delivery on one row, each after a coloured dot. */
.single-product .vasarlas-jelzesek {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  margin-block-end: 16px;
}

.single-product .vasarlas-jelzesek:not(:has(.vasarlas-jelzes:not(:empty))) {
  display: none;
}

.single-product .vasarlas-jelzes {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #2d2d2d;
  font-size: 15px;
  line-height: 1.4;
}

.single-product .vasarlas-jelzes:empty {
  display: none;
}

.single-product .vasarlas-jelzes::before {
  content: "";
  flex: none;
  inline-size: 8px;
  block-size: 8px;
  border-radius: 50%;
  background-color: currentcolor;
}

/* Amber for the last bottle, green when there is more. */
.single-product .vasarlas-jelzes--keszlet::before {
  background-color: #2e8b4a;
}

.single-product .vasarlas-jelzes--keszlet[data-allapot="utolso"]::before {
  background-color: #d49a1f;
}

/* Sold out: orange, both the dot and the words. */
.single-product .vasarlas-jelzes--keszlet[data-allapot="elfogyott"] {
  color: #d53c00;
}

.single-product .vasarlas-jelzes--keszlet[data-allapot="elfogyott"]::before {
  background-color: #d53c00;
}

/* Sold out: how to ask for it anyway, under the stock line. */
.single-product .elfogyott-info {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-block: -4px 18px;
  padding: 14px 18px;
  border: 1px solid #bcdcc6;
  border-radius: 6px;
  background-color: #dcefe3;
  color: #2b5e3b;
  font-size: 15px;
  line-height: 1.65;
}

.single-product .elfogyott-info__ikon {
  flex: none;
  inline-size: 24px;
  block-size: 24px;
  color: #2b5e3b;
}

.single-product .elfogyott-info__szoveg {
  margin: 0;
  font-size: inherit;
  line-height: inherit;
}

.single-product .elfogyott-info__szoveg a {
  display: inline;
  color: #1f6b3a;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.single-product .elfogyott-info__szoveg a:hover {
  color: #14502a;
}

.single-product .vasarlas-jelzes--szallitas::before {
  background-color: #2e8b4a;
}

/* Backordered: out of stock but orderable, so a quiet grey dot. */
.single-product .vasarlas-jelzes--keszlet[data-allapot="rendelheto"]::before {
  background-color: #9a9a9a;
}

/* The backorder notice, a size up from the Etch global 12px. */
.single-product .backorder-info {
  font-size: 14px;
}

/* Moved above the cart row (innowine-single-product.php); full column width,
   as the cart row under it. */
.single-product .backorder-felul,
.single-product .backorder-felul .backorder-top-wrapper {
  align-self: stretch;
  inline-size: 100%;
}

.single-product .backorder-felul .backorder-info {
  margin-block: 0 16px;
}

/* The Etch global sheet keeps 25px (+5px) free here for the quantity alerts,
   which made a 46px gap between the stock line and the cart row on every
   product. The space is taken only while an alert is actually showing. */
.single-product .backorder-felul .backorder-top-wrapper {
  min-block-size: 0;
  margin-block-start: 0;
}

.single-product .backorder-felul .stock-alert.is-latszik {
  margin-block: 0 12px;
}

/* Sold out: the cart button's place and look, leading to the shop. */
.single-product .single-vasarlas .elfogyott-gomb {
  display: flex;
  align-items: center;
  justify-content: center;
  inline-size: 100%;
  block-size: 46px;
  padding: 0 24px;
  background-color: #111;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 0.15s ease;
}

.single-product .single-vasarlas .elfogyott-gomb:hover {
  background-color: #333;
  color: #fff;
}

.single-product .single-vasarlas .elfogyott-gomb:focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
}

/* The 30-day lowest price, at the unit price line's size, right above it. */
.single-product .single-arlista .innowine-qv__lowest {
  margin-block: 12px 2px;
  font-size: calc(var(--text-m) - 1px);
}

/* The deposit reads at the unit price's size (81pstq9), its amount in black,
   as in the quick view. */
.single-product .szint-tabla__egysegar .egyseg-visszavalt,
.single-product .szint-tabla__egysegar .szint-tabla__elvalaszto {
  font-size: calc(var(--text-m) - 1px);
}

.single-product .egyseg-visszavalt .visszavalt-dij {
  color: #111;
}

/* Quantity stepper and a tall button that takes the rest of the row. */
.single-product .single-vasarlas .p-lightbox_addcart-wrapper {
  align-items: stretch;
  inline-size: 100%;
}

.single-product .single-vasarlas .button-wrapper {
  align-items: stretch;
  gap: 12px;
  inline-size: 100%;
}

.single-product .single-vasarlas .quantity {
  display: flex;
  flex: none;
  align-items: stretch;
  block-size: 46px;
  border: 1px solid #111;
}

.single-product .single-vasarlas .qty-lepes {
  inline-size: 38px;
  padding: 0;
  border: 0;
  background: none;
  color: #111;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.single-product .single-vasarlas .qty-lepes:hover {
  background-color: #f3f3f3;
}

.single-product .single-vasarlas .qty-lepes:focus-visible {
  outline: 2px solid #111;
  outline-offset: -2px;
}

.single-product .single-vasarlas .quantity .qty {
  inline-size: 40px;
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: #111;
  font-size: 16px;
  text-align: center;
  -moz-appearance: textfield;
}

.single-product .single-vasarlas .quantity .qty::-webkit-outer-spin-button,
.single-product .single-vasarlas .quantity .qty::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

/* Takes whatever the 550px column leaves next to the stepper. */
.single-product .single-vasarlas .product-add_to_cart {
  flex: 1 1 auto;
  inline-size: auto;
  block-size: 46px;
  padding: 0 24px;
  gap: 8px;
  border-radius: 0;
  background-color: #111;
}

/*
 * Sikeres kosárba tétel után zöld, mint a kártyákon és a gyorsnézetben. Az
 * Etch `.product-add_to_cart.is-kesz` szabálya gyengébb a fenti #111-nél,
 * ezért itt ugyanezzel a szelektorral kell megismételni.
 */
.single-product .single-vasarlas .product-add_to_cart.is-kesz {
  background-color: #1e7a3c;
  transform: none;
  box-shadow: none;
}

.single-product .single-vasarlas .product-add_to_cart_text,
.single-product .single-vasarlas .product-add_to_cart_kesz {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.single-product .single-vasarlas .product-add_to_cart_icon {
  margin: 0;
}

.single-product .single-vasarlas .product-add_to_cart_icon > svg {
  inline-size: 18px;
  block-size: 18px;
}

@media (width <= 767px) {
  .single-product .single-product__info > .product_title {
    font-size: 32px;
  }
}

/* --------------------------------------------------- wine-colour dots */

/*
 * The product card's dots: the colour follows the wine, a spirit gets none,
 * and the name shows as a tooltip on hover or focus. The global `.ball-*` rules
 * paint every wine the same two reds.
 */
.single-product .product-bor_icon_wrapper {
  --_dot-back: #9e191a;
  --_dot-front: #c71415;
  cursor: help;
}

.single-product .product-bor_icon_wrapper[data-szin=""] {
  display: none;
}

.single-product .product-bor_icon_wrapper[data-szin="feher"] { --_dot-back: #ffc700; --_dot-front: #ffd53f; }
.single-product .product-bor_icon_wrapper[data-szin="roze"]  { --_dot-back: #d00064; --_dot-front: #ee8b93; }
.single-product .product-bor_icon_wrapper[data-szin="habzo"] { --_dot-back: #8e9aa6; --_dot-front: #c2ced9; }

.single-product .product-bor_icon_wrapper .ball-right { background-color: var(--_dot-back); }
.single-product .product-bor_icon_wrapper .ball-left  { background-color: var(--_dot-front); }

.single-product .product-bor_icon_wrapper:is(:hover, :focus-visible) {
  z-index: 4;
}

/* 75%: the front dot is pulled back by a quarter of the pair's width. */
.single-product .product-bor_icon-name {
  position: absolute;
  inset-inline-start: calc(75% + 5px);
  inset-block-start: 50%;
  translate: 0 -50%;
  padding: 4px 9px;
  border-radius: var(--radius-xs, 4px);
  background-color: var(--black, #000);
  color: var(--white, #fff);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgb(0 0 0 / 22%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s;
  pointer-events: none;
}

.single-product .product-bor_icon-name:empty {
  display: none;
}

.single-product .product-bor_icon_wrapper:is(:hover, :focus-visible) .product-bor_icon-name {
  opacity: 1;
  visibility: visible;
}

/* ------------------------------ "A borról" + "Tulajdonságok" section */

/*
 * Description on the left, the property list on the right, both under the
 * same light heading. Replaces innowine's full-width "Termékleírás" block and
 * the grey property box that used to sit in the buy column.
 */
/* A faint full-width rule separates it from the buy area above. */
.single-product .termek-reszletek {
  border-block-start: 1px solid #ececec;
  scroll-margin-block-start: 8rem;
  padding-block: var(--space-l, 4.5rem);
  padding-inline: var(--space-s, 2rem);
}

/* No brand, so no dark winery block below: the same rule closes it, or it
   would run straight into the recommendations. */
.single-product .termek-reszletek:not(:has(+ .boraszat-blokk)) {
  border-block-end: 1px solid #ececec;
}

.single-product .termek-reszletek__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-l, 4.5rem);
  align-items: start;
  inline-size: 100%;
  max-inline-size: var(--innowine-oldal, 1140px);
}

/* No description: the list keeps its half, on the left. */
.single-product .termek-reszletek__inner:not(:has(.termek-reszletek__leiras)) .termek-reszletek__tulajdonsagok {
  grid-column: 1;
}

.single-product .termek-reszletek__cim {
  margin: 0 0 24px;
  color: var(--black, #000);
  font-size: 30px;
  font-weight: 400;
  line-height: 1.2;
}

.single-product .termek-reszletek__szoveg {
  color: #2d2d2d;
  font-size: 16px;
  line-height: 1.75;
}

.single-product .termek-reszletek__szoveg p {
  margin-block: 0 16px;
  font-size: inherit;
  line-height: inherit;
}

.single-product .termek-reszletek__szoveg p:last-child {
  margin-block-end: 0;
}

.single-product .termek-reszletek__szoveg iframe {
  display: none;
}

/*
 * Desktop: "A borról" stays in view while the longer property list scrolls
 * by. The grid's `align-items: start` leaves it room to move; when the text
 * is the taller column the row is its height and it simply does not move.
 * Top offset clears the sticky header (height set by the header script).
 */
@media (width >= 992px) {
  .single-product .termek-reszletek__leiras {
    position: sticky;
    inset-block-start: calc(var(--iw-header-cover, 0px) + 24px);
  }
}

/* No rule above the first row, one under every row. */
.single-product .tul-lista {
  margin: 0;
}

.single-product .tul-sor {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  padding-block: 14px;
  border-block-end: 1px solid #e6e6e6;
  font-size: 15px;
  line-height: 1.5;
}

.single-product .tul-cimke {
  margin: 0;
  color: #6b6b6b;
  font-weight: 400;
}

.single-product .tul-ertek {
  margin: 0;
  color: var(--black, #000);
}

/* Inline: a global rule makes these links blocks, which stacks "A, B". */
.single-product .tul-ertek a {
  display: inline;
  color: inherit;
  text-decoration: none;
}

.single-product .tul-ertek a:is(:hover, :focus-visible) {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

@media (width <= 767px) {
  .single-product .termek-reszletek {
    padding-block: var(--space-m, 3rem);
    padding-inline: var(--space-xs, 1.33rem);
  }

  .single-product .termek-reszletek__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-m, 3rem);
  }

  .single-product .termek-reszletek__cim {
    font-size: 26px;
  }

  .single-product .tul-sor {
    grid-template-columns: 120px minmax(0, 1fr);
  }
}

/* ------------------------------------------------------ winery block
   Moved to innowine-brand.css: the brand archive draws the same block as its
   hero, so both pages read one set of rules. */

/* --------------------------------------------------- recommended row */

/*
 * "Ha ez ízlik, ezeket is ajánljuk": the heading in the same light style as
 * "A borról", no rule under it, and much less air under the heading and the
 * cards.
 */
.single-product .ajanlott-section {
  padding-block: var(--space-l, 4.5rem) var(--space-s, 2rem);
}

.single-product .ajanlott-head {
  margin: 0 0 8px;
  color: var(--black, #000);
  font-size: 30px;
  font-weight: 400;
  line-height: 1.2;
}

/* The container's own 28px flex gap would add to the heading's margin. */
.single-product .ajanlott-inner {
  gap: 0;
  max-inline-size: var(--innowine-oldal, 1140px);
}

.single-product .ajanlott-inner > .border-bottom {
  display: none;
}

@media (width <= 767px) {
  .single-product .ajanlott-head {
    font-size: 26px;
    margin-block-end: 16px;
  }
}

/* ------------------------------------------------------- no club tiers */

/*
 * A product taken out of the tiers (párlat, borkóstoló) has only the
 * no-membership row. The "Szint" header, its club tooltip, the column rule and
 * the fading row lines would then frame a club price that is not there, so the
 * table collapses to a plain price: "Akció!" and the struck regular price only
 * when there is a sale.
 */
.single-product .szint-tabla:not(:has(.szint-tabla__sor--szint)) thead {
  display: none;
}

.single-product .szint-tabla:not(:has(.szint-tabla__sor--szint)) :is(.szint-tabla__tabla, tbody) {
  display: block;
}

.single-product .szint-tabla:not(:has(.szint-tabla__sor--szint)) .szint-tabla__sor {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.single-product .szint-tabla:not(:has(.szint-tabla__sor--szint)) .szint-tabla__sor > * {
  inline-size: auto;
  padding: 0;
  border: 0;
  background: none;
  text-align: start;
}

.single-product .szint-tabla:not(:has(.szint-tabla__sor--szint)) .szint-tabla__szint:has(.szint-tabla__nev:empty) {
  display: none;
}

.single-product .szint-tabla:not(:has(.szint-tabla__sor--szint)) .szint-tabla__nev {
  text-decoration: none;
}

.single-product .szint-tabla:not(:has(.szint-tabla__sor--szint)) .szint-tabla__osszeg {
  font-size: 26px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
}

/* Árlista (a gyorsnézet listája, `.single-arlista`): a termékoldalon nincs
   vonal a legfelső sor fölött, és az a sor, amit a vásárló most fizet,
   nagyobb, mint a többi. */
.single-arlista .innowine-qv__prices {
  border-block-start: 0;
}

.single-arlista .innowine-qv__price.is-aktiv {
  font-size: 1.7rem;
}

/* Three boxes on a phone: tighter, and "✓ Te" drops under the name. */

