/**
 * Compare Products - Stylesheet
 * Modern Pandora/Thomas Sabo inspired design for Zen Cart 2.1
 */

/* ==========================================================================
   1. COMPARE TOGGLE BUTTON (on product pages / listings)
   ========================================================================== */

.btn-compare-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid #ccc;
    background: #fff;
    color: #555;
    font-size: 12px;
    font-family: inherit;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: all 0.25s ease;
    text-transform: uppercase;
    line-height: 1;
}

.btn-compare-toggle:hover {
    border-color: #2c5aa0;
    color: #2c5aa0;
}

.btn-compare-toggle.in-compare {
    border-color: #2c5aa0;
    color: #2c5aa0;
    background: #f0f5ff;
}

.btn-compare-toggle .icon-compare {
    flex-shrink: 0;
}

/* Product detail page positioning */
.product-info-sticky .compareSelect {
    margin-top: 10px;
}

/* Listing page positioning */
.list-compare {
    margin: 5px 0;
}

/* ==========================================================================
   2. FLOATING COMPARE BAR (bottom of screen)
   ========================================================================== */

.compare-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    background: #1a1a1a;
    color: #fff;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.compare-bar.visible {
    transform: translateY(0);
}

.compare-bar-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.compare-bar-items {
    display: flex;
    gap: 10px;
    flex: 1;
    overflow-x: auto;
}

.compare-bar-item {
    position: relative;
    width: 45px;
    height: 45px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.compare-bar-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.compare-bar-item .compare-bar-remove {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    background: #c0392b;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    cursor: pointer;
    padding: 0;
}

.compare-bar-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.compare-bar .btn-compare-now {
    padding: 8px 20px;
    background: #fff;
    color: #1a1a1a;
    border: none;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.compare-bar .btn-compare-now:hover {
    background: #e0e0e0;
    text-decoration: none;
    color: #1a1a1a;
}

.compare-bar .btn-compare-clear {
    padding: 8px 12px;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 11px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
}

.compare-bar .btn-compare-clear:hover {
    color: #fff;
    border-color: #fff;
}

/* ==========================================================================
   3. COMPARE PAGE TABLE
   ========================================================================== */

.compare-page-title {
    font-size: 1.6em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 20px 0;
    color: var(--theme-text-primary, #1a1a1a);
}

.compare-table-wrapper {
    overflow-x: auto;
    margin: 20px 0;
    -webkit-overflow-scrolling: touch;
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.compare-table th,
.compare-table td {
    padding: 12px 15px;
    vertical-align: top;
    border-bottom: 1px solid #eee;
    text-align: center;
    font-size: 13px;
}

.compare-label-col,
.compare-label {
    text-align: right;
    font-weight: 600;
    width: 120px;
    min-width: 100px;
    color: #666;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.04em;
}

.compare-product-col {
    position: relative;
    min-width: 180px;
}

.compare-remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid #ccc;
    background: #fff;
    color: #999;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s;
}

.compare-remove-btn:hover {
    border-color: #c0392b;
    color: #c0392b;
    background: #fff5f5;
}

.compare-img {
    max-width: 150px;
    max-height: 150px;
}

.compare-name a {
    font-weight: 600;
    color: var(--theme-text-primary, #1a1a1a);
    text-decoration: none;
}

.compare-name a:hover {
    text-decoration: underline;
}

.compare-price {
    font-weight: 700;
    color: var(--theme-text-primary, #1a1a1a);
}

.compare-desc {
    font-size: 12px;
    line-height: 1.5;
    color: #666;
    text-align: left;
}

.btn-compare-view {
    display: inline-block;
    padding: 10px 24px;
    background: #1a1a1a;
    color: #fff;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: background 0.2s;
}

.btn-compare-view:hover {
    background: #333;
    color: #fff;
    text-decoration: none;
}

.compare-back {
    margin: 20px 0;
}

.btn-compare-back {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid #1a1a1a;
    color: #1a1a1a;
    text-decoration: none;
    font-size: 12px;
    text-transform: uppercase;
    transition: all 0.2s;
}

.btn-compare-back:hover {
    background: #1a1a1a;
    color: #fff;
    text-decoration: none;
}

.compare-empty {
    text-align: center;
    padding: 40px 20px;
    font-size: 14px;
    color: #888;
}

/* ==========================================================================
   4. TOAST for compare
   ========================================================================== */

.compare-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 260px;
    max-width: 380px;
    padding: 14px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    background: #2c5aa0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    transform: translateX(120%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.compare-toast.show {
    transform: translateX(0);
}

.compare-toast.warning {
    background: #e67e22;
}

/* ==========================================================================
   5. RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    .compare-bar {
        flex-wrap: wrap;
        padding: 10px 12px;
        gap: 8px;
    }

    .compare-bar-title {
        font-size: 11px;
        width: 100%;
    }

    .compare-bar-items {
        gap: 6px;
    }

    .compare-bar-item {
        width: 36px;
        height: 36px;
    }

    .compare-table th,
    .compare-table td {
        padding: 8px 10px;
        font-size: 12px;
    }

    .compare-img {
        max-width: 100px;
        max-height: 100px;
    }

    .btn-compare-toggle {
        padding: 6px 12px;
        font-size: 11px;
    }
}

/* ==========================================================================
   6. DARK MODE
   ========================================================================== */

.theme-dark .btn-compare-toggle {
    border-color: #555;
    color: #ccc;
    background: transparent;
}

.theme-dark .btn-compare-toggle:hover,
.theme-dark .btn-compare-toggle.in-compare {
    border-color: #6ea8fe;
    color: #6ea8fe;
    background: rgba(110, 168, 254, 0.1);
}

.theme-dark .compare-page-title {
    color: #eee;
}

.theme-dark .compare-table th,
.theme-dark .compare-table td {
    border-bottom-color: #333;
}

.theme-dark .compare-name a {
    color: #eee;
}

.theme-dark .compare-price {
    color: #D4AF37;
}

.theme-dark .compare-remove-btn {
    background: #222;
    border-color: #555;
    color: #aaa;
}

.theme-dark .compare-bar {
    background: #111;
}
