/**
 * MMPVT Frontend Styles
 *
 * Uses CSS custom properties (set via wp_head when Design Mode = Custom)
 * with sensible fallback defaults for Design Mode = Default.
 */

/* -----------------------------------------------------------------
   Section Title
   ----------------------------------------------------------------- */
.mmpvt-section-title {
    margin: 1.5em 0 0.75em;
    font-size: 1.3em;
    text-align: center !important;
}

/* -----------------------------------------------------------------
   Outer Wrapper
   ----------------------------------------------------------------- */
.mmpvt_init_variation_table {
    margin: 0 0 2em;
    clear: both;
}

/* -----------------------------------------------------------------
   Scroll Container
   ----------------------------------------------------------------- */
.mmpvt_variant_table_block {
    position: relative;
}

.mmpvt_variant_table_block.mmpvt-scroll-x {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

.mmpvt_variant_table_block.mmpvt-scroll-y {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}

/* Sticky header in scroll mode */
.mmpvt_variant_table_block.mmpvt-scroll-y .mmpvt-table thead th {
    position: sticky !important;
    top: 0;
    z-index: 2 !important;
}

/* -----------------------------------------------------------------
   Table Base
   ----------------------------------------------------------------- */
.mmpvt-table {
    width: 100% !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    font-size: 14px;
    line-height: 1.4;
    border: var(--mmpvt-border-width, 1px) solid var(--mmpvt-border-color, #eee);
}

/* Fit Content width mode - wrapper sizes to table, centered in container */
.mmpvt_init_variation_table.mmpvt-width-fit {
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.mmpvt_init_variation_table.mmpvt-width-fit .mmpvt-table {
    width: 100%;
}

/* -----------------------------------------------------------------
   Table Header
   ----------------------------------------------------------------- */
.mmpvt-table thead th {
    background: var(--mmpvt-header-bg, #f8f8f8);
    color: var(--mmpvt-header-text, #6d6d6d);
    text-align: var(--mmpvt-header-align, left);
    padding: var(--mmpvt-header-padding, 12px);
    border-bottom: var(--mmpvt-border-width, 1px) solid var(--mmpvt-border-color, #eee);
    font-weight: 600;
    font-size: 14px;
    text-transform: none;
    white-space: nowrap !important;
    position: relative;
    vertical-align: middle !important;
}

/* -----------------------------------------------------------------
   Sortable Headers
   ----------------------------------------------------------------- */
.mmpvt-table thead th.mmpvt-sortable {
    cursor: pointer !important;
    user-select: none !important;
    padding-right: calc(var(--mmpvt-header-padding, 12px) + 16px);
}

.mmpvt-table thead th.mmpvt-sortable:hover {
    background: color-mix(in srgb, var(--mmpvt-header-bg, #f8f8f8), #000 5%);
}

/* Sort arrow indicator */
.mmpvt-sort-arrow {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    opacity: 0.3;
    border-bottom: 5px solid var(--mmpvt-header-arrow, #666);
}

th.mmpvt-sort-asc .mmpvt-sort-arrow {
    opacity: 1;
    border-bottom: 5px solid var(--mmpvt-header-arrow, #666);
    border-top: none;
}

th.mmpvt-sort-desc .mmpvt-sort-arrow {
    opacity: 1;
    border-top: 5px solid var(--mmpvt-header-arrow, #666);
    border-bottom: none;
}

/* -----------------------------------------------------------------
   Table Body
   ----------------------------------------------------------------- */
.mmpvt-table tbody td {
    padding: var(--mmpvt-body-padding, 12px);
    color: var(--mmpvt-body-text, #6d6d6d);
    text-align: var(--mmpvt-body-align, left);
    border-bottom: var(--mmpvt-border-width, 1px) solid var(--mmpvt-border-color, #eee);
    vertical-align: middle !important;
    line-height: 1.5;
}

/* Row striping */
.mmpvt-table tbody tr.mmpvt-row-odd {
    background: var(--mmpvt-body-bg-odd, #fbfbfb);
}

.mmpvt-table tbody tr.mmpvt-row-even {
    background: var(--mmpvt-body-bg-even, #fff);
}

.mmpvt-table tbody tr.mmpvt-row:hover {
    background: color-mix(in srgb, var(--mmpvt-body-bg-even, #fff), #000 3%);
}

/* -----------------------------------------------------------------
   Restricted Rows
   ----------------------------------------------------------------- */
.mmpvt-table tbody tr.mmpvt-restricted {
    opacity: 0.65;
}

.mmpvt-restriction-notation {
    display: block;
    font-size: 12px;
    color: #b32d2e;
    margin-top: 4px;
    font-style: italic;
}

/* Attribute label suppress - hides "Flavor: " span per context */
.mmpvt-attr-suppress-desktop .mmpvt-attr-label {
    display: none;
}

/* -----------------------------------------------------------------
   Column-Specific Styles
   ----------------------------------------------------------------- */

/* Image */
.mmpvt-col-image {
    width: 80px;
}

.mmpvt-col-image.mmpvt-col-image-large {
    width: 120px;
}

.mmpvt-table th.mmpvt-col-image,
.mmpvt-table td.mmpvt-col-image {
    text-align: center;
}

.mmpvt-image {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
}

.mmpvt-image img {
    width: 100% !important;
    height: auto !important;
    border-radius: 3px;
    border: 1px solid #eee;
    box-sizing: border-box !important;
}

/* SKU */
.mmpvt-col-sku {
    white-space: nowrap !important;
    font-family: monospace;
    font-size: 14px;
}

/* Attributes */
.mmpvt-col-attr {
    white-space: nowrap !important;
}

/* Description */
.mmpvt-col-desc {
    min-width: 120px;
    max-width: 250px;
}

/* Availability / Stock */
.mmpvt-col-avail .stock {
    margin: 0;
    font-size: 14px;
}

.mmpvt-col-avail .stock.in-stock {
    color: #0f834d;
}

.mmpvt-col-avail .stock.out-of-stock {
    color: #b32d2e;
}

/* Price */
.mmpvt-col-price {
    white-space: nowrap !important;
}

.mmpvt-col-price del {
    color: #999;
    font-size: 0.9em;
    margin-right: 4px;
}

.mmpvt-col-price ins.mmpvt-wholesale-price {
    text-decoration: none;
    font-weight: 600;
    color: #0f834d;
}

/* Quantity */
.mmpvt-col-qty {
    white-space: nowrap !important;
}

/* Max/Min/Step */
.mmpvt-col-qty-rules {
    white-space: nowrap !important;
    font-size: 0.85em;
    color: #50575e;
}

/* Extended */
.mmpvt-col-subtotal {
    white-space: nowrap !important;
    font-weight: 600;
}

/* Action */
.mmpvt-col-action {
    white-space: nowrap !important;
}

/* Center-align these columns in both header and body */
.mmpvt-table th.mmpvt-col-qty,
.mmpvt-table td.mmpvt-col-qty,
.mmpvt-table th.mmpvt-col-subtotal,
.mmpvt-table td.mmpvt-col-subtotal,
.mmpvt-table th.mmpvt-col-action,
.mmpvt-table td.mmpvt-col-action {
    text-align: center;
}

/* -----------------------------------------------------------------
   Quantity Input
   ----------------------------------------------------------------- */
.mmpvt-qty-wrapper {
    display: inline-flex !important;
    align-items: center !important;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    overflow: hidden !important;
    background: #fff;
}

.mmpvt-qty-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 34px !important;
    background: #f8f8f8;
    border: none !important;
    cursor: pointer !important;
    font-size: 16px;
    font-weight: 600;
    color: #50575e;
    line-height: 1;
    padding: 0 !important;
    transition: background 0.15s;
}

.mmpvt-qty-btn:hover {
    background: #e8e8e8;
    color: #1d2327;
}

.mmpvt-qty-btn:active {
    background: #ddd;
}

.mmpvt-qty-input,
.mmpvt-qty-wrapper .mmpvt-qty-input {
    width: 52px !important;
    height: 34px !important;
    text-align: center !important;
    border: none !important;
    border-left: 1px solid #dcdcde !important;
    border-right: 1px solid #dcdcde !important;
    font-size: 14px;
    padding: 0 4px !important;
    margin: 0 !important;
    -moz-appearance: textfield !important;
    background: #fff;
    color: #1d2327;
}

.mmpvt-qty-input::-webkit-outer-spin-button,
.mmpvt-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

.mmpvt-qty-input[readonly] {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

/* -----------------------------------------------------------------
   Stacked Columns
   ----------------------------------------------------------------- */
.mmpvt-col-stacked {
    vertical-align: middle;
}

.mmpvt-stacked-field {
    padding: 2px 0;
}

.mmpvt-stacked-field + .mmpvt-stacked-field {
    margin-top: 2px;
    padding-top: 4px;
}

/* Stacked image should constrain */
.mmpvt-stacked-field.mmpvt-stacked-image_link img {
    max-width: 50px;
    height: auto;
    border: 1px solid #eee;
    border-radius: 3px;
}

.mmpvt-stacked-field.mmpvt-stacked-image_link .mmpvt-image-large img {
    max-width: 80px;
}

/* -----------------------------------------------------------------
   Cart Button (per-row)
   ----------------------------------------------------------------- */
.mmpvt-cart-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px;
    padding: 6px 14px;
    font-size: 14px;
    line-height: 1.4;
    cursor: pointer !important;
    white-space: nowrap !important;
    border-radius: 4px;
    transition: opacity 0.2s;
}

.mmpvt-cart-btn .mmpvt-cart-icon {
    flex-shrink: 0;
    vertical-align: middle;
}

.mmpvt-cart-btn.mmpvt-loading {
    opacity: 0.6;
    pointer-events: none !important;
}

.mmpvt-cart-btn.mmpvt-btn-disabled {
    opacity: 0.4;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

.mmpvt-oos-text {
    color: #b32d2e;
    font-size: 14px;
    font-style: italic;
}

/* -----------------------------------------------------------------
   Checkbox Column (Bulk Checkbox Mode)
   ----------------------------------------------------------------- */
.mmpvt-col-checkbox {
    width: 36px !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
}

.mmpvt-table th.mmpvt-col-checkbox,
.mmpvt-table td.mmpvt-col-checkbox {
    text-align: center;
}

.mmpvt-col-checkbox input[type="checkbox"] {
    margin: 0;
}

/* -----------------------------------------------------------------
   Attribute Filters
   ----------------------------------------------------------------- */
.mmpvt-attribute-filters {
    display: flex !important;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

.mmpvt-filter-group {
    display: inline-flex;
    align-items: center;
}

.mmpvt-attr-filter {
    min-width: 140px;
    padding: 6px 10px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    color: #1d2327;
}

/* -----------------------------------------------------------------
   Search Input
   ----------------------------------------------------------------- */
.mmpvt-search-wrapper {
    margin-bottom: 12px;
}

.mmpvt-search-input {
    width: 100% !important;
    max-width: 350px !important;
    padding: 8px 12px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
}

.mmpvt-search-input:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 1px #2271b1;
}

/* -----------------------------------------------------------------
   Bulk Cart Area
   ----------------------------------------------------------------- */
.mmpvt-bulk-cart-area {
    padding: 12px 0;
}

.mmpvt-bulk-cart-area.mmpvt-bulk-top {
    padding-bottom: 12px;
    border-bottom: none;
}

.mmpvt-bulk-cart-area.mmpvt-bulk-bottom {
    padding-top: 12px;
}

.mmpvt-bulk-controls {
    display: flex !important;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Bulk alignment */
.mmpvt-bulk-align-left .mmpvt-bulk-controls {
    justify-content: flex-start;
}

.mmpvt-bulk-align-right .mmpvt-bulk-controls {
    justify-content: flex-end;
}

/* Button on outside edge: first when left, last when right */
.mmpvt-bulk-align-left .mmpvt-bulk-cart-btn {
    order: -1;
}

.mmpvt-bulk-align-right .mmpvt-bulk-cart-btn {
    order: 99;
}

.mmpvt-bulk-info {
    font-size: 14px;
    color: #50575e;
}

.mmpvt-bulk-count {
    font-weight: 600;
}

.mmpvt-bulk-total {
    font-weight: 600;
}

.mmpvt-bulk-cart-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px;
    padding: 8px 20px;
    font-size: 14px;
    cursor: pointer !important;
    white-space: nowrap !important;
    border-radius: 4px;
}

.mmpvt-bulk-cart-btn .mmpvt-cart-icon {
    flex-shrink: 0;
}

.mmpvt-bulk-cart-btn.mmpvt-loading {
    opacity: 0.6;
    pointer-events: none !important;
}

.mmpvt-bulk-note {
    font-size: 14px;
    color: #646970;
    margin: 0 0 8px;
    font-style: italic;
}

/* -----------------------------------------------------------------
   Variation Totals (Live Cart mode)
   ----------------------------------------------------------------- */
.mmpvt-variation-totals {
    padding: 10px 0;
    text-align: right;
}

.mmpvt-variation-totals-top {
    padding-bottom: 10px;
}

.mmpvt-variation-totals-bottom {
    padding-top: 10px;
}

.mmpvt-vt-info {
    font-size: 14px;
    color: #50575e;
}

.mmpvt-vt-count {
    font-weight: 600;
}

.mmpvt-vt-total {
    font-weight: 600;
}

/* -----------------------------------------------------------------
   Pagination (tfoot)
   ----------------------------------------------------------------- */
.mmpvt-table tfoot {
    background: var(--mmpvt-footer-bg, #fff);
}

.mmpvt-pagination-cell {
    padding: 10px !important;
    text-align: center !important;
    border-bottom: none !important;
}

.mmpvt-pagination {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
}

.mmpvt-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #dcdcde;
    border-radius: 3px;
    text-decoration: none;
    font-size: 14px;
    color: var(--mmpvt-page-color, #222);
    background: #fff;
    transition: all 0.15s;
}

.mmpvt-page-link:hover {
    border-color: #8c8f94;
    color: #1d2327;
    background: #f6f7f7;
    text-decoration: none;
}

.mmpvt-page-link.mmpvt-page-active {
    background: var(--mmpvt-page-active-bg, #abb8c3);
    color: var(--mmpvt-page-active-color, #fff);
    border-color: var(--mmpvt-page-active-bg, #abb8c3);
    font-weight: 600;
    cursor: default;
}

.mmpvt-page-ellipsis {
    padding: 0 4px;
    color: #999;
}

/* -----------------------------------------------------------------
   Cart Notices
   ----------------------------------------------------------------- */
.mmpvt-notice {
    margin: 0 0 15px;
}

/* -----------------------------------------------------------------
   Available Options Scroll-To Button
   ----------------------------------------------------------------- */
.mmpvt-available-options-btn {
    display: inline-block;
    margin-top: 10px;
}

/* -----------------------------------------------------------------
   Field-Level Styling (Custom Properties)
   Uses --mmpvt-fs-d / --mmpvt-fw-d for desktop,
   --mmpvt-fs-m / --mmpvt-fw-m for mobile (switched via media query).
   ----------------------------------------------------------------- */
.mmpvt-field-styled {
    font-size: var(--mmpvt-fs-d, inherit);
    font-weight: var(--mmpvt-fw-d, inherit);
}

.mmpvt-field-label {
    font-weight: 600;
    color: var(--mmpvt-body-text, #6d6d6d);
    opacity: 0.75;
    font-size: 0.9em;
}

/* Desktop-only / mobile-only visibility helpers */
.mmpvt-mobile-only {
    display: none !important;
}

.mmpvt-desktop-only {
    display: inline !important;
}

/* Fields in mobile layout but not desktop - hidden on desktop, shown on mobile */
.mmpvt-desktop-hidden {
    display: none !important;
}

/* Extra left-column content injected for mobile consolidation - hidden on desktop */
.mmpvt-mobile-left-appended {
    display: none !important;
}

/* -----------------------------------------------------------------
   Responsive Two-Column Card Layout (< 768px)
   ----------------------------------------------------------------- */
@media screen and (max-width: 767px) {
    /* Mobile base font size */
    .mmpvt-table {
        font-size: 16px;
    }

    .mmpvt-table thead th {
        font-size: 16px;
    }

    .mmpvt-col-sku {
        font-size: 16px;
    }

    .mmpvt-col-avail .stock {
        font-size: 16px;
    }

    .mmpvt-qty-input {
        font-size: 16px;
    }

    .mmpvt-add-to-cart {
        font-size: 16px;
    }

    .mmpvt-oos-text {
        font-size: 16px;
    }

    /* Only apply mobile layout if not explicitly disabled */
    .mmpvt-table:not(.mmpvt-no-breakdown) thead {
        display: none !important;
    }

    /* Base card styles shared by all mobile layout modes */
    .mmpvt-table:not(.mmpvt-no-breakdown) tbody tr {
        display: block !important;
        position: relative;
        margin-bottom: 12px;
        border: var(--mmpvt-border-width, 1px) solid var(--mmpvt-border-color, #eee);
        border-radius: 4px;
        overflow: hidden;
    }

    .mmpvt-table:not(.mmpvt-no-breakdown) tbody td {
        display: block !important;
        padding: 6px 10px;
        border: none;
    }

    /* Hidden fields on mobile */
    .mmpvt-table:not(.mmpvt-no-breakdown) tbody td.mmpvt-mobile-hidden {
        display: none !important;
    }

    /* -------------------------------------------------------
       TWO-COLUMN mode: left panel floats left, row height
       expands to contain whichever side is taller.
    ------------------------------------------------------- */
    .mmpvt-mobile-two-col:not(.mmpvt-no-breakdown) tbody tr {
        overflow: hidden; /* clearfix for float */
        min-height: 80px;
        text-align: right; /* positions inline-block children (action + checkbox) */
    }

    /* Left column - floated, fixed width, full height of content */
    .mmpvt-mobile-two-col:not(.mmpvt-no-breakdown) tbody td.mmpvt-mobile-left {
        float: left !important;
        width: 130px !important;
        display: block !important;
        text-align: left;
        padding: 6px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* All non-left, non-hidden cells sit beside the float */
    .mmpvt-mobile-two-col:not(.mmpvt-no-breakdown) tbody td:not(.mmpvt-mobile-left):not(.mmpvt-mobile-hidden) {
        margin-left: 130px !important;
    }

    /* Extra left-column fields injected into the first left cell */
    /* In two-col mode: left-align to match the left panel default */
    /* In one-col mode: inherits text-align from parent td (centered by default) */
    .mmpvt-mobile-two-col .mmpvt-mobile-left-appended {
        text-align: left;
    }
    .mmpvt-mobile-left-appended {
        display: block !important;
        padding: 4px 0 0;
        width: 100%;
    }

    .mmpvt-mobile-two-col:not(.mmpvt-no-breakdown) tbody td.mmpvt-mobile-left .mmpvt-image {
        width: 100%;
    }

    .mmpvt-mobile-two-col:not(.mmpvt-no-breakdown) tbody td.mmpvt-mobile-left img {
        width: 100%;
        height: auto;
        border: 1px solid #eee;
        border-radius: 3px;
        box-sizing: border-box;
    }

    /* Large image mobile card - wider left panel */
    .mmpvt-table-image-large.mmpvt-mobile-two-col:not(.mmpvt-no-breakdown) tbody tr {
        min-height: 130px;
    }
    .mmpvt-table-image-large.mmpvt-mobile-two-col:not(.mmpvt-no-breakdown) tbody td.mmpvt-mobile-left {
        width: 170px !important;
    }
    .mmpvt-table-image-large.mmpvt-mobile-two-col:not(.mmpvt-no-breakdown) tbody td:not(.mmpvt-mobile-left):not(.mmpvt-mobile-hidden) {
        margin-left: 170px !important;
    }

    /* Right column in two-col mode - right-aligned by default */
    .mmpvt-mobile-two-col:not(.mmpvt-no-breakdown) tbody td.mmpvt-mobile-right {
        text-align: right;
    }

    /* -------------------------------------------------------
       ONE-COLUMN modes: no absolute positioning, full width,
       normal block flow, left-aligned by default
    ------------------------------------------------------- */
    .mmpvt-mobile-left-only:not(.mmpvt-no-breakdown) tbody tr,
    .mmpvt-mobile-right-only:not(.mmpvt-no-breakdown) tbody tr {
        padding-left: 0;
        min-height: 0;
        text-align: center;
    }

    .mmpvt-mobile-left-only:not(.mmpvt-no-breakdown) tbody td.mmpvt-mobile-left,
    .mmpvt-mobile-right-only:not(.mmpvt-no-breakdown) tbody td.mmpvt-mobile-right {
        position: static !important;
        width: auto !important;
        display: block !important;
        text-align: center;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Mobile text-align overrides - apply to all modes */
    .mmpvt-table:not(.mmpvt-no-breakdown) tbody td[data-mobile-align="left"] {
        text-align: left;
    }
    .mmpvt-table:not(.mmpvt-no-breakdown) tbody td[data-mobile-align="center"] {
        text-align: center;
    }
    .mmpvt-table:not(.mmpvt-no-breakdown) tbody td[data-mobile-align="right"] {
        text-align: right;
    }

    /* Remove data-title labels in card mode */
    .mmpvt-table:not(.mmpvt-no-breakdown) tbody td::before {
        display: none;
    }

    /* Stacked fields in mobile should be compact */
    .mmpvt-table:not(.mmpvt-no-breakdown) .mmpvt-stacked-field {
        padding: 1px 0;
    }

    /* Checkbox + Action inline on mobile - share a line, right-justified */
    .mmpvt-table:not(.mmpvt-no-breakdown) td.mmpvt-col-action {
        display: inline-block !important;
        vertical-align: middle !important;
        padding: 6px 10px;
    }

    .mmpvt-table:not(.mmpvt-no-breakdown) td.mmpvt-col-checkbox {
        display: inline-block !important;
        vertical-align: middle !important;
        border: none;
        padding: 6px 4px 6px 0;
    }

    .mmpvt-table:not(.mmpvt-no-breakdown) td.mmpvt-col-checkbox input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }

    /* Follow mobile right-column alignment override for action+checkbox row */
    .mmpvt-table:not(.mmpvt-no-breakdown) tbody tr[data-mobile-row-align="left"] {
        text-align: left;
    }

    .mmpvt-table:not(.mmpvt-no-breakdown) tbody tr[data-mobile-row-align="center"] {
        text-align: center;
    }

    /* Tfoot in mobile */
    .mmpvt-table:not(.mmpvt-no-breakdown) tfoot tr {
        display: block !important;
        padding-left: 0;
        min-height: 0;
    }

    .mmpvt-table:not(.mmpvt-no-breakdown) tfoot td {
        display: block !important;
    }

    /* Attribute filters stack vertically */
    .mmpvt-attribute-filters {
        flex-direction: column !important;
        align-items: stretch;
    }

    .mmpvt-attr-filter {
        width: 100% !important;
    }

    /* Search full width */
    .mmpvt-search-input {
        max-width: 100% !important;
    }

    /* Bulk controls stack */
    .mmpvt-bulk-controls {
        flex-direction: column !important;
        align-items: stretch;
        text-align: center;
    }

    .mmpvt-bulk-cart-btn {
        justify-content: center;
    }

    /* Field-level styling: switch to mobile custom properties */
    .mmpvt-field-styled {
        font-size: var(--mmpvt-fs-m, var(--mmpvt-fs-d, inherit));
        font-weight: var(--mmpvt-fw-m, var(--mmpvt-fw-d, inherit));
    }

    /* Swap desktop/mobile visibility */
    .mmpvt-desktop-only {
        display: none !important;
    }

    .mmpvt-mobile-only {
        display: inline !important;
    }

    /* Attribute label suppress on mobile */
    .mmpvt-attr-suppress-mobile .mmpvt-attr-label {
        display: none;
    }

    /* Show mobile-only fields (hidden on desktop) */
    .mmpvt-table:not(.mmpvt-no-breakdown) td.mmpvt-desktop-hidden {
        display: block !important;
    }

    /* Mobile display mode: Show All - remove scroll constraints */
    .mmpvt_variant_table_block[data-mobile-display="show_all"] {
        max-height: none !important;
        overflow-y: visible !important;
    }

    /* Mobile display mode: Scroll - use mobile scroll height */
    .mmpvt_variant_table_block[data-mobile-display="scroll"] {
        max-height: var(--mmpvt-mobile-scroll-height, 850px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Hide pagination on mobile */
    .mmpvt-pagination-cell {
        display: none !important;
    }
}

/* =========================================================================
   Cart Quantity Indicator - Badge
   ========================================================================= */

.mmpvt-qty-cell-wrapper {
    position: relative;
    display: inline-block;
    text-align: inherit;
}

.mmpvt-cart-badge {
    position: absolute !important;
    top: -8px;
    right: -8px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: #2271b1;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    border-radius: 9px;
    z-index: 1 !important;
}

/* =========================================================================
   Cart Quantity Indicator - Text
   ========================================================================= */

.mmpvt-cart-text {
    display: block;
    font-size: 11px;
    color: #888;
    text-align: inherit;
    white-space: nowrap;
}

.mmpvt-cart-remove {
    display: inline-block;
    background: none !important;
    border: none !important;
    padding: 2px;
    cursor: pointer !important;
    color: #b32d2e;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    line-height: 1;
    vertical-align: middle;
}

.mmpvt-cart-remove:hover {
    opacity: 1;
}

.mmpvt-cart-remove-link {
    color: #b32d2e;
    text-decoration: none;
    font-size: 11px;
}

.mmpvt-cart-remove-link:hover {
    text-decoration: underline;
}

/* =========================================================================
   In-Cart Row Highlight
   ========================================================================= */

.mmpvt-row.mmpvt-in-cart {
    border-left: 3px solid #2271b1 !important;
}

/* =========================================================================
   Live Cart - Row Syncing State
   ========================================================================= */

.mmpvt-row.mmpvt-row-syncing {
    opacity: 0.6;
    pointer-events: none !important;
    transition: opacity 0.2s ease;
}

/* Never show syncing state on restricted or OOS rows */
.mmpvt-row.mmpvt-restricted.mmpvt-row-syncing,
.mmpvt-row[data-stock-status="outofstock"].mmpvt-row-syncing {
    opacity: 1;
    pointer-events: auto;
}

.mmpvt-row.mmpvt-row-syncing .mmpvt-qty-wrapper {
    position: relative;
}

.mmpvt-row.mmpvt-row-syncing .mmpvt-qty-wrapper::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -24px;
    width: 14px;
    height: 14px;
    margin-top: -7px;
    border: 2px solid #dcdcde;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: mmpvt-spin 0.6s linear infinite;
}

/* No spinner on restricted or OOS rows */
.mmpvt-row.mmpvt-restricted.mmpvt-row-syncing .mmpvt-qty-wrapper::after,
.mmpvt-row[data-stock-status="outofstock"].mmpvt-row-syncing .mmpvt-qty-wrapper::after {
    display: none;
}

/* Hide native number input spinner on readonly/disabled inputs */
.mmpvt-qty-input[readonly]::-webkit-inner-spin-button,
.mmpvt-qty-input[readonly]::-webkit-outer-spin-button,
.mmpvt-qty-input[disabled]::-webkit-inner-spin-button,
.mmpvt-qty-input[disabled]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.mmpvt-qty-input[readonly],
.mmpvt-qty-input[disabled] {
    -moz-appearance: textfield;
}

@keyframes mmpvt-spin {
    to { transform: rotate(360deg); }
}

/* =========================================================================
   Cart Status Popup
   ========================================================================= */

.mmpvt-cart-status-popup {
    position: fixed !important;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    max-width: 400px;
    width: calc(100% - 32px);
    background: #1d2327;
    color: #f0f0f1;
    padding: 12px 20px;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.15);
    z-index: 99999 !important;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    line-height: 1.4;
    transition: transform 0.3s ease;
}

.mmpvt-cart-status-popup.mmpvt-popup-visible {
    transform: translateX(-50%) translateY(0);
}

.mmpvt-popup-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.mmpvt-popup-count {
    font-weight: 700;
}

.mmpvt-popup-total {
    font-weight: 600;
}

.mmpvt-popup-note {
    display: block;
    width: 100%;
    font-size: 11px;
    font-weight: 400;
    opacity: 0.7;
    margin-top: 0;
}

.mmpvt-popup-view-cart {
    color: #72aee6;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
    transition: color 0.15s;
}

.mmpvt-popup-view-cart:hover {
    color: #fff;
}

.mmpvt-popup-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 16px;
    flex-shrink: 0;
}

.mmpvt-popup-spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: mmpvt-spin 0.7s linear infinite;
}

.mmpvt-popup-spinner.mmpvt-spinner-active {
    display: inline-block;
}

@keyframes mmpvt-spin {
    to { transform: rotate(360deg); }
}

/* Mobile: full-width bar */
@media (max-width: 600px) {
    .mmpvt-cart-status-popup {
        max-width: none;
        width: 100%;
        left: 0;
        transform: translateY(100%);
        border-radius: 0;
        padding: 22px 20px;
        font-size: 14px;
    }
    .mmpvt-cart-status-popup.mmpvt-popup-visible {
        transform: translateY(0);
    }
}

/* =========================================================================
   Image Zoom
   ========================================================================= */

/* Zoomable figure - cursor + magnifier badge */
.mmpvt-image.mmpvt-image-zoomable {
    position: relative;
    cursor: zoom-in;
}

/* Magnifier badge - hidden by default, shown only when zoom is active for that context */
.mmpvt-image.mmpvt-image-zoomable::after {
    content: '';
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    background: rgba(0,0,0,0.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") center/14px no-repeat;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

/* Show badge on desktop hover (desktop zoom enabled) */
.mmpvt-image.mmpvt-zoom-desktop:hover::after {
    opacity: 1;
}

/* Always show badge on mobile (no hover, tap hint) */
@media (max-width: 767px) {
    .mmpvt-image.mmpvt-zoom-mobile::after {
        opacity: 1;
    }
}

/* Lightbox overlay */
.mmpvt-zoom-overlay {
    display: none !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 99999 !important;
    align-items: center;
    justify-content: center;
}

.mmpvt-zoom-overlay.mmpvt-zoom-visible {
    display: flex !important;
}

.mmpvt-zoom-backdrop {
    position: absolute !important;
    inset: 0 !important;
    background: rgba(0,0,0,0.82);
}

.mmpvt-zoom-content {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mmpvt-zoom-img {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
    display: block;
}

.mmpvt-zoom-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 32px;
    height: 32px;
    background: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    color: #1d2327;
    transition: background 0.15s;
    z-index: 2;
}

.mmpvt-zoom-close:hover {
    background: #f0f0f0;
}

/* Prevent body scroll when lightbox open */
body.mmpvt-zoom-open {
    overflow: hidden !important;
}

/* =========================================================================
   Image Hover Zoom Popup
   ========================================================================= */

.mmpvt-hover-zoom-popup {
    position: fixed !important;
    z-index: 99998 !important;
    pointer-events: auto !important;
    border-radius: 6px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
    background: #fff;
    padding: 4px;
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.18s ease-out, transform 0.18s ease-out;
    line-height: 0;
}

.mmpvt-hover-zoom-popup.mmpvt-hover-zoom-visible {
    opacity: 1;
    transform: scale(1);
}

.mmpvt-hover-zoom-popup img {
    display: block;
    max-width: 320px;
    max-height: 320px;
    width: auto;
    height: auto;
    border-radius: 3px;
}
