/**
 * Mixed Product Grid — Styles
 * Scoped to .mpg-wrap to avoid conflicts with live filter system.
 */

/* ─────────────────────────────────────────────────────────────────────────────
   Layout wrapper
───────────────────────────────────────────────────────────────────────────── */

.mpg-wrap {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    width: 100%;
    box-sizing: border-box;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Product sorting container
───────────────────────────────────────────────────────────────────────────── */

.product-sorting-container {
    display: flex;
    width: fit-content;
    align-items: center;
    gap: 10px;
}

.product-sorting-container label {
    width: fit-content;
    white-space: nowrap;
    width: fit-content;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 600;
    color: #000c5e;
    margin: 0;
}

.product-sort-select {
    flex: 1;
    max-width: 250px;
    padding: 10px 16px;
    border: 1px solid rgba(0, 0, 0, .1);
    border-radius: 8px;
    background-color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #000c5e;
    cursor: pointer;
    transition: border-color .2s ease;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Sidebar
───────────────────────────────────────────────────────────────────────────── */

.mpg-wrap .mpg-sidebar {
    width: 25%;
    min-width: 220px;
    border-radius: 8px;
    overflow: hidden;
}

.mpg-sidebar span.ui-accordion-header-icon.ui-icon.ui-icon-triangle-1-e, 
.mpg-sidebar span.ui-accordion-header-icon.ui-icon.ui-icon-triangle-1-s {
    display: none;
}

.mpg-sidebar .ui-accordion-content, .mpg-filter-flyout .ui-accordion-content {
    padding: 0;
    border: 0;
}

.mpg-filter-flyout span.ui-accordion-header-icon.ui-icon.ui-icon-triangle-1-e,
.mpg-filter-flyout span.ui-accordion-header-icon.ui-icon.ui-icon-triangle-1-s {
    display: none;
}



/* ─────────────────────────────────────────────────────────────────────────────
   Results column
───────────────────────────────────────────────────────────────────────────── */

.mpg-results-col {
    width: 75%;
    min-width: 0;
}

.mpg-results {
    width: 100%;
}

.mpg-sort-bar.desktop-sort-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Product grid (reuses .filtered-active classes from live filter)
───────────────────────────────────────────────────────────────────────────── */

.mpg-wrap .mpg-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Cards — shared base
───────────────────────────────────────────────────────────────────────────── */

.mpg-wrap .mpg-card {
    background: #fff;
    border-radius: 16px 16px 8px 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease;
    border: solid 1px #f3f3f3;
    box-shadow: 0px 0px 11px 0px rgba(0, 0, 0, 0.06);
}

.mpg-wrap .mpg-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.mpg-wrap .mpg-card-image-link {
    display: block;
    text-decoration: none;
}

.mpg-wrap .mpg-card .product-hover-image-wrapper {
    position: relative;
    overflow: hidden;
    display: block;
    width: 100%;
    background: transparent;
}

.mpg-wrap .mpg-card .product-hover-image-wrapper img {
    display: block;
    width: 100%;
    height: 430px;
    object-fit: contain;
    background: transparent;
    transition: opacity 0.4s ease;
    border-radius: 16px 16px 0 0;
}

.mpg-wrap .mpg-card .product-main-image {
    position: relative;
    opacity: 1;
    z-index: 1;
}

.mpg-wrap .mpg-card .product-hover-image {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    z-index: 2;
    object-fit: cover !important;
    object-position: top;
}

.mpg-wrap .mpg-card .product-hover-image-wrapper:has(.product-hover-image):hover .product-main-image {
    opacity: 0;
}

.mpg-wrap .mpg-card .product-hover-image-wrapper:has(.product-hover-image):hover .product-hover-image {
    opacity: 1;
}

/* Tag overlay */
.mpg-wrap .mpg-card .product-tag-overlay {
    position: absolute;
    z-index: 3;
    text-transform: uppercase;
    display: flex;
    font-size: 16px;
    font-weight: 500;
}

.mpg-wrap .mpg-card .product-tag-sale,
.mpg-wrap .mpg-card .product-tag-clearance {
    background: #000C5E;
    color: #fff;
    left: 0;
    top: 15px;
    border-radius: 0 99px 99px 0;
    padding: 8px 16px;
}

.mpg-wrap .mpg-card .product-tag-new,
.mpg-wrap .mpg-card .product-tag-comingsoon {
    rotate: 45deg;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 10px;
    background: #EFFDEF;
}

.mpg-wrap .mpg-card .product-tag-new {
    top: -55px;
    right: -55px;
    width: 110px;
    height: 110px;
}

.mpg-wrap .mpg-card .product-tag-comingsoon {
    top: -80px;
    right: -80px;
    text-align: center;
    width: 160px;
    height: 160px;
    font-size: 14px;
    line-height: 120%;
}

/* Card body */
.mpg-wrap .mpg-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    justify-content: flex-end;
}

.mpg-wrap .mpg-card-title {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #000C5E;
    text-decoration: none;
    line-height: 1.2;
    display: block;
}

.mpg-wrap .mpg-card-title:hover {
    text-decoration: underline;
}

.mpg-wrap .mpg-card-price {
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    color: #000c5e;
}

/* Colour swatches on product card */
.mpg-wrap .mpg-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 4px;
}

.mpg-wrap .product-color-swatch {
    display: inline-block;
    line-height: 0;
    text-decoration: none;
}

.mpg-wrap .color-circle {
    display: block;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #ddd;
    box-sizing: border-box;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Bundle card specifics
───────────────────────────────────────────────────────────────────────────── */

.mpg-wrap .mpg-bundle-badge {
    position: absolute;
    top: 12px;
    left: 0;
    background: #000C5E;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 0 99px 99px 0;
    z-index: 3;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mpg-wrap .mpg-original-price {
    text-decoration: line-through;
    color: #000c5e;
    font-weight: 600;
    font-size: 20px;
}

.mpg-wrap .mpg-bundle-price {
    color: #d9000e;
    font-weight: 700;
}

/* ─────────────────────────────────────────────────────────────────────────────
   No results
───────────────────────────────────────────────────────────────────────────── */

.mpg-no-results {
    font-family: 'Poppins', sans-serif;
    color: #666;
    padding: 40px 0;
    text-align: center;
    grid-column: 1 / -1;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Load More button
───────────────────────────────────────────────────────────────────────────── */

.mpg-wrap .load-more-style {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 0 8px;
    gap: 8px;
}

.mpg-wrap .mpg-load-more {
    background: #000c5e;
    color: #fff;
    border: none;
    border-radius: 99px;
    padding: 12px 24px;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background .2s ease;
}

.mpg-wrap .mpg-load-more:hover {
    background: #00149B;
}

.mpg-wrap .mpg-load-more:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Skeleton loader
───────────────────────────────────────────────────────────────────────────── */

.mpg-wrap .skeleton-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
}

.mpg-wrap .skeleton-card {
    background: #f0f7ff;
    border-radius: 8px;
    overflow: hidden;
    animation: mpg-skeleton-pulse 1.5s ease-in-out infinite;
}

.mpg-wrap .skeleton-image {
    width: 100%;
    padding-top: 0;
    height: 430px;
    background: linear-gradient(90deg, #d9ebff 25%, #e6f2ff 50%, #d9ebff 75%);
    background-size: 200% 100%;
    animation: mpg-skeleton-shimmer 1.5s ease-in-out infinite;
}

.mpg-wrap .skeleton-content { padding: 16px; }

.mpg-wrap .skeleton-title,
.mpg-wrap .skeleton-price,
.mpg-wrap .skeleton-button {
    background: linear-gradient(90deg, #d9ebff 25%, #e6f2ff 50%, #d9ebff 75%);
    background-size: 200% 100%;
    animation: mpg-skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
    margin-bottom: 12px;
}

.mpg-wrap .skeleton-title  { height: 20px; width: 80%; }
.mpg-wrap .skeleton-price  { height: 16px; width: 40%; }
.mpg-wrap .skeleton-button { height: 40px; width: 100%; margin-bottom: 0; }

@keyframes mpg-skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes mpg-skeleton-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.7; }
}

/* ─────────────────────────────────────────────────────────────────────────────
   Filter sidebar (reuses live system class names)
───────────────────────────────────────────────────────────────────────────── */

.mpg-wrap .filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #F3F3F3;
}

.mpg-wrap .filter-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
}

.mpg-wrap .filter-heading-container {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 16px !important;
    background: transparent;
    border-top: 1px solid #F3F3F3;
    border-bottom: 1px solid #F3F3F3;
    border-left: none;
    border-right: none;
    margin: 0 !important;
    cursor: pointer;
}

.mpg-wrap .filter-heading-container h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
}

.mpg-wrap .filter-heading-container img { width: 14px; }

.mpg-wrap .filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.mpg-wrap .filter-list li {
    cursor: pointer;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    transition: background .15s;
}

.mpg-wrap .filter-list li:hover:not(.disabled) {
    background: #E6F2FF;
}

.mpg-wrap .filter-list li.selected {
    background: #E6F2FF !important;
}

.mpg-wrap .filter-list li.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Colour swatches in filter */
.mpg-wrap .color-swatch-list {
    display: flex !important;
    flex-wrap: wrap !important;
    flex-direction: row !important;
    gap: 5px !important;
    padding: 15px !important;
}

.mpg-wrap .color-swatch-list li {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    padding: 5px !important;
    margin: 0 !important;
    border-radius: 4px !important;
    width: 60px !important;
}

.mpg-wrap .color-swatch-list .color-swatch {
    display: block !important;
    width: 30px !important;
    height: 30px !important;
    border-radius: 50% !important;
    border: 1px solid #ddd !important;
    margin-bottom: 5px !important;
    box-sizing: border-box !important;
}

.mpg-wrap .color-swatch-list .color-name {
    font-size: 11px !important;
    text-align: center !important;
    line-height: 1.2 !important;
    max-width: 60px !important;
    overflow: hidden !important;
    display: block !important;
    font-family: 'Poppins', sans-serif;
}

.mpg-wrap .color-swatch-list li.selected .color-swatch {
    box-shadow: 0 0 0 2px #000C5E;
}

/* Price filter */
.mpg-wrap .price-filter-container { padding: 20px; }

.mpg-wrap .price-range-slider {
    margin: 10px 0 20px;
    height: 6px;
    background: #E0E0E0;
    border-radius: 3px;
}

.mpg-wrap .price-range-values {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #000C5E;
}

/* Clear all button */
.mpg-wrap .mpg-clear-all {
    font-size: 10px;
    font-weight: 600;
    background: transparent;
    border: none;
    color: #000C5E;
    cursor: pointer;
    text-decoration: underline;
    padding: 0px;
}

/* Discounted price red */
.mpg-wrap .mpg-card-price ins,
.mpg-wrap .mpg-card-price ins .woocommerce-Price-amount {
    color: #D50000;
    text-decoration: none;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Mobile bar & flyout
───────────────────────────────────────────────────────────────────────────── */

.mpg-wrap .mpg-mobile-bar {
    display: none;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    width: 100%;
    margin-bottom: 16px;
}

.mpg-wrap .mpg-open-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: #000C5E;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    padding: 0;
}

.mpg-flyout-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 10004;
}

.mpg-flyout-overlay.active { display: block; }

.mpg-filter-flyout {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 350px;
    height: 100vh;
    background: #fff;
    z-index: 10005;
    box-shadow: -2px 0 8px rgba(0,0,0,0.2);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
    flex-direction: column;
}

.mpg-filter-flyout.active {
    display: flex !important;
    transform: translateX(0);
}

.mpg-close-filter {
    display: flex;
    justify-content: flex-end;
    font-size: 30px;
    background: none;
    border: none;
    cursor: pointer;
    color: #000;
    padding: 0 0 20px;
    margin-left: auto;
}

/* ─────────────────────────────────────────────────────────────────────────────
   noUiSlider overrides (scoped)
───────────────────────────────────────────────────────────────────────────── */

.mpg-wrap .noUi-target {
    background: #E0E0E0;
    border: none;
    box-shadow: none;
    border-radius: 3px;
    height: 6px;
}

.mpg-wrap .noUi-connect { background: #000C5E; }

.mpg-wrap .noUi-connects {
    border-radius: 3px;
    overflow: hidden;
}

.mpg-wrap .noUi-origin {
    position: absolute;
    z-index: 1;
    top: 0;
    right: 0;
    transform-origin: 0 0;
}

.mpg-wrap .noUi-horizontal .noUi-origin {
    height: 0;
}

.mpg-wrap .noUi-handle {
    position: absolute;
    z-index: 2;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #000C5E;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    right: -11px;
    top: -8px;
    cursor: pointer;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.mpg-wrap .noUi-handle:before,
.mpg-wrap .noUi-handle:after { display: none; }

.mpg-sidebar.desktop-filter {
    position: sticky;
    top: 115px;
    align-self: flex-start;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Responsive
───────────────────────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .mpg-wrap {
        flex-direction: column;
    }

    .mpg-wrap .mpg-sidebar {
        display: none !important;
    }

    .mpg-wrap .mpg-mobile-bar {
        display: flex !important;
    }

    .mpg-wrap .mpg-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .mpg-wrap .skeleton-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .mpg-wrap .mpg-results-col {
        width: 100%;
    }

    .mpg-sort-bar.desktop-sort-bar {
        display: none;
    }
}

@media (max-width: 767px) {
    .mpg-wrap .mpg-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .mpg-wrap .skeleton-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .mpg-wrap .mpg-card .product-hover-image-wrapper img {
        height: 200px;
    }

    .mpg-filter-flyout {
        max-width: 85%;
    }
}

