/* Channelmotive Styles */

/* Confirmation Dialog */
.cm-confirm-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.cm-confirm-dialog-overlay.cm-confirm-dialog-show {
    opacity: 1;
}

.cm-confirm-dialog {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.cm-confirm-dialog-overlay.cm-confirm-dialog-show .cm-confirm-dialog {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.cm-confirm-dialog-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e0e0e0;
}

.cm-confirm-dialog-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1d2327;
    line-height: 1.4;
}

.cm-confirm-dialog-body {
    padding: 24px;
}

.cm-confirm-dialog-message {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    color: #50575e;
}

.cm-confirm-dialog-footer {
    padding: 16px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    border-top: 1px solid #e0e0e0;
}

.cm-confirm-dialog-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
}

.cm-confirm-dialog-cancel {
    background: #f0f0f1;
    color: #2c3338;
}

.cm-confirm-dialog-cancel:hover {
    background: #dcdcde;
    color: #1d2327;
}

.cm-confirm-dialog-confirm {
    background: #2271b1;
    color: #fff;
}

.cm-confirm-dialog-confirm:hover {
    background: #135e96;
    color: #fff;
}

.cm-confirm-dialog-confirm:active {
    background: #0a4b78;
}

.cm-confirm-dialog-cancel:active {
    background: #c3c4c7;
}

@media (max-width: 768px) {
    .cm-confirm-dialog {
        width: 95%;
        margin: 20px;
    }
    
    .cm-confirm-dialog-header {
        padding: 20px 20px 14px;
    }
    
    .cm-confirm-dialog-title {
        font-size: 18px;
    }
    
    .cm-confirm-dialog-body {
        padding: 20px;
    }
    
    .cm-confirm-dialog-message {
        font-size: 15px;
    }
    
    .cm-confirm-dialog-footer {
        padding: 14px 20px 20px;
        flex-direction: column-reverse;
    }
    
    .cm-confirm-dialog-btn {
        width: 100%;
    }
}

/* Toast Notifications */
.cm-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #fff;
    border-left: 4px solid #d63638;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 14px 20px;
    min-width: 300px;
    max-width: 500px;
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
}

.cm-toast-show {
    opacity: 1;
    transform: translateY(0);
}

.cm-toast-error {
    border-left-color: #d63638;
    background: #fff;
}

.cm-toast-error .cm-toast-message {
    color: #d63638;
}

.cm-toast-success {
    border-left-color: #00a32a;
    background: #fff;
}

.cm-toast-success .cm-toast-message {
    color: #00a32a;
}

.cm-toast-warning {
    border-left-color: #dba617;
    background: #fff;
}

.cm-toast-warning .cm-toast-message {
    color: #dba617;
}

.cm-toast-info {
    border-left-color: #72aee6;
    background: #fff;
}

.cm-toast-info .cm-toast-message {
    color: #72aee6;
}

/* Toast position variants */
.cm-toast-position-top-right {
    top: 20px;
    right: 20px;
    bottom: auto;
    left: auto;
}

.cm-toast-position-top-left {
    top: 20px;
    left: 20px;
    right: auto;
    bottom: auto;
}

.cm-toast-position-bottom-right {
    bottom: 20px;
    right: 20px;
    top: auto;
    left: auto;
}

.cm-toast-position-bottom-left {
    bottom: 20px;
    left: 20px;
    top: auto;
    right: auto;
}

.cm-toast-position-top-center {
    top: 20px;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translateX(-50%) translateY(20px);
}

.cm-toast-position-top-center.cm-toast-show {
    transform: translateX(-50%) translateY(0);
}

.cm-toast-position-bottom-center {
    bottom: 20px;
    left: 50%;
    right: auto;
    top: auto;
    transform: translateX(-50%) translateY(20px);
}

.cm-toast-position-bottom-center.cm-toast-show {
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 768px) {
    .cm-toast {
        right: 10px;
        left: 10px;
        bottom: 10px;
        top: auto;
        min-width: auto;
        max-width: none;
    }
    
    .cm-toast-position-top-center,
    .cm-toast-position-bottom-center {
        left: 10px;
        right: 10px;
        transform: translateY(20px);
    }
    
    .cm-toast-position-top-center.cm-toast-show,
    .cm-toast-position-bottom-center.cm-toast-show {
        transform: translateY(0);
    }
}

/* Load Kenteken font for finder and drawer only */
@font-face {
    font-family: 'Kenteken';
    src: url('../fonts/Kenteken.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Override WordPress theme max-width for plugin elements */
/* Prevents var(--wp--style--global--content-size) from affecting drawer and overlay */
.cm-container,
.cm-container *,
.cm-drawer,
.cm-drawer *,
.cm-drawer-overlay {
    max-width: none !important;
}

.cm-container-wrapper {
    text-align: left;
}

.cm-container {
    margin: 20px 0;
    max-width: 368px !important;
    width: auto;
    display: inline-block;
}

.cm-search-form {
    background: rgb(22, 163, 74);
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    width: 368px;
    box-sizing: border-box;
}

.cm-search-form:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    background-color: rgb(34 197 94);
}

/* Hover background for partial selection */
.cm-search-form.has-partial-selection:hover {
    background-color: rgb(254 252 232) !important;
}

.cm-search-form-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 10px;
}

.cm-header-icon-section {
    flex-shrink: 0;
    color: #fff;
}

.cm-header-icon-section.cm-hidden {
    display: none;
}

/* When no partial or complete selection, keep icon section white */
.cm-search-form:not(.has-partial-selection):not(.has-complete-selection) .cm-header-icon-section {
    color: #fff;
}

.cm-search-form:not(.has-partial-selection):not(.has-complete-selection) .cm-header-icon-section .cm-check-icon {
    color: #fff;
}

.cm-header-text-section {
    flex: 1;
    color: #fff;
    font-size: 13px;
    line-height: 1.5;
}

.cm-header-text-section.cm-hidden {
    display: none;
}

/* When background is yellow (invalid plate or partial selection), use black text */
.cm-search-form.has-invalid-plate .cm-header-text-section,
.cm-search-form.has-partial-selection .cm-header-text-section {
    color: #000;
}

/* When invalid plate, set manual entry text to black */
.cm-search-form.has-invalid-plate #cm-manual-entry-text {
    color: #000 !important;
}

/* When background is green (valid plate), use white text */
.cm-search-form.has-valid-plate .cm-header-text-section {
    color: #fff;
}

/* Sticky bar invalid/valid plate - match finder styles */
.cm-results-sticky-bar.has-invalid-plate .cm-sticky-bar-info {
    color: #000;
}

.cm-results-sticky-bar.has-valid-plate .cm-sticky-bar-info {
    color: #fff;
}

.cm-results-sticky-bar.has-invalid-plate:not(.has-partial-selection):not(.has-complete-selection) .cm-header-icon-section .cm-check-icon {
    color: #FB1;
}

.cm-message-text {
    font-weight: 700;
    margin-bottom: 5px;
    font-size: 14px;
}

.cm-check-icon {
    width: 35px;
    height: 35px;
    flex-shrink: 0;
    color: inherit;
}

.cm-message-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    min-width: 14px;
    min-height: 14px;
    border-radius: 4px;
    flex-shrink: 0;
    padding: 15px;
    box-sizing: content-box;
}

.cm-message-icon-warning {
    background: rgb(234, 179, 8);
}

.cm-message-icon-success {
    background: rgb(22, 163, 74);
}

.cm-icon-svg {
    width: 25px;
    height: 25px;
    min-width: 25px;
    min-height: 25px;
    display: block;
}

.cm-icon-svg path {
    fill: #fff !important;
}
button.cm-view-compatible-parts {
    border: none !important;
    background: rgb(241 245 249) !important;
}
button.cm-view-compatible-parts:hover {
    background: rgb(238 235 255) !important;
}
button.cm-view-compatible-parts span{
    font-size: 14px;
    font-weight: 600;
}
button.cm-clear-selection-summary {
    border: none !important;
    opacity: 1 !important;
    color: rgb(71 85 105);
}
button.cm-clear-selection-summary:hover {
    background: rgb(241 245 249) !important;
    color: rgb(71 85 105);
}
button.cm-edit-vehicle-summary {
    border: none !important;
    opacity: 1 !important;
    color: rgb(255 255 255);
    background-color: rgb(51 65 85) !important;
}
button.cm-edit-vehicle-summary:hover {
    background: rgb(30 41 59) !important;
    color: rgb(255 255 255);
    opacity: 1 !important;
}
button.cm-view-compatible-parts svg {
    margin-right: 1vw !important;
}
button.cm-view-compatible-parts path {
    fill: rgb(82 0 229) !important;
}

.cm-message-selection {
    font-weight: normal;
    margin-bottom: 5px;
    font-size: 15px;
    text-transform: uppercase;
}

.cm-message-description {
    font-size: 12px;
    opacity: 0.95;
    line-height: 1.4;
    color: rgb(202 138 4);
}

/* For partial selection, change description text color */
.cm-search-form.has-partial-selection .cm-message-description {
    color: rgb(var(254,252,232)/1);
}

.cm-search-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cm-search-label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
}

.cm-plate-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
    font-family: monospace;
    letter-spacing: 1px;
}

.cm-plate-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.cm-search-section {
    position: relative;
}

.cm-plate-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.cm-plate-input-wrapper:focus-within {
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.cm-plate-input-wrapper.has-invalid {
    border-color: #dc3232;
    box-shadow: 0 0 0 3px rgba(220, 50, 50, 0.1);
}

.cm-plate-input-wrapper.has-valid {
    border-color: #46b450;
    box-shadow: 0 0 0 3px rgba(70, 180, 80, 0.1);
}

.cm-flag-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    flex-shrink: 0;
    border-right: 1px solid #e0e0e0;
    background: #039;
}

.cm-flag-svg {
    width: 24px;
    height: auto;
    display: block;
}

.cm-plate-input {
    flex: 1;
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 0;
    font-size: 16px;
    transition: none;
    box-sizing: border-box;
    font-family: 'Kenteken', monospace, sans-serif;
    letter-spacing: 1px;
    background: transparent;
}

.cm-plate-input:focus {
    outline: none;
    border: none;
    box-shadow: none;
}

.cm-plate-input-wrapper {
    position: relative;
    /* Default placeholder width - will be overridden by JavaScript */
    --cm-placeholder-width: 90px;
}

.cm-plate-input::placeholder {
    color: #999;
    opacity: 1;
}

.cm-plate-input:not(:focus):placeholder-shown::placeholder {
    color: transparent;
}

/* Typing animation overlay - positioned relative to wrapper */
/* Flag icon: 12px padding + 23px icon + 12px padding = 47px total */
/* Input padding: 27px left, so text starts at 47px + 27px = 74px */
.cm-plate-input-wrapper::before {
    content: attr(data-placeholder);
    position: absolute;
    left: calc(12px + 23px + 12px + 27px);
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
    font-family: 'Kenteken', monospace, sans-serif;
    letter-spacing: 1px;
    font-size: 16px;
    line-height: 1;
    z-index: 1;
    display: none;
    color: #666;
}

/* Typing animation - show when input is empty and not focused */
/* Only animate if width is ready (has cm-width-ready class) */
.cm-plate-input-wrapper:not(.cm-has-focus):not(.cm-has-value).cm-width-ready::before {
    display: block;
    animation: cm-typing 1.5s steps(10) forwards;
}

/* Fallback for browsers without :has() support */
.cm-plate-input-wrapper:not(:has(.cm-plate-input:focus)):not(:has(.cm-plate-input:not(:placeholder-shown))).cm-width-ready::before {
    content: attr(data-placeholder);
    color: #666;
    display: block;
    animation: cm-typing 1.5s steps(10) forwards;
}

/* Blinking caret - follows typing text */
/* Flag icon: 12px padding + 23px icon + 12px padding = 47px total */
/* Input padding: 27px left, so text starts at 47px + 27px = 74px */
.cm-plate-input-wrapper::after {
    content: '';
    position: absolute;
    left: calc(12px + 23px + 12px + 27px);
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-family: monospace;
    font-size: 16px;
    line-height: 1;
    z-index: 2;
    font-weight: bold;
    display: none;
}

.cm-plate-input-wrapper:not(.cm-has-focus):not(.cm-has-value).cm-width-ready::after {
    content: '|';
    color: #0073aa;
    display: block;
    animation: cm-typing-cursor 1.5s linear forwards, cm-blink-caret 0.9s 1.5s infinite;
}

/* Fallback for browsers without :has() support */
.cm-plate-input-wrapper:not(:has(.cm-plate-input:focus)):not(:has(.cm-plate-input:not(:placeholder-shown))).cm-width-ready::after {
    content: '|';
    color: #0073aa;
    display: block;
    animation: cm-typing-cursor 1.5s linear forwards, cm-blink-caret 0.9s 1.5s infinite;
}

@keyframes cm-typing {
    0% {
        width: 0;
    }
    100% {
        width: var(--cm-placeholder-width, 90px);
    }
}

@keyframes cm-typing-cursor {
    0% {
        left: calc(12px + 23px + 12px + 27px);
        opacity: 1;
    }
    100% {
        left: var(--cm-placeholder-end-left, calc(12px + 23px + 12px + 27px + 90px));
        opacity: 1;
    }
}

@keyframes cm-blink-caret {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

.cm-plate-input:focus::placeholder {
    color: #999;
    opacity: 0.5;
}

/* Plate Input Validation Styles - applied to wrapper - must override focus states */
.cm-plate-input-wrapper.has-invalid {
    border-color: #dc3232 !important;
    box-shadow: 0 0 0 3px rgba(220, 50, 50, 0.1) !important;
}

.cm-plate-input-wrapper.has-invalid:focus-within {
    border-color: #dc3232 !important;
    box-shadow: 0 0 0 3px rgba(220, 50, 50, 0.1) !important;
}

.cm-plate-input-wrapper.has-valid {
    border-color: #46b450 !important;
    box-shadow: 0 0 0 3px rgba(70, 180, 80, 0.1) !important;
}

.cm-plate-input-wrapper.has-valid:focus-within {
    border-color: #46b450 !important;
    box-shadow: 0 0 0 3px rgba(70, 180, 80, 0.1) !important;
}

/* Background color states for search form */
.cm-search-form.has-partial-selection {
    background: rgb(254, 249, 195) !important;
}

.cm-search-form.has-complete-selection {
    background: rgb(220 252 231) !important;
}

.cm-search-form.has-complete-selection:hover {
    background: rgb(240, 253, 244) !important;
}

/* When type selection is completed, change text colors to black */
.cm-search-form.has-complete-selection .cm-header-text-section .cm-message-text,
.cm-search-form.has-complete-selection .cm-header-text-section .cm-message-selection {
    color: #000;
}

/* When type selection is completed, change delete icon and search button background */
.cm-search-form.has-complete-selection .cm-clear-selection-form {
    background: rgb(187, 247, 208);
}

.cm-search-form.has-complete-selection .cm-search-button {
    background: rgb(187, 247, 208);
    color: #000;
}

.cm-search-form.has-complete-selection .cm-search-button:hover:not(:disabled) {
    background: rgb(134, 239, 172);
}

.cm-search-form.has-invalid-plate {
    background: rgb(254, 249, 195) !important;
}

.cm-search-form.has-valid-plate {
    background: rgb(22, 163, 74) !important;
}

.cm-results-sticky-bar.has-invalid-plate {
    background: rgb(254, 249, 195) !important;
}

.cm-results-sticky-bar.has-valid-plate {
    background: rgb(22, 163, 74) !important;
}

.cm-plate-error {
    color: #dc3232;
    font-size: 13px;
    margin-top: 5px;
    display: block;
}

.cm-plate-error:empty {
    display: none;
}

.cm-search-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16.5px;
    border: none;
    border-left: 1px solid #e0e0e0;
    background: #1f2937;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
    border-radius: 0 6px 6px 0;
}

.cm-search-icon-btn:hover {
    background: #111827;
}

.cm-search-icon-btn:active {
    background: #0f172a;
}

.cm-search-icon {
    width: 20px;
    height: 20px;
    display: block;
}

.cm-or-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 5px 0;
    position: relative;
}

.cm-or-divider::before,
.cm-or-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

.cm-or-text {
    padding: 0 15px;
    font-weight: 600;
    color: #666;
    font-size: 14px;
    background: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cm-dropdowns {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.cm-dropdown-wrapper {
    flex: 0 0 auto;
    min-width: 200px;
    max-width: 100%;
    width: 100%;
}

.cm-dropdown-btn {
    width: 100%;
    padding: 12px 16px;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    transition: all 0.3s ease;
    text-align: left;
    border: none;
}

.cm-dropdown-btn:hover:not(.cm-disabled) {
    border-color: #0073aa;
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.1);
}

.cm-dropdown-btn.cm-disabled {
    background-color: rgb(241 245 249 / .5);
    color: rgb(100 116 139 / .5);
    cursor: not-allowed;
}

.cm-dropdown-btn.cm-active {
    border-color: #0073aa;
    background: #f0f8ff;
}

.cm-label {
    font-weight: 600;
    color: #666;
    margin-right: 8px;
}

.cm-label.cm-label-selected {
    color: #16a34a;
}

.cm-selected {
    flex: 1;
    color: #666;
}

.cm-dropdown-btn.cm-disabled .cm-selected {
    color: rgb(100 116 139 / .5);
}

.cm-arrow {
    margin-left: 8px;
    transition: transform 0.3s ease;
    color: #666;
}

.cm-dropdown-btn.cm-active .cm-arrow {
    transform: rotate(180deg);
}

/* Drawer Styles */
.cm-drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: 400px;
    max-width: 90vw !important;
    height: 100vh;
    background: #fff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 10001;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    /* Override WordPress theme max-width */
    max-width: 90vw !important;
    width: 400px !important;
}

.cm-drawer.cm-open {
    right: 0;
}

.cm-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    /* Override WordPress theme max-width */
    max-width: 100vw !important;
    width: 100vw !important;
}

.cm-drawer-overlay.cm-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Ensure overlay doesn't block drawer content */
.cm-drawer.cm-open ~ .cm-drawer-overlay.cm-active,
.cm-drawer-overlay.cm-active {
    pointer-events: auto;
}

/* But drawer content should be above overlay */
.cm-drawer.cm-open {
    pointer-events: none;
}

.cm-drawer.cm-open .cm-drawer-content {
    pointer-events: auto;
}

.cm-drawer-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    position: relative;
    z-index: 10002;
    pointer-events: auto;
    /* Override WordPress theme max-width */
    max-width: 100% !important;
    width: 100% !important;
}

.cm-drawer-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    gap: 15px;
}

.cm-drawer-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cm-drawer-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: rgb(46 0 128);
    flex: 1;
    text-align: center;
    opacity: 1;
}

.cm-drawer-back {
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    padding: 5px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
    margin-right: auto;
}

.cm-drawer-back:hover {
    background: #e0e0e0;
    color: #333;
}

.cm-drawer-back svg {
    width: 100%;
    height: 100%;
}

.cm-drawer-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.cm-drawer-close:hover {
    background: #e0e0e0;
}

.cm-clear-selection {
    background: #dc3545;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s ease;
    line-height: 1.4;
}

.cm-clear-selection:hover {
    background: #c82333;
}

.cm-clear-selection:active {
    background: #bd2130;
}

.cm-clear-selection {
    background: #dc3545;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s ease;
    line-height: 1.4;
}

.cm-clear-selection:hover {
    background: #c82333;
}

.cm-clear-selection:active {
    background: #bd2130;
}

.cm-clear-selection.cm-hidden {
    display: none;
}

.cm-drawer-search {
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #fff;
}

.cm-search-input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.cm-search-input:focus {
    outline: none;
    border-color: #0073aa;
}

.cm-search-input::placeholder {
    color: #999;
}

.cm-drawer-tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    background: #fff;
    position: relative;
    z-index: 10002;
    pointer-events: auto;
}

.cm-tab {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    color: rgb(15 23 42);
    transition: all 0.3s ease;
    position: relative;
    z-index: 10003;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.cm-tab-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: 12px;
    color: transparent;
    transition: color 0.2s ease;
}

.cm-tab-icon.cm-tab-checked {
    color: #28a745;
    font-weight: bold;
}

.cm-tab-label {
    display: inline-block;
}

.cm-tab:hover {
    background: #f5f5f5;
    color: #333;
}

.cm-tab.active {
    color: #0073aa;
    border-bottom-color: #0073aa;
    background: #f0f8ff;
}

.cm-tab:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f5f5f5;
    pointer-events: none;
}

.cm-tab:not(:disabled):hover {
    background: #f0f8ff;
    color: #0073aa;
}

/* Ensure Make tab is always clickable */
.cm-tab[data-tab="make"] {
    pointer-events: auto !important;
    cursor: pointer !important;
}

.cm-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.cm-tab-content {
    display: none;
}

.cm-tab-content.active {
    display: block;
}

.cm-options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cm-option-item {
    padding: 12px 16px;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 15px;
    color: #333;
    user-select: none;
    -webkit-user-select: none;
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
}

.cm-make-logo-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    flex-shrink: 0;
    width: 32px;
    min-width: 32px;
}

.cm-make-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    display: block;
}

.cm-option-name {
    flex: 1;
}

.cm-model-name-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 2px;
    min-width: 0;
}

.cm-model-name-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 10px;
}

.cm-model-name-bold {
    font-weight: 700;
    flex: 1;
    min-width: 0;
}

.cm-model-bracket-row {
    display: flex;
    width: 100%;
}

.cm-model-bracket-text {
    font-weight: normal;
    color: #333;
    font-size: 14px;
}

.cm-option-years {
    color: #666;
    font-size: 13px;
    margin-left: 10px;
    flex-shrink: 0;
}

/* Type grid layout - 3 columns, 2 rows */
.cm-type-grid {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 4px;
    width: 100%;
    min-width: 0;
}

.cm-type-row {
    display: grid;
    gap: 8px;
    width: 100%;
    align-items: center;
}

/* Row 1: 2 columns (name and year range) */
.cm-type-row-2col {
    grid-template-columns: 1fr auto;
}

/* Row 2: 3 columns with optimized widths (CC max 6 chars, Power max 14 chars) */
.cm-type-row-3col {
    grid-template-columns: 1fr 60px 120px;
}

.cm-type-col {
    display: flex;
    align-items: center;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.cm-type-name {
    font-weight: 600;
    justify-content: flex-start;
}

/* .cm-type-empty - Empty column placeholder, no styling needed */

.cm-type-years {
    text-align: right;
    justify-content: flex-end;
    color: #666;
    font-size: 13px;
}

.cm-type-fuel {
    justify-content: flex-start;
}

.cm-type-cc {
    text-align: center;
    justify-content: center;
    color: #666;
    font-size: 13px;
    flex-shrink: 0;
}

.cm-type-power {
    text-align: right;
    justify-content: flex-end;
    color: #666;
    font-size: 13px;
    flex-shrink: 0;
}

.cm-option-item:hover {
    border-color: #0073aa;
    background: #f0f8ff;
    transform: translateX(4px);
}

.cm-option-item.cm-selected {
    border-color: #0073aa;
    background: #0073aa;
    color: #fff;
}

/* Make all text white when selected */
.cm-option-item.cm-selected,
.cm-option-item.cm-selected .cm-option-name,
.cm-option-item.cm-selected .cm-option-years,
.cm-option-item.cm-selected .cm-model-name-bold,
.cm-option-item.cm-selected .cm-model-bracket-text,
.cm-option-item.cm-selected .cm-type-col,
.cm-option-item.cm-selected .cm-type-name,
.cm-option-item.cm-selected .cm-type-years,
.cm-option-item.cm-selected .cm-type-fuel,
.cm-option-item.cm-selected .cm-type-cc,
.cm-option-item.cm-selected .cm-type-power {
    color: #fff !important;
}

/* Make all text black when selected item is hovered */
.cm-option-item.cm-selected:hover,
.cm-option-item.cm-selected:hover .cm-option-name,
.cm-option-item.cm-selected:hover .cm-option-years,
.cm-option-item.cm-selected:hover .cm-model-name-bold,
.cm-option-item.cm-selected:hover .cm-model-bracket-text,
.cm-option-item.cm-selected:hover .cm-type-col,
.cm-option-item.cm-selected:hover .cm-type-name,
.cm-option-item.cm-selected:hover .cm-type-years,
.cm-option-item.cm-selected:hover .cm-type-fuel,
.cm-option-item.cm-selected:hover .cm-type-cc,
.cm-option-item.cm-selected:hover .cm-type-power {
    color: #000 !important;
}

.cm-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.cm-empty-state p {
    margin: 0;
    font-size: 14px;
}

.cm-filter-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.cm-filter-empty-state p {
    margin: 0;
    font-size: 14px;
}

/* Loading State Styles */
.cm-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.cm-loading-state p {
    margin: 20px 0 0 0;
    color: #666;
    font-size: 14px;
}

.cm-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: cm-spin 1s linear infinite;
}

@keyframes cm-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.cm-selected-label {
    padding: 12px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
    display: none;
}

.cm-selected-text {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

/* Popular Makes Badges */
.cm-popular-makes {
    padding: 15px 20px;
}

.cm-popular-makes-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.cm-popular-badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cm-popular-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    font-size: 14px;
    color: #333;
    user-select: none;
    -webkit-user-select: none;
    box-sizing: border-box;
    flex-shrink: 0;
    flex-grow: 0;
    width: fit-content;
}

.cm-popular-badge:hover:not(.cm-selected) {
    border-color: #0073aa;
    background: #f0f8ff;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cm-popular-badge.cm-selected:hover {
    transform: none;
    box-shadow: none;
}

.cm-popular-badge.cm-selected {
    border-color: #0073aa;
    background: #0073aa;
    color: #fff !important;
    border-width: 2px;
    padding: 8px 10px;
    width: fit-content;
    flex-shrink: 0;
    flex-grow: 0;
}

.cm-popular-badge.cm-selected .cm-popular-badge-name {
    color: #fff !important;
}

.cm-popular-badge.cm-selected:hover {
    border-color: #005a87;
    background: #005a87;
    color: #fff !important;
}

.cm-popular-badge.cm-selected:hover .cm-popular-badge-name {
    color: #fff !important;
}

.cm-popular-badge-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.cm-popular-badge-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: block;
}

.cm-popular-badge-name {
    font-weight: 500;
    white-space: nowrap;
}

/* Accordion Styles */
.cm-accordion-item {
    margin-bottom: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.cm-accordion-header {
    padding: 12px 16px;
    background: #f8f9fa;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
}

.cm-accordion-header:hover {
    background: #f0f0f0;
}

.cm-accordion-title {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.cm-accordion-icon {
    font-size: 12px;
    color: #666;
    transition: transform 0.2s ease;
}

.cm-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.cm-accordion-content-open {
    max-height: 2000px;
}

.cm-accordion-content .cm-option-item {
    border: none;
    border-top: 1px solid #f0f0f0;
    border-radius: 0;
    margin: 0;
}

.cm-accordion-content .cm-option-item:first-child {
    border-top: none;
}

.cm-accordion-content .cm-option-item:hover {
    transform: none;
    background: #f0f8ff;
}

.cm-clear-selection-form {
    background: rgb(254, 240, 138);
    border: none;
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    box-sizing: border-box;
}

.cm-dustbin-icon {
    width: 18px;
    height: 18px;
    color: #000;
    transition: color 0.2s ease;
}

.cm-clear-selection-form:hover .cm-dustbin-icon {
    color: rgb(220, 38, 38);
}

.cm-clear-selection-form:active {
    opacity: 0.8;
}

.cm-clear-selection-form.cm-hidden {
    display: none;
}

.cm-search-button-wrapper {
    margin-top: 5px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.cm-search-button-wrapper.cm-hidden {
    display: none;
}

.cm-search-section.cm-hidden {
    display: none;
}

.cm-or-divider.cm-hidden {
    display: none;
}

.cm-search-button {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: #000;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.2);
}

.cm-search-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #005a87 0%, #004a6f 100%);
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.3);
    transform: translateY(-1px);
}

.cm-search-button:active:not(:disabled) {
    background: linear-gradient(135deg, #004a6f 0%, #003d5c 100%);
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.2);
}

.cm-search-button:disabled {
    background: rgb(254, 240, 138);
    cursor: not-allowed;
    opacity: 1;
    transform: none;
    box-shadow: none;
}

.cm-search-button:disabled:hover {
    background: rgb(253, 224, 71);
}

/* Filtered Products Page Styles */
.cm-filtered-products-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.cm-products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.cm-products-title {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.cm-products-controls {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.cm-sort-controls,
.cm-per-page-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cm-sort-controls label,
.cm-per-page-controls label {
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.cm-orderby-select,
.cm-order-select,
.cm-per-page-select {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.cm-orderby-select:focus,
.cm-order-select:focus,
.cm-per-page-select:focus {
    outline: none;
    border-color: #0073aa;
}

.cm-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.cm-product-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cm-product-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.cm-product-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cm-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.cm-product-item:hover .cm-product-image img {
    transform: scale(1.05);
}

.cm-product-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.cm-product-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
}

.cm-product-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.cm-product-title a:hover {
    color: #0073aa;
}

.cm-product-price {
    font-size: 20px;
    font-weight: 700;
    color: #0073aa;
    margin-bottom: 10px;
}

.cm-product-sku {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
}

.cm-sku-label {
    font-weight: 600;
}

.cm-product-rating {
    margin-bottom: 15px;
}

.cm-product-actions {
    margin-top: auto;
}

.cm-product-actions .button,
.cm-product-actions .cm-add-to-cart-btn {
    width: 100%;
    text-align: center;
    padding: 12px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    text-decoration: none;
    display: block;
    box-sizing: border-box;
}

.cm-product-actions .button:hover,
.cm-product-actions .cm-add-to-cart-btn:hover {
    background: #005a87;
    color: #fff;
}

.cm-products-pagination {
    margin-top: 40px;
    text-align: center;
}

.cm-products-pagination .page-numbers {
    display: inline-flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 5px;
}

.cm-products-pagination .page-numbers li {
    display: inline-block;
}

.cm-products-pagination .page-numbers a,
.cm-products-pagination .page-numbers span {
    display: block;
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
}

.cm-products-pagination .page-numbers a:hover {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.cm-products-pagination .page-numbers .current {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.cm-no-products {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.cm-no-products p {
    font-size: 18px;
    color: #666;
    margin: 0;
}

/* Responsive - Dynamic width based on screen size */
@media (min-width: 1400px) {
    .cm-container {
        max-width: 400px !important;
    }
    .cm-search-form {
        width: 400px;
    }
}

@media (min-width: 1200px) and (max-width: 1399px) {
    .cm-container {
        max-width: 380px !important;
    }
    .cm-search-form {
        width: 380px;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .cm-container {
        max-width: 368px !important;
    }
    .cm-search-form {
        width: 368px;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .cm-container {
        max-width: 340px !important;
    }
    .cm-search-form {
        width: 340px;
    }
}

/* Legacy Responsive - Kept for backward compatibility */
/* Note: More comprehensive responsive styles are defined below */
@media (max-width: 768px) {
    .cm-container {
        max-width: 100% !important;
        width: 100%;
    }
    
    .cm-search-form {
        padding: 20px;
        width: 100%;
    }
    
    .cm-dropdowns {
        flex-direction: column;
    }
    
    .cm-dropdown-wrapper {
        min-width: 100%;
        max-width: 100%;
    }
    
    .cm-drawer {
        width: 100%;
        max-width: 100vw;
    }
    
    .cm-plate-input-wrapper {
        flex-wrap: nowrap;
    }
    
    .cm-flag-icon {
        padding: 0 10px;
    }
    
    .cm-flag-svg {
        width: 20px;
    }
    
    .cm-search-icon-btn {
        padding: 8px;
    }
    
    .cm-search-icon {
        width: 18px;
        height: 18px;
    }
    
    .cm-plate-input {
        font-size: 15px;
        padding: 12px 12px;
    }
    
    .cm-search-button {
        width: 100%;
    }
    
    .cm-products-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cm-products-controls {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cm-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 20px;
    }
}

@media (min-width: 769px) {
    .cm-search-form {
        max-width: 600px;
    }
}

/* Container for sticky bar - positioned just below menu */
.cm-sticky-bar-container {
    width: 100%;
    margin: 0;
    padding: 0;
    position: relative;
    z-index: 100;
    /* Ensure parent doesn't have overflow that breaks sticky */
    overflow: visible;
    /* Match page content width - will be set by JavaScript or inherit from parent */
}

/* Inner wrapper to match page content max-width */
.cm-sticky-bar-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
    /* Ensure wrapper doesn't break sticky */
    overflow: visible;
}

/* Results Page Sticky Bar */
.cm-results-sticky-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    background: rgb(22, 163, 74);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 20px auto;
    position: relative; /* Default to relative, JavaScript will change to fixed when needed */
    top: auto;
    left: auto;
    right: auto;
    z-index: 1000;
    min-height: 56px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    /* Ensure sticky works - create new stacking context */
    will-change: transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    /* Ensure it's not affected by parent transforms */
    isolation: isolate;
}

/* Ensure sticky bar container has proper spacing below header/menu */
body:not(.admin-bar) .cm-sticky-bar-container {
    margin-top: 0;
}

body.admin-bar .cm-sticky-bar-container {
    margin-top: 0;
}

/* Responsive container adjustments */
@media (max-width: 768px) {
    .cm-sticky-bar-wrapper {
        padding: 0 10px;
    }
    
    .cm-results-sticky-bar {
        margin: 15px auto;
        padding: 10px 15px;
    }
}

/* Account for admin bar when present */
body.admin-bar .cm-results-sticky-bar {
    top: 32px !important;
}

@media screen and (max-width: 782px) {
    body.admin-bar .cm-results-sticky-bar {
        top: 46px !important;
    }
}

/* Ensure parent containers don't break sticky positioning */
.cm-sticky-bar-container {
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
}

.cm-sticky-bar-wrapper {
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
}

/* Fix for themes that might have overflow on body or html */
body .cm-sticky-bar-container,
html .cm-sticky-bar-container {
    overflow: visible !important;
}

/* Ensure all parent elements don't break sticky */
.cm-sticky-bar-container * {
    overflow: visible !important;
}

/* Sticky bar will be controlled by JavaScript for reliable cross-browser support */
#cm-results-sticky-bar.cm-fixed,
.cm-results-sticky-bar.cm-fixed {
    position: fixed !important;
    top: 0 !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 1000 !important;
}

body.admin-bar #cm-results-sticky-bar.cm-fixed,
body.admin-bar .cm-results-sticky-bar.cm-fixed {
    top: 32px !important;
}

@media screen and (max-width: 782px) {
    body.admin-bar #cm-results-sticky-bar.cm-fixed,
    body.admin-bar .cm-results-sticky-bar.cm-fixed {
        top: 46px !important;
    }
}

.cm-results-sticky-bar.cm-hidden {
    display: none;
}

/* Sticky bar background colors based on selection (matching search form) */
.cm-results-sticky-bar.has-partial-selection {
    background: rgb(254, 249, 195) !important;
}

.cm-results-sticky-bar.has-complete-selection {
    background: rgb(220 252 231) !important;
}

#cm-results-sticky-bar.has-complete-selection:hover {
    background: rgb(240, 253, 244) !important;
}

/* When type selection is completed, change text colors to black */
.cm-results-sticky-bar.has-complete-selection .cm-sticky-bar-info .cm-message-text,
.cm-results-sticky-bar.has-complete-selection .cm-sticky-bar-info .cm-message-selection {
    color: #000;
}

/* When type selection is completed, change delete icon background */
.cm-results-sticky-bar.has-complete-selection .cm-sticky-bar-delete {
    background: rgb(187 247 208);
    color: rgb(0 0 0);
}


.cm-results-sticky-bar.has-complete-selection .cm-sticky-bar-delete svg {
    color: rgb(0 0 0);
}

/* Modify button styles for partial selection */
.cm-results-sticky-bar.has-partial-selection .cm-sticky-bar-modify {
    background-color: rgb(254 240 138);
}

.cm-results-sticky-bar.has-partial-selection .cm-sticky-bar-modify:hover {
    background-color: rgb(253 224 71);
}

/* Modify button styles for complete selection */
.cm-results-sticky-bar.has-complete-selection .cm-sticky-bar-modify {
    background-color: rgb(187 247 208);
}

.cm-results-sticky-bar.has-complete-selection .cm-sticky-bar-modify:hover {
    background-color: rgb(134 239 172);
}

/* When partial selection, change text colors */
.cm-results-sticky-bar.has-partial-selection .cm-sticky-bar-info {
    color: #000;
}

/* Sticky bar invalid/valid plate text colors - match finder styles */
.cm-results-sticky-bar.has-invalid-plate:not(.has-partial-selection):not(.has-complete-selection) .cm-sticky-bar-info {
    color: #000;
}

.cm-results-sticky-bar.has-valid-plate:not(.has-partial-selection):not(.has-complete-selection) .cm-sticky-bar-info {
    color: #fff;
}

/* Hover background colors for sticky bar (default state - no selection classes) */
#cm-results-sticky-bar:hover:not(.has-partial-selection):not(.has-complete-selection) {
    background-color: rgb(34 197 94) !important;
}

#cm-results-sticky-bar.has-partial-selection:hover {
    background-color: rgb(254 252 232) !important;
}

.cm-sticky-bar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    color: rgb(22, 163, 74);
}

.cm-sticky-bar-icon svg {
    width: 35px;
    height: 35px;
    color: #fff;
}

.cm-sticky-bar-info {
    flex: 1;
    color: #fff;
    font-size: 13px;
    line-height: 1.5;
    min-width: 0;
    margin-left: 10px;
}

/* Ensure message elements in sticky bar display as block (like in finder) */
.cm-sticky-bar-info .cm-message-text,
.cm-sticky-bar-info .cm-message-selection,
.cm-sticky-bar-info .cm-message-description {
    display: block;
}

/* Set description color for sticky bar */
#cm-results-sticky-bar .cm-message-description {
    color: rgb(202 138 4);
}

.cm-sticky-bar-text {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    white-space: normal;
    overflow: visible;
    word-wrap: break-word;
    line-height: 1.5;
    cursor: pointer;
}

.cm-sticky-bar-manual-link {
    display: block;
    margin-top: 4px;
    color: #fff;
    text-decoration: none;
    opacity: 0.6;
}

.cm-sticky-bar-manual-link:hover {
    text-decoration: none;
    color: rgb(255 255 255);
}

.cm-sticky-bar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.cm-sticky-bar-plate-input-wrapper {
    max-width: 300px;
    width: 100%;
}

@media (max-width: 768px) {
    .cm-sticky-bar-plate-input-wrapper {
        max-width: 200px;
    }
}

.cm-sticky-bar-modify {
    padding: 8px 16px;
    background: rgb(22, 163, 74);
    color: #000;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.cm-sticky-bar-modify:hover {
    background: rgb(21, 128, 61);
}

.cm-sticky-bar-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: rgb(254 240 138);
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.cm-results-sticky-bar .cm-sticky-bar-delete:hover {
    background: rgb(254 226 226);
}

.cm-results-sticky-bar .cm-sticky-bar-delete svg:hover {
    color: rgb(220 38 38);
}

.cm-sticky-bar-delete svg {
    width: 18px;
    height: 18px;
    color: #000;
}

/* Responsive adjustments for sticky bar */
@media (max-width: 768px) {
    .cm-results-sticky-bar {
        padding: 10px 15px;
        gap: 12px;
        margin: 15px 0;
    }
    
    .cm-sticky-bar-text {
        font-size: 13px;
    }
    
    .cm-sticky-bar-modify {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .cm-sticky-bar-delete {
        width: 32px;
        height: 32px;
    }
    
    .cm-sticky-bar-delete svg {
        width: 16px;
        height: 16px;
    }
}

/* Products Container
   `#cm-products-container` is assigned to the WooCommerce product collection element so we have a stable
   hook for JS refresh/loading state. Do NOT override layout here — block themes (e.g. alignwide) rely on
   the product collection's native widths/margins, and forcing `width/max-width: 100%` breaks the shop look.
*/

/* Loading state for products container */
#cm-products-container.cm-products-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

#cm-products-container.cm-products-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #16a34a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ============================================
   Drawer Style Variations
   ============================================ */

/* Boxed Style (Default) - Already styled above */
.cm-drawer-style-boxed .cm-option-item {
    padding: 12px 16px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 8px;
}

.cm-drawer-style-boxed .cm-option-item:hover {
    transform: translateX(4px);
}

.cm-drawer-style-boxed .cm-accordion-item {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.cm-drawer-style-boxed .cm-accordion-header {
    border-radius: 6px 6px 0 0;
}

/* List with Underline Style */
.cm-drawer-style-list-underline .cm-options-list {
    gap: 0;
}

.cm-drawer-style-list-underline .cm-option-item {
    padding: 14px 16px;
    background: transparent;
    border: none;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 0;
    margin: 0;
    transition: background-color 0.2s ease;
}

.cm-drawer-style-list-underline .cm-option-item:last-child {
    border-bottom: none;
}

.cm-drawer-style-list-underline .cm-option-item:hover {
    background: #f8f9fa;
    transform: none;
    border-bottom-color: #0073aa;
}

.cm-drawer-style-list-underline .cm-option-item.cm-selected {
    background: #0073aa;
    border-bottom-color: #0073aa;
}

.cm-drawer-style-list-underline .cm-accordion-item {
    border: none;
    border-radius: 0;
    margin-bottom: 0;
    background: transparent;
}

.cm-drawer-style-list-underline .cm-accordion-header {
    padding: 14px 16px;
    background: transparent;
    border-bottom: 2px solid #0073aa;
    border-radius: 0;
    margin-bottom: 0;
}

.cm-drawer-style-list-underline .cm-accordion-header:hover {
    background: #f8f9fa;
}

.cm-drawer-style-list-underline .cm-accordion-content .cm-option-item {
    padding-left: 32px;
    border-bottom: 1px solid #e8e8e8;
}

.cm-drawer-style-list-underline .cm-accordion-content .cm-option-item:hover {
    border-bottom-color: #c0c0c0;
}

/* List with Separator Style */
.cm-drawer-style-list-separator .cm-options-list {
    gap: 0;
}

.cm-drawer-style-list-separator .cm-option-item {
    padding: 14px 16px;
    background: transparent;
    border: none;
    border-bottom: 1px solid #d0d0d0;
    border-radius: 0;
    margin: 0;
    position: relative;
}

.cm-drawer-style-list-separator .cm-option-item:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 1px;
    background: #e8e8e8;
}

.cm-drawer-style-list-separator .cm-option-item:hover {
    background: #f8f9fa;
    transform: none;
}

.cm-drawer-style-list-separator .cm-option-item.cm-selected {
    background: #0073aa;
    border-bottom-color: #006399;
}

.cm-drawer-style-list-separator .cm-option-item.cm-selected::after {
    display: none;
}

.cm-drawer-style-list-separator .cm-accordion-item {
    border: none;
    border-radius: 0;
    margin-bottom: 0;
    background: transparent;
}

.cm-drawer-style-list-separator .cm-accordion-header {
    padding: 14px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #d0d0d0;
    border-radius: 0;
    margin-bottom: 0;
}

.cm-drawer-style-list-separator .cm-accordion-header:hover {
    background: #f0f0f0;
}

.cm-drawer-style-list-separator .cm-accordion-content .cm-option-item {
    padding-left: 32px;
}

.cm-drawer-style-list-separator .cm-accordion-content .cm-option-item:first-child {
    border-top: 1px solid #e8e8e8;
}

/* Minimal Style */
.cm-drawer-style-minimal .cm-drawer-body {
    padding: 20px 0;
    background: rgb(241 245 249);
}

.cm-drawer-style-minimal .cm-options-list {
    gap: 0;
}

.cm-drawer-style-minimal .cm-option-item {
    padding: 12px 16px;
    border-radius: 3px;
    margin: 0;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    background: rgb(241 245 249);
}

.cm-drawer-style-minimal .cm-option-item:hover {
    border-color: #c0c0c0;
    background: rgb(238 235 255);
    transform: none;
}

.cm-drawer-style-minimal .cm-option-item.cm-selected {
    border-color: #0073aa;
    background: #0073aa;
    color: #fff;
}

.cm-drawer-style-minimal .cm-accordion-item {
    border: none;
    border-bottom: 3px solid #e8e8e8;
    border-radius: 0;
    background: transparent;
    margin-bottom: 0;
}

.cm-drawer-style-minimal .cm-accordion-header {
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 0;
}

.cm-drawer-style-minimal .cm-accordion-content .cm-option-item {
    border: none;
    border-top: none;
    border-radius: 0;
    margin: 0;
    padding-left: 32px;
}

.cm-drawer-style-minimal .cm-accordion-content .cm-option-item:first-child {
    border-top: none;
}

/* Clean Style */
.cm-drawer-style-clean .cm-drawer-body {
    padding: 20px 0;
}

.cm-drawer-style-clean .cm-options-list {
    gap: 0;
}

.cm-drawer-style-clean .cm-option-item {
    padding: 16px;
    background: transparent;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    border-radius: 0;
    margin: 0;
    transition: background-color 0.15s ease;
}

.cm-drawer-style-clean .cm-option-item:last-child {
    border-bottom: none;
}

.cm-drawer-style-clean .cm-option-item:hover {
    background: #fafafa;
    transform: none;
}

.cm-drawer-style-clean .cm-option-item.cm-selected {
    background: #f0f8ff;
    border-bottom-color: #0073aa;
    color: #0073aa;
}

.cm-drawer-style-clean .cm-accordion-item {
    border: none;
    border-bottom: 1px solid #f0f0f0;
    border-radius: 0;
    background: transparent;
    margin-bottom: 0;
}

.cm-drawer-style-clean .cm-accordion-header {
    padding: 16px;
    background: transparent;
    border: none;
    border-radius: 0;
    font-weight: 500;
}

.cm-drawer-style-clean .cm-accordion-header:hover {
    background: #fafafa;
}

.cm-drawer-style-clean .cm-accordion-content .cm-option-item {
    padding-left: 48px;
}

/* Modern Style */
.cm-drawer-style-modern .cm-drawer-body {
    padding: 20px 0;
}

.cm-drawer-style-modern .cm-options-list {
    gap: 8px;
}

.cm-drawer-style-modern .cm-option-item {
    padding: 14px 16px;
    background: #fff;
    border: none;
    border-radius: 4px;
    margin: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease, background-color 0.2s ease;
}

.cm-drawer-style-modern .cm-option-item:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: #fff;
    transform: none;
}

.cm-drawer-style-modern .cm-option-item.cm-selected {
    background: #0073aa;
    box-shadow: 0 2px 6px rgba(0, 115, 170, 0.3);
    color: #fff;
}

.cm-drawer-style-modern .cm-accordion-item {
    border: none;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    margin-bottom: 8px;
}

.cm-drawer-style-modern .cm-accordion-header {
    padding: 14px 16px;
    background: #fff;
    border: none;
    border-radius: 4px 4px 0 0;
    font-weight: 600;
}

.cm-drawer-style-modern .cm-accordion-header:hover {
    background: #f8f9fa;
}

.cm-drawer-style-modern .cm-accordion-content .cm-option-item {
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    padding-left: 32px;
}

.cm-drawer-style-modern .cm-accordion-content .cm-option-item:last-child {
    border-radius: 0 0 4px 4px;
}


/* Spacious Style */
.cm-drawer-style-spacious .cm-drawer-body {
    padding: 20px 0;
}

.cm-drawer-style-spacious .cm-options-list {
    gap: 12px;
}

.cm-drawer-style-spacious .cm-option-item {
    padding: 18px 24px;
    background: #fff;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    margin: 0;
    transition: all 0.2s ease;
}

.cm-drawer-style-spacious .cm-option-item:hover {
    border-color: #0073aa;
    background: #f0f8ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.cm-drawer-style-spacious .cm-option-item.cm-selected {
    border-color: #0073aa;
    background: #0073aa;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.cm-drawer-style-spacious .cm-accordion-item {
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    background: #fff;
    margin-bottom: 12px;
}

.cm-drawer-style-spacious .cm-accordion-header {
    padding: 18px 24px;
    background: #fff;
    border-bottom: 2px solid #e8e8e8;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
}

.cm-drawer-style-spacious .cm-accordion-header:hover {
    background: #f8f9fa;
}

.cm-drawer-style-spacious .cm-accordion-content .cm-option-item {
    border: none;
    border-top: 1px solid #f0f0f0;
    border-radius: 0;
    margin: 0;
    padding-left: 48px;
}

.cm-drawer-style-spacious .cm-accordion-content .cm-option-item:first-child {
    border-top: 1px solid #e8e8e8;
}

.cm-drawer-style-spacious .cm-accordion-content .cm-option-item:last-child {
    border-radius: 0 0 6px 6px;
}

/* Compact Style */
.cm-drawer-style-compact .cm-drawer-body {
    padding: 20px 0;
}

.cm-drawer-style-compact .cm-options-list {
    gap: 2px;
}

.cm-drawer-style-compact .cm-option-item {
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 3px;
    margin: 0;
    font-size: 14px;
    transition: background-color 0.15s ease;
}

.cm-drawer-style-compact .cm-option-item:hover {
    background: #f8f9fa;
    transform: none;
    border-color: #0073aa;
}

.cm-drawer-style-compact .cm-option-item.cm-selected {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

.cm-drawer-style-compact .cm-accordion-item {
    border: 1px solid #e8e8e8;
    border-radius: 3px;
    background: #fff;
    margin-bottom: 2px;
}

.cm-drawer-style-compact .cm-accordion-header {
    padding: 8px 12px;
    background: #f8f9fa;
    border-bottom: 1px solid #e8e8e8;
    border-radius: 3px 3px 0 0;
    font-size: 13px;
    font-weight: 600;
}

.cm-drawer-style-compact .cm-accordion-header:hover {
    background: #f0f0f0;
}

.cm-drawer-style-compact .cm-accordion-content .cm-option-item {
    border: none;
    border-top: 1px solid #f0f0f0;
    border-radius: 0;
    margin: 0;
    padding-left: 24px;
}

.cm-drawer-style-compact .cm-accordion-content .cm-option-item:first-child {
    border-top: 1px solid #e8e8e8;
}

.cm-drawer-style-compact .cm-accordion-content .cm-option-item:last-child {
    border-radius: 0 0 2px 2px;
}

/* ============================================
   COMPREHENSIVE RESPONSIVE STYLES
   ============================================ */

/* Mobile Devices (max-width: 480px) */
@media (max-width: 480px) {
    /* Finder Form - Mobile */
    .cm-search-form {
        width: 100% !important;
        max-width: 100% !important;
        padding: 15px !important;
        gap: 15px !important;
        border-radius: 8px;
    }
    
    .cm-search-form-header {
        gap: 10px;
        margin-bottom: 8px;
    }
    
    .cm-header-text-section {
        font-size: 12px !important;
        line-height: 1.4;
    }
    
    .cm-check-icon {
        width: 28px !important;
        height: 28px !important;
    }
    
    .cm-message-icon {
        width: 12px !important;
        height: 12px !important;
        min-width: 12px !important;
        min-height: 12px !important;
        padding: 12px !important;
    }
    
    .cm-icon-svg {
        width: 20px !important;
        height: 20px !important;
        min-width: 20px !important;
        min-height: 20px !important;
    }
    
    .cm-dropdowns {
        flex-direction: column;
        gap: 12px;
    }
    
    .cm-dropdown-wrapper {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
    }
    
    .cm-dropdown-btn {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .cm-plate-input-wrapper {
        flex-wrap: nowrap;
        gap: 8px;
    }
    
    .cm-flag-icon {
        padding: 0 8px;
        flex-shrink: 0;
    }
    
    .cm-flag-svg {
        width: 18px !important;
        height: auto;
    }
    
    .cm-plate-input {
        font-size: 14px !important;
        padding: 10px 10px !important;
        flex: 1;
        min-width: 0;
    }
    
    .cm-search-icon-btn {
        padding: 8px !important;
        flex-shrink: 0;
    }
    
    .cm-search-icon {
        width: 16px !important;
        height: 16px !important;
    }
    
    .cm-search-button {
        width: 100%;
        padding: 12px 20px;
        font-size: 14px;
    }
    
    /* Sticky Bar - Mobile */
    .cm-sticky-bar-wrapper {
        padding: 0 10px !important;
    }
    
    .cm-results-sticky-bar {
        padding: 10px 12px !important;
        gap: 10px !important;
        margin: 10px 0 !important;
        border-radius: 6px;
        flex-wrap: wrap;
    }
    
    .cm-sticky-bar-icon {
        flex-shrink: 0;
    }
    
    .cm-sticky-bar-icon .cm-check-icon {
        width: 24px !important;
        height: 24px !important;
    }
    
    .cm-sticky-bar-info {
        flex: 1;
        min-width: 0;
    }
    
    .cm-sticky-bar-text {
        font-size: 12px !important;
        line-height: 1.4;
    }
    
    .cm-sticky-bar-actions {
        display: flex;
        gap: 8px;
        flex-shrink: 0;
    }
    
    .cm-sticky-bar-modify {
        padding: 6px 12px !important;
        font-size: 12px !important;
        white-space: nowrap;
    }
    
    .cm-sticky-bar-delete {
        width: 28px !important;
        height: 28px !important;
        padding: 0;
        flex-shrink: 0;
    }
    
    .cm-sticky-bar-delete svg {
        width: 14px !important;
        height: 14px !important;
    }
    
    /* Drawer - Mobile */
    .cm-drawer {
        width: 100% !important;
        max-width: 100vw !important;
        right: -100%;
    }
    
    .cm-drawer-header {
        padding: 15px !important;
        gap: 10px;
    }
    
    .cm-drawer-title {
        font-size: 1rem !important;
        padding: 0 10px;
    }
    
    .cm-drawer-back,
    .cm-drawer-close {
        width: 28px !important;
        height: 28px !important;
        padding: 4px;
    }
    
    .cm-drawer-close {
        font-size: 24px !important;
    }
    
    .cm-drawer-search {
        padding: 12px 15px !important;
    }
    
    .cm-search-input {
        padding: 10px 12px !important;
        font-size: 14px;
    }
    
    .cm-drawer-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .cm-tab {
        padding: 12px 10px !important;
        font-size: 14px !important;
        min-width: 80px;
        flex-shrink: 0;
    }
    
    .cm-tab-icon {
        width: 16px !important;
        height: 16px !important;
        font-size: 11px !important;
    }
    
    .cm-tab-label {
        font-size: 13px;
    }
    
    .cm-drawer-body {
        padding: 15px !important;
    }
    
    .cm-option-item {
        padding: 10px 12px !important;
        font-size: 14px !important;
        gap: 8px;
    }
    
    .cm-make-logo-container {
        width: 28px !important;
        min-width: 28px !important;
    }
    
    .cm-make-logo {
        width: 28px !important;
        height: 28px !important;
    }
    
    /* Container adjustments */
    .cm-container {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .cm-container-wrapper {
        padding: 15px 10px !important;
    }
}

/* Small Tablets and Large Phones (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    /* Finder Form */
    .cm-search-form {
        width: 100% !important;
        max-width: 100% !important;
        padding: 20px !important;
        gap: 18px;
    }
    
    .cm-header-text-section {
        font-size: 12.5px;
    }
    
    .cm-check-icon {
        width: 32px;
        height: 32px;
    }
    
    .cm-dropdowns {
        flex-direction: column;
        gap: 15px;
    }
    
    .cm-dropdown-wrapper {
        width: 100%;
    }
    
    .cm-dropdown-btn {
        padding: 13px 16px;
    }
    
    .cm-plate-input {
        font-size: 15px;
        padding: 11px 12px;
    }
    
    .cm-search-button {
        padding: 13px 24px;
    }
    
    /* Sticky Bar */
    .cm-sticky-bar-wrapper {
        padding: 0 15px !important;
    }
    
    .cm-results-sticky-bar {
        padding: 12px 16px !important;
        gap: 12px;
    }
    
    .cm-sticky-bar-text {
        font-size: 13px;
    }
    
    .cm-sticky-bar-modify {
        padding: 7px 14px;
        font-size: 13px;
    }
    
    .cm-sticky-bar-delete {
        width: 30px;
        height: 30px;
    }
    
    /* Drawer */
    .cm-drawer {
        width: 85vw !important;
        max-width: 85vw !important;
    }
    
    .cm-drawer-header {
        padding: 18px;
    }
    
    .cm-drawer-title {
        font-size: 1.05rem;
    }
    
    .cm-drawer-search {
        padding: 14px 18px;
    }
    
    .cm-tab {
        padding: 14px 12px;
        font-size: 15px;
    }
    
    .cm-drawer-body {
        padding: 18px;
    }
    
    .cm-option-item {
        padding: 11px 14px;
    }
}

/* Tablets (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Finder Form */
    .cm-search-form {
        width: 100% !important;
        max-width: 500px !important;
        padding: 22px;
    }
    
    .cm-dropdowns {
        gap: 18px;
    }
    
    /* Sticky Bar */
    .cm-sticky-bar-wrapper {
        padding: 0 20px;
    }
    
    .cm-results-sticky-bar {
        padding: 12px 18px;
    }
    
    /* Drawer */
    .cm-drawer {
        width: 450px !important;
        max-width: 80vw !important;
    }
}

/* Large Screens (1025px and above) */
@media (min-width: 1025px) {
    /* Finder Form - ensure it doesn't get too wide */
    .cm-search-form {
        max-width: 600px;
    }
    
    /* Drawer - optimal width for large screens */
    .cm-drawer {
        width: 400px !important;
        max-width: 400px !important;
    }
}

/* Landscape orientation adjustments for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .cm-drawer {
        width: 60vw !important;
        max-width: 60vw !important;
    }
    
    .cm-drawer-header {
        padding: 12px 15px;
    }
    
    .cm-drawer-body {
        padding: 12px 15px;
    }
    
    .cm-results-sticky-bar {
        padding: 8px 12px;
        min-height: 48px;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .cm-check-icon,
    .cm-icon-svg,
    .cm-sticky-bar-icon .cm-check-icon {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets for mobile */
    .cm-dropdown-btn,
    .cm-search-button,
    .cm-tab,
    .cm-option-item {
        min-height: 44px;
    }
    
    .cm-drawer-back,
    .cm-drawer-close,
    .cm-sticky-bar-delete {
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .cm-search-form:hover {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }
    
    .cm-tab:hover {
        background: transparent;
    }
    
    .cm-option-item:hover {
        background: #fff;
    }
}

/* Print styles - hide interactive elements */
@media print {
    .cm-search-form,
    .cm-results-sticky-bar,
    .cm-drawer,
    .cm-drawer-overlay {
        display: none !important;
    }
}

