/**
 * TGND Custom Styles
 * Custom CSS overrides for the theme
 */

/* Sticky header-ben lévő kereső: ne görgessenek a scroll anchor kompenzáció */
html {
  overflow-anchor: none;
}

/* Kereső input fókuszkor ne görgessenek be (sticky header esetén) */
.js-search-input {
  scroll-margin-top: 0;
}

/* Hide shipping line ONLY in blockcart modal (when adding to cart) */
div.blockcart-modal__total.product-shipping,
.blockcart-modal__total.product-shipping,
#blockcart-modal .product-shipping {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  overflow: hidden !important;
}

/* FORCE shipping line to be visible in cart summary - OVERRIDE all hiding rules */
body#cart #cart-subtotal-shipping,
body.cart #cart-subtotal-shipping,
#cart-subtotal-shipping,
.cart-summary__line#cart-subtotal-shipping {
  display: flex !important;
  visibility: visible !important;
  justify-content: space-between !important;
  align-items: center !important;
}

#cart-subtotal-shipping .cart-summary__value,
.cart-summary__line#cart-subtotal-shipping .cart-summary__value {
  text-align: right !important;
}

/* Blockreassurance inside cart summary - styling */
.cart-summary__reassurance {
  margin-top: 0.5rem !important;
  padding-top: 0.5rem !important;
  border-top: 1px solid #dee2e6 !important;
}

.cart-summary__reassurance #block-reassurance,
.cart-summary__reassurance .blockreassurance_product {
  background-color: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
}

.cart-summary__reassurance #block-reassurance ul {
  background-color: transparent !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.cart-summary__reassurance #block-reassurance ul li {
  margin-bottom: 0.75rem !important;
}

.cart-summary__reassurance #block-reassurance .block-reassurance-item {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  font-size: 0.875rem !important;
}

.cart-summary__reassurance #block-reassurance .block-reassurance-item img {
  max-width: 24px !important;
  max-height: 24px !important;
}

/* Mobil: Gyorsn?zet ?s Kedvenc gombok elrejt?se */
@media screen and (max-width: 767.98px) {
  /* Gyorsn?zet gombok elrejt?se - er?s selectorok */
  .product-miniature button.js-quickview,
  .product-miniature .js-quickview,
  .product-miniature__quickview_touch,
  .product-miniature__quickview,
  .product-miniature__quickview_button,
  button[data-link-action="quickview"],
  .product-miniature__quickview_touch.btn,
  .product-miniature__quickview_button.btn {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
  }
  
  /* Wishlist (kedvenc) gomb elrejt?se - er?s selectorok */
  .product-miniature .wishlist-button,
  .product-miniature .wishlist-button-add,
  .wishlist-button[data-is-product="true"],
  .product-miniature [data-is-product="true"].wishlist-button,
  .product-miniature div.wishlist-button,
  article.product-miniature .wishlist-button,
  article.product-miniature .wishlist-button-add {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
  }
  
  /* DisplayProductActions hook tartalma elrejt?se mobilon */
  .product-miniature [data-hook="displayProductActions"],
  .product-miniature [class*="wishlist"],
  .product-miniature .product-actions {
    display: none !important;
    visibility: hidden !important;
  }
  
  /* Term?k k?p nagyobb mobilon */
  .product-miniature__image-container,
  .product-miniature__image-container img,
  .product-miniature__image,
  .product-miniature picture img {
    min-height: 250px !important;
    object-fit: contain !important;
    max-height: none !important;
  }
  
  /* Term?kn?v kisebb bet?m?ret ?s marg?/padding ellen?rz?s */
  .product-miniature__title,
  .product-miniature__infos__top .product-miniature__title,
  .product-miniature__infos__top p.product-miniature__title {
    font-size: 0.9rem !important;
    line-height: 1.3 !important;
    margin-bottom: 0.5rem !important;
    margin-top: 0 !important;
    padding: 0 !important;
  }
  
  /* Term?kn?v kont?ner (infos__top) marg?/padding */
  .product-miniature__infos__top {
    margin-bottom: 0.5rem !important;
    padding: 0 !important;
  }
  
  /* Card body padding cs?kkent?se mobilon */
  .product-miniature .card-body,
  .product-miniature__infos.card-body {
    padding: 0.1rem !important;
  }
  
  /* 2-oszlopos grid t?vols?g cs?kkent?se mobilon */
  .products.row,
  .row.products {
    --bs-gutter-x: 0.2rem !important;
    --bs-gutter-y: 0.2rem !important;
    margin-left: calc(var(--bs-gutter-x) * -6) !important;
    margin-right: calc(var(--bs-gutter-x) * -6) !important;
  }
  
  .products.row > *,
  .row.products > * {
    padding-left: calc(var(--bs-gutter-x) * 0.5) !important;
    padding-right: calc(var(--bs-gutter-x) * 0.5) !important;
  }
  
  /* Mennyis?g input mez? sz?less?g n?vel?se mobilon - csak sz?less?g, bet?m?ret ?s gombm?ret v?ltozatlan */
  .product-miniature input[name="qty"],
  .product-miniature input[type="text"][name="qty"],
  .product-miniature .form-control[name="qty"],
  .product-miniature input#quantity_wanted_,
  .product-miniature input[id^="quantity_wanted_"],
  .product-miniature .input-group input.form-control {
    min-width: 80px !important;
    width: 80px !important;
    text-align: center !important;
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
  }
  
  /* Input group kont?ner mobilon - t?bb hely */
  .product-miniature .input-group,
  .product-miniature .quantity-button,
  .product-miniature .js-quantity-button {
    width: auto !important;
    min-width: 160px !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
  }

  /* Form kont?ner - t?bb hely a mennyis?g inputnak */
  .product-miniature form.d-flex {
    gap: 0.5rem !important;
  }
}

/* Kis telefonok (< 380px) - kompaktabb quantity gombok */
@media screen and (max-width: 379.98px) {
  /* Card body padding teljesen nulla mobilon - szimmetrikus */
  .product-miniature .card-body,
  .product-miniature__infos.card-body {
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Input group - margin ?s padding nulla, szimmetrikus */
  .product-miniature .input-group,
  .product-miniature .input-group.flex-nowrap {
    margin: 0 !important;
    padding: 0 !important;
    min-width: 130px !important;
    max-width: 100% !important;
  }

  /* Quantity button konténer - szimmetrikus */
  .product-miniature .quantity-button,
  .product-miniature .js-quantity-button {
    margin: 0 !important;
    padding: 0 !important;
    min-width: 130px !important;
    max-width: 100% !important;
  }

  /* Quantity input sz?less?g cs?kkent?se */
  .product-miniature input[name="qty"],
  .product-miniature input[type="text"][name="qty"],
  .product-miniature .form-control[name="qty"],
  .product-miniature input#quantity_wanted_,
  .product-miniature input[id^="quantity_wanted_"],
  .product-miniature .input-group input.form-control {
    min-width: 60px !important;
    width: 60px !important;
    padding: 0.375rem 0.25rem !important;
    font-size: 0.875rem !important;
    margin: 0 !important;
  }

  /* Gombok padding cs?kkent?se */
  .product-miniature .input-group .btn,
  .product-miniature .input-group button.increment,
  .product-miniature .input-group button.decrement,
  .product-miniature .input-group .js-increment-button,
  .product-miniature .input-group .js-decrement-button {
    padding: 0.375rem 0.5rem !important;
    min-width: 35px !important;
    margin: 0 !important;
  }

  /* Form - padding ?s margin nulla, szimmetrikus */
  .product-miniature form,
  .product-miniature form.d-flex {
    gap: 0.25rem !important;
    padding: 0.25rem !important;
    margin: 0 !important;
  }

  /* Kos?rba gomb sz?veg elrejt?se, csak ikon */
  .product-miniature form button[data-button-action="add-to-cart"] span:not(.visually-hidden) {
    display: none !important;
  }

  .product-miniature form button[data-button-action="add-to-cart"] {
    padding: 0.5rem 0.75rem !important;
    min-width: 45px !important;
    margin: 0 !important;
  }
  
  /* ?rny?kol?s elt?vol?t?sa mobilon - nincs mouseover */
  .product-miniature .card,
  .product-miniature.card,
  .js-product-miniature .card {
    box-shadow: none !important;
    border: 1px solid #dee2e6 !important;
  }
  
  .product-miniature .card:hover,
  .product-miniature.card:hover,
  .js-product-miniature .card:hover {
    box-shadow: none !important;
  }
}

/* ============================================
   TERMÉKLISTA KÉPEK - AUTO MÉRETEZÉS + NAGYOBB MÉRET
   ============================================ */
/* Terméklista képek - arányos megjelenítés, fehér keret minimalizálása */
.product-miniature__image-container {
  width: 100% !important;
  min-height: 250px !important;
  display: block !important;
  position: relative !important;
  aspect-ratio: 1 / 1 !important;
  background: #fff !important;
}

.product-miniature__image-container picture {
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Contain: minden kép beleférjen, ne legyen levágva */
.product-miniature__image-container img.product-miniature__image,
.product-miniature__image-container img.card-img-top {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  display: block !important;
  object-fit: contain !important;
}

/* Tablet és nagyobb: még nagyobb képek */
@media (min-width: 768px) {
  .product-miniature__image-container {
    min-height: 300px !important;
  }
}

/* Desktop: még nagyobb képek */
@media (min-width: 1200px) {
  .product-miniature__image-container {
    min-height: 350px !important;
  }
}

/* ============================================
   SZŰRŐ "FILTER BY" / "SZŰRÉS ESZERINT" ELREJTÉSE
   ============================================ */
/* ps_facetedsearch modul címének elrejtése */
.faceted-title,
.left-block__title,
.search-filters-title,
#faceted-offcanvas-label,
.facets .text-uppercase.h6 {
  display: none !important;
}

/* MOBIL SZŰRŐ - EGYSZERŰ MEGOLDÁS */
/* Mobilon elrejtjük a szűrő gombot */
@media (max-width: 767px) {
  #search_filter_toggler,
  .filter-button {
    display: none !important;
  }

  /* A szűrők láthatók legyenek mobilon is, mint desktop-on */
  #search_filters_wrapper,
  .left-block {
    display: block !important;
  }

  /* Szűrők mobilon szépen jelenjenek meg */
  #search-filters {
    margin-bottom: 1.5rem;
  }
}

/* ============================================
   ALKATEGÓRIA HOVER EFFEKT
   ============================================ */
/* Ugyanaz az emelés és drop shadow mint a category grid-nél */
.subcategory {
  transition: all 0.3s ease;
}

.subcategory:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}
/* ============================================
   MOBILNÉZETI JAVÍTÁSOK - TERMÉK OLDAL
   ============================================ */
@media (max-width: 767px) {
  /* Wrapper padding csökkentése */
  .wrapper__content,
  #content-wrapper {
    padding: 0 !important;
  }
  
  /* Termék oldal oszlop padding */
  .page-product .product__col {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }
  
  /* Árak betűmérete */
  .page-product .product__current-price {
    font-size: 1rem !important;
  }
  
  .page-product .product__prices {
    font-size: 0.875rem !important;
  }
  
  /* Mennyiségi kedvezmény táblázat - 4 oszlop */
  .page-product .product__discounts__table {
    font-size: 0.75rem !important;
  }

  .page-product .product__discounts__table th,
  .page-product .product__discounts__table td {
    padding: 0.5rem 0.2rem !important;
    word-break: break-word !important;
  }

  .page-product .product__discounts__table thead th {
    font-size: 0.7rem !important;
  }
  
  /* Kategória grid spacing */
  .subcategory {
    padding: 2px !important;
  }
  
  .subcategory__wrapper {
    margin-bottom: 2px !important;

/* ============================================
   MOBILNÉZETI JAVÍTÁSOK - TERMÉK OLDAL
   ============================================ */
@media (max-width: 767px) {
  /* Wrapper padding csökkentése - MEGA SPECIFIKUS */
  body .wrapper__content,
  body #content-wrapper,
  body .wrapper__content.col-md-8,
  body .wrapper__content.col-md-9,
  body .wrapper__content.col-lg-9,
  body .wrapper__content.col-lg-10,
  body #content-wrapper.col-md-8,
  body #content-wrapper.col-md-9,
  body #content-wrapper.col-lg-9,
  body #content-wrapper.col-lg-10 {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  
  /* Termék oldal oszlop padding */
  .page-product .product__col {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }
  
  /* Árak betűmérete */
  .page-product .product__current-price {
    font-size: 1rem !important;
  }
  
  .page-product .product__prices {
    font-size: 0.875rem !important;
  }
  
  /* Mennyiségi kedvezmény táblázat - 4 oszlop */
  .page-product .product__discounts__table {
    font-size: 0.8rem !important;
  }

  .page-product .product__discounts__table th,
  .page-product .product__discounts__table td {
    padding: 0.5rem 0.15rem !important;
    word-break: break-word !important;
  }

  .page-product .product__discounts__table thead th {
    font-size: 0.75rem !important;
  }
  
  /* Kategória grid spacing */
  .subcategory {
    padding: 2px !important;
  }
  
  .subcategory__wrapper {
    margin-bottom: 2px !important;
  }
}

/* MEGA OVERRIDE - wrapper padding mobilon LEGVÉGÉN */
@media (max-width: 767px) {
  .wrapper__content,
  #content-wrapper {
    padding: 0 !important;
  }
}

/* ULTRA MEGA OVERRIDE - wrapper padding mobilon minden lehetséges módon */
@media (max-width: 767px) {
  html body .wrapper__content,
  html body #content-wrapper,
  html body div.wrapper__content,
  html body div#content-wrapper {
    padding: 0 !important;
    padding-top: 0 !important;
    padding-right: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 0 !important;
  }
}

/* Árak betűmérete mobilon - override */
@media (max-width: 767px) {
  .product-prices .current-price, 
  .product-prices .current-price-value, 
  .product-price, 
  .product-price h3, 
  .price-item span, 
  .price-item .fw-bold {
    font-size: 1rem !important;
  }
}

/* BRUTÁLIS OVERRIDE - mindenképp mobilon 0 padding */
@media (max-width: 767px) {
  * .wrapper__content,
  * #content-wrapper {
    padding: 0 !important;
  }
}

/* BRUTÁLIS OVERRIDE - ár betűméret mobilon */
@media (max-width: 767px) {
  * .product-prices .current-price,
  * .product-prices .current-price-value,
  * .product-price,
  * .product-price h3,
  * .price-item span,
  * .price-item .fw-bold {
    font-size: 1rem !important;
  }
}


/* ============================================
   OPCIONÁLIS SZÖVEG ELREJTÉSE
   ============================================ */
/* Elrejti az "Opcionális" szöveget csak a checkout és cart oldalakon */
#checkout .optional,
#checkout .form-text,
#checkout .help-block,
#checkout small.text-muted,
#cart .optional,
#cart .form-text,
#cart .help-block,
#cart small.text-muted,
.checkout-step .optional,
.checkout-step .form-text,
.cart-grid .optional,
.cart-grid .form-text,
.js-child-focus .optional,
body.checkout .optional,
body.order .optional {
  display: none !important;
  visibility: hidden !important;
}


/* ==============================================

/* Mobilon (max 576px) vertikális elrendezés */
@media (max-width: 576px) {
  .product__price-breakdown .d-flex {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
  }
  
  .product__price-breakdown .price-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }
  
  .product__price-breakdown .price-item .text-muted {
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
  }
  
  .product__price-breakdown .price-item .fw-bold {
    font-size: 1.125rem;
  }
}

/* Tablet (577px - 768px) is keep together but allow wrapping of items */
@media (min-width: 577px) and (max-width: 768px) {
  .product__price-breakdown .d-flex {
    flex-wrap: wrap !important;
    gap: 1rem !important;
  }
  
  .product__price-breakdown .price-item {
    white-space: nowrap;
  }
}

/* ==============================================
   TERMÉK ÁR - Mobilon ne törje el a számokat
   ============================================== */

/* Az ár számok ne törjenek el soha */
.product__price-breakdown .price-item .fw-bold {
  white-space: nowrap;
}

/* Mobilon (max 576px) - címkék felül, árak alul */
@media (max-width: 576px) {
  .product__price-breakdown > .d-flex {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.25rem !important;
  }
  
  /* Első sor: címkék egymás mellett */
  .product__price-breakdown .d-flex {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between;
    gap: 1rem !important;
  }
  
  .product__price-breakdown .price-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
  }
  
  .product__price-breakdown .price-item .text-muted {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
  }
  
  .product__price-breakdown .price-item .fw-bold {
    font-size: 1.125rem;
    white-space: nowrap;
  }
}

/* Tablet (577px - 768px) - keep together */
@media (min-width: 577px) and (max-width: 768px) {
  .product__price-breakdown .d-flex {
    flex-wrap: wrap !important;
    gap: 1rem !important;
  }
  
  .product__price-breakdown .price-item {
    white-space: nowrap;
  }
}

/* Logo méret növelése */
.logo img {
  max-width: 250px !important;
  height: auto !important;
}

@media (max-width: 767px) {
  .logo img {
    max-width: 180px !important;
  }
}

/* Kosárba rakás animáció - modal nélküli módban */
@keyframes cartAddedPop {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.35); }
  60%  { transform: scale(0.92); }
  100% { transform: scale(1); }
}

@keyframes badgePop {
  0%   { transform: scale(1); background-color: var(--bs-primary, #25b9d7); }
  40%  { transform: scale(1.6); background-color: #28a745; }
  100% { transform: scale(1); background-color: var(--bs-primary, #25b9d7); }
}

.cart-added-animation .header-block__icon {
  animation: cartAddedPop 0.6s ease;
}

.cart-added-animation .header-block__badge {
  animation: badgePop 0.6s ease;
}

/* Floating kosár gomb - csak mobilon jelenik meg */
.tgnd-floating-cart {
  display: none;
}

@media (max-width: 767.98px) {
  .tgnd-floating-cart {
    display: flex;
    position: fixed;
    bottom: 20px;
    left: 16px;
    z-index: 1050;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background-color: var(--bs-primary, #25b9d7);
    color: #fff;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  .tgnd-floating-cart:active {
    transform: scale(0.92);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    color: #fff;
  }

  .tgnd-floating-cart .material-icons {
    font-size: 26px;
    color: #fff;
  }

  .tgnd-floating-cart__badge {
    display: none;
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: #e74c3c;
    color: #fff;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    padding: 0 3px;
    font-size: 11px;
    font-weight: 700;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 2px solid #fff;
  }

  .tgnd-floating-cart__badge--visible {
    display: flex;
  }

  /* Animáció a floating gombra is */
  .tgnd-floating-cart.cart-added-animation {
    animation: cartAddedPop 0.6s ease;
  }
}

/* Mobil kereső dropdown javítás - JS fix pozicionálja (custom.js), CSS csak overflow biztosít */
@media (max-width: 767.98px) {
  #searchCanvas,
  #searchCanvas .offcanvas-header,
  .search__offcanvas,
  .search__offcanvas .offcanvas-header,
  #searchCanvas .search__container,
  #searchCanvas .search-widgets {
    overflow: visible !important;
  }
}
