/* ================================================================
   Custom Product Showcase v4.3 — style.css
   SALIENT THEME + WP BAKERY SPECIFIC FIXES
   ================================================================ */

/* ================================================================
   GRID — Nuclear override for Salient + WP Bakery
   The problem: .wpb_column forces children to width:100% which
   stacks grid items vertically. Fix: target grid children directly.
   ================================================================ */

/* ================================================================
   GRID — Flexbox based (more compatible with Salient + WP Bakery)
   Grid approach fails because theme parents override child widths.
   Flexbox with percentage widths on items is more reliable.
   ================================================================ */

.cps-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    float: none !important;
    clear: both !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Flexbox items — percentage widths control column count.
   Target the wrapper div that wraps each card.
   Salient/WP Bakery cannot override percentage flex items as easily. */
.cps-grid > div {
    box-sizing: border-box !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    flex-shrink: 0 !important;
    min-width: 0 !important;
}

/* Desktop 3 col */
@media screen and (min-width: 1025px) {
    .cps-grid > div {
        width: 33.3333% !important;
        max-width: 33.3333% !important;
        flex: 0 0 33.3333% !important;
    }
}

/* Tablet 2 col */
@media screen and (min-width: 768px) and (max-width: 1024px) {
    .cps-grid > div {
        width: 50% !important;
        max-width: 50% !important;
        flex: 0 0 50% !important;
    }
}

/* Mobile 1 col */
@media screen and (max-width: 767px) {
    .cps-grid > div {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
}


.cps-card {
    text-decoration: none !important;
    color: inherit !important;
    position: relative !important;
    overflow: hidden !important;
}

.cps-card:hover,
.cps-card:focus {
    text-decoration: none !important;
    color: inherit !important;
    outline: none;
}

/* Image container — tall portrait ratio */
.cps-card-img-wrap {
    position: relative !important;
    width: 100% !important;
    padding-bottom: 133% !important;
    overflow: hidden !important;
    background: rgba(128, 128, 128, 0.06);
    display: block !important;
    margin: 0 !important;
}

/* Main + hover images */
.cps-img-main,
.cps-img-hover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    transition: opacity 0.55s ease;
}

.cps-img-hover {
    opacity: 0;
}

.cps-card:hover .cps-img-hover { opacity: 1; }
.cps-card:hover .cps-img-main  { opacity: 0; }

.cps-no-img {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    opacity: 0.3;
}

/* Caption */
.cps-card-caption {
    padding: 16px 12px 24px;
    text-align: center;
}

.cps-card-title {
    display: block;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    line-height: 1.5;
    color: inherit;
    opacity: 0.85;
}

.cps-empty {
    padding: 50px 20px;
    text-align: center;
    opacity: 0.45;
    font-size: 14px;
}

.cps-msg {
    padding: 40px 20px;
    text-align: center;
    opacity: 0.45;
}

/* ================================================================
   PRODUCT DETAIL PAGE
   ================================================================ */

.cps-detail-wrap {
    width: 100%;
    padding: 0;
    box-sizing: border-box;
}

.cps-detail-back {
    padding: 20px 0 28px;
}

.cps-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    text-decoration: none;
    color: inherit;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.cps-back-btn:hover {
    opacity: 1;
    text-decoration: none;
    color: inherit;
}

.cps-detail-inner {
    display: grid !important;
    grid-template-columns: 55fr 45fr !important;
    gap: 60px !important;
    align-items: start;
    width: 100% !important;
}

/* Fix detail inner children too */
.cps-detail-inner > .cps-slider-col,
.cps-detail-inner > .cps-info-col {
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
}

/* ---- LEFT: Slider ---- */
.cps-slider-col { width: 100%; }

.cps-main-stage {
    position: relative;
    width: 100%;
    background: rgba(128, 128, 128, 0.04);
    overflow: hidden;
}

/* Fix: browser default figure margin causes dash artefacts top-left and bottom-left */
figure.cps-slide {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

.cps-slide { display: none; width: 100%; margin: 0; padding: 0; border: none; }
.cps-slide.is-active { display: block; }

.cps-slide img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 90vh;
    object-fit: contain;
    object-position: top center;
}

.cps-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.85);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s, opacity 0.2s;
    opacity: 0;
    color: #111;
}

.cps-main-stage:hover .cps-nav { opacity: 1; }
.cps-nav:hover { background: #fff; }
.cps-nav-prev { left: 0; }
.cps-nav-next { right: 0; }

.cps-thumb-strip {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
}

.cps-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 100px;
    padding: 0;
    border: 2px solid transparent;
    background: rgba(128,128,128,0.06);
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s, opacity 0.2s;
    opacity: 0.55;
}

.cps-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

.cps-thumb.is-active, .cps-thumb:hover {
    border-color: currentColor;
    opacity: 1;
}

.cps-no-img-lg {
    padding: 100px 20px;
    text-align: center;
    opacity: 0.3;
    font-size: 14px;
    border: 1px dashed rgba(128,128,128,0.25);
}

/* ---- RIGHT: Info ---- */
.cps-info-sticky {
    position: sticky;
    top: 40px;
    padding-top: 10px;
}

.cps-prod-title {
    font-size: clamp(22px, 3vw, 38px);
    font-weight: 300;
    line-height: 1.25;
    letter-spacing: 1px;
    margin: 0 0 24px;
    text-transform: uppercase;
    color: inherit;
}

.cps-prod-line {
    width: 32px;
    height: 1px;
    background: currentColor;
    opacity: 0.2;
    margin-bottom: 28px;
}

.cps-prod-desc {
    font-size: 14px;
    line-height: 1.9;
    opacity: 0.7;
    margin-bottom: 36px;
    font-weight: 300;
}

.cps-prod-feats {
    border-top: 1px solid rgba(128,128,128,0.12);
    padding-top: 28px;
}

.cps-feats-heading {
    font-size: 10px;
    letter-spacing: 3px;
    text-transform: uppercase;
    opacity: 0.4;
    margin: 0 0 16px;
    font-weight: 500;
}

.cps-prod-feats ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cps-prod-feats ul li {
    list-style: none !important;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    font-size: 13px;
    line-height: 1.6;
    opacity: 0.75;
    font-weight: 300;
}

.cps-prod-feats ul li::before {
    content: '' !important;
    display: inline-block !important;
    width: 5px !important;
    height: 5px !important;
    min-width: 5px !important;
    border: 1px solid currentColor !important;
    transform: rotate(45deg) !important;
    margin-top: 5px !important;
    opacity: 0.5 !important;
    flex-shrink: 0 !important;
    background: none !important;
}

/* ================================================================
   RESPONSIVE — detail page only (grid items handled above via flex)
   ================================================================ */

@media (max-width: 767px) {

    .cps-detail-inner {
        grid-template-columns: 1fr !important;
        gap: 28px !important;
    }

    .cps-info-sticky { position: static !important; }
    .cps-slide img   { max-height: 70vh; }
    .cps-thumb       { width: 64px; height: 80px; }
    .cps-prod-title  { font-size: 22px; }
    .cps-detail-back { padding: 16px 0 20px; }
}

@media (max-width: 400px) {
    .cps-card-title   { font-size: 10px; letter-spacing: 1.5px; }
    .cps-card-caption { padding: 12px 8px 18px; }
    .cps-thumb        { width: 54px; height: 68px; }
}
