/* CodeMola Category Showcase — luxury editorial tiles */

.cmshow {
    /* Base: fill the parent. Full-bleed offsets are computed by JS
       (data-cmshow-full) so any Elementor ancestor layout works. */
    position: relative;
    width: 100%;
    margin: 48px 0;
    padding: 0;
}
/* Un-clip Elementor ancestors so the JS breakout isn't cut off. */
.elementor-widget-shortcode:has(.cmshow),
.elementor-element:has(.cmshow),
.e-con:has(.cmshow),
.elementor-section:has(.cmshow) {
    overflow: visible !important;
}
.cmshow--boxed {
    width: auto;
    max-width: 1440px;
    margin: 48px auto;
    padding: 0 16px;
}
.cmshow__title {
    font-size: 26px;
    font-weight: 400;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-align: center;
    margin: 0 0 28px;
}
.cmshow__grid {
    display: grid;
    grid-template-columns: repeat(var(--cmshow-cols, 4), 1fr);
    gap: 14px;
    padding: 0 14px;
}
.cmshow--boxed .cmshow__grid { padding: 0; }

/* Tile */
.cmshow__tile {
    position: relative;
    display: block;
    height: var(--cmshow-h, 520px);
    overflow: hidden;
    text-decoration: none;
    background: #111;
    opacity: 0;
    transform: translateY(18px);
    animation: cmshow-in .7s ease forwards;
    animation-delay: var(--cmshow-delay, 0ms);
}
@keyframes cmshow-in {
    to { opacity: 1; transform: translateY(0); }
}
.cmshow__tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform .8s cubic-bezier(.2, .6, .2, 1), filter .5s ease;
    display: block;
}
.cmshow__tile:hover img {
    transform: scale(1.06);
    filter: saturate(1.08);
}

/* Bottom shade for label legibility */
.cmshow__shade {
    position: absolute;
    inset: auto 0 0 0;
    height: 45%;
    background: linear-gradient(to top, rgba(10, 8, 6, .72), transparent);
    transition: height .4s ease;
    pointer-events: none;
}
.cmshow__tile:hover .cmshow__shade {
    height: 62%;
}

/* Category label — ivory plate, gold rule, echoes the reference design */
.cmshow__label {
    position: absolute;
    right: 0;
    bottom: 26px;
    background: #faf7f1;
    color: #1a1a1a;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    padding: 10px 20px 10px 26px;
    box-shadow: -3px 0 0 #c9a35c;
    transition: transform .35s ease;
}
.cmshow__tile:hover .cmshow__label {
    transform: translateX(-6px);
}

/* Hover CTA slides up from beneath the label */
.cmshow__cta {
    position: absolute;
    left: 22px;
    bottom: 26px;
    color: #faf7f1;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .35s ease, transform .35s ease;
}
.cmshow__cta i {
    font-style: normal;
    color: #c9a35c;
    transition: transform .3s ease;
    display: inline-block;
}
.cmshow__tile:hover .cmshow__cta {
    opacity: 1;
    transform: translateY(0);
}
.cmshow__tile:hover .cmshow__cta i {
    transform: translateX(4px);
}

/* Piece count — quiet metadata top-left, revealed on hover */
.cmshow__count {
    position: absolute;
    top: 18px;
    left: 20px;
    color: #faf7f1;
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    background: rgba(10, 8, 6, .45);
    padding: 5px 12px;
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity .35s ease;
}
.cmshow__tile:hover .cmshow__count {
    opacity: 1;
}

/* ---------------- Just In ---------------- */
.cmshow-justin {
    max-width: 1440px;
    margin: 56px auto;
    padding: 0 16px;
}
.cmshow-justin__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}
.cmshow-justin__title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0;
    position: relative;
    padding-bottom: 8px;
}
.cmshow-justin__title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 46px;
    height: 3px;
    background: #c9a35c;
}
.cmshow-justin__all {
    font-size: 12px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-decoration: none;
    color: #8a2b3a;
    white-space: nowrap;
}
.cmshow-justin__all:hover { color: #c9a35c; }

.cmshow-justin__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}
.cmshow-justin__card {
    display: block;
    text-decoration: none;
    color: inherit;
}
.cmshow-justin__imgwrap {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    background: #f4f1ea;
}
.cmshow-justin__imgwrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform .7s cubic-bezier(.2, .6, .2, 1);
    display: block;
}
.cmshow-justin__card:hover img {
    transform: scale(1.05);
}
.cmshow-justin__new {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #1a1a1a;
    color: #faf7f1;
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 4px 10px;
}
.cmshow-justin__name {
    display: block;
    margin-top: 12px;
    font-size: 14px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}
.cmshow-justin__price {
    display: block;
    margin-top: 4px;
    font-size: 14px;
    color: #8a2b3a;
    font-weight: 600;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 1024px) {
    .cmshow__grid { grid-template-columns: repeat(2, 1fr); }
    .cmshow { --cmshow-h: 420px; }
    .cmshow-justin__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    /* Mobile: 2×2 editorial grid matching the reference —
       tall portrait tiles, near-flush gaps, centered label plates. */
    .cmshow { margin: 18px 0; }
    .cmshow__grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: 0 8px;
    }
    .cmshow__tile {
        height: auto;
        aspect-ratio: 3 / 4.4;   /* tall portrait like the reference */
    }
    .cmshow__label {
        /* Centered plate at the bottom, not right-edge */
        left: 50%;
        right: auto;
        bottom: 14px;
        transform: translateX(-50%);
        font-size: 14px;
        letter-spacing: 1.8px;
        padding: 9px 16px;
        box-shadow: 0 3px 0 #c9a35c;   /* gold rule moves under the plate */
        white-space: nowrap;
        max-width: calc(100% - 20px);
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .cmshow__tile:hover .cmshow__label,
    .cmshow__tile:active .cmshow__label {
        transform: translateX(-50%);   /* no sideways slide on touch */
    }
    .cmshow__shade { height: 34%; }
    .cmshow__cta, .cmshow__count { display: none; }
    .cmshow__title { font-size: 19px; letter-spacing: 2px; margin-bottom: 16px; }

    /* Just In: 2-up with tighter type */
    .cmshow-justin { margin: 34px auto; }
    .cmshow-justin__grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .cmshow-justin__title { font-size: 20px; }
    .cmshow-justin__all { font-size: 11px; }
    .cmshow-justin__name { font-size: 12px; letter-spacing: 1px; }
    .cmshow-justin__price { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
    .cmshow__tile { animation: none; opacity: 1; transform: none; }
    .cmshow__tile img, .cmshow-justin__imgwrap img { transition: none; }
}
