/* AeroCore B2B Product Comparison Stylesheet */

/* Product Card Checkbox overlay */
.scy-compare-checkbox {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    background: rgba(15, 25, 40, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 5px 9px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    transition: all 0.25s ease;
}

.scy-compare-checkbox:hover {
    background: rgba(15, 25, 40, 0.88);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.02);
}

.scy-compare-checkbox input[type="checkbox"] {
    margin: 0;
    width: 14px;
    height: 14px;
    accent-color: #3557a0;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 3px;
    background: transparent;
}

/* Floating Compare Bar */
.scy-compare-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    width: min(840px, 94vw);
    background: rgba(21, 37, 64, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    box-shadow: 0 16px 48px rgba(15, 25, 40, 0.35);
    z-index: 9998;
    padding: 14px 20px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, visibility 0.3s ease;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.scy-compare-bar.is-active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

/* Pull Handle for mobile folding */
.scy-compare-bar-handle {
    display: none;
}

@media (max-width: 768px) {
    .scy-compare-bar-handle {
        display: block;
        width: 36px;
        height: 4px;
        border-radius: 2px;
        background: rgba(255, 255, 255, 0.25);
        margin: -4px auto 10px;
        cursor: pointer;
        transition: background 0.2s ease;
    }
    .scy-compare-bar-handle:hover {
        background: rgba(255, 255, 255, 0.45);
    }
}

/* Collapsed State */
.scy-compare-bar.is-collapsed {
    transform: translateX(-50%) translateY(calc(100% - 32px));
}

@media (max-width: 768px) {
    .scy-compare-bar.is-collapsed {
        transform: translateX(-50%) translateY(calc(100% - 22px));
    }
    .scy-compare-bar.is-collapsed .scy-compare-bar-content {
        opacity: 0 !important;
        pointer-events: none !important;
        height: 0 !important;
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

.scy-compare-bar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 16px;
    transition: opacity 0.3s ease, height 0.3s ease;
}

.scy-compare-bar-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 100px;
}

.scy-compare-bar-title {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.04em;
}

.scy-compare-bar-count {
    color: rgba(255, 255, 255, 0.65);
    font-size: 12px;
}

.scy-compare-bar-items {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-grow: 1;
    overflow-x: auto;
    padding: 4px 0;
}

/* hide scrollbars */
.scy-compare-bar-items::-webkit-scrollbar {
    height: 4px;
}
.scy-compare-bar-items::-webkit-scrollbar-track {
    background: transparent;
}
.scy-compare-bar-items::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 4px;
}

.scy-compare-bar-item {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    overflow: visible;
    flex-shrink: 0;
}

.scy-compare-bar-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 7px;
}

.scy-compare-bar-item-remove {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    border: 0;
    font-size: 11px;
    font-weight: bold;
    line-height: 16px;
    text-align: center;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    transition: transform 0.2s;
    padding: 0;
}

.scy-compare-bar-item-remove:hover {
    transform: scale(1.2);
    background: #dc2626;
}

.scy-compare-bar-item-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    color: #8a96a3;
    background: #f1f3f7;
    border-radius: 7px;
}

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

.scy-compare-bar-btn-start {
    background: linear-gradient(135deg, #2458a6, #5f80cc);
    color: #fff !important;
    border: 0;
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(36, 88, 166, 0.25);
    white-space: nowrap;
}

.scy-compare-bar-btn-start:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(36, 88, 166, 0.35);
    opacity: 0.96;
}

.scy-compare-bar-btn-clear {
    color: rgba(255, 255, 255, 0.7);
    background: transparent;
    border: 0;
    font-size: 13px;
    cursor: pointer;
    transition: color 0.25s;
    padding: 4px;
}

.scy-compare-bar-btn-clear:hover {
    color: #fff;
    text-decoration: underline;
}

/* Modal dialog modifier */
.scy-modal__dialog--compare {
    width: min(1200px, 95vw) !important;
    max-height: 90vh !important;
    margin: 5vh auto !important;
}

/* Compare Matrix Table */
.scy-compare-table-wrapper {
    overflow-x: auto;
    width: 100%;
    margin-top: 36px;
    border-radius: 12px;
    border: 1px solid #e8edf7;
}

.scy-compare-matrix {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
    line-height: 1.6;
}

.scy-compare-matrix th,
.scy-compare-matrix td {
    padding: 14px 18px;
    border: 1px solid #e8edf7;
    vertical-align: middle;
}

.scy-compare-matrix thead th {
    background: #f8faff;
    position: sticky;
    top: 0;
    z-index: 10;
}

.scy-compare-label {
    width: 150px;
    min-width: 120px;
    font-weight: 700;
    color: #24365f;
    background: #f8faff !important;
    font-size: 14px;
    letter-spacing: 0.02em;
}

.scy-compare-col {
    width: calc(85% / 4);
    min-width: 220px;
}

.scy-compare-col-header {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 10px 0;
}

.scy-compare-remove-col {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 0;
    background: #f1f3f7;
    color: #5c6c84;
    font-size: 15px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.scy-compare-remove-col:hover {
    background: #ef4444;
    color: #fff;
    transform: scale(1.1);
}

.scy-compare-img-wrap {
    width: 76px;
    height: 76px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8faff;
    border: 1px solid #e8edf7;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.scy-compare-img-wrap:hover {
    opacity: 0.8;
}

.scy-compare-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scy-compare-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #8a96a3;
    background: #eef3fb;
    padding: 4px;
    text-align: center;
}

.scy-compare-title-link {
    font-size: 13px;
    font-weight: 700;
    color: #24365f;
    text-decoration: none;
    transition: color 0.2s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    max-height: 2.8em;
}

.scy-compare-title-link:hover {
    color: #3557a0;
}

.scy-compare-matrix tbody tr:nth-child(even) td {
    background: #fafcfe;
}

.scy-compare-matrix tbody td:not(.scy-compare-label) {
    color: #4b5563;
    font-size: 13px;
}

.scy-compare-actions-row td {
    text-align: center;
    padding: 16px !important;
}

.scy-compare-actions-row td .scy-add-to-cart-btn {
    width: 100%;
    min-width: 0;
}

/* Loading status style */
.scy-compare-loading-wrap {
    padding: 60px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.scy-compare-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #f1f3f7;
    border-top-color: #2458a6;
    border-radius: 50%;
    animation: scy-compare-spin 0.8s linear infinite;
}

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

.scy-compare-loading-text {
    color: #6b7280;
    font-size: 14px;
}

/* Image Lightbox Style */
.scy-compare-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000;
    align-items: center;
    justify-content: center;
}

.scy-compare-lightbox.is-active {
    display: flex;
}

.scy-compare-lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.scy-compare-lightbox-content {
    position: relative;
    z-index: 2;
    width: min(800px, 90vw);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    animation: scy-lightbox-zoom 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scy-lightbox-zoom {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.scy-compare-lightbox-content img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    background: #f8faff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.scy-compare-lightbox-caption {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.scy-compare-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.scy-compare-lightbox-close:hover {
    color: #ef4444;
}

body.scy-lightbox-open {
    overflow: hidden !important;
}

/* Responsive adjustment for Mobile Compare */
@media (max-width: 768px) {
    .scy-compare-bar {
        bottom: 12px;
        border-radius: 12px;
        padding: 10px 14px;
    }
    
    .scy-compare-bar-content {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .scy-compare-bar-info {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .scy-compare-bar-actions {
        justify-content: space-between;
    }
    
    .scy-compare-bar-items {
        justify-content: center;
    }
    
    .scy-compare-matrix th,
    .scy-compare-matrix td {
        padding: 10px 12px;
    }
    
    .scy-compare-label {
        width: 110px;
        min-width: 100px;
        font-size: 13px;
    }
    
    .scy-compare-col {
        min-width: 160px;
    }
}
