/**
 * Oto Product Compare - High Performance Automotive Specification Comparison
 * Fully Optimized for Desktop & Mobile (Responsive, Sticky 2D, Touch Friendly)
 */

:root {
    --oto-primary: #3893d8;
    --oto-primary-dark: #002244;
    --oto-primary-light: #f0f5fa;
    --oto-primary-border: rgba(0, 51, 102, 0.12);
    --oto-accent: #0070ba;
    --oto-accent-hover: #005a96;
    --oto-gold: #ffb800;
    --oto-danger: #ef4444;
    --oto-danger-bg: #fef2f2;
    --oto-success: #10b981;
    --oto-border: #e2e8f0;
    --oto-border-dark: #cbd5e1;
    --oto-text-main: #1e293b;
    --oto-text-muted: #64748b;
    --oto-bg-subtle: #f8fafc;
    --oto-bg-zebra: #f1f5f9;
    --oto-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --oto-shadow-md: 0 8px 24px rgba(0, 35, 70, 0.12);
    --oto-shadow-lg: 0 20px 45px rgba(0, 25, 50, 0.22);
    --oto-radius: 12px;
}

/* ========================================================
   1. COMPARE TOGGLE BUTTON (CARDS & SINGLE PRODUCT)
   ======================================================== */
.oto-compare-btn-wrap {
    display: inline-block;
    margin-top: 0;
    vertical-align: middle;
}

.oto-compare-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--oto-primary);
    background-color: #ffffff;
    border: 1.5px solid var(--oto-primary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    line-height: 1.2;
    user-select: none;
    box-shadow: 0 1px 3px rgba(0, 51, 102, 0.06);
    text-decoration: none !important;
}

.oto-compare-toggle-btn:hover {
    background-color: var(--oto-primary);
    color: #ffffff;
    border-color: var(--oto-primary);
    box-shadow: 0 4px 10px rgba(0, 51, 102, 0.2);
    transform: translateY(-1px);
}

.oto-compare-toggle-btn .oto-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.oto-compare-toggle-btn .oto-btn-icon svg {
    display: block;
    stroke: currentColor !important;
    fill: none !important;
}

.oto-compare-toggle-btn .oto-btn-check-icon {
    display: none;
    align-items: center;
    justify-content: center;
}

.oto-compare-toggle-btn .oto-btn-check-icon svg {
    display: block;
    stroke: currentColor !important;
    fill: none !important;
}

/* Active State (Vehicle added to comparison) */
.oto-compare-toggle-btn.is-active {
    background-color: var(--oto-primary) !important;
    color: #ffffff !important;
    border-color: var(--oto-primary) !important;
}

.oto-compare-toggle-btn.is-active .oto-btn-icon {
    display: none !important;
}

.oto-compare-toggle-btn.is-active .oto-btn-check-icon {
    display: inline-flex !important;
    color: #ffcc00;
}

/* Integrated inside Product Card Action Bar (Flatsome / Custom Theme) */
.ot-card-action {
    display: flex !important;
    align-items: stretch !important;
    justify-content: center !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.ot-card-action .ot-btn-xem-chi-tiet {
    flex: 1 1 50% !important;
    min-width: 0 !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    padding: 8px 10px !important;
    font-size: 12.5px !important;
    font-weight: 700 !important;
    height: 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 6px !important;
    box-sizing: border-box !important;
}

.ot-card-action .oto-compare-btn-wrap {
    flex: 1 1 50% !important;
    min-width: 0 !important;
    margin-top: 0 !important;
    box-sizing: border-box !important;
}

.ot-card-action .oto-compare-toggle-btn {
    width: 100% !important;
    height: 38px !important;
    padding: 0 8px !important;
    font-size: 12.5px !important;
    white-space: nowrap !important;
    border-radius: 6px !important;
    box-sizing: border-box !important;
    margin: 0;
}

.ot-card-action .oto-btn-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Single Product Page */
.oto-in-single {
    margin: 18px 0;
    display: block;
}

.oto-in-single .oto-compare-toggle-btn {
    padding: 10px 22px;
    font-size: 14px;
    border-radius: 8px;
    height: 42px;
}

/* ========================================================
   2. STICKY BOTTOM FLOATING DOCK BAR
   ======================================================== */
.oto-compare-dock {
    position: fixed;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%) translateY(140%);
    z-index: 99995;
    width: calc(100% - 32px);
    max-width: 820px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 16px;
    box-shadow: 0 12px 36px rgba(0, 35, 80, 0.2), 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1.5px solid var(--oto-primary-border);
    padding: 10px 18px;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
    opacity: 0;
    pointer-events: none;
}

.oto-compare-dock.is-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* When modal is open, dock hides smoothly */
.oto-compare-dock.modal-open {
    transform: translateX(-50%) translateY(140%) !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.oto-dock-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.oto-dock-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 13.5px;
    color: var(--oto-primary);
    white-space: nowrap;
    flex-shrink: 0;
}

.oto-dock-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--oto-primary-light);
    color: var(--oto-primary);
    border-radius: 8px;
}

.oto-dock-icon svg {
    stroke: currentColor !important;
    fill: none !important;
}

/* Hide scrollbar completely on dock slots */
.oto-dock-slots {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-grow: 1;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}

.oto-dock-slots::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.oto-dock-item {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    border: 1.5px solid var(--oto-border);
    background: #f1f5f9;
    overflow: visible;
    flex-shrink: 0;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.oto-dock-item:hover {
    border-color: var(--oto-primary);
    transform: scale(1.05);
}

.oto-dock-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 6px;
}

.oto-dock-item-remove {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: var(--oto-danger);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    border: 2px solid #ffffff;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.2s ease;
    opacity: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
    z-index: 5;
    padding: 0;
}

.oto-dock-item:hover .oto-dock-item-remove {
    opacity: 1;
    transform: scale(1.1);
}

.oto-dock-item-empty {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    border: 1.5px dashed #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 18px;
    flex-shrink: 0;
    background: rgba(248, 250, 252, 0.5);
}

.oto-dock-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

.oto-dock-btn-clear {
    background: none;
    border: none;
    color: var(--oto-text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.oto-dock-btn-clear:hover {
    color: var(--oto-danger);
    background: var(--oto-danger-bg);
}

.oto-dock-btn-compare {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #3893d8 0%, #3893d8 100%);
    color: #ffffff !important;
    border: none;
    border-radius: 10px;
    padding: 9px 18px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(0, 51, 102, 0.28);
    text-decoration: none !important;
    margin: 0;
}

.oto-dock-btn-compare:hover {
    background: linear-gradient(135deg, #002244 0%, #003366 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 51, 102, 0.36);
}

.oto-dock-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffcc00;
    color: #002244;
    font-size: 12px;
    font-weight: 800;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    line-height: 1;
}

/* ========================================================
   3. MODAL POPUP DIALOG
   ======================================================== */
.oto-compare-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.3s ease, opacity 0.3s ease;
    box-sizing: border-box;
}

.oto-compare-modal.is-active {
    visibility: visible;
    opacity: 1;
}

.oto-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.oto-modal-dialog {
    position: relative;
    z-index: 2;
    background: #ffffff;
    width: 100%;
    max-width: 1240px;
    max-height: 92vh;
    border-radius: 18px;
    box-shadow: 0 25px 60px rgba(0, 20, 50, 0.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95) translateY(16px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.oto-compare-modal.is-active .oto-modal-dialog {
    transform: scale(1) translateY(0);
}

/* Modal Header */
.oto-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1.5px solid var(--oto-border);
    background: #ffffff;
    flex-shrink: 0;
}

.oto-modal-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.oto-modal-icon-badge {
    width: 42px;
    height: 42px;
    background: var(--oto-primary-light);
    color: var(--oto-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.oto-modal-icon-badge svg {
    stroke: currentColor !important;
    fill: none !important;
}

.oto-modal-title {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    color: var(--oto-primary);
    line-height: 1.25;
}

.oto-modal-subtitle {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--oto-text-muted);
}

/* Close Button: Bulletproof SVG styling against theme overrides */
.oto-modal-close {
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #475569 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0 !important;
    padding: 0 !important;
    outline: none !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
}

.oto-modal-close svg {
    width: 20px !important;
    height: 20px !important;
    stroke: #334155 !important;
    stroke-width: 2.5 !important;
    fill: none !important;
    display: block !important;
    transition: stroke 0.2s ease !important;
}

.oto-modal-close svg path {
    stroke: currentColor !important;
    fill: none !important;
    stroke-width: 2.5 !important;
}

.oto-modal-close:hover {
    background: var(--oto-danger) !important;
    border-color: var(--oto-danger) !important;
    color: #ffffff !important;
    transform: rotate(90deg) !important;
}

.oto-modal-close:hover svg,
.oto-modal-close:hover svg path {
    stroke: #ffffff !important;
}

/* Modal Body */
.oto-modal-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 18px 24px 24px;
    background: #f8fafc;
    -webkit-overflow-scrolling: touch;
}

/* Loading State */
.oto-modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--oto-text-muted);
    font-size: 14px;
}

.oto-spinner {
    width: 42px;
    height: 42px;
    border: 3.5px solid rgba(0, 51, 102, 0.12);
    border-top-color: var(--oto-primary);
    border-radius: 50%;
    animation: otoSpin 0.8s linear infinite;
    margin-bottom: 14px;
}

@keyframes otoSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================================
   4. COMPARISON TOOLBAR & CONTROLS
   ======================================================== */
.oto-compare-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding: 10px 18px;
    background: #ffffff;
    border: 1px solid var(--oto-border);
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.oto-toolbar-left {
    display: flex;
    align-items: center;
}

.oto-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Difference Toggle Switch: Triệt tiêu mọi checkbox của theme */
.oto-diff-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--oto-text-main);
}

.oto-diff-toggle input[type="checkbox"],
.oto-diff-toggle input {
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none !important;
    display: none !important;
    visibility: hidden !important;
}

.oto-diff-switch {
    position: relative;
    width: 40px;
    height: 22px;
    background: #cbd5e1;
    border-radius: 20px;
    transition: background 0.25s ease;
    flex-shrink: 0;
}

.oto-diff-switch::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.oto-diff-toggle input:checked+.oto-diff-switch {
    background: var(--oto-primary);
}

.oto-diff-toggle input:checked+.oto-diff-switch::before {
    transform: translateX(18px);
}

.oto-count-badge {
    font-size: 13px;
    font-weight: 600;
    color: var(--oto-primary);
    background: var(--oto-primary-light);
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid var(--oto-primary-border);
    white-space: nowrap;
}

.oto-btn-clear-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--oto-text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
    margin: 0;
}

.oto-btn-clear-all svg {
    stroke: currentColor !important;
    fill: none !important;
    flex-shrink: 0;
}

.oto-btn-clear-all:hover {
    color: var(--oto-danger);
    background: var(--oto-danger-bg);
}

/* ========================================================
   5. COMPARISON TABLE & 2D STICKY HEADERS
   ======================================================== */
.oto-table-scroll-container {
    max-height: calc(90vh - 200px);
    overflow: auto;
    background: #ffffff;
    border: 1px solid var(--oto-border);
    border-radius: 14px;
    box-shadow: var(--oto-shadow-sm);
    position: relative;
    -webkit-overflow-scrolling: touch;
}

.oto-compare-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
}

/* Sticky Header Row (Top): Giữ ảnh và tên xe khi cuộn dọc */
.oto-compare-table thead tr.oto-row-products th {
    position: sticky;
    top: 0;
    z-index: 15;
    background: #ffffff;
    border-bottom: 2px solid var(--oto-border-dark);
    box-shadow: 0 4px 10px -2px rgba(0, 0, 0, 0.05);
}

/* Sticky Top + Left Intersection: Góc trái trên cùng */
.oto-compare-table thead tr.oto-row-products th.oto-col-label {
    position: sticky;
    top: 0;
    left: 0;
    z-index: 25;
    background: #f8fafc;
    border-right: 2px solid var(--oto-border);
}

/* Sticky Left Column: Giữ tên thông số khi cuộn ngang */
.oto-compare-table tbody td.oto-col-label {
    position: sticky;
    left: 0;
    z-index: 8;
    background: #f8fafc;
    border-right: 2px solid var(--oto-border);
}

.oto-spec-row:nth-child(even) td.oto-col-label {
    background: #f1f5f9;
}

/* Column dimensions & styling */
.oto-col-label {
    width: 220px;
    min-width: 200px;
    max-width: 240px;
    border-bottom: 1px solid var(--oto-border);
    padding: 16px 20px !important;
    vertical-align: middle;
}

.oto-label-header {
    display: flex;
    flex-direction: column;
}

.oto-label-header .oto-title-main {
    font-size: 15px;
    font-weight: 700;
    color: var(--oto-primary);
}

.oto-label-header .oto-title-sub {
    font-size: 12px;
    color: var(--oto-text-muted);
    margin-top: 2px;
}

.oto-spec-name {
    font-size: 13.5px;
    font-weight: 600;
    color: #334155;
    display: block;
    line-height: 1.35;
}

/* Product Column Cells */
.oto-col-product {
    min-width: 240px;
    max-width: 280px;
    width: 25%;
    border-right: 1px solid var(--oto-border);
    border-bottom: 1px solid var(--oto-border);
    padding: 16px;
    vertical-align: top;
    background: #ffffff;
}

.oto-col-value {
    min-width: 240px;
    max-width: 280px;
    border-right: 1px solid var(--oto-border);
    border-bottom: 1px solid var(--oto-border);
    padding: 14px 18px;
    vertical-align: middle;
    font-size: 13.5px;
    color: var(--oto-text-main);
    background: #ffffff;
    line-height: 1.4;
}

.oto-spec-row:nth-child(even) .oto-col-value {
    background: #fafbfc;
}

/* Difference Highlighting */
.oto-diff-active .oto-row-identical {
    display: none !important;
}

.oto-diff-active .oto-row-different .oto-col-value {
    background: #fffbeb !important;
}

.oto-diff-active .oto-row-different .oto-col-label {
    background: #fef3c7 !important;
    color: #92400e;
}

/* Product Card Head inside Table */
.oto-product-card-head {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: 4px;
}

.oto-remove-col-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 1px solid var(--oto-border);
    color: var(--oto-text-muted);
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 0;
    margin: 0;
    min-height: 26px;
}

.oto-remove-col-btn:hover {
    background: var(--oto-danger);
    color: #ffffff;
    border-color: var(--oto-danger);
    transform: scale(1.1);
}

.oto-product-thumb-link {
    display: block;
    width: 140px;
    height: 95px;
    margin-bottom: 10px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8fafc;
}

.oto-product-thumb-link img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.25s ease;
    display: block;
}

.oto-product-thumb-link:hover img {
    transform: scale(1.06);
}

.oto-product-name {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    min-height: 38px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.oto-product-name a {
    color: var(--oto-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.oto-product-name a:hover {
    color: var(--oto-accent);
}

.oto-product-price {
    font-size: 13.5px;
    font-weight: 700;
    color: #d32f2f;
    margin-bottom: 10px;
}

.oto-price-contact {
    color: #e65100;
    font-style: italic;
    font-weight: 600;
}

.oto-product-cta {
    width: 100%;
}

.oto-btn-view-detail {
    display: block;
    width: 100%;
    padding: 8px 12px;
    background: var(--oto-primary);
    color: #ffffff !important;
    text-align: center;
    text-decoration: none !important;
    font-size: 12.5px;
    font-weight: 700;
    border-radius: 6px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.oto-btn-view-detail:hover {
    background: var(--oto-accent);
    color: #ffffff !important;
}

/* Taxonomy Badges */
.oto-badge-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.oto-term-badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 600;
    background: var(--oto-primary-light);
    color: var(--oto-primary);
    border: 1px solid var(--oto-primary-border);
    border-radius: 4px;
    line-height: 1.3;
}

.oto-val-empty {
    color: #94a3b8;
    font-style: italic;
}

/* Add Product Slot in Table */
.oto-col-add-slot {
    background: #fafbfc;
    border-right: 1px dashed var(--oto-border-dark);
}

.oto-add-slot-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 10px;
}

.oto-add-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #e2e8f0;
    color: var(--oto-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.oto-add-icon svg {
    stroke: currentColor !important;
    fill: none !important;
}

.oto-add-text {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--oto-primary);
}

.oto-add-desc {
    margin: 4px 0 10px;
    font-size: 11.5px;
    color: var(--oto-text-muted);
}

/* Quick Search inside slot */
.oto-quick-search-wrap {
    position: relative;
    width: 100%;
}

.oto-quick-search-wrap .oto-quick-search-input {
    width: 100%;
    padding: 7px 10px;
    font-size: 12.5px;
    border: 1.5px solid var(--oto-border);
    border-radius: 6px;
    background: #ffffff;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.oto-quick-search-wrap .oto-quick-search-input:focus {
    border-color: var(--oto-primary);
}

.oto-quick-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: #ffffff;
    border: 1px solid var(--oto-border);
    border-radius: 8px;
    box-shadow: var(--oto-shadow-md);
    max-height: 220px;
    overflow-y: auto;
    display: none;
    margin-top: 4px;
    text-align: left;
}

.oto-search-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s ease;
}

.oto-search-item:hover {
    background: var(--oto-primary-light);
}

.oto-search-thumb {
    width: 34px;
    height: 34px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.oto-search-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--oto-text-main);
    line-height: 1.3;
}

.oto-col-add-slot-empty {
    text-align: center;
    background: #fafbfc;
    border-right: 1px dashed var(--oto-border-dark);
}

.oto-slot-dash {
    color: #cbd5e1;
}

/* ========================================================
   6. EMPTY STATE
   ======================================================== */
.oto-compare-empty {
    text-align: center;
    padding: 50px 20px;
}

.oto-empty-icon {
    margin-bottom: 16px;
}

.oto-empty-icon svg {
    stroke: var(--oto-primary) !important;
    fill: none !important;
}

.oto-compare-empty h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--oto-primary);
    margin: 0 0 8px;
}

.oto-compare-empty p {
    font-size: 14px;
    color: var(--oto-text-muted);
    max-width: 440px;
    margin: 0 auto;
}

/* ========================================================
   7. TOAST NOTIFICATION
   ======================================================== */
.oto-compare-toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1e293b;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    z-index: 9999999;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.oto-compare-toast.is-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========================================================
   8. RESPONSIVE OPTIMIZATIONS (TABLETS & PHONES)
   ======================================================== */
@media (max-width: 768px) {

    /* Modal layout */
    .oto-compare-modal {
        padding: 8px;
    }

    .oto-modal-dialog {
        max-height: 96vh;
        border-radius: 14px;
    }

    .oto-modal-header {
        padding: 12px 14px;
    }

    .oto-modal-title {
        font-size: 16px;
    }

    .oto-modal-subtitle {
        font-size: 11.5px;
    }

    .oto-modal-icon-badge {
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }

    .oto-modal-close {
        width: 34px !important;
        height: 34px !important;
    }

    .oto-modal-close svg {
        width: 18px !important;
        height: 18px !important;
    }

    .oto-modal-body {
        padding: 12px 10px 18px;
    }

    /* Modal Toolbar 2-row on mobile */
    .oto-compare-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 10px 12px;
        margin-bottom: 12px;
    }

    .oto-toolbar-actions {
        width: 100%;
        justify-content: space-between;
        order: 1;
    }

    .oto-toolbar-left {
        width: 100%;
        order: 2;
        padding-top: 8px;
        border-top: 1px dashed var(--oto-border);
    }

    .oto-diff-toggle {
        font-size: 12.5px;
    }

    .oto-count-badge {
        font-size: 12px;
        padding: 4px 10px;
    }

    .oto-btn-clear-all {
        font-size: 12px;
        padding: 4px 6px;
    }

    /* Table columns on Mobile */
    .oto-col-label {
        width: 115px;
        min-width: 105px;
        max-width: 120px;
        padding: 10px 8px;
    }

    .oto-label-header .oto-title-main {
        font-size: 13px;
    }

    .oto-label-header .oto-title-sub {
        font-size: 10.5px;
    }

    .oto-spec-name {
        font-size: 12px;
        font-weight: 700;
    }

    .oto-col-product,
    .oto-col-value {
        min-width: 165px;
        max-width: 180px;
        width: 170px;
        padding: 10px 8px;
    }

    .oto-product-thumb-link {
        width: 110px;
        height: 75px;
        margin-bottom: 8px;
    }

    .oto-product-name {
        font-size: 12.5px;
        min-height: 34px;
        margin-bottom: 4px;
    }

    .oto-product-price {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .oto-btn-view-detail {
        padding: 6px 8px;
        font-size: 11.5px;
        border-radius: 5px;
    }

    .oto-term-badge {
        font-size: 11px;
        padding: 2px 6px;
    }

    .oto-col-value {
        font-size: 12.5px;
    }

    .oto-remove-col-btn {
        width: 24px;
        height: 24px;
        font-size: 16px;
        top: -6px;
        right: -6px;
    }

    /* Floating Dock on Mobile */
    .oto-compare-dock {
        width: calc(100% - 20px);
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        padding: 8px 10px;
        border-radius: 12px;
    }

    .oto-dock-info {
        display: none;
    }

    .oto-dock-slots {
        gap: 8px;
    }

    .oto-dock-item,
    .oto-dock-item-empty {
        width: 42px;
        height: 42px;
    }

    /* ALWAYS show remove button on touch/mobile */
    .oto-dock-item-remove {
        opacity: 1 !important;
        width: 18px;
        height: 18px;
        font-size: 12px;
        top: -4px;
        right: -4px;
    }

    .oto-dock-actions {
        gap: 6px;
    }

    .oto-dock-btn-clear {
        font-size: 12px;
        padding: 5px 6px;
    }

    .oto-dock-btn-compare {
        padding: 8px 12px;
        font-size: 12.5px;
        border-radius: 8px;
    }

    .oto-dock-count-badge {
        width: 18px;
        height: 18px;
        font-size: 11px;
    }

    /* Product card action buttons on Mobile */
    .ot-card-action {
        gap: 6px !important;
    }

    .ot-card-action .ot-btn-xem-chi-tiet,
    .ot-card-action .oto-compare-toggle-btn {
        height: 36px !important;
        font-size: 12px !important;
        padding: 0 6px !important;
    }
}