/* MPR Warehouse Revolution - Stock Checker */

/* --- Hidden stock bar (v2 mode: theme's stock_checker opens modal) --- */
.mprw-stock-bar.mprw-stock-bar-hidden {
    display: none !important;
}

/* --- Two-row Stock Bar layout --- */

.mprw-stock-bar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 16px;
    margin: 16px 0 8px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
}

.mprw-bar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.mprw-bar-row-top {
}

.mprw-bar-stock {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    font-weight: 600;
}

.mprw-bar-stock svg,
.mprw-bar-stock .material-icons,
.mprw-bar-stock i {
    width: 16px;
    height: 16px;
    font-size: 16px;
    flex-shrink: 0;
}

.mprw-bar-in-stock {
    color: #155724;
}

.mprw-bar-out-of-stock {
    color: #721c24;
}

.mprw-bar-secondary-stock {
    color: #856404;
}

.mprw-bar-delivery {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0;
}

.mprw-bar-delivery-fast {
    background: #d4edda;
    color: #155724;
}

.mprw-bar-delivery-slow {
    background: #fff3cd;
    color: #856404;
}

.mprw-bar-similar-info {
    color: #6c757d;
    white-space: nowrap;
}

.mprw-bar-similar-info strong {
    color: #495057;
}

.mprw-bar-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #fff !important;
    background: #2980b9;
    white-space: nowrap;
    text-decoration: none !important;
    flex-shrink: 0;
    cursor: pointer;
    transition: background 0.15s;
    margin-left: auto;
}

.mprw-bar-btn:hover,
.mprw-bar-btn:focus {
    color: #fff !important;
    background: #2471a3;
    text-decoration: none !important;
    outline: none;
}

.mprw-bar-btn svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 575px) {
    .mprw-bar-row-bottom {
        flex-direction: column;
        gap: 8px;
    }
    .mprw-bar-btn {
        width: 100%;
        justify-content: center;
        margin-left: 0;
    }
}

/* Hide theme delivery button when our bar is present */
.product-additional-info .about-delivery-btn,
.product-add-to-cart .about-delivery {
    display: none !important;
}

/* --- Base Widget (product page, now disabled but kept for standalone) --- */

.mprw-stock-widget {
    margin: 12px 0;
    font-family: inherit;
}

.mprw-widget-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mprw-widget-stock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.mprw-widget-stock svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.mprw-widget-stock.mprw-in-stock {
    background: #d4edda;
    color: #155724;
}

.mprw-widget-stock.mprw-out-of-stock {
    background: #f8d7da;
    color: #721c24;
}

.mprw-widget-similar {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #495057;
    background: #f0f1f3;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.mprw-widget-similar svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.7;
}

.mprw-widget-similar:hover {
    background: #e2e6ea;
    color: #212529;
    text-decoration: none;
}

.mprw-widget-similar.mprw-page-link::after,
.mprw-widget-similar::after {
    content: none;
}

/* Stock badges */
.mprw-stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.mprw-stock-badge svg,
.mprw-stock-badge i {
    width: 16px;
    height: 16px;
    font-size: 16px;
    flex-shrink: 0;
}

.mprw-stock-badge.mprw-in-stock {
    color: #155724;
}

.mprw-stock-badge.mprw-out-of-stock {
    color: #856404;
}

/* --- Combinations --- */

.mprw-combinations {
    margin-top: 8px;
    padding: 0;
}

.mprw-combinations-title {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    padding: 0 4px;
}

.mprw-combo-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 13px;
    transition: background 0.15s;
}

.mprw-combo-row:hover {
    background: #f0f0f0;
}

.mprw-combo-attr {
    color: #333;
    flex-grow: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mprw-combo-stock {
    flex-shrink: 0;
    margin-left: 10px;
}

.mprw-combo-row.mprw-combo-out-of-stock .mprw-combo-attr {
    color: #999;
}

/* --- Related Products Section --- */

.mprw-related {
    margin-top: 12px;
    border-top: 1px solid #eee;
    padding-top: 8px;
}

.mprw-related-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 4px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
}

.mprw-related-toggle:hover {
    color: #007bff;
}

.mprw-related-toggle::before {
    content: '\25B6';
    font-size: 10px;
    transition: transform 0.2s;
}

.mprw-related-open .mprw-related-toggle::before {
    transform: rotate(90deg);
}

.mprw-related-content {
    display: none;
    padding: 4px 0;
}

.mprw-related-open .mprw-related-content {
    display: block;
}

/* --- Product Cards (list) --- */

.mprw-product-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s, box-shadow 0.15s;
    border: 1px solid transparent;
}

.mprw-product-card:hover {
    background: #f8f9fa;
    border-color: #e9ecef;
    text-decoration: none;
    color: inherit;
}

.mprw-card-image {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 4px;
    overflow: hidden;
    background: #f0f0f0;
}

.mprw-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mprw-no-image {
    width: 100%;
    height: 100%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
}

.mprw-card-info {
    flex-grow: 1;
    min-width: 0;
}

.mprw-card-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mprw-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
    font-size: 11px;
    color: #888;
}

.mprw-card-ref {
    font-family: monospace;
}

.mprw-card-price {
    font-weight: 600;
    color: #333;
}

.mprw-card-shared {
    display: block;
    font-size: 10px;
    color: #6c757d;
    margin-top: 2px;
}

.mprw-card-stock {
    flex-shrink: 0;
}

/* --- Search --- */

.mprw-search {
    margin-top: 12px;
    border-top: 1px solid #eee;
    padding-top: 8px;
}

.mprw-search-box {
    position: relative;
}

.mprw-search-input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    background: #fff;
}

.mprw-search-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.mprw-search-input::placeholder {
    color: #adb5bd;
}

.mprw-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #adb5bd;
    pointer-events: none;
}

.mprw-search-icon-svg,
.mprw-modal-body .mprw-search-icon,
.mprw-stock-checker-page .mprw-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #adb5bd;
    pointer-events: none;
    line-height: 1;
}

.mprw-search-kbd {
    display: none;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    padding: 2px 6px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 10px;
    font-family: inherit;
    color: #adb5bd;
    background: #f8f9fa;
    pointer-events: none;
}

.mprw-search-loading {
    display: none;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid #e9ecef;
    border-top-color: #007bff;
    border-radius: 50%;
    animation: mprw-spin 0.6s linear infinite;
}

@keyframes mprw-spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

.mprw-search-results.mprw-loading .mprw-search-loading {
    display: block;
}

.mprw-search-results.mprw-loading .mprw-search-kbd {
    display: none !important;
}

.mprw-search-count {
    font-size: 11px;
    color: #888;
    padding: 6px 4px 2px;
}

.mprw-search-results {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 4px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.mprw-search-results .mprw-product-card .mprw-combinations {
    width: 100%;
    padding: 6px 0 0 62px;
}

.mprw-no-results {
    padding: 20px;
    text-align: center;
    color: #888;
    font-size: 13px;
    grid-column: 1 / -1;
}

.mprw-loading-text {
    grid-column: 1 / -1;
    padding: 40px 12px;
    text-align: center;
    color: #888;
    font-size: 14px;
}
.mprw-loading-text .fa-spinner {
    font-size: 18px;
    margin-right: 6px;
    vertical-align: middle;
}

.mprw-loading-inline {
    padding: 8px 12px;
    font-size: 12px;
    color: #888;
}

/* --- Standalone Page --- */

.mprw-stock-checker-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 0 40px;
}

/* Hero Section */
.mprw-hero {
    padding: 24px 0 20px;
}

.mprw-hero-title {
    font-size: 28px;
    font-weight: 700;
    color: #212529;
    margin: 0 0 8px;
    line-height: 1.2;
}

.mprw-hero-desc {
    font-size: 15px;
    color: #6c757d;
    margin: 0;
    line-height: 1.5;
    max-width: 640px;
}

/* Search Section on Page */
.mprw-search-section {
    margin-bottom: 32px;
}

.mprw-search-section .mprw-search {
    margin-top: 0;
    border-top: none;
    padding-top: 0;
}

.mprw-stock-checker-page .mprw-search-input {
    font-size: 16px;
    padding: 14px 60px 14px 46px;
    border-radius: 12px;
    border-width: 2px;
}

.mprw-stock-checker-page .mprw-search-icon-svg,
.mprw-stock-checker-page .mprw-search-icon {
    font-size: 20px;
    left: 16px;
}

.mprw-stock-checker-page .mprw-search-kbd {
    right: 14px;
}

.mprw-stock-checker-page .mprw-search-results {
    max-height: none;
    margin-top: 12px;
}

.mprw-stock-checker-page .mprw-product-card {
    padding: 14px 16px;
    gap: 16px;
    border-radius: 8px;
}

.mprw-stock-checker-page .mprw-card-image {
    width: 64px;
    height: 64px;
    border-radius: 6px;
}

.mprw-stock-checker-page .mprw-card-name {
    font-size: 15px;
    white-space: normal;
}

.mprw-stock-checker-page .mprw-card-meta {
    font-size: 12px;
}

.mprw-stock-checker-page .mprw-product-card .mprw-combinations {
    padding-left: 80px;
}

/* --- Filter Bar --- */

.mprw-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.mprw-filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    background: #fff;
    font-size: 13px;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    line-height: 1.3;
}

.mprw-filter-tab:hover {
    border-color: #adb5bd;
    background: #f8f9fa;
}

.mprw-filter-count {
    font-weight: 700;
    font-size: 12px;
    background: #e9ecef;
    padding: 1px 7px;
    border-radius: 10px;
    color: #495057;
    min-width: 20px;
    text-align: center;
}

.mprw-stat-total.mprw-stat-active {
    border-color: #007bff;
    background: #e7f1ff;
    color: #0056b3;
}
.mprw-stat-total.mprw-stat-active .mprw-filter-count {
    background: #007bff;
    color: #fff;
}

.mprw-stat-instock.mprw-stat-active {
    border-color: #28a745;
    background: #e6f4ea;
    color: #155724;
}
.mprw-stat-instock.mprw-stat-active .mprw-filter-count {
    background: #28a745;
    color: #fff;
}

.mprw-stat-outstock.mprw-stat-active {
    border-color: #856404;
    background: #fff8e1;
    color: #856404;
}
.mprw-stat-outstock.mprw-stat-active .mprw-filter-count {
    background: #856404;
    color: #fff;
}

/* --- Section Headers --- */

.mprw-section-header {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 16px;
}

.mprw-section-title {
    font-size: 20px;
    font-weight: 700;
    color: #212529;
    margin: 0;
    line-height: 1.3;
}

.mprw-section-desc {
    font-size: 13px;
    color: #6c757d;
}

/* --- Categories Grid --- */

.mprw-categories-section {
    margin-bottom: 36px;
}

.mprw-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.mprw-category-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-family: inherit;
    font-size: inherit;
}

.mprw-category-tile:hover {
    border-color: #007bff;
    background: #f0f7ff;
    box-shadow: 0 2px 8px rgba(0,123,255,0.1);
    transform: translateY(-1px);
}

.mprw-cat-name {
    font-size: 14px;
    font-weight: 600;
    color: #212529;
    line-height: 1.3;
    margin-bottom: 4px;
}

.mprw-cat-count {
    font-size: 12px;
    color: #6c757d;
}

/* --- Featured Products Grid --- */

.mprw-featured-section {
    margin-bottom: 36px;
}

.mprw-featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.mprw-product-grid-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.mprw-product-grid-card:hover {
    border-color: #dee2e6;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}

.mprw-grid-image {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: #fff;
}

.mprw-grid-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
    padding: 4px;
}

.mprw-product-grid-card:hover .mprw-grid-image img {
    transform: scale(1.05);
}

.mprw-grid-image .mprw-no-image {
    aspect-ratio: 1;
}

.mprw-grid-body {
    padding: 12px 14px 14px;
}

.mprw-grid-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    line-height: 1.3;
    margin-bottom: 6px;
}

.mprw-grid-price {
    font-size: 14px;
    font-weight: 700;
    color: #212529;
    margin-bottom: 8px;
}

.mprw-grid-stock {
    display: flex;
}

/* --- Browse Section --- */

.mprw-browse-section {
    margin-bottom: 36px;
}

.mprw-browse-section .mprw-section-header {
    align-items: center;
}

.mprw-browse-count {
    font-size: 13px;
    color: #6c757d;
    margin-left: auto;
}

.mprw-browse-results {
    margin-top: 8px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.mprw-search-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

/* --- Buttons --- */

.mprw-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
    line-height: 1;
}

.mprw-btn-outline {
    background: #fff;
    color: #007bff;
    border: 2px solid #007bff;
}

.mprw-btn-outline:hover {
    background: #007bff;
    color: #fff;
}

.mprw-btn-back {
    background: none;
    color: #6c757d;
    padding: 6px 10px;
    border-radius: 6px;
}

.mprw-btn-back:hover {
    background: #f0f0f0;
    color: #333;
}

.mprw-search-load-more,
.mprw-browse-load-more {
    text-align: center;
    padding: 16px 0;
}

/* --- Info Section --- */

.mprw-info-section {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid #e9ecef;
}

.mprw-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.mprw-info-card {
    text-align: center;
    padding: 24px 16px;
}

.mprw-info-icon {
    margin-bottom: 12px;
    color: #007bff;
}

.mprw-info-icon svg,
.mprw-info-icon i {
    width: 32px;
    height: 32px;
    font-size: 32px;
    line-height: 1;
}

.mprw-info-card h3 {
    font-size: 15px;
    font-weight: 600;
    color: #212529;
    margin: 0 0 8px;
}

.mprw-info-card p {
    font-size: 13px;
    color: #6c757d;
    line-height: 1.5;
    margin: 0;
}

/* --- Link to standalone page --- */

.mprw-page-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    padding: 6px 0;
    font-size: 12px;
    color: #007bff;
    text-decoration: none;
}

.mprw-page-link:hover {
    text-decoration: underline;
    color: #0056b3;
}

.mprw-page-link::after {
    content: '\2192';
}

.mprw-show-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #495057;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.mprw-show-more::after {
    content: none;
}

.mprw-show-more:hover {
    background: #e9ecef;
    border-color: #ced4da;
    color: #212529;
    text-decoration: none;
}

.mprw-show-more .material-icons,
.mprw-show-more i {
    font-size: 16px;
}

/* --- Modal --- */

/* Bootstrap modal overrides for stock checker */
.mprw-bootstrap-modal .modal-dialog {
    max-width: 1200px;
    margin: 30px auto;
    max-height: calc(100vh - 60px);
}
.mprw-bootstrap-modal .modal-title {
    font-size: 18px;
    font-weight: 700;
}
.mprw-bootstrap-modal .modal-content {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 60px);
}

.mprw-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.mprw-attr-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 4px;
}

.mprw-chip {
    display: inline-block;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 3px;
    line-height: 1.4;
    white-space: nowrap;
}

.mprw-chip small {
    font-size: inherit;
    font-weight: 600;
    vertical-align: baseline;
}

.mprw-chip-in-stock {
    background: #e8f5e9;
    color: #2e7d32;
}

.mprw-chip-out-of-stock {
    background: #f5f5f5;
    color: #bbb;
}

.mprw-chip-active {
    background: #1d93ab;
    color: #fff;
    font-weight: 600;
}

.mprw-attr-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.mprw-attr-filter-group {
    flex: 0 0 auto;
}

.mprw-attr-select {
    padding: 5px 28px 5px 10px;
    font-size: 13px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    appearance: auto;
    color: #333;
    min-width: 120px;
}

.mprw-attr-select:focus {
    border-color: #2fb5d2;
    outline: none;
}

.mprw-modal-body .mprw-search {
    margin-top: 0;
    border-top: none;
    padding-top: 0;
}

.mprw-modal-body .mprw-search-input {
    font-size: 15px;
    padding: 12px 50px 12px 42px;
    border-radius: 10px;
}

.mprw-modal-body .mprw-search-icon-svg,
.mprw-modal-body .mprw-search-icon {
    font-size: 18px;
    left: 14px;
}

.mprw-modal-body .mprw-search-results {
    max-height: none;
    margin-top: 8px;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.mprw-modal-body .mprw-filter-bar {
    margin-bottom: 16px;
    gap: 6px;
}

.mprw-modal-body .mprw-section-title {
    font-size: 16px;
}

.mprw-modal-body .mprw-categories-section {
    margin-bottom: 24px;
}

.mprw-modal-body .mprw-categories-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
}

.mprw-modal-body .mprw-category-tile {
    padding: 12px;
}

.mprw-modal-body .mprw-featured-section {
    margin-bottom: 24px;
}

.mprw-modal-body .mprw-featured-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.mprw-modal-body .mprw-product-card {
    padding: 10px 12px;
    gap: 12px;
}

.mprw-modal-body .mprw-card-image {
    width: 50px;
    height: 50px;
}

.mprw-modal-body .mprw-card-name {
    font-size: 13px;
    white-space: normal;
}

/* --- Responsive --- */

@media (max-width: 768px) {
    .mprw-modal-body .mprw-categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .mprw-modal-body .mprw-featured-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .mprw-filter-tab {
        padding: 6px 12px;
        font-size: 12px;
    }

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

    .mprw-featured-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .mprw-info-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .mprw-info-card {
        padding: 16px;
    }

    .mprw-hero-title {
        font-size: 24px;
    }
}

@media (max-width: 576px) {
    .mprw-product-card {
        gap: 8px;
        padding: 8px 10px;
    }

    .mprw-card-image {
        width: 40px;
        height: 40px;
    }

    .mprw-stock-checker-page .mprw-card-image {
        width: 48px;
        height: 48px;
    }

    .mprw-card-name {
        font-size: 12px;
    }

    .mprw-search-results .mprw-product-card .mprw-combinations {
        padding-left: 48px;
    }

    .mprw-stock-checker-page .mprw-product-card .mprw-combinations {
        padding-left: 56px;
    }

    .mprw-filter-tab {
        padding: 5px 10px;
        font-size: 11px;
    }

    .mprw-filter-count {
        font-size: 11px;
        padding: 0 5px;
    }

    .mprw-categories-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .mprw-category-tile {
        padding: 12px;
    }

    .mprw-featured-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .mprw-hero-title {
        font-size: 22px;
    }

    .mprw-hero-desc {
        font-size: 13px;
    }

    .mprw-section-title {
        font-size: 18px;
    }
}

/* Availability button — styled as subtle text link, not competing with Add to Cart */
#about-delivery .about-delivery {
    display: block !important;
    width: 100% !important;
    text-align: center;
    padding: 10px 0 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #555 !important;
    background: none !important;
    border: none !important;
    border-bottom: 1px solid #e0e0e0 !important;
    border-radius: 0 !important;
    cursor: pointer;
    transition: color 0.2s ease;
    box-sizing: border-box;
    letter-spacing: 0.01em;
    text-transform: none !important;
    text-decoration: none !important;
}
#about-delivery .about-delivery:hover {
    color: #222 !important;
    background: none !important;
    text-decoration: underline !important;
}

/* --- Modal Tab Bar --- */

.mprw-tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e9ecef;
    margin: 16px 0 0;
}

.mprw-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 600;
    color: #6c757d;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    font-family: inherit;
}

.mprw-tab:hover {
    color: #495057;
}

.mprw-tab.mprw-tab-active {
    color: #007bff;
    border-bottom-color: #007bff;
}

.mprw-tab-count {
    font-size: 11px;
    font-weight: 700;
    background: #e9ecef;
    padding: 1px 7px;
    border-radius: 10px;
    color: #495057;
    min-width: 18px;
    text-align: center;
}

.mprw-tab.mprw-tab-active .mprw-tab-count {
    background: #007bff;
    color: #fff;
}

.mprw-tab-content {
    margin-top: 16px;
}

.mprw-tab-pane {
    display: none;
}

.mprw-tab-pane.mprw-tab-pane-active {
    display: block;
}

.mprw-tab-pane .mprw-tab-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.mprw-tab-pane .mprw-tab-load-more {
    text-align: center;
    padding: 16px 0;
}

/* Category browse inside tab */
.mprw-cat-browse-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.mprw-cat-browse-title {
    font-size: 16px;
    font-weight: 700;
    color: #212529;
}

.mprw-cat-browse-count {
    font-size: 13px;
    color: #6c757d;
    margin-left: auto;
}

.mprw-tab-pane .mprw-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
}

@media (max-width: 576px) {
    .mprw-tab-bar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .mprw-tab {
        padding: 8px 12px;
        font-size: 12px;
    }
    .mprw-tab-count {
        font-size: 10px;
        padding: 0 5px;
    }
}

/* --- Modal Stock Toggle + Product Grid --- */

.mprw-modal-stock-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    margin-top: 8px;
    border-top: 1px solid #e9ecef;
    line-height: 1.4;
}

.mprw-stock-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    margin-bottom: 0;
    line-height: 1.4;
}

.mprw-stock-toggle-input {
    width: 18px;
    height: 18px;
    accent-color: #27ae60;
    cursor: pointer;
    margin: 0;
}

.mprw-stock-toggle-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.mprw-stock-toggle-only {
    font-weight: 400;
    color: #6c757d;
}

.mprw-modal-stock-count {
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
}

.mprw-modal-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.mprw-modal-products {
    margin-top: 4px;
}

.mprw-modal-load-more {
    text-align: center;
    padding: 16px 0;
}

.mprw-modal-browse-all {
    text-align: center;
    padding: 8px 0 16px;
    border-top: 1px solid #e9ecef;
    margin-top: 16px;
}

.mprw-btn-link {
    background: none;
    border: none;
    color: #007bff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 16px;
    font-family: inherit;
    transition: color 0.15s;
}

.mprw-btn-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

@media (max-width: 576px) {
    .mprw-modal-product-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 8px;
    }
    .mprw-modal-stock-header {
        flex-wrap: wrap;
        gap: 8px;
    }
}

/* Related products section in modal */
.mprw-modal-related-section {
    margin-bottom: 24px;
}
.mprw-modal-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}


/* Warehouse info banner in modal */
.mprw-warehouse-info {
    background: #f8fafb;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 14px;
    font-size: 13px;
    line-height: 1.5;
    color: #475569;
}
.mprw-warehouse-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}
.mprw-warehouse-info-icon {
    flex-shrink: 0;
}
.mprw-warehouse-info-icon svg {
    width: 16px;
    height: 16px;
}
.mprw-warehouse-info-local .mprw-warehouse-info-icon {
    color: #16a34a;
}
.mprw-warehouse-info-central .mprw-warehouse-info-icon {
    color: #e67e22;
}
.mprw-warehouse-info-support {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
    font-style: italic;
    color: #64748b;
}
/* Delivery info card in modal */
.mprw-delivery-info {
    margin-bottom: 20px;
}
.mprw-delivery-card {
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4f8 100%);
    border: 1px solid #d0e3f0;
    border-radius: 10px;
    padding: 16px 20px;
}
.mprw-delivery-text {
    font-size: 13px;
    line-height: 1.5;
    color: #444;
    margin-bottom: 12px;
}
.mprw-delivery-timing {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}
.mprw-delivery-countdown,
.mprw-delivery-arrival {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #333;
}
.mprw-delivery-countdown svg,
.mprw-delivery-arrival svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.mprw-delivery-countdown strong {
    color: #c0392b;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
}
.mprw-delivery-arrival strong {
    color: #27ae60;
}
/* Delivery info card in modal */
.mprw-delivery-info {
    margin-bottom: 20px;
}
.mprw-delivery-card {
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4f8 100%);
    border: 1px solid #d0e3f0;
    border-radius: 10px;
    padding: 16px 20px;
}
.mprw-delivery-text {
    font-size: 13px;
    line-height: 1.5;
    color: #444;
    margin-bottom: 12px;
}
.mprw-delivery-timing {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}
.mprw-delivery-countdown,
.mprw-delivery-arrival {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #333;
}
.mprw-delivery-countdown svg,
.mprw-delivery-arrival svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.mprw-delivery-countdown strong {
    color: #c0392b;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
}
.mprw-delivery-arrival strong {
    color: #27ae60;
}

/* Broken image placeholder */
.mprw-img-broken {
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
}
.mprw-img-broken::after {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    background: #ddd;
    border-radius: 6px;
}
