/* HID Compare Products - Frontend Styles */

/* Compare Button Styles */
.hid-compare-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 20px;
    border: 2px solid #333;
    background: #fff;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hid-compare-button:hover {
    background: #333;
    color: #fff;
    border-color: #333;
}

.hid-compare-button.active {
    background: #4CAF50;
    color: #fff;
    border-color: #4CAF50;
}

.hid-compare-button.active:hover {
    background: #45a049;
    border-color: #45a049;
}

.hid-compare-button-small {
    padding: 8px 12px;
    font-size: 12px;
    margin-top: 5px;
}

.hid-compare-icon {
    font-size: 18px;
    line-height: 1;
}

/* Shop Loop Button */
.woocommerce ul.products li.product .hid-compare-button-small {
    width: 100%;
    justify-content: center;
}

/* Compare Bar Styles */
.hid-compare-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    transform: translateY(calc(100% - 60px));
    transition: transform 0.3s ease;
}

.hid-compare-bar.expanded {
    transform: translateY(0);
}

.hid-compare-bar.has-products {
    transform: translateY(0);
}

.hid-compare-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.hid-compare-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.hid-compare-bar-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.hid-compare-count {
    display: inline-block;
    min-width: 24px;
    height: 24px;
    line-height: 24px;
    padding: 0 8px;
    background: #333;
    color: #fff;
    border-radius: 12px;
    font-size: 12px;
    text-align: center;
}

.hid-compare-bar-toggle {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    font-size: 20px;
    transition: transform 0.3s ease;
}

.hid-compare-bar.expanded .hid-compare-toggle-icon {
    transform: rotate(180deg);
}

.hid-compare-bar-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.hid-compare-bar.expanded .hid-compare-bar-content {
    max-height: 400px;
    overflow-y: auto;
}

.hid-compare-products-list {
    display: flex;
    gap: 15px;
    padding: 20px 0;
    overflow-x: auto;
}

.hid-compare-empty {
    width: 100%;
    text-align: center;
    padding: 30px 0;
    color: #999;
}

.hid-compare-product-item {
    flex: 0 0 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 5px;
    position: relative;
}

.hid-compare-product-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: #f44336;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.hid-compare-product-remove:hover {
    background: #d32f2f;
}

.hid-compare-product-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    margin-bottom: 10px;
    border-radius: 3px;
}

.hid-compare-product-name {
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hid-compare-product-price {
    font-size: 16px;
    color: #4CAF50;
    font-weight: 600;
}

.hid-compare-bar-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 0;
    border-top: 1px solid #eee;
}

.hid-compare-bar-actions .button {
    margin: 0;
}

/* Comparison Page Styles */
.hid-compare-page-wrapper {
    padding: 40px 20px;
    background: #f9f9f9;
    min-height: 60vh;
}

.hid-compare-container {
    max-width: 1400px;
    margin: 0 auto;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hid-compare-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.hid-compare-page-title {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
}

.hid-compare-header-actions {
    display: flex;
    gap: 10px;
}

/* Empty State */
.hid-compare-empty-state {
    text-align: center;
    padding: 60px 20px;
}

.hid-compare-empty-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.hid-compare-empty-state h2 {
    font-size: 28px;
    margin-bottom: 10px;
}

.hid-compare-empty-state p {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
}

/* Comparison Table */
.hid-compare-table-wrapper {
    overflow-x: auto;
    margin-top: 20px;
}

.hid-compare-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.hid-compare-table thead tr {
    background: #f5f5f5;
}

.hid-compare-table th,
.hid-compare-table td {
    padding: 15px;
    border: 1px solid #ddd;
    text-align: left;
    vertical-align: top;
}

.hid-compare-th-label {
    width: 200px;
    font-weight: 700;
    background: #333;
    color: #fff;
}

.hid-compare-th-product {
    min-width: 200px;
    position: relative;
    text-align: center;
}

.hid-compare-remove-product {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: #f44336;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.hid-compare-remove-product:hover {
    background: #d32f2f;
}

.hid-compare-label {
    font-weight: 600;
    background: #f9f9f9;
}

.hid-compare-value {
    min-width: 200px;
}

.hid-compare-row-image .hid-compare-value {
    text-align: center;
}

.hid-compare-row-image img {
    max-width: 100%;
    height: auto;
    max-height: 250px;
    object-fit: contain;
}

.hid-compare-product-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
}

.hid-compare-product-name:hover {
    color: #4CAF50;
}

.hid-compare-price {
    font-size: 20px;
    font-weight: 700;
    color: #4CAF50;
}

.hid-compare-description {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
}

.hid-compare-row-actions .hid-compare-value {
    text-align: center;
}

/* Responsive Styles */
@media screen and (max-width: 768px) {
    .hid-compare-bar-inner {
        padding: 0 15px;
    }
    
    .hid-compare-products-list {
        gap: 10px;
    }
    
    .hid-compare-product-item {
        flex: 0 0 150px;
    }
    
    .hid-compare-page-wrapper {
        padding: 20px 10px;
    }
    
    .hid-compare-container {
        padding: 15px;
    }
    
    .hid-compare-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .hid-compare-page-title {
        font-size: 24px;
    }
    
    .hid-compare-table th,
    .hid-compare-table td {
        padding: 10px;
        font-size: 14px;
    }
    
    .hid-compare-th-label {
        width: 120px;
    }
    
    .hid-compare-value {
        min-width: 150px;
    }
}

/* Print Styles */
@media print {
    .hid-compare-header-actions,
    .hid-compare-remove-product,
    .hid-compare-row-actions {
        display: none !important;
    }
    
    .hid-compare-table {
        page-break-inside: avoid;
    }
}
