/**
 * Motor Marks Plates - UK Number Plate Styling
 * 
 * UK number plate specifications:
 * - Standard plate: 520mm x 111mm
 * - Font: Charles Wright (mandatory)
 * - Character height: 79mm
 * - Character width: 50mm (except I and 1)
 * - Character stroke: 14mm
 * - Margin: 11mm sides, 11mm top/bottom
 *
 * @package MotorMarks\Plates
 * @version 1.0.0
 */

/* ==========================================================================
   CSS Custom Properties
   ========================================================================== */

:root {
    /* UK Plate Colors */
    --mm-plate-yellow: #F2B407;
    --mm-plate-yellow-hover: #f5c107;
    --mm-plate-white: #FFFFFF;
    --mm-plate-white-hover: #f5f5f5;
    --mm-plate-black: #000000;
    --mm-plate-border: #000000;
    
    /* Plate Dimensions (scaled for web) */
    --mm-plate-border-radius: 6px;
    --mm-plate-border-width: 2px;
    --mm-plate-padding-x: 12px;
    --mm-plate-padding-y: 8px;
    
    /* Font Sizes */
    --mm-plate-font-size-small: 14px;
    --mm-plate-font-size-standard: 20px;
    --mm-plate-font-size-large: 28px;
    --mm-plate-font-size-xlarge: 36px;
    
    /* Search Form Colors */
    --mm-search-primary: #0073aa;
    --mm-search-primary-hover: #005a87;
    --mm-search-primary-active: #004a70;
    --mm-search-border: #ddd;
    --mm-search-bg: #f9f9f9;
    --mm-search-text: #333;
    --mm-search-text-light: #666;
    --mm-search-text-muted: #888;
    
    /* Grid columns (can be overridden inline) */
    --mm-grid-columns: 4;
}

/* ==========================================================================
   UK Number Plate Base Styles
   ========================================================================== */

.mm-plate {
    display: inline-block;
    font-family: 'UKNumberPlate', 'Arial Black', 'Arial Bold', Helvetica, sans-serif;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: var(--mm-plate-padding-y) var(--mm-plate-padding-x);
    border: var(--mm-plate-border-width) solid var(--mm-plate-border);
    border-radius: var(--mm-plate-border-radius);
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    line-height: 1.2;
}

/* Rear Plate (Yellow) */
.mm-plate--rear {
    background-color: var(--mm-plate-yellow);
    color: var(--mm-plate-black);
}

/* Front Plate (White) */
.mm-plate--front {
    background-color: var(--mm-plate-white);
    color: var(--mm-plate-black);
}

/* Own Stock Plates (White background to distinguish from third-party) */
.mm-plate--own-stock {
    background-color: var(--mm-plate-white);
}

/* ==========================================================================
   Plate Sizes
   ========================================================================== */

.mm-plate--small {
    font-size: var(--mm-plate-font-size-small);
    padding: 4px 8px;
    border-radius: 4px;
    letter-spacing: 1px;
}

.mm-plate--standard {
    font-size: var(--mm-plate-font-size-standard);
}

.mm-plate--large {
    font-size: var(--mm-plate-font-size-large);
    padding: 12px 20px;
    letter-spacing: 3px;
}

.mm-plate--xlarge {
    font-size: var(--mm-plate-font-size-xlarge);
    padding: 16px 28px;
    letter-spacing: 4px;
}

/* ==========================================================================
   Plate Container & Link Styles
   ========================================================================== */

.mm-plate-container {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.mm-plate-price {
    font-size: 14px;
    font-weight: bold;
    color: var(--mm-search-primary);
}

.mm-plate-link {
    text-decoration: none;
    display: inline-block;
}

.mm-plate-link:hover .mm-plate,
.mm-plate-link:focus .mm-plate {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.mm-plate-link:hover .mm-plate--rear {
    background-color: var(--mm-plate-yellow-hover);
}

.mm-plate-link:hover .mm-plate--front {
    background-color: var(--mm-plate-white-hover);
}

.mm-plate-link:focus {
    outline: 2px solid var(--mm-search-primary);
    outline-offset: 4px;
    border-radius: 4px;
}

/* ==========================================================================
   Search Form Wrapper
   ========================================================================== */

.mm-plate-search-wrapper {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
}

.mm-plate-search-form {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   Search Input Styles
   ========================================================================== */

.mm-search-input-wrapper {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}

#mm-search-query,
.mm-search-input {
    flex: 1;
    padding: 16px 20px;
    font-size: 22px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 3px;
    border: 3px solid var(--mm-plate-yellow);
    border-radius: var(--mm-plate-border-radius);
    background: var(--mm-plate-yellow);
    color: var(--mm-plate-black);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    min-width: 0; /* Allow shrinking in flexbox */
}

#mm-search-query::placeholder,
.mm-search-input::placeholder {
    color: rgba(0, 0, 0, 0.4);
    text-transform: none;
    letter-spacing: normal;
    font-weight: bold;
    font-size: 16px;
}

#mm-search-query:focus,
.mm-search-input:focus {
    border-color: var(--mm-plate-black);
    box-shadow: 0 0 0 3px rgba(242, 180, 7, 0.3);
}

/* ==========================================================================
   Search Button
   ========================================================================== */

.mm-search-button {
    padding: 16px 32px;
    font-size: 16px;
    font-weight: bold;
    background: var(--mm-search-primary);
    color: white;
    border: none;
    border-radius: var(--mm-plate-border-radius);
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 120px;
}

.mm-search-button:hover {
    background: var(--mm-search-primary-hover);
}

.mm-search-button:active {
    background: var(--mm-search-primary-active);
    transform: translateY(1px);
}

.mm-search-button:focus {
    outline: 2px solid var(--mm-search-primary);
    outline-offset: 2px;
}

.mm-search-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Button loading state */
.mm-search-button--loading .mm-search-button-text {
    opacity: 0;
}

.mm-search-button--loading .mm-search-button-spinner {
    display: block;
}

.mm-search-button-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: mm-spin 0.8s linear infinite;
    position: absolute;
}

/* ==========================================================================
   Search Help Text
   ========================================================================== */

.mm-search-help-text {
    font-size: 13px;
    color: var(--mm-search-text-muted);
    margin: 0 0 15px 0;
    text-align: center;
}

/* ==========================================================================
   Search Filters
   ========================================================================== */

.mm-search-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 14px;
    color: var(--mm-search-text-light);
    padding-top: 15px;
    border-top: 1px solid var(--mm-search-border);
}

.mm-filter-checkbox,
.mm-filter-select {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.mm-filter-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.mm-search-filters select {
    padding: 6px 12px;
    border: 1px solid var(--mm-search-border);
    border-radius: 4px;
    background: white;
    font-size: 14px;
    cursor: pointer;
}

.mm-search-filters select:focus {
    outline: 2px solid var(--mm-search-primary);
    outline-offset: 1px;
}

/* ==========================================================================
   Search Results Container
   ========================================================================== */

.mm-search-results,
.mm-plate-results-container,
.mm-search-results-container {
    margin-top: 30px;
}

.mm-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--mm-search-border);
}

.mm-results-count {
    font-size: 16px;
    color: var(--mm-search-text);
}

.mm-results-count strong {
    color: var(--mm-search-primary);
}

/* ==========================================================================
   Results Grid
   ========================================================================== */

.mm-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 10px 0;
}

.mm-result-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 15px;
    background: var(--mm-search-bg);
    border: 1px solid var(--mm-search-border);
    border-radius: 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}

.mm-result-item:hover {
    border-color: var(--mm-plate-yellow);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.mm-result-item:focus {
    outline: 2px solid var(--mm-search-primary);
    outline-offset: 2px;
}

.mm-result-plate {
    margin-bottom: 15px;
}

.mm-result-details {
    text-align: center;
    margin-bottom: 12px;
}

.mm-result-price {
    font-size: 18px;
    font-weight: bold;
    color: var(--mm-search-primary);
}

.mm-result-type {
    font-size: 12px;
    color: var(--mm-search-text-muted);
    margin-top: 4px;
    text-transform: capitalize;
}

.mm-result-link {
    display: inline-block;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--mm-search-primary);
    text-decoration: none;
    border: 1px solid var(--mm-search-primary);
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.mm-result-link:hover {
    background: var(--mm-search-primary);
    color: white;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.mm-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--mm-search-border);
}

.mm-page-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--mm-search-primary);
    background: white;
    border: 1px solid var(--mm-search-primary);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.mm-page-btn:hover:not(.mm-page-btn--disabled) {
    background: var(--mm-search-primary);
    color: white;
}

.mm-page-btn--disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.mm-page-info {
    font-size: 14px;
    color: var(--mm-search-text-light);
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.mm-loading {
    text-align: center;
    padding: 50px 20px;
    color: var(--mm-search-text-light);
}

.mm-loading-spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 4px solid var(--mm-search-border);
    border-top-color: var(--mm-plate-yellow);
    border-radius: 50%;
    animation: mm-spin 0.8s linear infinite;
    margin-bottom: 15px;
}

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

/* ==========================================================================
   No Results & Error States
   ========================================================================== */

.mm-no-results,
.mm-error,
.mm-message {
    text-align: center;
    padding: 50px 20px;
    background: var(--mm-search-bg);
    border-radius: 10px;
}

.mm-no-results-icon,
.mm-error-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.mm-error-icon {
    color: #e74c3c;
}

.mm-no-results-text {
    font-size: 18px;
    color: var(--mm-search-text);
    margin-bottom: 15px;
}

.mm-no-results-suggestions {
    font-size: 14px;
    color: var(--mm-search-text-muted);
    text-align: left;
    max-width: 400px;
    margin: 0 auto;
}

.mm-no-results-suggestions ul {
    margin: 10px 0 0 20px;
    padding: 0;
}

.mm-no-results-suggestions li {
    margin-bottom: 5px;
}

.mm-error p {
    font-size: 16px;
    color: #e74c3c;
    margin-bottom: 15px;
}

.mm-retry-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    background: var(--mm-search-primary);
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.mm-retry-btn:hover {
    background: var(--mm-search-primary-hover);
}

/* ==========================================================================
   Featured Plates Section
   ========================================================================== */

.mm-featured-plates {
    padding: 20px 0;
}

.mm-featured-plates-title {
    font-size: 24px;
    font-weight: bold;
    color: var(--mm-search-text);
    margin-bottom: 20px;
    text-align: center;
}

.mm-featured-plates--empty {
    text-align: center;
    padding: 40px;
    background: var(--mm-search-bg);
    border-radius: 10px;
}

/* ==========================================================================
   Plate Grid Layout
   ========================================================================== */

.mm-plate-grid-container,
.mm-featured-plates {
    --mm-grid-columns: 4;
}

.mm-plate-grid {
    display: grid;
    grid-template-columns: repeat(var(--mm-grid-columns), 1fr);
    gap: 20px;
    padding: 10px 0;
}

.mm-plate-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 15px;
    background: var(--mm-search-bg);
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mm-plate-grid-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.mm-plate-grid-item .mm-plate {
    margin-bottom: 10px;
}

.mm-plate-grid-price {
    font-size: 16px;
    font-weight: bold;
    color: var(--mm-search-primary);
}

/* ==========================================================================
   Static Page Plate Tables
   ========================================================================== */

/* Style for existing plate tables in static content pages */
.plate-table,
.mm-static-plates {
    width: 100%;
    border-collapse: separate;
    border-spacing: 10px;
}

.plate-table td,
.mm-static-plates td {
    padding: 0;
    vertical-align: middle;
}

/* Convert plain text cells to plate styling */
.plate-table td.plate-cell,
.mm-static-plates td.plate-cell,
.plate-cell {
    background-color: var(--mm-plate-yellow);
    color: var(--mm-plate-black);
    font-family: 'UKNumberPlate', 'Arial Black', 'Arial Bold', Helvetica, sans-serif;
    font-weight: bold;
    font-size: var(--mm-plate-font-size-standard);
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: var(--mm-plate-padding-y) var(--mm-plate-padding-x);
    border: var(--mm-plate-border-width) solid var(--mm-plate-border);
    border-radius: var(--mm-plate-border-radius);
    text-align: center;
    white-space: nowrap;
}

/* ==========================================================================
   Screen Reader Only (Accessibility)
   ========================================================================== */

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    clip-path: none;
    color: #21759b;
    display: block;
    font-size: 14px;
    font-weight: bold;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 900px) {
    .mm-plate-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .mm-plate-search-wrapper {
        padding: 15px;
    }
    
    .mm-plate-search-form {
        padding: 20px;
    }
    
    .mm-search-input-wrapper {
        flex-direction: column;
        gap: 10px;
    }
    
    #mm-search-query,
    .mm-search-input {
        font-size: 18px;
        padding: 14px 16px;
        letter-spacing: 2px;
    }
    
    .mm-search-button {
        width: 100%;
        padding: 14px 20px;
    }
    
    .mm-search-filters {
        flex-direction: column;
        gap: 12px;
    }
    
    .mm-filter-select {
        flex-wrap: wrap;
    }
    
    .mm-results-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .mm-result-item {
        padding: 15px 12px;
    }
    
    .mm-plate--standard {
        font-size: 16px;
        padding: 6px 10px;
    }
    
    .mm-plate--large {
        font-size: var(--mm-plate-font-size-standard);
    }
    
    .mm-plate-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .mm-pagination {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .mm-page-info {
        width: 100%;
        text-align: center;
        order: -1;
    }
}

@media (max-width: 480px) {
    .mm-plate-search-wrapper {
        padding: 10px;
    }
    
    .mm-plate-search-form {
        padding: 15px;
    }
    
    #mm-search-query,
    .mm-search-input {
        font-size: 16px;
        letter-spacing: 1px;
        padding: 12px 14px;
    }
    
    .mm-results-grid {
        grid-template-columns: 1fr;
    }
    
    .mm-plate-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .mm-plate-grid-item {
        padding: 10px;
    }
    
    .mm-plate--standard {
        font-size: 14px;
        padding: 5px 8px;
        letter-spacing: 1px;
    }
    
    .mm-result-price {
        font-size: 16px;
    }
    
    .mm-featured-plates-title {
        font-size: 20px;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .mm-plate {
        box-shadow: none;
        border-color: #000;
    }
    
    .mm-plate--rear {
        background-color: #F2B407 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .mm-plate--front {
        background-color: #FFFFFF !important;
    }
    
    .mm-search-button,
    .mm-search-filters,
    .mm-pagination,
    .mm-result-link {
        display: none;
    }
    
    .mm-results-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ==========================================================================
   High Contrast Mode Support
   ========================================================================== */

@media (prefers-contrast: high) {
    .mm-plate {
        border-width: 3px;
    }
    
    .mm-plate--rear {
        background-color: #FFB800;
    }
    
    .mm-result-item {
        border-width: 2px;
    }
    
    .mm-search-button {
        border: 2px solid currentColor;
    }
}

/* ==========================================================================
   Reduced Motion Support
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .mm-plate,
    .mm-plate-link .mm-plate,
    .mm-result-item,
    .mm-plate-grid-item,
    .mm-search-button,
    .mm-loading-spinner,
    .mm-search-button-spinner {
        transition: none;
        animation: none;
    }
}

/* ==========================================================================
   Dark Mode Support (if theme supports it)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    :root {
        --mm-search-bg: #2a2a2a;
        --mm-search-border: #444;
        --mm-search-text: #eee;
        --mm-search-text-light: #bbb;
        --mm-search-text-muted: #888;
    }
    
    .mm-plate-search-form {
        background: #1a1a1a;
    }
    
    .mm-result-item,
    .mm-plate-grid-item {
        background: var(--mm-search-bg);
        border-color: var(--mm-search-border);
    }
    
    .mm-search-filters select {
        background: #333;
        color: #eee;
        border-color: var(--mm-search-border);
    }
    
    .mm-result-link {
        color: #4da6d9;
        border-color: #4da6d9;
    }
    
    .mm-result-link:hover {
        background: #4da6d9;
        color: #000;
    }
}

/* ==========================================================================
   UK Number Plate Font Note
   ========================================================================== */

/*
 * The official UK number plate font is "Charles Wright"
 * For web use, we fall back to system fonts that approximate the look.
 * For authentic styling, consider loading a web font version.
 *
 * @font-face {
 *     font-family: 'UKNumberPlate';
 *     src: url('path/to/charles-wright.woff2') format('woff2');
 *     font-weight: bold;
 *     font-display: swap;
 * }
 */

/* ==========================================================================
   Grouped Results Layout (Live Site Style)
   ========================================================================== */

/* Container for grouped results */
.mm-results-grouped {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Individual result group section */
.mm-result-group {
    background: #fff;
    border: 1px solid var(--mm-search-border);
    border-radius: 8px;
    overflow: hidden;
}

/* Group header - "Results in: Antique" style */
.mm-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #151854;
    color: white;
}

.mm-group-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.mm-group-count {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

/* Results within a group - table/row layout */
.mm-group-results {
    padding: 0;
}

/* Individual plate row in grouped view */
.mm-result-row {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid #eee;
    gap: 15px;
    transition: background-color 0.15s ease;
}

.mm-result-row:last-child {
    border-bottom: none;
}

.mm-result-row:hover {
    background-color: #f8f9fa;
}

/* Plate display in row */
.mm-row-plate {
    flex: 0 0 auto;
    min-width: 140px;
}

.mm-row-plate .mm-plate {
    font-size: 16px;
    padding: 6px 12px;
}

.mm-row-plate a {
    text-decoration: none;
}

/* Price in row */
.mm-row-price {
    flex: 0 0 80px;
    font-size: 15px;
    font-weight: 600;
    color: var(--mm-search-text);
}

/* Action buttons container */
.mm-row-actions {
    display: flex;
    gap: 8px;
    flex: 1;
    justify-content: flex-start;
}

/* Order/Enquire buttons */
.mm-btn-order,
.mm-btn-enquire,
.mm-btn-offer {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.mm-btn-order {
    background-color: #151854;
    color: white;
}

.mm-btn-order:hover {
    background-color: #1c2870;
}

.mm-btn-enquire {
    background-color: #F2B407;
    color: #000;
}

.mm-btn-enquire:hover {
    background-color: #d9a006;
}

.mm-btn-offer {
    background-color: #fff;
    color: #151854;
    border: 2px solid #151854;
}

.mm-btn-offer:hover {
    background-color: #151854;
    color: #fff;
}

/* P.O.A. plates: Order button rendered as a faded span. Cursor stays as the
   normal pointer; clicking reveals the explanation via .mm-btn--show-msg. */
.mm-btn--disabled,
.mm-btn--disabled:hover {
    background-color: #b8baca !important;
    color: #6c6e80 !important;
    user-select: none;
    position: relative;
}

.mm-btn--disabled.mm-btn--show-msg::after {
    content: attr(data-message);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #151854;
    color: #fff;
    padding: 7px 11px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
    z-index: 20;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
    pointer-events: none;
}

.mm-btn--disabled.mm-btn--show-msg::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 3px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #151854;
    z-index: 20;
    pointer-events: none;
}

/* Similar count link */
.mm-row-similar {
    flex: 0 0 auto;
    margin-left: auto;
}

.mm-similar-link {
    display: inline-block;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--mm-search-primary);
    background-color: #e8f4fc;
    border: 1px solid var(--mm-search-primary);
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.mm-similar-link:hover {
    background-color: var(--mm-search-primary);
    color: white;
}

.mm-unique-match {
    display: inline-block;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #888;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* See more results button */
.mm-see-more-btn {
    display: block;
    width: 100%;
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    background-color: #f39c12;
    border: none;
    border-radius: 0;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.mm-see-more-btn:hover {
    background-color: #d68910;
    color: white;
}

/* Hide pagination in grouped mode */
.mm-pagination-hidden {
    display: none;
}

/* ==========================================================================
   Single Type View Styles
   ========================================================================== */

/* Container for single type results */
.mm-single-type-results {
    background: #fff;
    border: 1px solid var(--mm-search-border);
    border-radius: 8px;
    overflow: hidden;
}

/* Type header with title and back link */
.mm-type-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #151854;
    color: white;
    gap: 10px;
}

.mm-back-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    color: white;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.mm-back-link:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.mm-type-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.mm-type-total {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

/* Results list in single type view */
.mm-type-results-list {
    padding: 0;
}

/* Back to all results link (legacy) */
.mm-filter-back-link {
    margin-bottom: 20px;
}

.mm-back-to-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--mm-search-primary);
    background: #f0f7fc;
    border: 1px solid var(--mm-search-primary);
    border-radius: 6px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.mm-back-to-all:hover {
    background: var(--mm-search-primary);
    color: white;
}

.mm-back-to-all svg {
    width: 16px;
    height: 16px;
}

/* Current type display */
.mm-filter-current-type {
    margin-bottom: 20px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
}

.mm-filter-current-type span {
    font-size: 13px;
    color: var(--mm-search-text-muted);
}

.mm-filter-type-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    background: var(--mm-search-primary);
    border-radius: 4px;
}

/* Search query subtitle */
.mm-search-hero-query {
    font-size: 14px;
    color: var(--mm-search-text-muted);
    margin-top: 8px;
}

/* ==========================================================================
   Grouped Results - Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .mm-result-row {
        flex-wrap: wrap;
        gap: 10px;
        padding: 15px;
    }

    .mm-row-plate {
        flex: 0 0 100%;
        text-align: center;
    }

    .mm-row-price {
        flex: 0 0 auto;
    }

    .mm-row-actions {
        flex: 1;
        justify-content: center;
    }

    .mm-row-similar {
        flex: 0 0 100%;
        margin-left: 0;
        text-align: center;
    }

    .mm-btn-order,
    .mm-btn-enquire,
    .mm-btn-offer {
        padding: 10px 14px;
        font-size: 12px;
    }

    .mm-group-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .mm-row-actions {
        flex-wrap: wrap;
        justify-content: center;
    }

    .mm-btn-order,
    .mm-btn-enquire,
    .mm-btn-offer,
    .mm-similar-link {
        flex: 1 1 45%;
        text-align: center;
    }
}

/* ================================================
   SINGLE-PLATE BUY / ENQUIRE BUTTONS
================================================ */
.mm-price-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}
.mm-buy-button,
.mm-enquire-button {
    display: block;
    width: 100%;
    padding: 14px 20px;
    font-size: 17px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    background: linear-gradient(180deg, #ffcc00 0%, #ff9900 100%);
    color: #000;
    border: 2px solid #000;
    border-radius: 8px;
    cursor: pointer;
    transition: filter 0.2s;
    font-family: inherit;
}
.mm-buy-button:hover,
.mm-enquire-button:hover {
    filter: brightness(1.08);
}
.mm-call-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: #fff;
    color: #151854;
    border: 2px solid #151854;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
}
.mm-call-button:hover {
    background: #151854;
    color: #fff;
}

/* ==========================================================================
   PLATE CHARACTER SPRITES (lifted from live PrestaShop site)
   Each plate character is a <div class="ln ln_X"> showing a slice of
   the largeletters.png sprite. Sizes: in (ickle), sn (small), mn (med), ln (large).
   ========================================================================== */
.inback{padding:3px 0;text-align:center;width:108px;height:20px;background:url("../img/plates/gold_grad.png") repeat scroll 0 0 #ff9900;-moz-box-shadow:0 0 2px #000;-webkit-box-shadow:0 0 2px #000;box-shadow:0 0 2px #000;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px}
.inlcont{height:25px;display:inline-block;display:inline !ie7}
.in{background:url("../img/plates/ickleletters.png") no-repeat scroll 0 0 transparent;float:left;height:19px}
.in_space{background-position:0 0;width:5px}
.in_0{background-position:-5px 0;width:12px}
.in_1{background-position:-17px 0;width:5px}
.in_2{background-position:-22px 0;width:12px}
.in_3{background-position:-34px 0;width:12px}
.in_4{background-position:-46px 0;width:12px}
.in_5{background-position:-58px 0;width:12px}
.in_6{background-position:-70px 0;width:12px}
.in_7{background-position:-82px 0;width:12px}
.in_8{background-position:-94px 0;width:12px}
.in_9{background-position:-106px 0;width:12px}
.in_a{background-position:-118px 0;width:12px}
.in_b{background-position:-130px 0;width:12px}
.in_c{background-position:-142px 0;width:12px}
.in_d{background-position:-154px 0;width:12px}
.in_e{background-position:-166px 0;width:12px}
.in_f{background-position:-178px 0;width:12px}
.in_g{background-position:-190px 0;width:12px}
.in_h{background-position:-202px 0;width:12px}
.in_i{background-position:-17px 0;width:5px}
.in_j{background-position:-214px 0;width:12px}
.in_k{background-position:-226px 0;width:12px}
.in_l{background-position:-238px 0;width:12px}
.in_m{background-position:-250px 0;width:12px}
.in_n{background-position:-262px 0;width:12px}
.in_o{background-position:-274px 0;width:12px}
.in_p{background-position:-286px 0;width:12px}
.in_r{background-position:-298px 0;width:12px}
.in_s{background-position:-310px 0;width:12px}
.in_t{background-position:-322px 0;width:12px}
.in_u{background-position:-334px 0;width:12px}
.in_v{background-position:-346px 0;width:12px}
.in_w{background-position:-358px 0;width:12px}
.in_x{background-position:-370px 0;width:12px}
.in_y{background-position:-382px 0;width:12px}
.in_z{background-position:-394px 0;width:12px}
.snback{padding:4px 0;text-align:center;width:150px;background:#ffd208;-moz-box-shadow:0 0 2px #000;-webkit-box-shadow:0 0 2px #000;box-shadow:0 0 2px #000;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}
.snlcont{height:20px;display:inline-block;display:inline !ie7}
.sn{background:url("../img/plates/smallletters.png") no-repeat scroll 0 0 transparent;float:left;height:23px}
.sn_space{background-position:0 0;width:11px}
.sn_0{background-position:-11px 0;width:15px}
.sn_1{background-position:-26px 0;width:7px}
.sn_2{background-position:-33px 0;width:15px}
.sn_3{background-position:-48px 0;width:15px}
.sn_4{background-position:-63px 0;width:15px}
.sn_5{background-position:-78px 0;width:15px}
.sn_6{background-position:-93px 0;width:15px}
.sn_7{background-position:-108px 0;width:15px}
.sn_8{background-position:-123px 0;width:15px}
.sn_9{background-position:-138px 0;width:15px}
.sn_a{background-position:-153px 0;width:15px}
.sn_b{background-position:-168px 0;width:15px}
.sn_c{background-position:-183px 0;width:15px}
.sn_d{background-position:-198px 0;width:15px}
.sn_e{background-position:-213px 0;width:15px}
.sn_f{background-position:-228px 0;width:15px}
.sn_g{background-position:-243px 0;width:15px}
.sn_h{background-position:-258px 0;width:15px}
.sn_i{background-position:-26px 0;width:7px}
.sn_j{background-position:-273px 0;width:15px}
.sn_k{background-position:-288px 0;width:15px}
.sn_l{background-position:-303px 0;width:15px}
.sn_m{background-position:-318px 0;width:15px}
.sn_n{background-position:-333px 0;width:15px}
.sn_o{background-position:-348px 0;width:15px}
.sn_p{background-position:-363px 0;width:15px}
.sn_r{background-position:-378px 0;width:15px}
.sn_s{background-position:-393px 0;width:15px}
.sn_t{background-position:-408px 0;width:15px}
.sn_u{background-position:-423px 0;width:15px}
.sn_v{background-position:-438px 0;width:15px}
.sn_w{background-position:-453px 0;width:15px}
.sn_x{background-position:-468px 0;width:15px}
.sn_y{background-position:-483px 0;width:15px}
.sn_z{background-position:-498px 0;width:15px}
.mnback{padding:8px 5px 0;text-align:center;width:248px;background:#ffd208;-moz-box-shadow:0 0 3px #000;-webkit-box-shadow:0 0 3px #000;box-shadow:0 0 3px #000;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px}
.mnlcont{height:40px;display:inline-block;display:inline !ie7}
.mn{background:url("../img/plates/medletters.png") no-repeat scroll 0 0 transparent;float:left;height:43px}
.mn_space{background-position:0 0;width:9px}
.mn_0{background-position:-9px 0;width:29px}
.mn_1{background-position:-38px 0;width:12px}
.mn_2{background-position:-50px 0;width:29px}
.mn_3{background-position:-79px 0;width:29px}
.mn_4{background-position:-108px 0;width:29px}
.mn_5{background-position:-137px 0;width:29px}
.mn_6{background-position:-166px 0;width:29px}
.mn_7{background-position:-195px 0;width:29px}
.mn_8{background-position:-224px 0;width:29px}
.mn_9{background-position:-253px 0;width:29px}
.mn_a{background-position:-282px 0;width:29px}
.mn_b{background-position:-311px 0;width:29px}
.mn_c{background-position:-340px 0;width:29px}
.mn_d{background-position:-369px 0;width:29px}
.mn_e{background-position:-398px 0;width:29px}
.mn_f{background-position:-427px 0;width:29px}
.mn_g{background-position:-456px 0;width:29px}
.mn_h{background-position:-485px 0;width:29px}
.mn_i{background-position:-38px 0;width:12px}
.mn_j{background-position:-514px 0;width:29px}
.mn_k{background-position:-543px 0;width:29px}
.mn_l{background-position:-572px 0;width:29px}
.mn_m{background-position:-601px 0;width:29px}
.mn_n{background-position:-630px 0;width:29px}
.mn_o{background-position:-659px 0;width:29px}
.mn_p{background-position:-688px 0;width:29px}
.mn_r{background-position:-717px 0;width:29px}
.mn_s{background-position:-746px 0;width:29px}
.mn_t{background-position:-775px 0;width:29px}
.mn_u{background-position:-804px 0;width:29px}
.mn_v{background-position:-833px 0;width:29px}
.mn_w{background-position:-862px 0;width:29px}
.mn_x{background-position:-891px 0;width:29px}
.mn_y{background-position:-920px 0;width:29px}
.mn_z{background-position:-949px 0;width:29px}
.lnback{padding:10px 0 2px;text-align:center;width:578px;background:#ffd208;-moz-box-shadow:0 0 3px #000;-webkit-box-shadow:0 0 3px #000;box-shadow:0 0 3px #000;-moz-border-radius:8px;-webkit-border-radius:8px;border-radius:8px}

/* Mini plate wrapper for inline lists (search results, tables, etc.)
   Uses the `.mn` medium sprite chars — same glyphs as the single-plate hero,
   just scaled down. Fixed width so every plate in a list is identical
   regardless of reg length. Max UK reg content ≈ 200px; 210px content area
   gives breathing room. */
.mm-plate-mini {
    display: inline-block;
    width: 250px;
    box-sizing: border-box;
    padding: 7px 10px 9px;
    background: #ffd208;
    border: 2px solid #1a1a1a;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    line-height: 0;
    text-align: center;
    vertical-align: middle;
    /* Prevent sprite chars from wrapping onto a second line on the widest
       UK formats (e.g. suffix "CCN 580 B" = ~221px content). */
    white-space: nowrap;
    /* Render at 81% of the natural size (two 0.9 reductions). Shrinks border,
       padding, sprite chars and shadow proportionally. */
    transform: scale(0.81);
    transform-origin: center center;
}
/* Within the mini wrapper, chars are inline-block (not floated) so
   text-align:center actually centres short regs. The global `.mn { float:left }`
   rule from the legacy sprite block is overridden here. */
.mm-plate-mini .mn {
    float: none;
    display: inline-block;
    vertical-align: top;
    margin: 0;
}
.lnlcont{height:93px;display:inline-block;display:inline !ie7}
.ln{background:url("../img/plates/largeletters.png") no-repeat scroll 0 0 transparent;float:left;height:98px}
.ln_space{background-position:0 0;width:31px}
.ln_0{background-position:-31px 0;width:70px}
.ln_1{background-position:-101px 0;width:26px}
.ln_2{background-position:-127px 0;width:70px}
.ln_3{background-position:-197px 0;width:70px}
.ln_4{background-position:-267px 0;width:70px}
.ln_5{background-position:-337px 0;width:70px}
.ln_6{background-position:-407px 0;width:70px}
.ln_7{background-position:-477px 0;width:70px}
.ln_8{background-position:-547px 0;width:70px}
.ln_9{background-position:-617px 0;width:70px}
.ln_a{background-position:-687px 0;width:70px}
.ln_b{background-position:-757px 0;width:70px}
.ln_c{background-position:-827px 0;width:70px}
.ln_d{background-position:-897px 0;width:70px}
.ln_e{background-position:-967px 0;width:70px}
.ln_f{background-position:-1037px 0;width:70px}
.ln_g{background-position:-1107px 0;width:70px}
.ln_h{background-position:-1177px 0;width:70px}
.ln_i{background-position:-101px 0;width:26px}
.ln_j{background-position:-1247px 0;width:70px}
.ln_k{background-position:-1317px 0;width:70px}
.ln_l{background-position:-1387px 0;width:70px}
.ln_m{background-position:-1457px 0;width:70px}
.ln_n{background-position:-1527px 0;width:70px}
.ln_o{background-position:-1597px 0;width:70px}
.ln_p{background-position:-1667px 0;width:70px}
.ln_r{background-position:-1737px 0;width:70px}
.ln_s{background-position:-1807px 0;width:70px}
.ln_t{background-position:-1877px 0;width:70px}
.ln_u{background-position:-1947px 0;width:70px}
.ln_v{background-position:-2017px 0;width:70px}
.ln_w{background-position:-2087px 0;width:70px}
.ln_x{background-position:-2157px 0;width:70px}
.ln_y{background-position:-2227px 0;width:70px}
.ln_z{background-position:-2297px 0;width:70px}

/* Watermark/subtext positioning inside plate backs (lifted from live) */
.reg_subtext { display: none; }
.lnback .reg_subtext { font-size: 14px; display: block; margin-top: 8px; }
.mnback .reg_subtext { font-size: 8px;  display: block; margin-top: 4px; }
.snback .reg_subtext { font-size: 6px;  display: block; margin-top: 3px; }

/* Plate sprite cells inside listing tables: tidy spacing + link decoration */
.mm-plate-table td .snback,
.mm-plate-table td .mnback,
.mm-plate-table td .inback { display: inline-block; }
.mm-plate-link { text-decoration: none; }
.mm-plate-link:hover .snback,
.mm-plate-link:hover .mnback,
.mm-plate-link:hover .inback { box-shadow: 0 0 0 2px #151854; }
