/* rpdesignfix 1.0.0 (20261130d)
   Product page: shorter mobile gallery, keep title/description clear of the chat widget,
   equal-height related titles (2-line clamp) and aligned prices.
   Footer: hide the dead "Privatumo politika" link until that CMS page exists.
   Isolated from rpcontactmenufix / header / menu. */

/* ---- 1. Mobile product gallery: cut empty vertical space ---- */
@media (max-width: 767px) {
  body#product .product-cover,
  body#product #product-images-large,
  body#product .product-lmage-large,
  body#product .product-cover .easyzoom,
  body#product .product-cover .swiper-wrapper,
  body#product .product-cover .swiper-slide {
    max-height: 280px;
    min-height: 0 !important;
  }
  body#product .product-cover img,
  body#product #product-images-large img,
  body#product .product-lmage-large img {
    max-height: 280px !important;
    width: auto !important;
    max-width: 100%;
    height: auto !important;
    object-fit: contain;
    display: block;
    margin-left: auto;
    margin-right: auto;
  }

  /* Offset ONLY the outer product-info column. Theme CCC may still contain
     the old stacked 80px rule; zero the nested pads so they cannot add up. */
  body#product #col-product-info,
  body#product .product_header_container,
  body#product .product-information {
    padding-right: 0;
  }
  body#product #main-product-wrapper > .row > .col-product-info {
    padding-right: 80px;
    box-sizing: border-box;
  }
}

/* ---- 2. Related products: 2-line title clamp, prices on one line ---- */
body#product .category-products .js-product-miniature-wrapper,
body#product .category-products .product-miniature {
  display: flex;
  flex-direction: column;
  height: 100%;
}
body#product .category-products .product-description {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
}
body#product .category-products .product-description > .row {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
  flex: 1 1 auto;
}
body#product .category-products .product-category-name {
  min-height: 1.4em;
  max-height: 1.4em;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body#product .category-products .product-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  line-height: 1.3;
  min-height: calc(1.3em * 2);
  max-height: calc(1.3em * 2);
  margin-top: 0;
  margin-bottom: 4px;
}
body#product .category-products .product-miniature-right {
  padding-top: 1.4em; /* sit beside the title, under the category line */
  display: flex;
  align-items: flex-start;
  flex: 0 0 auto;
}
body#product .category-products .product-price-and-shipping {
  margin-top: 0;
  white-space: nowrap;
}

/* ---- Dead footer privacy link (no CMS page yet). Restore: disable rpdesignfix or delete these rules. ---- */
#footer a[href*="privatumo-politika"],
footer a[href*="privatumo-politika"],
.footer-container a[href*="privatumo-politika"],
.page-footer a[href*="privatumo-politika"],
[class*="rp-footer"] a[href*="privatumo-politika"],
.rp-site-footer a[href*="privatumo-politika"],
li a[href*="privatumo-politika"] {
  display: none !important;
}
#footer li:has(> a[href*="privatumo-politika"]),
footer li:has(> a[href*="privatumo-politika"]),
[class*="rp-footer"] li:has(> a[href*="privatumo-politika"]) {
  display: none !important;
}

/* 1.0.1 category description first-paint collapse (also inlined in head) */
@media (max-width: 767px) {
  body#category .category-description:has(p + p):not(.rp-desc-open),
  body#category .category-description:has(img):not(.rp-desc-open) {
    max-height: 11.5em !important;
    overflow: hidden !important;
    position: relative;
    background: #f5f1e9;
    border-radius: 10px;
    padding: 14px 16px 8px !important;
    margin: 0 0 10px !important;
    box-sizing: border-box;
  }
  body#category .category-description:has(p + p):not(.rp-desc-open)::after,
  body#category .category-description:has(img):not(.rp-desc-open)::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 1.8em;
    background: linear-gradient(to bottom, rgba(245, 241, 233, 0), #f5f1e9);
    pointer-events: none;
    z-index: 1;
  }
  body#category .category-description:has(p + p):not(.rp-desc-open) img,
  body#category .category-description:has(img):not(.rp-desc-open) img {
    display: none !important;
  }
  body#category .category-description:not(.rp-desc-open) + .rp-desc-toggle {
    display: inline-block;
    margin: 10px 0 16px 16px;
    padding: 8px 0;
    background: none;
    border: 0;
    color: #b51942;
    font: 600 15px/1.3 Inter, sans-serif;
    cursor: pointer;
    text-decoration: underline;
    position: relative;
    z-index: 2;
  }
  body#category .category-description.rp-desc-open {
    max-height: none !important;
    overflow: visible !important;
    margin-bottom: 8px !important;
  }
  body#category .category-description.rp-desc-open::after {
    content: none !important;
    display: none !important;
  }
  body#category .category-description.rp-desc-open + .rp-desc-toggle {
    margin-top: 4px;
    margin-left: 16px;
    margin-bottom: 16px;
  }
}
@media (min-width: 768px) {
  body#category .rp-desc-toggle { display: none !important; }
}


/* 1.0.5: same first-paint left-column grid as critical CSS. Grid
   grid. #left-column comes after #content-wrapper in HTML (order-first).
   A 22%/78% flex + margin gutter wrapped the main column under the tall
   sidebar while it was parsed (CLS ~0.8). Grid column 2 is reserved immediately. */
@media (min-width: 992px) {
  body#category #inner-wrapper > .row {
    display: grid !important;
    grid-template-columns: 22% 78%;
    align-items: start;
  }
  body#category #content-wrapper.left-column {
    grid-column: 2;
    grid-row: 1;
    flex: none;
    max-width: 100%;
    width: auto;
    margin-left: 0;
  }
  body#category #left-column {
    grid-column: 1;
    grid-row: 1;
    flex: none;
    max-width: 100%;
    width: auto;
    min-height: 1px;
  }
}
@media (min-width: 768px) and (max-width: 991px) {
  body#category #inner-wrapper > .row {
    display: grid !important;
    grid-template-columns: 25% 75%;
    align-items: start;
  }
  body#category #content-wrapper.left-column {
    grid-column: 2;
    grid-row: 1;
    flex: none;
    max-width: 100%;
    width: auto;
    margin-left: 0;
  }
  body#category #left-column {
    grid-column: 1;
    grid-row: 1;
    flex: none;
    max-width: 100%;
    width: auto;
    min-height: 1px;
  }
}

/* 1.0.4: show the injected phone on Kontaktai desktop (>=1101px), same as shop header.
   Menu CSS already hides phone/contact at max-width 1100px; do not override that. */
@media (min-width: 1101px) {
  html body.cms-id-6 .rp-site-header-inner:not(:has(.rp-site-search)) {
    grid-template-columns: 44px auto minmax(0, 1fr) auto auto !important;
  }
  html body.cms-id-6 .rp-site-header-inner > .rp-header-phone {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    justify-self: end;
    width: max-content;
    max-width: max-content;
    color: #f5f1e9 !important;
    text-decoration: none !important;
    font: 600 14px/1 Inter, sans-serif;
    white-space: nowrap;
  }
  html body.cms-id-6 .rp-site-header-inner > .rp-header-phone .rp-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
  }
}
@media (max-width: 1100px) {
  html body.cms-id-6 .rp-site-header-inner > .rp-header-phone { display: none !important; }
}
