/**
 * Product Scraping Frontend Styles - Modern Design
 */

:root {
    --ps-primary: #046bd2;
    --ps-primary-dark: #0358ab;
    --ps-primary-light: #1a7fd9;
    --ps-secondary: #046bd2;
    --ps-success: #10b981;
    --ps-danger: #ef4444;
    --ps-warning: #f59e0b;
    --ps-bg: #f8fafc;
    --ps-surface: #ffffff;
    --ps-border: #e2e8f0;
    --ps-text: #1e293b;
    --ps-text-light: #64748b;
    --ps-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --ps-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --ps-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --ps-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --ps-radius: 12px;
    --ps-radius-sm: 8px;
    --ps-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ps-products-container {
    width: 100%;
    max-width: 1400px;
    margin: 20px auto;
    padding: 20px;
    background: var(--ps-bg);
    border-radius: var(--ps-radius);
    box-sizing: border-box;
}

.ps-products-wrapper {
    display: flex;
    flex-direction: row;
    gap: 30px;
    align-items: flex-start;
    box-sizing: border-box;
}

.ps-loading {
    text-align: center;
    padding: 60px 20px;
    font-size: 16px;
    color: var(--ps-text-light);
    background: var(--ps-surface);
    border-radius: var(--ps-radius);
    box-shadow: var(--ps-shadow);
}

.ps-loading::before {
    content: '';
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--ps-border);
    border-top-color: var(--ps-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 15px;
}

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

.ps-error {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 1px solid #fca5a5;
    border-radius: var(--ps-radius);
    color: #dc2626;
    box-shadow: var(--ps-shadow-md);
}

.ps-no-products {
    text-align: center;
    padding: 60px 20px;
    color: var(--ps-text-light);
    font-size: 16px;
    background: var(--ps-surface);
    border-radius: var(--ps-radius);
    box-shadow: var(--ps-shadow);
}

.ps-products-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 10px;
    margin-top: 20px;
}

.ps-products-container .ps-products-grid,
.ps-products-wrapper .ps-products-grid,
#ps-1-grid,
[id*="ps-"][id*="-grid"] {
    grid-template-columns: repeat(4, 1fr) !important;
    display: grid !important;
}

/* Featured grid layout (used by [product_scraping_featured]) */
.ps-products-container-featured .ps-products-grid-featured {
    grid-template-columns: repeat(var(--ps-featured-columns, 4), minmax(0, 1fr)) !important;
    display: grid !important;
}

/* Ensure featured columns are not overridden */
.ps-products-container-featured[id*="ps-"] .ps-products-grid-featured,
.ps-products-container.ps-products-container-featured .ps-products-grid-featured {
    grid-template-columns: repeat(var(--ps-featured-columns, 4), minmax(0, 1fr)) !important;
}

.ps-product-card {
    background: var(--ps-surface);
    border: 1px solid var(--ps-border);
    border-radius: var(--ps-radius);
    overflow: hidden;
    transition: var(--ps-transition);
    display: flex;
    flex-direction: column;
    box-shadow: var(--ps-shadow);
    position: relative;
}

.ps-product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--ps-primary), var(--ps-secondary));
    opacity: 0;
    transition: var(--ps-transition);
}

.ps-product-card:hover {
    box-shadow: var(--ps-shadow-xl);
    border-color: var(--ps-primary-light);
}

.ps-product-card:hover::before {
    opacity: 1;
}

.ps-product-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.ps-product-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.05) 100%);
    opacity: 0;
    transition: var(--ps-transition);
}

.ps-product-card:hover .ps-product-image::after {
    opacity: 1;
}

.ps-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--ps-transition);
}

.ps-product-card:hover .ps-product-image img {
    transform: scale(1.08);
}

.ps-product-title {
    font-size: 16px;
    font-weight: 600;
    margin: 18px 18px 12px;
    color: var(--ps-text);
    line-height: 1.5;
    min-height: 48px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: var(--ps-transition);
}

.ps-product-card:hover .ps-product-title {
    color: var(--ps-primary);
}

.ps-product-price {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: baseline;
    font-size: 18px;
    font-weight: 700;
    color: var(--ps-text);
    margin: 0 18px 12px;
}

.ps-product-price-current {
    font-size: 22px;
    color: var(--ps-primary);
    font-weight: 700;
}

.ps-product-price-original {
    font-size: 14px;
    font-weight: 400;
    color: var(--ps-text-light);
    text-decoration: line-through;
}

.ps-product-price-savings {
    font-size: 13px;
    font-weight: 600;
    color: var(--ps-danger);
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    padding: 2px 8px;
    border-radius: 6px;
}

.ps-product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 18px 12px;
    font-size: 13px;
    color: var(--ps-text-light);
}

.ps-product-meta span {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    color: var(--ps-primary);
    font-size: 12px;
    transition: var(--ps-transition);
}

.ps-product-card:hover .ps-product-meta span {
    background: linear-gradient(135deg, var(--ps-primary-light) 0%, var(--ps-primary) 100%);
    color: white;
    transform: scale(1.05);
}

.ps-product-description {
    font-size: 14px;
    color: var(--ps-text-light);
    line-height: 1.6;
    margin: 0 18px 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--ps-border);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ps-product-button {
    display: block;
    margin: 0 18px 18px;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--ps-primary) 0%, var(--ps-primary-dark) 100%);
    color: #fff;
    text-align: center;
    text-decoration: none;
    border-radius: var(--ps-radius-sm);
    font-weight: 600;
    font-size: 15px;
    transition: var(--ps-transition);
    box-shadow: var(--ps-shadow-md);
    position: relative;
    overflow: hidden;
}

.ps-product-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.ps-product-button:hover {
    background: linear-gradient(135deg, var(--ps-primary-dark) 0%, var(--ps-primary) 100%);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--ps-shadow-lg);
}

.ps-product-button:hover::before {
    left: 100%;
}

.ps-product-button:active {
    transform: translateY(0);
}

/* Filter Sidebar */
.ps-filter-sidebar {
    width: 300px;
    flex-shrink: 0;
    background: var(--ps-surface);
    border: 1px solid var(--ps-border);
    border-radius: var(--ps-radius);
    padding: 20px;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-shadow: var(--ps-shadow);
}

.ps-filter-sidebar::-webkit-scrollbar {
    width: 6px;
}

.ps-filter-sidebar::-webkit-scrollbar-track {
    background: var(--ps-bg);
    border-radius: 10px;
}

.ps-filter-sidebar::-webkit-scrollbar-thumb {
    background: var(--ps-primary-light);
    border-radius: 10px;
}

.ps-filter-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--ps-primary);
}

.ps-filter-title {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--ps-text);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ps-border);
    text-transform: uppercase;
    letter-spacing: 0;
}

.ps-clear-filters {
    width: 100%;
    padding: 10px 16px;
    margin-bottom: 20px;
    background: transparent;
    border: 1px solid var(--ps-border);
    border-radius: var(--ps-radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--ps-text);
    transition: all 0.2s ease;
}

.ps-clear-filters:hover {
    background: var(--ps-bg);
    color: var(--ps-primary);
    border-color: var(--ps-primary);
}

.ps-filter-section {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
    transition: var(--ps-transition);
}

.ps-filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.ps-filter-section h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--ps-text);
    text-transform: none;
    letter-spacing: 0;
    padding: 8px 0 4px 0;
    border-bottom: 1px solid var(--ps-border);
    cursor: pointer;
    position: relative;
    user-select: none;
}

/* .ps-filter-section h4::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--ps-text-light);
    transition: transform 0.3s ease;
} */

.ps-filter-section.ps-collapsed h4::after {
    transform: translateY(-50%) rotate(-90deg);
}

.ps-filter-section.ps-collapsed .ps-filter-options {
    display: none;
}

/* Search Section */
/* .ps-search-section {
    background: transparent;
    padding: 0;
    border-radius: 0;
    border: none;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ps-border);
} */

.ps-search-section h4 {
    margin-bottom: 12px;
}

/* Show More/Less Toggle */
.ps-action-toggle {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 0;
    color: var(--ps-primary);
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
    border: none;
    background: none;
}

.ps-action-toggle:hover {
    color: var(--ps-primary-dark);
    text-decoration: underline;
}

.ps-filter-option.ps-hidden {
    display: none;
}

.ps-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.ps-search-input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 2px solid var(--ps-border);
    border-radius: var(--ps-radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--ps-text);
    background: var(--ps-surface);
    transition: all 0.3s ease;
    outline: none;
}

.ps-search-input:focus {
    border-color: var(--ps-primary);
    box-shadow: 0 0 0 3px rgba(4, 107, 210, 0.1);
    background: white;
}

.ps-search-input::placeholder {
    color: var(--ps-text-light);
    font-weight: 400;
}

.ps-search-arrow-btn {
    position: absolute;
    right: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ps-primary);
    color: white;
    border: none;
    border-radius: var(--ps-radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    outline: none;
}

.ps-search-arrow-btn:hover {
    background: var(--ps-primary-dark);
    transform: scale(1.05);
}

.ps-search-arrow-btn:active {
    transform: scale(0.95);
}

.ps-search-arrow-btn svg {
    width: 16px;
    height: 16px;
    display: block;
}

.ps-filter-section-title {
    color: var(--ps-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 13px;
}

/* ========================================
   Global Search Bar (Header) - Modern Design
   ======================================== */

.ps-search-bar-container {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}

.ps-search-bar-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    height: 50px;
    background: #ffffff;
    border: none;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
    transition: all 0.15s ease;
}

.ps-search-bar-wrapper:focus-within {
    box-shadow: none;
}

.ps-search-bar-input {
    flex: 1;
    padding: 0 60px 0 16px;
    height: 50px !important;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 400;
    color: #111827;
    outline: none;
    letter-spacing: 0;
}

.ps-search-bar-input::placeholder {
    color: #6b7280;
    font-weight: 400;
}

.ps-search-bar-button {
    position: absolute;
    right: 0;
    top: 0;
    width: 50px;
    height: 50px;
    border: none;
    background: var(--ps-primary);
    color: white;
    border-radius: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease;
    flex-shrink: 0;
}

.ps-search-bar-button:hover {
    background: var(--ps-primary-dark);
}

.ps-search-bar-button:active {
    background: #024a8a;
}

.ps-search-bar-icon {
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Search bar animation on load */
@keyframes searchBarSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ps-search-bar-container {
    animation: searchBarSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

/* Search Results Popup */
.ps-search-results-popup {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid var(--ps-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12),
                0 4px 12px rgba(0, 0, 0, 0.08);
    z-index: 10000;
    max-height: 500px;
    display: flex;
    flex-direction: column;
    animation: popupSlideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

@keyframes popupSlideDown {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.ps-search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--ps-border);
    background: #f8fafc;
}

.ps-search-results-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--ps-text);
}

.ps-search-close-popup {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--ps-text-light);
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.ps-search-close-popup:hover {
    background: var(--ps-border);
    color: var(--ps-text);
}

.ps-search-results-list {
    max-height: 420px;
    overflow-y: auto;
    padding: 8px 0;
}

.ps-search-results-list::-webkit-scrollbar {
    width: 6px;
}

.ps-search-results-list::-webkit-scrollbar-track {
    background: #f8fafc;
}

.ps-search-results-list::-webkit-scrollbar-thumb {
    background: var(--ps-border);
    border-radius: 3px;
}

.ps-search-results-list::-webkit-scrollbar-thumb:hover {
    background: var(--ps-primary-light);
}

.ps-search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f1f5f9;
}

.ps-search-result-item:last-child {
    border-bottom: none;
}

.ps-search-result-item:hover {
    background: #f8fafc;
    transform: translateX(4px);
}

.ps-search-result-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--ps-border);
    flex-shrink: 0;
}

.ps-search-result-content {
    flex: 1;
    min-width: 0;
}

.ps-search-result-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--ps-text);
    margin-bottom: 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ps-search-result-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--ps-primary);
}

.ps-search-no-results {
    padding: 40px 20px;
    text-align: center;
    color: var(--ps-text-light);
    font-size: 14px;
}

.ps-filter-options {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
    margin-bottom: 20px;
    list-style: none;
    padding-left: 0;
}

.ps-filter-options::-webkit-scrollbar {
    width: 4px;
}

.ps-filter-options::-webkit-scrollbar-track {
    background: transparent;
}

.ps-filter-options::-webkit-scrollbar-thumb {
    background: var(--ps-border);
    border-radius: 10px;
}

.ps-filter-options-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ps-filter-option {
    display: block;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ps-filter-option a,
.ps-filter-option label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    cursor: pointer;
    text-decoration: none;
    color: var(--ps-text);
    font-size: 14px;
    transition: color 0.2s ease;
    position: relative;
    padding-left: 24px;
    width: 100%;
}

.ps-filter-option a::before,
.ps-filter-option label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 1px solid var(--ps-border);
    background: var(--ps-surface);
    border-radius: 3px;
    transition: all 0.2s ease;
}

.ps-filter-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.ps-filter-option input[type="checkbox"]:checked + label::before,
.ps-filter-option a.ps-selected::before {
    background: var(--ps-primary);
    border-color: var(--ps-primary);
}

.ps-filter-option input[type="checkbox"]:checked + label::after,
.ps-filter-option a.ps-selected::after {
    content: '✓';
    position: absolute;
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 11px;
    font-weight: bold;
    line-height: 1;
}

.ps-filter-option a:hover,
.ps-filter-option label:hover {
    color: var(--ps-primary);
}

.ps-filter-option input[type="checkbox"]:checked + label,
.ps-filter-option a.ps-selected {
    color: var(--ps-primary);
    font-weight: 500;
}

.ps-filter-count {
    color: var(--ps-text-light);
    font-size: 13px;
    font-weight: normal;
    margin-left: auto;
}

.ps-filter-option input[type="checkbox"]:checked + label .ps-filter-count,
.ps-filter-option a.ps-selected .ps-filter-count {
    color: var(--ps-primary);
}

.ps-filter-count {
    color: #999;
    font-size: 12px;
    margin-left: auto;
}

/* Price Range Filter */
.ps-price-range {
    position: relative;
    padding: 0;
    margin-top: 0; /* remove extra vertical spacing around slider */
}

.ps-price-range-wrapper {
    position: relative;
    margin: 0; /* remove spacing around slider */
}

.ps-price-slider {
    width: 100%;
    margin: 0;
    outline: none;
}

/* Hide the internal min-price slider so only one handle is visible */
.ps-price-slider[id$="-price-min"] {
    opacity: 0;
    pointer-events: none;
}

/* Hide custom active track and pseudo styling so browser default range is used */
.ps-price-range-active {
    display: none;
}

.ps-price-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    gap: 10px;
    margin-top: 8px;
}

.ps-price-display span:first-child,
.ps-price-display span:last-child {
    background: linear-gradient(135deg, var(--ps-primary) 0%, var(--ps-primary-dark) 100%);
    color: #ffffff;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    min-width: 75px;
    text-align: center;
    box-shadow: 0 3px 8px rgba(4, 107, 210, 0.25);
    transition: var(--ps-transition);
    cursor: default;
    letter-spacing: 0.3px;
}

.ps-price-display span:first-child:hover,
.ps-price-display span:last-child:hover {
    background: linear-gradient(135deg, var(--ps-primary-dark) 0%, var(--ps-primary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(4, 107, 210, 0.35);
}

.ps-price-display span:nth-child(2) {
    color: var(--ps-text-light);
    font-weight: 500;
    font-size: 18px;
    padding: 0 4px;
}

/* Products Content Area */
.ps-products-content {
    flex: 1;
    min-width: 0;
}

/* No Sidebar Layout */
.ps-products-container.ps-no-sidebar .ps-products-wrapper {
    flex-direction: column;
}

.ps-products-container.ps-no-sidebar .ps-products-content {
    width: 100%;
    max-width: 100%;
}

.ps-products-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--ps-border);
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.ps-products-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, var(--ps-primary), var(--ps-secondary));
    border-radius: 2px;
}

.ps-per-page-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ps-per-page-selector label {
    font-size: 14px;
    font-weight: 500;
    color: var(--ps-text);
}

.ps-per-page-select {
    padding: 8px 12px;
    border: 1px solid var(--ps-border);
    border-radius: 6px;
    background: #ffffff;
    font-size: 14px;
    color: var(--ps-text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ps-per-page-select:hover {
    border-color: var(--ps-primary);
}

.ps-per-page-select:focus {
    outline: none;
    border-color: var(--ps-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Pagination Styles */
.ps-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--ps-border);
}

.ps-pagination-btn {
    padding: 10px 16px;
    border: 1px solid var(--ps-border);
    border-radius: 6px;
    background: #ffffff;
    color: var(--ps-text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ps-pagination-btn:hover:not(:disabled) {
    background: var(--ps-primary);
    color: #ffffff;
    border-color: var(--ps-primary);
}

.ps-pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ps-pagination-numbers {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ps-pagination-page {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--ps-border);
    border-radius: 6px;
    background: #ffffff;
    color: var(--ps-text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ps-pagination-page:hover {
    background: var(--ps-primary);
    color: #ffffff;
    border-color: var(--ps-primary);
}

.ps-pagination-page.active {
    background: var(--ps-primary);
    color: #ffffff;
    border-color: var(--ps-primary);
    font-weight: 600;
}

.ps-pagination-ellipsis {
    padding: 0 8px;
    color: var(--ps-text-secondary);
    font-size: 14px;
}

.ps-products-count {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--ps-text);
    background: linear-gradient(135deg, var(--ps-primary) 0%, var(--ps-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Responsive Design */
/* ========================================
   Responsive Design - All Devices
   ======================================== */

/* Mobile Devices - Force Non-Sticky Sidebar (All Mobile Breakpoints) */
@media (max-width: 768px) {
    .ps-filter-sidebar,
    aside.ps-filter-sidebar,
    .ps-products-wrapper .ps-filter-sidebar,
    .ps-products-container .ps-filter-sidebar,
    #ps-1-filters,
    [id*="ps-"][id*="-filters"],
    [class*="ps-filter-sidebar"] {
        position: relative !important;
        top: 0 !important;
        max-height: none !important;
        overflow-y: visible !important;
        width: 100% !important;
    }
    
    /* Fix Brand Filter Section on Mobile */
    .ps-filter-section {
        width: 100% !important;
        overflow: visible !important;
    }
    
    .ps-filter-section .ps-filter-options {
        width: 100% !important;
        overflow: visible !important;
        max-height: none !important;
    }
    
    .ps-filter-option {
        width: 100% !important;
        overflow: visible !important;
    }
    
    .ps-filter-option label {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        min-height: 44px !important;
        padding-right: 8px !important;
        word-break: break-word !important;
        width: 100% !important;
    }
    
    .ps-filter-text {
        flex: 1 !important;
        min-width: 0 !important;
        word-break: break-word !important;
    }
    
    .ps-filter-count {
        flex-shrink: 0 !important;
        margin-left: auto !important;
        white-space: nowrap !important;
    }
}

/* Large Tablets and Small Desktops (769px to 1200px) */
/* Keep horizontal layout (sidebar and products side by side) */
@media (min-width: 769px) and (max-width: 1200px) {
    .ps-products-container {
        max-width: 100%;
        padding: 20px;
        margin: 10px auto;
    }
    
    /* Tablet: 2 columns */
    .ps-products-grid,
    .ps-products-container .ps-products-grid,
    .ps-products-wrapper .ps-products-grid,
    #ps-1-grid,
    [id*="ps-"][id*="-grid"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }
    
    .ps-products-wrapper {
        flex-direction: row !important;
        gap: 24px;
    }
    
    .ps-filter-sidebar {
        width: 280px;
        position: sticky;
        top: 20px;
        max-height: calc(100vh - 40px);
        padding: 20px;
    }
    
    .ps-filter-options {
        max-height: 200px;
    }
    
    .ps-product-image {
        height: 220px;
    }
}

/* Desktop (1201px and above) - Horizontal layout */
@media (min-width: 1201px) {
    .ps-products-wrapper {
        flex-direction: row !important;
    }
    
    .ps-filter-sidebar {
        width: 300px;
        position: sticky;
        top: 20px;
        max-height: calc(100vh - 40px);
    }
}

/* Tablets and Mobile (768px and below) - Vertical layout */
@media (max-width: 768px) {
    .ps-products-container {
        padding: 16px;
        margin: 8px auto;
    }
    
    .ps-products-wrapper {
        flex-direction: column !important;
        gap: 20px;
    }
    
    .ps-filter-sidebar,
    aside.ps-filter-sidebar,
    #ps-1-filters,
    [id*="ps-"][id*="-filters"] {
        width: 100% !important;
        position: relative !important;
        top: 0 !important;
        max-height: none !important;
        padding: 18px;
        border-radius: var(--ps-radius-sm);
        overflow-y: visible !important;
    }
    
    .ps-filter-title {
        font-size: 20px;
        margin-bottom: 16px;
        padding-bottom: 12px;
    }
    
    .ps-filter-section {
        margin-bottom: 18px;
        width: 100%;
        overflow: visible;
    }
    
    .ps-filter-section .ps-filter-options {
        width: 100%;
        overflow: visible !important;
        max-height: none !important;
    }
    
    .ps-search-section {
        padding: 16px;
        margin-bottom: 20px;
    }
    
    .ps-search-input {
        padding: 10px 36px 10px 14px;
        font-size: 14px;
    }
    
    .ps-search-arrow-btn {
        right: 6px;
        width: 28px;
        height: 28px;
    }
    
    .ps-search-arrow-btn svg {
        width: 14px;
        height: 14px;
    }
    
    .ps-filter-section-title {
        font-size: 15px;
    }
    
    /* Mobile: 2 columns */
    .ps-products-grid,
    .ps-products-container .ps-products-grid,
    .ps-products-wrapper .ps-products-grid,
    #ps-1-grid,
    [id*="ps-"][id*="-grid"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
        margin-top: 16px;
    }
    
    .ps-products-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ps-per-page-selector {
        width: 100%;
        justify-content: space-between;
    }
    
    .ps-pagination {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .ps-pagination-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .ps-pagination-page {
        min-width: 36px;
        height: 36px;
        padding: 0 8px;
        font-size: 13px;
    }
    
    .ps-product-card {
        border-radius: var(--ps-radius-sm);
    }
    
    .ps-product-image {
        height: 200px;
    }
    
    .ps-product-title {
        font-size: 15px;
        margin: 16px 16px 10px;
        min-height: 44px;
    }
    
    .ps-product-price {
        margin: 0 16px 12px;
        gap: 8px;
    }
    
    .ps-product-price-current {
        font-size: 20px;
    }
    
    .ps-product-price-original {
        font-size: 13px;
    }
    
    .ps-product-price-savings {
        font-size: 12px;
        padding: 2px 6px;
    }
    
    .ps-product-meta {
        margin: 0 16px 10px;
        font-size: 12px;
        gap: 6px;
    }
    
    .ps-product-meta span {
        padding: 3px 10px;
        font-size: 11px;
    }
    
    .ps-product-button {
        margin: 0 16px 16px;
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .ps-product-description {
        font-size: 13px;
        margin: 0 16px 16px;
        padding-bottom: 16px;
    }
    
    .ps-clear-filters {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    /* Featured grid responsive - respect columns attribute */
    .ps-products-container-featured .ps-products-grid-featured {
        grid-template-columns: repeat(var(--ps-featured-columns, 3), minmax(0, 1fr)) !important;
    }
}

/* Small Tablets and Large Phones (600px and below) */
@media (max-width: 600px) {
    .ps-products-container {
        padding: 12px;
        margin: 5px auto;
    }
    
    .ps-filter-sidebar,
    aside.ps-filter-sidebar,
    #ps-1-filters,
    [id*="ps-"][id*="-filters"] {
        width: 100% !important;
        position: relative !important;
        top: 0 !important;
        max-height: none !important;
        padding: 16px;
        overflow-y: visible !important;
    }
    
    .ps-filter-title {
        font-size: 18px;
    }
    
    /* Small tablets: Keep 2 columns */
    .ps-products-grid,
    .ps-products-container .ps-products-grid,
    .ps-products-wrapper .ps-products-grid,
    #ps-1-grid,
    [id*="ps-"][id*="-grid"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .ps-product-image {
        height: 180px;
    }
    
    .ps-product-title {
        font-size: 14px;
        margin: 14px 14px 8px;
        min-height: 40px;
    }
    
    .ps-product-price-current {
        font-size: 18px;
    }
    
    .ps-product-button {
        padding: 11px 18px;
        font-size: 13px;
    }
    
    /* Featured grid - 2 columns on small tablets */
    .ps-products-container-featured .ps-products-grid-featured {
        grid-template-columns: repeat(var(--ps-featured-columns, 2), minmax(0, 1fr)) !important;
    }
}

/* Mobile Phones (480px and below) */
@media (max-width: 480px) {
    .ps-search-bar-container {
        max-width: 100%;
    }
    
    .ps-search-bar-wrapper {
        height: 44px;
        border-radius: 6px;
    }
    
    .ps-search-bar-input {
        padding: 0 12px;
        font-size: 14px;
    }
    
    .ps-search-bar-button {
        width: 44px;
        height: 48px;
        right: 4px;
        border-radius: 0;
    }
    
    .ps-search-bar-icon {
        font-size: 17px;
    }
    
    .ps-products-container {
        padding: 10px;
        margin: 0 auto;
        border-radius: 0;
    }
    
    .ps-pagination {
        margin-top: 24px;
        padding-top: 20px;
        gap: 4px;
    }
    
    .ps-pagination-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .ps-pagination-page {
        min-width: 32px;
        height: 32px;
        padding: 0 6px;
        font-size: 12px;
    }
    
    .ps-per-page-selector {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .ps-per-page-select {
        width: 100%;
    }
    
    /* Small mobile: 2 columns */
    .ps-products-grid,
    .ps-products-container .ps-products-grid,
    .ps-products-wrapper .ps-products-grid,
    #ps-1-grid,
    [id*="ps-"][id*="-grid"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }
    
    .ps-products-wrapper {
        flex-direction: column;
        gap: 16px;
    }
    
    .ps-filter-sidebar,
    aside.ps-filter-sidebar,
    #ps-1-filters,
    [id*="ps-"][id*="-filters"] {
        width: 100% !important;
        position: relative !important;
        top: 0 !important;
        max-height: none !important;
        padding: 14px;
        border-radius: var(--ps-radius-sm);
        overflow-y: visible !important;
    }
    
    .ps-filter-title {
        font-size: 16px;
        margin-bottom: 14px;
        padding-bottom: 10px;
    }
    
    .ps-filter-section {
        margin-bottom: 16px;
        width: 100%;
        overflow: visible;
    }
    
    .ps-filter-section .ps-filter-options {
        width: 100%;
        overflow: visible !important;
        max-height: none !important;
    }
    
    .ps-filter-option label {
        flex-wrap: wrap;
        min-height: 44px;
        align-items: center;
        padding-right: 8px;
        word-break: break-word;
    }
    
    .ps-filter-text {
        flex: 1;
        min-width: 0;
        word-break: break-word;
    }
    
    .ps-filter-count {
        flex-shrink: 0;
        margin-left: auto;
        white-space: nowrap;
    }
    
    .ps-filter-section-title {
        font-size: 14px;
    }
    
    .ps-search-bar-container {
        max-width: 100%;
    }
    
    .ps-search-bar-wrapper {
        height: 60px;
        border-radius: 0;
        border: 2px solid #e2e8f0;
    }
    
    .ps-search-bar-wrapper:focus-within {
        border-color: var(--ps-primary);
        box-shadow: none;
    }
    
    .ps-search-bar-input {
        padding: 0 60px 0 18px;
        height: 100%;
        font-size: 14px;
    }
    
    .ps-search-bar-button {
        width: 46px;
        height: 46px;
        right: 4px;
        border-radius: 0;
    }
    
    .ps-search-results-popup {
        max-height: 400px;
    }
    
    
    .ps-search-result-item {
        padding: 10px 12px;
        gap: 10px;
    }
    
    .ps-search-result-image {
        width: 50px;
        height: 50px;
    }
    
    .ps-search-result-title {
        font-size: 13px;
    }
    
    .ps-search-result-price {
        font-size: 14px;
    }
    
    .ps-search-bar-icon {
        font-size: 16px;
    }
    
    .ps-filter-options {
        max-height: none !important;
        font-size: 13px;
        overflow-y: visible !important;
    }
    
    .ps-filter-option {
        padding: 8px 0;
        font-size: 13px;
        width: 100%;
    }
    
    .ps-filter-option label {
        flex-wrap: wrap;
        min-height: 44px;
        align-items: center;
        padding-right: 8px;
    }
    
    .ps-filter-text {
        flex: 1;
        min-width: 0;
        word-break: break-word;
    }
    
    .ps-filter-count {
        flex-shrink: 0;
        margin-left: auto;
        white-space: nowrap;
    }
    
    .ps-filter-option input[type="checkbox"] {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }
    
    .ps-products-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-top: 14px;
    }
    
    .ps-product-card {
        border-radius: var(--ps-radius-sm);
    }
    
    .ps-product-image {
        height: 220px;
    }
    
    .ps-product-title {
        font-size: 15px;
        margin: 14px 14px 10px;
        min-height: auto;
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }
    
    .ps-product-price {
        margin: 0 14px 10px;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .ps-product-price-current {
        font-size: 20px;
    }
    
    .ps-product-price-original {
        font-size: 13px;
    }
    
    .ps-product-price-savings {
        font-size: 12px;
        padding: 3px 8px;
    }
    
    .ps-product-meta {
        margin: 0 14px 10px;
        font-size: 12px;
        gap: 6px;
    }
    
    .ps-product-meta span {
        padding: 4px 10px;
        font-size: 11px;
    }
    
    .ps-product-description {
        font-size: 13px;
        margin: 0 14px 14px;
        padding-bottom: 14px;
        -webkit-line-clamp: 4;
        line-clamp: 4;
    }
    
    .ps-product-button {
        margin: 0 14px 14px;
        padding: 12px 20px;
        font-size: 14px;
        min-height: 44px; /* Better touch target */
    }
    
    .ps-product-compare-wrapper {
        margin: 8px 14px;
        padding: 8px 20px;
    }
    
    .ps-product-compare-label {
        font-size: 13px;
    }
    
    .ps-clear-filters {
        width: 100%;
        padding: 12px;
        font-size: 14px;
        margin-bottom: 16px;
    }
    
    /* Featured grid - single column on mobile */
    .ps-products-container-featured .ps-products-grid-featured {
        grid-template-columns: repeat(var(--ps-featured-columns, 1), minmax(0, 1fr)) !important;
    }
    
    /* Loading and error messages */
    .ps-loading {
        padding: 40px 15px;
        font-size: 14px;
    }
    
    .ps-error {
        padding: 30px 15px;
        font-size: 14px;
    }
}

/* Extra Small Phones (360px and below) */
@media (max-width: 360px) {
    .ps-products-container {
        padding: 8px;
    }
    
    .ps-filter-sidebar,
    aside.ps-filter-sidebar,
    #ps-1-filters,
    [id*="ps-"][id*="-filters"] {
        width: 100% !important;
        position: relative !important;
        top: 0 !important;
        max-height: none !important;
        padding: 12px;
        overflow-y: visible !important;
    }
    
    .ps-filter-title {
        font-size: 15px;
    }
    
    /* Extra small: 2 columns */
    .ps-products-grid,
    .ps-products-container .ps-products-grid,
    .ps-products-wrapper .ps-products-grid,
    #ps-1-grid,
    [id*="ps-"][id*="-grid"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .ps-product-image {
        height: 200px;
    }
    
    .ps-product-title {
        font-size: 14px;
        margin: 12px 12px 8px;
    }
    
    .ps-product-price-current {
        font-size: 18px;
    }
    
    .ps-product-button {
        padding: 11px 16px;
        font-size: 13px;
    }
}

/* Large Desktops (1400px and above) */
@media (min-width: 1400px) {
    .ps-products-container {
        max-width: 1600px;
        padding: 30px;
    }
    
    .ps-products-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 10px;
    }
    
    .ps-products-container .ps-products-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
    
    .ps-product-image {
        height: 280px;
    }
}

/* Landscape Orientation on Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .ps-filter-sidebar,
    aside.ps-filter-sidebar,
    #ps-1-filters,
    [id*="ps-"][id*="-filters"] {
        width: 100% !important;
        position: relative !important;
        top: 0 !important;
        max-height: none !important;
        overflow-y: visible !important;
    }
    
    .ps-filter-options {
        max-height: 150px;
    }
    
    /* Landscape mobile: 2 columns (not 4) */
    .ps-products-grid,
    .ps-products-container .ps-products-grid,
    .ps-products-wrapper .ps-products-grid,
    #ps-1-grid,
    [id*="ps-"][id*="-grid"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .ps-product-button {
        min-height: 44px;
        padding: 14px 24px;
    }
    
    .ps-product-card:hover {
        transform: none;
    }
    
    .ps-product-card:active {
        transform: scale(0.98);
    }
    
    .ps-filter-option {
        padding: 12px 0;
        min-height: 44px;
        width: 100%;
    }
    
    .ps-filter-option label {
        flex-wrap: wrap;
        align-items: center;
        padding-right: 8px;
        word-break: break-word;
    }
    
    .ps-filter-text {
        flex: 1;
        min-width: 0;
    }
    
    .ps-filter-count {
        flex-shrink: 0;
        margin-left: auto;
        white-space: nowrap;
    }
    
    .ps-compare-checkbox,
    .ps-product-compare-checkbox {
        width: 20px;
        height: 20px;
    }
}

/* ========================================
   Compare Feature Styles
   ======================================== */

/* Compare checkbox on product card */
.ps-product-compare-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    margin: 8px 0;
    border-top: 1px solid var(--ps-border);
}

.ps-product-compare-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--ps-primary);
}

.ps-product-compare-label {
    font-size: 14px;
    color: var(--ps-text);
    cursor: pointer;
    user-select: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.ps-product-compare-label:hover {
    color: var(--ps-primary);
}

.ps-product-compare-checkbox:checked + .ps-product-compare-label {
    color: var(--ps-primary);
    font-weight: 600;
}

/* Bottom Comparison Bar */
.ps-compare-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #2d2d2d;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    z-index: 9998;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.ps-compare-slots {
    display: flex;
    gap: 12px;
    align-items: center;
}

.ps-compare-slot {
    width: 80px;
    height: 80px;
    background: white;
    border: 2px solid #4a4a4a;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.ps-compare-slot-filled {
    border-color: #4a4a4a;
    padding: 0;
}

.ps-compare-thumbnail {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ps-compare-thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ps-compare-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ps-compare-thumbnail-placeholder::after {
    content: '';
    width: 40px;
    height: 40px;
    background: #ddd;
    border-radius: 4px;
}

.ps-compare-thumbnail-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
    padding: 0;
    transition: all 0.2s ease;
    z-index: 10;
}

.ps-compare-thumbnail-remove:hover {
    background: #b91c1c;
    transform: scale(1.1);
}

.ps-compare-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.ps-compare-bar-btn {
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

.ps-compare-bar-btn:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.ps-compare-bar-btn:active {
    transform: translateY(0);
}

.ps-compare-remove-all {
    color: white;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.ps-compare-remove-all:hover {
    color: #ffcccc;
    text-decoration: underline;
}

/* Compare Modal */
.ps-compare-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.ps-compare-modal-content {
    background: white;
    border-radius: var(--ps-radius);
    max-width: 95%;
    max-height: 90vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

.ps-compare-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 2px solid var(--ps-border);
    background: linear-gradient(135deg, var(--ps-primary) 0%, var(--ps-primary-dark) 100%);
    color: white;
    border-radius: var(--ps-radius) var(--ps-radius) 0 0;
}

.ps-compare-modal-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: white;
}

.ps-compare-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 28px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
    padding: 0;
}

.ps-compare-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.ps-compare-table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(90vh - 180px);
    flex: 1;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.ps-compare-table-wrapper::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.ps-compare-table-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.ps-compare-table-wrapper::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.ps-compare-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.ps-compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.ps-compare-table thead {
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

.ps-compare-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--ps-border);
    vertical-align: top;
}

.ps-compare-label-col {
    min-width: 150px;
    background: #f8f9fa;
    font-weight: 600;
    color: var(--ps-text);
}

.ps-compare-product-col {
    min-width: 200px;
    max-width: 250px;
    text-align: center;
    position: relative;
}

.ps-compare-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(220, 38, 38, 0.9);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0;
    z-index: 10;
}

.ps-compare-product-col:hover .ps-compare-remove {
    opacity: 1;
}

/* Always show remove button on mobile */
@media (max-width: 768px) {
    .ps-compare-remove {
        opacity: 1 !important;
    }
}

.ps-compare-remove:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.ps-compare-product-image {
    width: 100%;
    max-width: 180px;
    height: auto;
    border-radius: var(--ps-radius-sm);
    margin-bottom: 12px;
    object-fit: contain;
}

.ps-compare-product-col h3 {
    margin: 0 0 12px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--ps-text);
    line-height: 1.4;
    padding: 0 8px;
}

.ps-compare-table tbody tr {
    border-bottom: 1px solid var(--ps-border);
    transition: background 0.2s ease;
}

.ps-compare-table tbody tr:hover {
    background: #f8f9fa;
}

.ps-compare-table tbody td {
    padding: 14px 16px;
    vertical-align: middle;
}

.ps-compare-label {
    font-weight: 600;
    color: var(--ps-text);
    background: #f8f9fa;
}

.ps-compare-view-btn {
    display: inline-block;
    padding: 8px 16px;
    background: var(--ps-primary);
    color: white;
    text-decoration: none;
    border-radius: var(--ps-radius-sm);
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.ps-compare-view-btn:hover {
    background: var(--ps-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(4, 107, 210, 0.3);
    color: #fff;
}

.ps-compare-modal-footer {
    padding: 16px 24px;
    border-top: 2px solid var(--ps-border);
    background: #f8f9fa;
    border-radius: 0 0 var(--ps-radius) var(--ps-radius);
    display: flex;
    justify-content: flex-end;
}

.ps-compare-clear-all {
    background: #dc2626;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--ps-radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ps-compare-clear-all:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

/* Responsive Compare Modal */
@media (max-width: 1024px) {
    .ps-compare-modal-content {
        max-width: 95%;
    }
    
    .ps-compare-product-col {
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    .ps-compare-bar {
        padding: 12px 16px;
        gap: 16px;
    }
    
    .ps-compare-slot {
        width: 60px;
        height: 60px;
    }
    
    .ps-compare-bar-btn {
        padding: 10px 24px;
        font-size: 14px;
        min-width: 100px;
    }
    
    .ps-compare-remove-all {
        font-size: 12px;
    }
    
    .ps-compare-modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }
    
    .ps-compare-modal-header {
        padding: 16px;
        flex-wrap: wrap;
    }
    
    .ps-compare-modal-header h2 {
        font-size: 18px;
        flex: 1;
        min-width: 0;
    }
    
    .ps-compare-close {
        width: 36px;
        height: 36px;
        font-size: 22px;
    }
    
    .ps-compare-table-wrapper {
        max-height: calc(100vh - 140px);
        overflow-x: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .ps-compare-table {
        min-width: 600px;
        font-size: 13px;
    }
    
    .ps-compare-product-col {
        min-width: 160px;
        max-width: 180px;
    }
    
    .ps-compare-label-col {
        min-width: 100px;
        position: sticky;
        left: 0;
        z-index: 5;
    }
    
    .ps-compare-product-image {
        max-width: 140px;
    }
    
    .ps-compare-product-col h3 {
        font-size: 14px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .ps-compare-table th,
    .ps-compare-table td {
        padding: 12px 10px;
    }
    
    .ps-compare-remove {
        opacity: 1;
        width: 24px;
        height: 24px;
        font-size: 16px;
        top: 6px;
        right: 6px;
    }
    
    .ps-compare-view-btn {
        padding: 7px 14px;
        font-size: 12px;
        word-break: break-word;
    }
    
    .ps-compare-modal-footer {
        padding: 14px 16px;
    }
    
    .ps-compare-clear-all {
        padding: 9px 18px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .ps-compare-bar {
        padding: 10px 12px;
        gap: 12px;
    }
    
    .ps-compare-slots {
        gap: 8px;
    }
    
    .ps-compare-slot {
        width: 50px;
        height: 50px;
    }
    
    .ps-compare-thumbnail-remove {
        width: 18px;
        height: 18px;
        font-size: 12px;
        top: 2px;
        right: 2px;
    }
    
    .ps-compare-bar-btn {
        padding: 8px 20px;
        font-size: 13px;
        min-width: 90px;
    }
    
    .ps-compare-remove-all {
        font-size: 11px;
    }
    
    .ps-compare-modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .ps-compare-modal-header {
        padding: 12px 14px;
    }
    
    .ps-compare-modal-header h2 {
        font-size: 16px;
        line-height: 1.3;
    }
    
    .ps-compare-close {
        width: 32px;
        height: 32px;
        font-size: 22px;
        flex-shrink: 0;
    }
    
    .ps-compare-table-wrapper {
        max-height: calc(100vh - 120px);
        overflow-x: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .ps-compare-table {
        min-width: 500px;
        font-size: 11px;
    }
    
    .ps-compare-table th,
    .ps-compare-table td {
        padding: 10px 8px;
    }
    
    .ps-compare-product-col {
        min-width: 130px;
        max-width: 150px;
    }
    
    .ps-compare-label-col {
        min-width: 90px;
        position: sticky;
        left: 0;
        z-index: 5;
        background: #f8f9fa;
    }
    
    .ps-compare-product-col h3 {
        font-size: 12px;
        padding: 0 4px;
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .ps-compare-product-image {
        max-width: 100px;
        margin-bottom: 8px;
    }
    
    .ps-compare-view-btn {
        padding: 6px 10px;
        font-size: 11px;
        word-break: break-word;
        white-space: normal;
        line-height: 1.3;
    }
    
    .ps-compare-modal-footer {
        padding: 12px 14px;
    }
    
    .ps-compare-clear-all {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .ps-compare-remove {
        width: 22px;
        height: 22px;
        font-size: 14px;
        top: 4px;
        right: 4px;
        opacity: 1;
    }
    
    .ps-compare-table tbody td {
        padding: 10px 8px;
        word-break: break-word;
    }
}

@media (max-width: 360px) {
    .ps-compare-modal-header {
        padding: 10px 12px;
    }
    
    .ps-compare-modal-header h2 {
        font-size: 14px;
    }
    
    .ps-compare-close {
        width: 28px;
        height: 28px;
        font-size: 20px;
    }
    
    .ps-compare-table-wrapper {
        max-height: calc(100vh - 110px);
    }
    
    .ps-compare-table {
        min-width: 450px;
        font-size: 10px;
    }
    
    .ps-compare-product-col {
        min-width: 110px;
        max-width: 130px;
    }
    
    .ps-compare-label-col {
        min-width: 80px;
        position: sticky;
        left: 0;
        z-index: 5;
        background: #f8f9fa;
    }
    
    .ps-compare-product-col h3 {
        font-size: 11px;
    }
    
    .ps-compare-product-image {
        max-width: 90px;
    }
    
    .ps-compare-table th,
    .ps-compare-table td {
        padding: 8px 6px;
    }
    
    .ps-compare-view-btn {
        padding: 5px 8px;
        font-size: 10px;
    }
    
    .ps-compare-remove {
        width: 20px;
        height: 20px;
        font-size: 12px;
    }
}

