/* ============================================
   Compare Similar Items - Frontend Styles
   ============================================ */

:root {
    --wccs-accent: #2563eb;
    --wccs-highlight: #eff6ff;
    --wccs-header-bg: #f8fafc;
    --wccs-border: #e2e8f0;
}

/* Section Container */
.wccs-compare-section {
    margin: 40px 0;
    padding: 0;
    clear: both;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Header */
.wccs-compare-header {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--wccs-accent);
}

.wccs-compare-title {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    padding: 0;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

/* Table Wrapper */
.wccs-table-wrapper {
    position: relative;
    overflow: hidden;
}

.wccs-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--wccs-accent) #f1f5f9;
}

.wccs-table-scroll::-webkit-scrollbar {
    height: 6px;
}

.wccs-table-scroll::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.wccs-table-scroll::-webkit-scrollbar-thumb {
    background: var(--wccs-accent);
    border-radius: 3px;
}

/* Table */
.wccs-compare-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    border: 1px solid var(--wccs-border);
    table-layout: fixed;
    min-width: 600px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

/* Column widths */
.wccs-col-label {
    width: 140px;
}

.wccs-col-product {
    min-width: 170px;
}

/* Label cells (left column) */
.wccs-label-cell {
    background: var(--wccs-header-bg);
    font-weight: 600;
    font-size: 13px;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 14px 16px;
    text-align: left;
    vertical-align: middle;
    border-right: 1px solid var(--wccs-border);
    border-bottom: 1px solid var(--wccs-border);
    white-space: nowrap;
    position: sticky;
    left: 0;
    z-index: 2;
}

/* Product cells */
.wccs-product-cell {
    padding: 14px 16px;
    text-align: center;
    vertical-align: middle;
    border-bottom: 1px solid var(--wccs-border);
    border-right: 1px solid var(--wccs-border);
    font-size: 14px;
    color: #334155;
    transition: background-color 0.2s ease;
}

.wccs-product-cell:last-child {
    border-right: none;
}

/* Current product highlight */
.wccs-current-product {
    background-color: var(--wccs-highlight);
}

/* "This Item" badge */
.wccs-badge-current {
    display: inline-block;
    background: var(--wccs-accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 10px;
}

/* Product image in header */
.wccs-row-image td,
.wccs-row-image th {
    padding: 20px 16px;
    vertical-align: top;
    border-bottom: 2px solid var(--wccs-border);
}

.wccs-product-image-link {
    display: block;
    text-decoration: none;
    margin-bottom: 10px;
}

.wccs-product-img {
    max-width: 120px;
    height: auto;
    border-radius: 6px;
    margin: 0 auto;
    display: block;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.wccs-product-image-link:hover .wccs-product-img {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Product name */
.wccs-product-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--wccs-accent);
    text-decoration: none;
    line-height: 1.4;
    margin-top: 6px;
    transition: color 0.2s ease;
}

.wccs-product-name:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Price */
.wccs-price {
    font-weight: 700;
    font-size: 16px;
    color: #0f172a;
}

.wccs-price del {
    color: #94a3b8;
    font-weight: 400;
    font-size: 13px;
}

.wccs-price ins {
    text-decoration: none;
    color: #dc2626;
    font-weight: 700;
}

/* Rating */
.wccs-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
}

.wccs-rating .star-rating {
    font-size: 14px;
}

.wccs-rating-count {
    font-size: 12px;
    color: #64748b;
}

.wccs-no-rating {
    font-size: 12px;
    color: #94a3b8;
    font-style: italic;
}

/* Description */
.wccs-description {
    font-size: 13px;
    line-height: 1.5;
    color: #475569;
    text-align: left;
}

/* Stock status */
.wccs-stock {
    font-size: 13px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    display: inline-block;
}

.wccs-stock-in {
    color: #15803d;
    background: #f0fdf4;
}

.wccs-stock-out {
    color: #dc2626;
    background: #fef2f2;
}

.wccs-stock-low {
    color: #d97706;
    background: #fffbeb;
}

.wccs-stock-backorder {
    color: #2563eb;
    background: #eff6ff;
}

/* Add to Cart button */
.wccs-add-to-cart {
    display: inline-block;
    background: var(--wccs-accent) !important;
    color: #fff !important;
    border: none !important;
    padding: 10px 22px !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    line-height: 1.4 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.wccs-add-to-cart:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.wccs-add-to-cart.added::after {
    content: ' ✓';
}

.wccs-unavailable {
    font-size: 13px;
    color: #94a3b8;
    font-style: italic;
}

/* Cart row */
.wccs-row-cart td,
.wccs-row-cart th {
    padding: 18px 16px;
    border-bottom: none;
}

/* Zebra striping */
.wccs-compare-table tbody tr:nth-child(even) .wccs-label-cell {
    background: #f1f5f9;
}

.wccs-compare-table tbody tr:nth-child(even) .wccs-product-cell:not(.wccs-current-product) {
    background: #fafbfc;
}

/* Scroll hint */
.wccs-scroll-hint {
    display: none;
    text-align: center;
    padding: 8px 0 0;
}

.wccs-scroll-hint-text {
    font-size: 12px;
    color: #94a3b8;
    animation: wccs-pulse 2s ease-in-out infinite;
}

@keyframes wccs-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ============================================
   Responsive Styles
   ============================================ */

@media (max-width: 1024px) {
    .wccs-col-label {
        width: 120px;
    }

    .wccs-product-img {
        max-width: 100px;
    }
}

@media (max-width: 768px) {
    .wccs-compare-section {
        margin: 24px -15px;
        padding: 0 15px;
    }

    .wccs-compare-title {
        font-size: 18px;
    }

    .wccs-col-label {
        width: 100px;
    }

    .wccs-label-cell {
        font-size: 11px;
        padding: 10px 10px;
    }

    .wccs-product-cell {
        padding: 10px 10px;
        font-size: 13px;
    }

    .wccs-product-img {
        max-width: 80px;
    }

    .wccs-product-name {
        font-size: 12px;
    }

    .wccs-price {
        font-size: 14px;
    }

    .wccs-add-to-cart {
        padding: 8px 14px !important;
        font-size: 12px !important;
    }

    .wccs-scroll-hint {
        display: block;
    }
}

@media (max-width: 480px) {
    .wccs-col-label {
        width: 80px;
    }

    .wccs-label-cell {
        font-size: 10px;
        padding: 8px 6px;
        letter-spacing: 0.02em;
    }

    .wccs-product-cell {
        padding: 8px 8px;
        min-width: 140px;
    }

    .wccs-product-img {
        max-width: 65px;
    }

    .wccs-badge-current {
        font-size: 9px;
        padding: 2px 8px;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .wccs-compare-section {
        page-break-inside: avoid;
    }

    .wccs-add-to-cart,
    .wccs-scroll-hint {
        display: none !important;
    }

    .wccs-compare-table {
        border: 1px solid #ccc;
    }

    .wccs-product-cell,
    .wccs-label-cell {
        border: 1px solid #ccc;
    }
}
