/**
 * Marcrist Product Comparison Styles
 */

/* ===================================
   Compare Checkbox on Product Cards
   =================================== */

.marcrist-compare-wrapper {
    margin-top: 10px;
    text-align: center;
}

.marcrist-compare-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    user-select: none;
}

.marcrist-compare-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.marcrist-compare-text {
    font-weight: 500;
}

/* Hover effect */
.marcrist-compare-label:hover .marcrist-compare-text {
    text-decoration: underline;
}

/* ===================================
   Compare Button Container
   =================================== */

.marcrist-compare-button-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.marcrist-compare-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    background-color: #d32f2f;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.marcrist-compare-button:hover {
    background-color: #b71c1c;
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.marcrist-compare-button .compare-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    background-color: #ffffff;
    color: #d32f2f;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
}

/* ===================================
   Comparison Page
   =================================== */

.marcrist-comparison-page {
    padding: 40px 0;
    background-color: #fcfcfd;
}

.marcrist-comparison-page .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Page Header */
.comparison-header {
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}

.comparison-header .back-link {
    color: #333;
    text-decoration: none;
}

.comparison-header .back-link:hover {
    text-decoration: underline;
}

.comparison-header .separator {
    margin: 0 10px;
}

.comparison-header .current-page {
    color: #333;
}

.comparison-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 30px;
    color: #333;
}

/* Empty State */
.comparison-empty {
    text-align: center;
    padding: 60px 20px;
    background-color: #ffffff;
    border-radius: 8px;
}

.comparison-empty p {
    font-size: 18px;
    color: #666;
    margin-bottom: 20px;
}

.comparison-empty .button {
    display: inline-block;
    padding: 12px 30px;
    background-color: #d32f2f;
    color: #ffffff;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
}

.comparison-empty .button:hover {
    background-color: #b71c1c;
}

/* ===================================
   Comparison Table
   =================================== */

.comparison-table-wrapper {
    overflow-x: auto;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
}

.comparison-table thead {
    background-color: #333;
    color: #ffffff;
}

.comparison-table thead th {
    padding: 15px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    border-right: 1px solid #555;
}

.comparison-table thead th:last-child {
    border-right: none;
}

.comparison-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
}

.comparison-table tbody tr:last-child {
    border-bottom: none;
}

.comparison-table tbody td {
    padding: 20px;
    vertical-align: top;
    border-right: 1px solid #e0e0e0;
    font-size: 14px;
    line-height: 1.6;
}

.comparison-table tbody td:last-child {
    border-right: none;
}

/* Product Cell */
.product-cell {
    width: 200px;
    text-align: center;
}

.product-image {
    max-width: 150px;
    height: auto;
    margin: 0 auto 15px;
    display: block;
}

.product-title {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.product-sku {
    margin-bottom: 10px;
}

.product-sku small {
    color: #666;
    font-size: 12px;
}

.product-link {
    display: inline-block;
    padding: 8px 16px;
    background-color: #d32f2f;
    color: #ffffff !important;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.product-link:hover {
    background-color: #b71c1c;
    color: #ffffff !important;
}

/* Description Cell */
.description-cell {
}

.product-description p:last-child {
    margin-bottom: 0;
}

/* Features Cell */
.features-cell {
}

.product-features ul {
    margin: 0;
    padding-left: 20px;
}

.product-features li {
    margin-bottom: 8px;
}

.product-features li:last-child {
    margin-bottom: 0;
}

/* Materials Cell */
.materials-cell {
}

/* Other Cell */
.other-cell {
}

.product-other-item {
    margin-bottom: 15px;
}

.product-other-item:last-child {
    margin-bottom: 0;
}

.product-other-item strong {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-size: 13px;
}

/* Guarantee Cell */
.guarantee-cell {
    text-align: center;
}

.product-guarantee img {
    max-width: 100px;
    height: auto;
    margin-bottom: 10px;
}

.product-guarantee p {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

/* ===================================
   Responsive Design - Mobile Stacked Layout
   =================================== */

@media screen and (max-width: 968px) {
    .marcrist-compare-button-container {
        bottom: 20px;
        right: 20px;
    }

    .marcrist-compare-button {
        padding: 12px 20px;
        font-size: 14px;
    }

    .comparison-title {
        font-size: 24px;
    }

    .comparison-table-wrapper {
        border-radius: 0;
        overflow-x: visible;
    }

    .comparison-table {
        display: block;
        width: 100%;
        min-width: 0;
    }

    /* Hide table header on mobile */
    .comparison-table thead {
        display: none;
    }

    .comparison-table tbody {
        display: block;
    }

    /* Each product row becomes a card */
    .comparison-table tbody tr {
        display: block;
        margin-bottom: 20px;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        background-color: #fff;
        padding: 20px;
    }

    .comparison-table tbody tr:last-child {
        margin-bottom: 0;
    }

    /* Stack all cells vertically */
    .comparison-table tbody td {
        display: block;
        width: 100%;
        border: none;
        border-bottom: 1px solid #f0f0f0;
        padding: 15px 0;
        text-align: left;
    }

    .comparison-table tbody td:last-child {
        border-bottom: none;
    }

    /* Add labels before each cell */
    .comparison-table tbody td:not(.product-cell)::before {
        content: attr(data-label);
        display: block;
        font-weight: 700;
        color: #333;
        margin-bottom: 8px;
        font-size: 14px;
    }

    /* Product cell centered */
    .product-cell {
        text-align: center;
        padding-bottom: 20px;
        border-bottom: 2px solid #e0e0e0;
    }

    .product-image {
        max-width: 120px;
    }

    .product-title {
        font-size: 18px;
    }

    /* Other cells left-aligned */
    .description-cell,
    .features-cell,
    .materials-cell,
    .other-cell,
    .guarantee-cell {
        text-align: left;
        min-width: 0;
    }

    .guarantee-cell {
        text-align: center;
    }
}

@media screen and (max-width: 480px) {
    .marcrist-comparison-page .container {
        padding: 0 10px;
    }

    .comparison-header {
        font-size: 12px;
    }

    .comparison-title {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .marcrist-compare-button-container {
        bottom: 10px;
        right: 10px;
    }

    .marcrist-compare-button {
        padding: 10px 16px;
        font-size: 13px;
    }

    .comparison-table tbody tr {
        padding: 15px;
    }

    .product-image {
        max-width: 100px;
    }

    .product-title {
        font-size: 16px;
    }
}
