/* Coffin catalogue card images use a fixed landscape 3:2 frame at every breakpoint.
   Scope to coffin catalogue to preserve portrait wreaths and independent hearse cards. */
.pc-coffins-catalog-block .pogost-wreath-card__media{aspect-ratio:3 / 2}
.pc-coffins-catalog-block .pogost-wreath-card__media img{object-fit:contain;object-position:center;padding:10px}
.pc-coffins-catalog-block .pogost-wreath-card__media.is-wide-source img{object-fit:contain;padding:10px}
.pc-coffins-catalog-block .pogost-wreath-card__height{background:rgba(255,255,255,.94)}
.pc-coffins-catalog-block [data-coffin-card][hidden]{display:none!important}
.pc-coffins-catalog-block .pogost-catalog__filters button{max-width:100%;overflow-wrap:anywhere}
.pc-coffins-catalog-block .pogost-wreath-card__head strong{white-space:normal}
.pc-coffins-catalog-block .pogost-wreath-card__specs dd{text-align:right;overflow-wrap:anywhere}
.pogost-coffin-product-page .pogost-product-main{aspect-ratio:1.22}
.pogost-coffin-product-page .pogost-product-main.is-portrait{aspect-ratio:1}
.pogost-coffin-product-page .pogost-product-main.is-landscape{aspect-ratio:1.28}
.pogost-coffin-product-page .pogost-product-main.is-landscape img{object-fit:contain;padding:10px}
@media(max-width:820px){.pogost-coffin-product-page .pogost-product-main.is-portrait,.pogost-coffin-product-page .pogost-product-main.is-landscape{height:auto;min-height:0;aspect-ratio:1.22}}
@media(max-width:600px){.pc-coffins-catalog-block .pogost-wreath-card__media img{padding:5px}}
/* Contain the catalogue at narrow mobile widths, without altering legacy wreaths. */
.pc-coffins-catalog-block,.pc-coffins-catalog-block *,.pc-coffins-catalog-block *::before,.pc-coffins-catalog-block *::after{box-sizing:border-box}
.pc-coffins-catalog-block .pogost-catalog-container,.pc-coffins-catalog-block .pogost-catalog,.pc-coffins-catalog-block .pogost-wreath-grid{min-width:0;max-width:100%}
.pc-coffins-catalog-block .pogost-wreath-card__head a{overflow-wrap:anywhere}
.pc-coffins-catalog-block .pogost-wreath-card__head a{color:var(--ink);text-decoration:none}
.pc-coffins-catalog-block .pogost-wreath-card__head a:hover{color:var(--brand)}
.pc-coffins-catalog-block .pogost-wreath-card__actions>a{text-decoration:none}
.pc-coffins-catalog-block .pogost-wreath-card__placeholder{text-decoration:none}
.pogost-coffin-product-page .pogost-block-btn{text-decoration:none}

/* v0.36.0: apply 3:2 also to "Похожие гробы" on the individual product page. */
.pogost-coffin-product-page .pogost-product-related .pogost-wreath-card__media{aspect-ratio:3 / 2}
.pogost-coffin-product-page .pogost-product-related .pogost-wreath-card__media img,
.pogost-coffin-product-page .pogost-product-related .pogost-wreath-card__media.is-wide-source img{object-fit:contain;object-position:center;padding:10px}
/* Unified 16x16 SVG-style chevrons in mobile filter and sort fields. */
@media(max-width:600px){
 .pc-coffins-catalog-block .pogost-catalog__filter-toggle{display:flex;align-items:center;justify-content:space-between;gap:9px;min-height:46px;padding:10px 13px;line-height:1.2}
 .pc-coffins-catalog-block .pogost-catalog__filter-toggle>span{font-size:11px;line-height:1.2;flex:0 0 auto}
 .pc-coffins-catalog-block .pogost-catalog__filter-toggle>strong{flex:1;min-width:0;font-size:12px;line-height:1.2}
 .pc-coffins-catalog-block .pogost-catalog__filter-toggle>i{display:block;flex:0 0 16px;width:16px;height:16px;border:0;background-color:var(--brand-dark);transform:none;transition:transform .18s ease;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'/%3E%3C/svg%3E") center/contain no-repeat}
 .pc-coffins-catalog-block .pogost-catalog__filter-toggle[aria-expanded=true]>i{transform:rotate(180deg)}
 .pc-coffins-catalog-block .pogost-catalog__right select{appearance:none;-webkit-appearance:none;min-height:46px;line-height:1.2;padding:10px 39px 10px 13px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%23273548' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'/%3E%3C/svg%3E");background-repeat:no-repeat;background-size:16px 16px;background-position:right 13px center}
 .pc-coffins-catalog-block .pogost-wreath-grid,.pogost-coffin-product-page .pogost-product-related .pogost-wreath-grid{grid-template-columns:repeat(var(--pc-coffin-mobile-columns,1),minmax(0,1fr));gap:10px}
 .pc-coffins-catalog-block .pogost-wreath-card,.pogost-coffin-product-page .pogost-product-related .pogost-wreath-card{min-width:0}
 .pc-coffins-catalog-block .pogost-wreath-card__body,.pogost-coffin-product-page .pogost-product-related .pogost-wreath-card__body{padding:clamp(9px,2.7vw,16px)}
 .pc-coffins-catalog-block .pogost-wreath-card__head strong,.pogost-coffin-product-page .pogost-product-related .pogost-wreath-card__head strong{font-size:clamp(15px,4.7vw,23px);white-space:normal}
 .pc-coffins-catalog-block .pogost-wreath-card__head a,.pogost-coffin-product-page .pogost-product-related .pogost-wreath-card__head a{font-size:clamp(12px,3.75vw,17px);overflow-wrap:anywhere}
 .pc-coffins-catalog-block .pogost-wreath-card__specs>div,.pogost-coffin-product-page .pogost-product-related .pogost-wreath-card__specs>div{grid-template-columns:minmax(0,1fr);gap:3px}
 .pc-coffins-catalog-block .pogost-wreath-card__specs dd,.pogost-coffin-product-page .pogost-product-related .pogost-wreath-card__specs dd{text-align:left}
 .pc-coffins-catalog-block .pogost-wreath-card__actions,.pogost-coffin-product-page .pogost-product-related .pogost-wreath-card__actions{display:grid;grid-template-columns:minmax(0,1fr);gap:8px}
 .pc-coffins-catalog-block .pogost-wreath-card__actions>a,.pogost-coffin-product-page .pogost-product-related .pogost-wreath-card__actions>a{text-align:center;min-width:0;overflow-wrap:anywhere}
}

/* v0.43.1 · Desktop catalogue rhythm.
   A one-line name occupies the same two-line title slot as a wrapped name.
   Keep longer names readable; do not truncate product names. Align the
   final availability/action row at the card bottom even if specs differ. */
@media (min-width: 601px) {
  .pc-coffins-catalog-block .pogost-coffin-card,
  .pogost-coffin-product-page .pogost-product-related .pogost-coffin-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }
  .pc-coffins-catalog-block .pogost-coffin-card .pogost-wreath-card__media,
  .pogost-coffin-product-page .pogost-product-related .pogost-coffin-card .pogost-wreath-card__media {
    flex: none;
  }
  .pc-coffins-catalog-block .pogost-coffin-card .pogost-wreath-card__body,
  .pogost-coffin-product-page .pogost-product-related .pogost-coffin-card .pogost-wreath-card__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
  }
  .pc-coffins-catalog-block .pogost-coffin-card .pogost-wreath-card__head > div > a,
  .pogost-coffin-product-page .pogost-product-related .pogost-coffin-card .pogost-wreath-card__head > div > a {
    min-height: 2.48em; /* 2 lines at the existing 1.24 line-height */
  }
  .pc-coffins-catalog-block .pogost-coffin-card .pogost-wreath-card__actions,
  .pogost-coffin-product-page .pogost-product-related .pogost-coffin-card .pogost-wreath-card__actions {
    margin-top: auto;
  }
}


/* 0.46.4 - Whole-image fitting for the coffin archive and related products.
   A fixed 3:2 card can contain a 4:3 or portrait original without cutting off
   the lid or the pedestal. Absolute image geometry keeps the frame independent
   from WordPress width/height attributes and theme-level img rules. */
.pc-coffins-catalog-block .pogost-wreath-card__media,
.pogost-coffin-product-page .pogost-product-related .pogost-wreath-card__media{
  position:relative; display:block; aspect-ratio:3/2; overflow:hidden;
  isolation:isolate; background:#f3f4f5;
}
.pc-coffins-catalog-block .pogost-wreath-card__media img,
.pc-coffins-catalog-block .pogost-wreath-card__media.is-wide-source img,
.pogost-coffin-product-page .pogost-product-related .pogost-wreath-card__media img,
.pogost-coffin-product-page .pogost-product-related .pogost-wreath-card__media.is-wide-source img{
  box-sizing:border-box; position:absolute; inset:0;
  display:block; width:100%; height:100%; max-width:none; max-height:none;
  aspect-ratio:auto; object-fit:contain; object-position:center;
  padding:clamp(4px,1vw,10px); margin:0; border-radius:0;
}
/* Different source orientation changes the main frame without stretching it. */
.pogost-coffin-product-page .pogost-product-main,
.pogost-coffin-product-page .pogost-product-main.is-landscape{aspect-ratio:4/3}
.pogost-coffin-product-page .pogost-product-main.is-portrait{aspect-ratio:4/5}
.pogost-coffin-product-page .pcp-main-open>img,
.pogost-coffin-product-page .pogost-product-main.is-landscape .pcp-main-open>img{
  box-sizing:border-box; width:100%; height:100%; max-width:none; max-height:none;
  aspect-ratio:auto; object-fit:contain; object-position:center;
  padding:clamp(6px,1vw,12px); margin:0;
}
.pogost-coffin-product-page .pogost-product-thumbs button img{
  box-sizing:border-box; object-fit:contain; object-position:center;
  padding:4px; background:#f3f4f5;
}
@media(max-width:600px){
  .pc-coffins-catalog-block .pogost-wreath-card__media img,
  .pogost-coffin-product-page .pogost-product-related .pogost-wreath-card__media img{padding:4px}
  .pogost-coffin-product-page .pogost-product-main.is-portrait{aspect-ratio:4/5}
}
