/**
 * 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;
}

/* -----------------------------------------------------------------
   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;
    -webkit-overflow-scrolling: touch;
}

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

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

/* -----------------------------------------------------------------
   Table Base
   ----------------------------------------------------------------- */
.mmpvt-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    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;
    position: relative;
    vertical-align: middle;
}

/* -----------------------------------------------------------------
   Sortable Headers
   ----------------------------------------------------------------- */
.mmpvt-table thead th.mmpvt-sortable {
    cursor: pointer;
    user-select: none;
    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;
    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;
}

/* -----------------------------------------------------------------
   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;
    padding: 0;
    line-height: 0;
}

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

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

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

/* 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;
}

.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;
}

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

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

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

/* 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;
    align-items: center;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

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

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

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

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

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

.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;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    font-size: 14px;
    line-height: 1.4;
    cursor: pointer;
    white-space: nowrap;
    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;
}

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

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

/* -----------------------------------------------------------------
   Checkbox Column (Bulk Checkbox Mode)
   ----------------------------------------------------------------- */
.mmpvt-col-checkbox {
    width: 36px;
    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;
    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%;
    max-width: 350px;
    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;
    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;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    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;
}

.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;
    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;
}

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

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

/* -----------------------------------------------------------------
   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;
    }

    .mmpvt-table:not(.mmpvt-no-breakdown) tbody tr {
        display: block;
        position: relative;
        padding-left: 130px;
        min-height: 140px;
        margin-bottom: 12px;
        border: var(--mmpvt-border-width, 1px) solid var(--mmpvt-border-color, #eee);
        border-radius: 4px;
        overflow: hidden;
        text-align: right; /* positions inline-block children (action + checkbox) */
    }

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

    /* Left column - absolute positioned alongside right cells */
    .mmpvt-table:not(.mmpvt-no-breakdown) tbody td.mmpvt-mobile-left {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 130px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 6px;
    }

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

    .mmpvt-table: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:not(.mmpvt-no-breakdown) tbody tr {
        padding-left: 170px;
        min-height: 190px;
    }
    .mmpvt-table-image-large:not(.mmpvt-no-breakdown) tbody td.mmpvt-mobile-left {
        width: 170px;
    }

    /* Right column - stacks naturally as block elements */
    .mmpvt-table:not(.mmpvt-no-breakdown) tbody td.mmpvt-mobile-right {
        text-align: right;
    }

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

    /* Mobile text-align overrides */
    .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;
        vertical-align: middle;
        padding: 6px 10px;
    }

    .mmpvt-table:not(.mmpvt-no-breakdown) td.mmpvt-col-checkbox {
        display: inline-block;
        vertical-align: middle;
        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;
        padding-left: 0;
        min-height: 0;
    }

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

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

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

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

    /* Bulk controls stack */
    .mmpvt-bulk-controls {
        flex-direction: column;
        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;
    }

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

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

    /* 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;
    }
}

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

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

.mmpvt-cart-badge {
    position: absolute;
    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;
}

/* =========================================================================
   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;
    border: none;
    padding: 2px;
    cursor: pointer;
    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;
}

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

.mmpvt-row.mmpvt-row-syncing {
    opacity: 0.6;
    pointer-events: none;
    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;
    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: 9999;
    display: flex;
    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;
    gap: 4px;
}

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

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

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

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

/* Mobile: full width */
@media (max-width: 600px) {
    .mmpvt-cart-status-popup {
        max-width: none;
        width: calc(100% - 16px);
        padding: 10px 16px;
        font-size: 14px;
    }
}
