/* ================================================================
   MY HOUSE PROJECTS — Frontend
   Font stacks controlled via plugin settings (--mhp-font-*).
   Font sizes controlled via plugin settings (--mhp-size-*) — when
   unset, the var() fallback keeps the original responsive clamp().
   Falls back to Kadence CSS variables when settings are empty.
   ================================================================ */

.mhp-home,
.mhp-page,
.mhp-single {
    --mhp-gap: 24px;
    --mhp-max-width: 1320px;
    color: var(--mhp-body);
    font-family: var(--mhp-font-body) !important;
}
/* Force ALL children to inherit — kills rogue <code>/<kbd>/<strong> wrappers */
.mhp-home, .mhp-home *,
.mhp-page, .mhp-page *,
.mhp-single, .mhp-single * {
    font-family: inherit;
    box-sizing: border-box;
}
/* Then re-apply heading fonts per level */
.mhp-home h1, .mhp-page h1, .mhp-single h1 {
    font-family: var(--mhp-font-h1) !important;
    font-weight: var(--mhp-w-h1);
}
.mhp-home h2, .mhp-page h2, .mhp-single h2 {
    font-family: var(--mhp-font-h2) !important;
    font-weight: var(--mhp-w-h2);
}
.mhp-home h3, .mhp-page h3, .mhp-single h3 {
    font-family: var(--mhp-font-h3) !important;
    font-weight: var(--mhp-w-h3);
}

/* ================================================================
   HOMEPAGE — [mhp_home]  (grid + button only, no bg/header)
   ================================================================ */
.mhp-home__footer {
    max-width: var(--mhp-max-width);
    margin: 36px auto 0;
    padding: 0 24px;
    text-align: right;
}

/* ================================================================
   PROJECTS PAGE — [mhp_projects]
   ================================================================ */
.mhp-page { padding: 0 0 80px; }

.mhp-page__header {
    text-align: center;
    padding: 64px 24px 48px;
    max-width: 780px;
    margin: 0 auto;
}
.mhp-page__title {
    font-size: var(--mhp-size-h1, clamp(32px, 4vw, 52px));
    font-weight: var(--mhp-w-h1);
    color: var(--mhp-page-title, var(--mhp-heading));
    margin: 0 0 8px;
    line-height: 1.15;
}
.mhp-page__subtitle {
    display: block;
    font-family: var(--mhp-font-subtitle) !important;
    font-size: 12px;
    font-weight: var(--mhp-w-subtitle);
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--mhp-subtitle);
    margin: 0 0 24px;
}
.mhp-page__divider {
    border: none;
    border-top: 1px solid #d5d0ca;
    max-width: 520px;
    margin: 0 auto 28px;
}
.mhp-page__desc {
    font-size: var(--mhp-size-body, 16px);
    line-height: 1.75;
    color: var(--mhp-body);
}
.mhp-page__desc p { margin: 0 0 16px; }
.mhp-page__desc p:last-child { margin-bottom: 0; }
.mhp-page__link {
    color: var(--mhp-body);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color .2s;
}
.mhp-page__link:hover { color: var(--mhp-accent); }

.mhp-page__load-more {
    text-align: right;
    max-width: var(--mhp-max-width);
    margin: 40px auto 0;
    padding: 0 24px;
}

/* ================================================================
   GRID
   ================================================================ */
.mhp-grid {
    display: grid;
    gap: var(--mhp-gap);
    max-width: var(--mhp-max-width);
    margin: 0 auto;
    padding: 0;
}
.mhp-grid--3 { grid-template-columns: repeat(3, 1fr); }
.mhp-grid--4 { grid-template-columns: repeat(4, 1fr); }
.mhp-grid--2 { grid-template-columns: repeat(2, 1fr); }

/* ================================================================
   CARD
   ================================================================ */
.mhp-card {
    display: flex;
    flex-direction: column;
}
.mhp-card__link {
    display: block;
    text-decoration: none;
    overflow: hidden;
}
.mhp-card__image-wrap {
    position: relative;
    width: 100%;
    padding-top: var(--mhp-img-ratio);
    overflow: hidden;
    background: #e8e4df;
}
.mhp-card__image-wrap .mhp-card__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .45s cubic-bezier(.25,.46,.45,.94);
    will-change: transform;
}
.mhp-card__link:hover .mhp-card__img,
.mhp-card__link:focus .mhp-card__img {
    transform: scale(1.04);
}
.mhp-card__body {
    padding: 18px 0 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.mhp-card__title {
    font-family: var(--mhp-font-card-title) !important;
    font-size: var(--mhp-size-h3, 14px);
    font-weight: var(--mhp-w-card-title);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0 0 8px;
    color: var(--mhp-heading);
    line-height: 1.3;
}
.mhp-card__title a { color: inherit; text-decoration: none; }
.mhp-card__title a:hover { color: var(--mhp-accent); }

.mhp-card__desc {
    font-size: var(--mhp-size-body, 15px);
    line-height: 1.6;
    color: var(--mhp-body);
    margin: 0 0 14px;
    flex: 1;
}
.mhp-card__more {
    font-family: var(--mhp-font-readmore) !important;
    font-weight: var(--mhp-w-readmore);
    font-size: 14px;
    color: var(--mhp-link);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: gap .2s, color .2s;
}
.mhp-card__more span { font-size: 18px; line-height: 1; }
.mhp-card__more:hover { gap: 8px; color: var(--mhp-accent); }

/* ================================================================
   BUTTON
   ================================================================ */
.mhp-btn {
    display: inline-block;
    font-family: var(--mhp-font-btn) !important;
    font-size: 12px;
    font-weight: var(--mhp-w-btn);
    letter-spacing: 2.5px;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--mhp-btn-text);
    border: 1px solid var(--mhp-btn-border);
    padding: 16px 36px;
    background: transparent;
    cursor: pointer;
    transition: background .25s, color .25s;
    line-height: 1;
}
.mhp-btn:hover,
.mhp-btn:focus-visible {
    background: var(--mhp-heading);
    color: #fff;
    border-color: var(--mhp-heading);
}
.mhp-btn:disabled { opacity: .5; cursor: not-allowed; }
.mhp-btn--loading { position: relative; color: transparent !important; }
.mhp-btn--loading::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 16px; height: 16px;
    border: 2px solid var(--mhp-btn-border);
    border-top-color: transparent;
    border-radius: 50%;
    animation: mhp-spin .6s linear infinite;
}
@keyframes mhp-spin { to { transform: rotate(360deg); } }

/* ================================================================
   HIGHLIGHTED SECTION
   ================================================================ */
.mhp-highlight {
    margin: 72px auto 0;
    padding: 0;
}
.mhp-highlight__label {
    display: inline-block;
    font-family: var(--mhp-font-subtitle) !important;
    font-size: 12px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--mhp-subtitle);
    border: 1px solid #d5d0ca;
    padding: 14px 28px;
    margin: 0 0 40px;
}
.mhp-highlight__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}
.mhp-highlight__cat {
    display: inline-block;
    font-family: var(--mhp-font-subtitle) !important;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--mhp-subtitle);
    margin: 0 0 24px;
}
.mhp-highlight__title {
    font-size: var(--mhp-size-h2, clamp(24px, 2.8vw, 36px));
    font-weight: var(--mhp-w-h2);
    color: var(--mhp-accent);
    margin: 0 0 6px;
    line-height: 1.3;
}
.mhp-highlight__title a { color: inherit; text-decoration: none; }
.mhp-highlight__title a:hover { text-decoration: underline; text-underline-offset: 3px; }

.mhp-highlight__location {
    display: block;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--mhp-subtitle);
    margin: 0 0 28px;
}
.mhp-highlight__quote {
    margin: 0 0 24px;
    border: none;
    padding: 0;
}
.mhp-highlight__quote p {
    font-size: 16px;
    font-style: italic;
    line-height: 1.75;
    color: var(--mhp-body);
    margin: 0 0 16px;
}
.mhp-highlight__quote p:last-child { margin-bottom: 0; }

.mhp-highlight__author { margin-top: 20px; }
.mhp-highlight__author-name { display: block; font-size: 15px; color: var(--mhp-body); }
.mhp-highlight__author-loc  { display: block; font-size: 14px; color: var(--mhp-subtitle); margin-top: 2px; }

.mhp-highlight__image { overflow: hidden; }
.mhp-highlight__img { width: 100%; height: auto; display: block; }

/* ================================================================
   SINGLE PROJECT
   Layout: badge → title → location → [testimonial | image] → gallery → content
   Matches the original design: 2-column hero, then gallery, then text
   ================================================================ */
.mhp-single {
    max-width: var(--global-content-width, 1200px);
    margin: 0 auto;
    padding: 0 24px 80px;
}

/* Header: badge, title, location */
.mhp-single__header {
    padding: 48px 0 32px;
}
.mhp-single__cat {
    display: inline-block;
    font-family: var(--mhp-font-subtitle) !important;
    font-size: 11px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--mhp-subtitle);
    border: 1px solid #d5d0ca;
    padding: 12px 24px;
    margin: 0 0 28px;
}
.mhp-single__title {
    font-size: var(--mhp-size-h1, clamp(24px, 2.5vw, 32px));
    font-weight: var(--mhp-w-h1);
    color: var(--mhp-page-title, var(--mhp-heading));
    margin: 0 0 8px;
    line-height: 1.2;
}
.mhp-single__location {
    display: block;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--mhp-subtitle);
    margin: 0;
}

/* Hero: 2-column — testimonial left (wider), image right (narrower) */
.mhp-single__hero {
    display: grid;
    grid-template-columns: 5fr 4fr;
    gap: 48px;
    align-items: start;
    margin: 0 0 48px;
}
.mhp-single__hero-text {}
.mhp-single__hero-quote {
    border: none;
    margin: 0 0 24px;
    padding: 0;
}
.mhp-single__hero-quote p {
    font-size: 16px;
    font-style: italic;
    line-height: 1.75;
    color: var(--mhp-body);
    margin: 0 0 16px;
}
.mhp-single__hero-quote p:last-child { margin-bottom: 0; }

.mhp-single__hero-author { margin-top: 20px; }
.mhp-single__hero-author-name { display: block; font-size: 15px; color: var(--mhp-body); }
.mhp-single__hero-author-loc  { display: block; font-size: 14px; color: var(--mhp-subtitle); margin-top: 2px; }

.mhp-single__hero-image { overflow: hidden; }
.mhp-single__hero-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Gallery: full-viewport-width background, controlled image height */
.mhp-single__gallery-wrap {
    background: var(--mhp-bg-light, #FAF8F5);
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    padding: 48px calc(50vw - 50%);
    margin-bottom: 56px;
}
.mhp-single__gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-width: var(--global-content-width, 1200px);
    margin: 0 auto;
}
.mhp-single__gallery-item {
    overflow: hidden;
    position: relative;
    padding-top: var(--mhp-gallery-ratio, 75%);
    cursor: pointer;
}
.mhp-single__gallery-item img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}
.mhp-single__gallery-item:hover img { transform: scale(1.03); }

/* First gallery image spans 2 columns */
.mhp-single__gallery-item:first-child {
    grid-column: span 2;
}

/* ── Lightbox ──────────────────────────────────────── */
.mhp-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0,0,0,.92);
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}
.mhp-lightbox.is-open { display: flex; }
.mhp-lightbox__img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 2px;
    animation: mhpLbIn .25s ease;
}
@keyframes mhpLbIn {
    from { opacity: 0; transform: scale(.95); }
    to   { opacity: 1; transform: scale(1); }
}
.mhp-lightbox__close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    padding: 8px;
    opacity: .8;
    transition: opacity .2s;
}
.mhp-lightbox__close:hover { opacity: 1; }
.mhp-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    padding: 16px;
    opacity: .7;
    transition: opacity .2s;
}
.mhp-lightbox__nav:hover { opacity: 1; }
.mhp-lightbox__prev { left: 12px; }
.mhp-lightbox__next { right: 12px; }

/* Content section (from WP editor) — styled like "CRAFTED TO YOUR VISION" */
.mhp-single__content {
    max-width: 780px;
    margin: 0 0 48px;
}
.mhp-single__content h2,
.mhp-single__content h3 {
    font-size: 14px;
    font-weight: var(--mhp-w-subtitle);
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--mhp-subtitle);
    margin: 0 0 16px;
}
.mhp-single__content hr {
    border: none;
    border-top: 1px solid #d5d0ca;
    max-width: 520px;
    margin: 0 0 28px;
}
.mhp-single__content p {
    font-size: var(--mhp-size-body, 16px);
    line-height: 1.8;
    color: var(--mhp-body);
    margin: 0 0 18px;
}
.mhp-single__content a {
    color: var(--mhp-body);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.mhp-single__content a:hover { color: var(--mhp-accent); }

/* Back button */
.mhp-single__back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--mhp-font-btn) !important;
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--mhp-btn-text);
    border: 1px solid var(--mhp-btn-border);
    padding: 14px 32px;
    transition: background .25s, color .25s;
}
.mhp-single__back:hover {
    background: var(--mhp-heading);
    color: #fff;
    border-color: var(--mhp-heading);
}

/* ================================================================
   ANIMATION
   ================================================================ */
.mhp-card--new { animation: mhpFadeUp .45s ease both; }
@keyframes mhpFadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1024px) {
    .mhp-grid--4 { grid-template-columns: repeat(3, 1fr); }
    .mhp-highlight__inner { gap: 32px; }
    .mhp-single__gallery { grid-template-columns: repeat(2, 1fr); }
    .mhp-single__gallery-item:first-child { grid-column: span 2; }
}
@media (max-width: 768px) {
    .mhp-grid--3, .mhp-grid--4 { grid-template-columns: repeat(2, 1fr); }
    .mhp-grid { gap: 20px; }
    .mhp-page__header { padding: 40px 20px 36px; }
    .mhp-home__footer, .mhp-page__load-more { text-align: center; }

    .mhp-highlight__inner { grid-template-columns: 1fr; gap: 28px; }
    .mhp-highlight__image { order: -1; }
    .mhp-highlight { margin-top: 48px; }
    .mhp-highlight__label { margin-bottom: 28px; }

    .mhp-single__hero { grid-template-columns: 1fr; gap: 32px; }
    .mhp-single__hero-image { order: -1; }
    .mhp-single__gallery { grid-template-columns: repeat(2, 1fr); }
    .mhp-single__gallery-item:first-child { grid-column: span 1; }
    .mhp-single__gallery-wrap { padding-top: 32px; padding-bottom: 32px; margin-bottom: 36px; }
    .mhp-single__content { margin-bottom: 36px; }
    .mhp-single__content p { font-size: 15px; }
    .mhp-single__hero-quote p { font-size: 15px; }
    .mhp-single__hero-author-name { font-size: 14px; }
    .mhp-single__hero-author-loc { font-size: 13px; }
}
@media (max-width: 480px) {
    .mhp-grid--3, .mhp-grid--4, .mhp-grid--2 { grid-template-columns: 1fr; }
    .mhp-grid { gap: 28px; }
    .mhp-card__body { padding-top: 14px; }
    .mhp-btn, .mhp-single__back { width: 100%; text-align: center; padding: 14px 24px; }
    .mhp-single__gallery { grid-template-columns: 1fr; }
}

/* ================================================================
   A11Y
   ================================================================ */
@media (prefers-reduced-motion: reduce) {
    .mhp-card__image-wrap .mhp-card__img,
    .mhp-single__gallery-item img { transition: none; }
    .mhp-card--new { animation: none; }
}
.mhp-card__link:focus-visible,
.mhp-card__more:focus-visible,
.mhp-btn:focus-visible,
.mhp-page__link:focus-visible,
.mhp-highlight__title a:focus-visible,
.mhp-single__back:focus-visible {
    outline: 2px solid var(--mhp-accent);
    outline-offset: 3px;
}

/* ================================================================
   PRODUCTS — [mhp_products_home] card grid
   ================================================================ */
.mhpp-home {
    max-width: var(--mhp-max-width, 1320px);
    margin: 0 auto;
    padding: 0;
}
.mhpp-grid {
    display: grid;
    gap: var(--mhp-gap, 24px);
}
.mhpp-grid--3 { grid-template-columns: repeat(3, 1fr); }
.mhpp-grid--4 { grid-template-columns: repeat(4, 1fr); }
.mhpp-grid--2 { grid-template-columns: repeat(2, 1fr); }

.mhpp-card__link {
    display: block;
    text-decoration: none;

    overflow: hidden;
}
.mhpp-card__image-wrap {
    position: relative;
    width: 100%;
    padding-top: var(--mhp-img-ratio, 133.33%);
    overflow: hidden;
    background: #e8e4df;

}
.mhpp-card__image-wrap .mhpp-card__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .5s cubic-bezier(.25,.46,.45,.94);
    will-change: transform;
}
.mhpp-card__link:hover .mhpp-card__img,
.mhpp-card__link:focus .mhpp-card__img {
    transform: scale(1.05);
}
.mhpp-card__label {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    color: var(--mhp-heading, #2C1215);
    font-family: var(--mhp-font-subtitle) !important;
    font-weight: var(--mhp-w-subtitle);
    font-size: 11px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    padding: 14px 28px;
    white-space: nowrap;
    line-height: 1;
}

@media (max-width: 768px) {
    .mhpp-grid--3, .mhpp-grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .mhpp-grid--3, .mhpp-grid--4, .mhpp-grid--2 { grid-template-columns: 1fr; }
}

/* ================================================================
   PRODUCT SINGLE — hero (image LEFT, content RIGHT), gallery filters
   ================================================================ */

/* Hero: 2-column — image left, content right */
.mhpp-hero {
    display: grid;
    grid-template-columns: 4fr 5fr;
    gap: 48px;
    align-items: start;
    max-width: var(--global-content-width, 1200px);
    margin: 0 auto;
    padding: 48px 24px 48px;
}
.mhpp-hero__image { overflow: hidden; }
.mhpp-hero__image img {
    width: 100%;
    height: auto;
    display: block;
}
.mhpp-hero__title {
    font-style: italic !important;
    font-weight: var(--mhp-w-h1) !important;
}
.mhpp-hero__content .mhp-single__cat { margin-bottom: 20px; }
.mhpp-hero__content .mhp-single__location { margin-bottom: 24px; }

/* No separate header for products — it's inside hero */
.mhpp-single > .mhp-single__header { display: none; }

.mhpp-hero-caption {
    display: block;
    font-size: 13px;
    font-style: italic;
    color: var(--mhp-subtitle, #888);
    margin-top: 10px;
}

/* Filter buttons — inside gallery bg, separated, Kadence-proof */
.mhpp-filters {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr)) !important;
    gap: 12px !important;
    max-width: var(--global-content-width, 1200px) !important;
    margin: 0 auto !important;
    padding: 32px 0 28px !important;
}
.mhp-single__gallery-wrap .mhpp-filter-btn,
.mhpp-filter-btn.mhpp-filter-btn {
    font-family: var(--mhp-font-subtitle) !important;
    font-weight: var(--mhp-w-subtitle) !important;
    font-size: 11px !important;
    letter-spacing: 2px !important;
    text-transform: uppercase !important;
    border: 1px solid #d5d0ca !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--mhp-body, #555) !important;
    padding: 16px 12px !important;
    cursor: pointer !important;
    transition: background .2s !important;
    line-height: 1 !important;
    outline: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
    margin: 0 !important;
}
.mhp-single__gallery-wrap .mhpp-filter-btn:hover,
.mhpp-filter-btn.mhpp-filter-btn:hover {
    background: rgba(0,0,0,.05) !important;
    color: var(--mhp-body, #555) !important;
    border-color: #d5d0ca !important;
}
.mhp-single__gallery-wrap .mhpp-filter-btn.is-active,
.mhpp-filter-btn.mhpp-filter-btn.is-active {
    background: rgba(0,0,0,.07) !important;
    color: var(--mhp-body, #555) !important;
    border-color: #bbb !important;
}

/* Hidden gallery items */
.mhpp-gallery-item.mhpp-hidden {
    display: none;
}
.mhpp-gallery-item.mhpp-overflow {
    display: none;
}

/* Gallery ratio modes — override default padding-top */
.mhpp-gallery--portrait .mhp-single__gallery-item { padding-top: 133.33%; }
.mhpp-gallery--landscape .mhp-single__gallery-item { padding-top: 75%; }
.mhpp-gallery--square .mhp-single__gallery-item { padding-top: 100%; }

/* Masonry: no forced ratio, natural image heights */
.mhpp-gallery--masonry {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: auto;
}
.mhpp-gallery--masonry .mhp-single__gallery-item {
    padding-top: 0;
    position: relative;
    overflow: hidden;
}
.mhpp-gallery--masonry .mhp-single__gallery-item img {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Justified: same height per row, widths fill row based on aspect ratio */
.mhpp-gallery--justified {
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px;
    grid-template-columns: none;
}
.mhpp-gallery--justified .mhp-single__gallery-item {
    flex-grow: var(--ar, 1);
    flex-basis: calc(var(--ar, 1) * var(--gal-h, 280px));
    height: var(--gal-h, 280px);
    padding-top: 0;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
.mhpp-gallery--justified .mhp-single__gallery-item:first-child {
    grid-column: auto;
}
.mhpp-gallery--justified .mhp-single__gallery-item img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
@media (max-width: 768px) {
    .mhpp-gallery--justified .mhp-single__gallery-item {
        height: calc(var(--gal-h, 280px) * 0.7);
        flex-basis: calc(var(--ar, 1) * var(--gal-h, 280px) * 0.7);
    }
}
@media (max-width: 480px) {
    .mhpp-gallery--justified .mhp-single__gallery-item {
        flex-basis: 100%;
        height: calc(var(--gal-h, 280px) * 0.6);
    }
}

/* Gallery grid for products — no first-child spanning */
.mhpp-single .mhp-single__gallery {
    grid-template-columns: repeat(3, 1fr);
}
.mhpp-single .mhp-single__gallery-item:first-child {
    grid-column: span 1;
}

/* ================================================================
   CAROUSEL LIGHTBOX (Amber-style)
   ================================================================ */
.mhp-carousel-lb {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(255,255,255,.97);
    flex-direction: column;
    align-items: center;
}
.mhp-carousel-lb.is-open {
    display: flex;
}
.mhp-carousel-lb__title {
    padding: 28px 60px 16px;
    font-family: var(--mhp-font-h1) !important;
    font-weight: var(--mhp-w-h1);
    font-size: 18px;
    font-style: italic;
    color: var(--mhp-heading, #2C1215);
    text-align: center;
    flex-shrink: 0;
}
.mhp-carousel-lb__close {
    position: absolute;
    top: 16px;
    right: 24px;
    background: none;
    border: none;
    font-size: 32px;
    color: var(--mhp-body, #555);
    cursor: pointer;
    line-height: 1;
    padding: 8px;
    z-index: 10;
    opacity: .6;
    transition: opacity .2s;
}
.mhp-carousel-lb__close:hover { opacity: 1; }

.mhp-carousel-lb__track {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 0;
    transition: transform .45s cubic-bezier(.4,0,.2,1);
    will-change: transform;
}
.mhp-carousel-lb__slide {
    flex-shrink: 0;
    height: 72vh;
    opacity: .2;
    transition: opacity .35s ease;
    overflow: hidden;
}
.mhp-carousel-lb__slide.is-active {
    opacity: 1;
}
.mhp-carousel-lb__slide img {
    height: 100%;
    width: auto;
    display: block;
    object-fit: contain;
}

.mhp-carousel-lb__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.85);
    border: 1px solid #ddd;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 28px;
    color: var(--mhp-body, #555);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background .2s, box-shadow .2s;
    line-height: 1;
    padding: 0 0 2px;
}
.mhp-carousel-lb__nav:hover {
    background: #f0f0f0;
    border-color: #ccc;
}
.mhp-carousel-lb__prev { left: 16px; }
.mhp-carousel-lb__next { right: 16px; }

.mhp-carousel-lb__back {
    padding: 16px 24px 28px;
    font-family: var(--mhp-font-btn) !important;
    font-weight: var(--mhp-w-btn);
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--mhp-body, #555);
    text-decoration: none;
    flex-shrink: 0;
    transition: color .2s;
}
.mhp-carousel-lb__back:hover {
    color: var(--mhp-accent, #4A2029);
}

@media (max-width: 768px) {
    .mhp-carousel-lb__slide { height: 50vh; }
    .mhp-carousel-lb__track { gap: 8px; }
    .mhp-carousel-lb__nav { width: 36px; height: 36px; font-size: 22px; }
    .mhp-carousel-lb__prev { left: 4px; }
    .mhp-carousel-lb__next { right: 4px; }
    .mhp-carousel-lb__title { font-size: 15px; padding: 20px 48px 12px; }
    .mhp-carousel-lb__back { font-size: 11px; padding: 12px 16px 20px; }
    .mhp-carousel-lb__close { top: 12px; right: 12px; font-size: 28px; }
}

/* ================================================================
   PRODUCTS — MOBILE (must be AFTER all desktop rules)
   ================================================================ */
@media (max-width: 768px) {
    /* Break hero out of Kadence container, keep small consistent margin */
    .mhpp-hero {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
        padding: 0 !important;
        margin-left: calc(-50vw + 50%) !important;
        margin-right: calc(-50vw + 50%) !important;
        width: 100vw !important;
        max-width: 100vw !important;
    }
    .mhpp-hero__image { order: -1; padding: 0 16px; }
    .mhpp-hero__image img { border-radius: 0; width: 100%; }
    .mhpp-hero__content { padding: 20px 16px 24px; }
    .mhpp-hero-caption { font-size: 12px; padding: 8px 16px 0; }
    .mhpp-hero__title { font-size: clamp(22px, 6vw, 30px) !important; }

    /* Gallery wrap — break out + match hero side margins */
    .mhpp-single .mhp-single__gallery-wrap {
        margin-left: calc(-50vw + 50%) !important;
        margin-right: calc(-50vw + 50%) !important;
        padding: 28px 16px !important;
        margin-bottom: 32px !important;
    }
    .mhpp-single .mhp-single__gallery {
        gap: 10px !important;
    }

    /* Filters — stack, match margins */
    .mhpp-filters {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        padding: 0 0 20px !important;
    }

    /* Product gallery 2 cols on tablet */
    .mhpp-single .mhp-single__gallery {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .mhpp-single .mhp-single__gallery-item:first-child {
        grid-column: span 1 !important;
    }

    /* Products homepage grid */
    .mhpp-grid--3, .mhpp-grid--4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    /* Single column gallery on phone */
    .mhpp-single .mhp-single__gallery {
        grid-template-columns: 1fr !important;
    }

    .mhp-single__cat {
        font-size: 10px !important;
        padding: 10px 16px !important;
    }

    /* Products homepage grid */
    .mhpp-grid--3, .mhpp-grid--4, .mhpp-grid--2 {
        grid-template-columns: 1fr !important;
    }
    .mhpp-card__label {
        font-size: 10px;
        padding: 10px 20px;
        letter-spacing: 2px;
        bottom: 16px;
    }
}
