/**
 * PPSERVIS Product Catalog Styles
 * Complete styling for new catalog system with variant awareness
 */

/* =============================================================================
   ORDERING SYSTEM - Enhanced with Loading States
   ============================================================================= */

.wpd-ordering {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 20px 0;
    position: relative;
}

.wpd-ordering .order-btn {
    background: #f8f9fa;
    border: 1px solid #ddd;
    color: #333;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-family: inherit;
    text-decoration: none;
    display: inline-block;
}

.wpd-ordering .order-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.wpd-ordering .order-btn.active {
    background: #007cba;
    color: white;
    border-color: #0056b3;
}

.wpd-ordering .order-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loading State for Ordering */
.wpd-ordering.loading {
    opacity: 0.7;
    pointer-events: none;
}

.ordering-loading {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    background: rgba(0, 124, 186, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 10;
}

.ordering-success {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    background: rgba(40, 167, 69, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 10;
}

/* Loading spinner animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ordering-loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
    margin-left: 6px;
}

/* Responsive ordering buttons */
@media (max-width: 768px) {
    .wpd-ordering {
        justify-content: center;
    }

    .wpd-ordering .order-btn {
        flex: 1;
        min-width: calc(50% - 4px);
        text-align: center;
        font-size: 13px;
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .wpd-ordering .order-btn {
        min-width: 100%;
        margin-bottom: 4px;
    }
}

/* =============================================================================
   COLOR VARIANTS - Enhanced Interactive System
   ============================================================================= */

.group-colors__wrapper {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.color__item {
    position: relative;
}

.color-variant-swatch {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.color-variant-swatch:hover {
    transform: scale(1.15);
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.5);
    z-index: 2;
}

.color-variant-swatch.active {
    box-shadow: 0 0 0 2px #007cba;
    transform: scale(1.1);
}

.color-variant-swatch:focus {
    outline: none;
    box-shadow: 0 0 0 2px #007cba, 0 0 0 4px rgba(0, 124, 186, 0.25);
}

/* Loading state for image switching */
.product-card img.variant-switching {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

/* Preview state */
.product-card.variant-preview {
    position: relative;
}

.product-card.variant-preview::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    pointer-events: none;
    z-index: 1;
}

/* Variant switch feedback */
.variant-switch-feedback {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 124, 186, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 10;
    animation: slideInLeft 0.3s ease;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .color-variant-swatch {
        width: 18px;
        height: 18px;
    }

    .group-colors__wrapper {
        gap: 4px;
    }
}

/* Accessibility improvements */
.color-variant-swatch[aria-label] {
    position: relative;
}

.color-variant-swatch:focus::before {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    font-size: 12px;
    z-index: 1000;
    margin-bottom: 4px;
}

/* =============================================================================
   PRODUCT CARD LAYOUT - New Enhanced Layout (Client Requirements)
   ============================================================================= */

/* Image Section - 55%+ of card height */
.product-image-section {
    position: relative;
    flex: 1;
    min-height: 410px; /* Ensure minimum height for image */
    overflow: hidden;
}

.jet-woo-product-thumbnail {
    position: relative;
    height: 100%;
    overflow: hidden;
}

.jet-woo-product-thumbnail img {
    width: 100%;
    height: 100% !important;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-card:hover .jet-woo-product-thumbnail img {
    transform: scale(1.05);
}

/* DOPRAVA ZDARMA ČR banner - full width at top */
.free-shipping-banner {
    position: absolute;
    border-radius: 8px;
    top: 10px;
    left: 15px;
    right: 15px;
    background: rgba(0, 123, 255, 0.95);
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 6px;
    text-align: center;
    z-index: 15;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.elementor-388183 .elementor-element.elementor-element-843cb6e .free-shipping-banner {
    position: unset !important;
}

/* Marketing badges - default position at top, moves down if free shipping exists */
.marketing-badges {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    z-index: 12;
    flex-direction: column;
}

/* When free shipping banner is present, push marketing badges down */
.jet-woo-product-thumbnail:has(.free-shipping-banner) .marketing-badges {
    top: 50px;
}

.marketing-badges .marketing-label {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 8px;
    text-transform: uppercase;
    display: inline-block;
    color: #FFF;
}

.marketing-badges .marketing-label.new {
    background-color: #00b9ee !important;
}

.marketing-badges .marketing-label.sale {
    background-color: #F70000 !important;
}

.marketing-badges .marketing-label.discount {
    background-color: #F70000 !important;
    font-weight: 700;
}

.marketing-badges .marketing-label.clearance {
    background-color: #a0a0a0 !important;
}

.marketing-badges .marketing-label.limitka {
    background-color: #00ddc6 !important;
}

.marketing-badges .marketing-label.nedostupne {
    background-color: #333333 !important;
}

.marketing-badges .marketing-label.doprava-zdarma {
    background-color: #90d5ff !important;
}

/* 2P Servis logo in top left corner */
.manufacturer-logo {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 12;
    background: white;
    border-radius: 50%;
    padding: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* When free shipping exists, push manufacturer logo down */
.jet-woo-product-thumbnail:has(.free-shipping-banner) .manufacturer-logo {
    top: 40px;
}

/* When marketing badges exist (which would be at top: 40px with free shipping), push manufacturer logo further down */
.jet-woo-product-thumbnail:has(.free-shipping-banner):has(.marketing-badges) .manufacturer-logo {
    top: 80px;
}

/* When no free shipping but marketing badges exist, push manufacturer logo down */
.jet-woo-product-thumbnail:not(:has(.free-shipping-banner)):has(.marketing-badges) .manufacturer-logo {
    top: 50px;
}

.manufacturer-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 15px !important;
}

/* Discount Percentage Overlay - top right */
.discount-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #dc3545;
    color: white;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 12;
}

/* Color Variants - Group-based system */
.color-variants {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
}

.group-colors__wrapper {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    min-height: 21px;
}

.color__item {
    display: inline-block;
}

.color-link {
    text-decoration: none;
    display: block;
}

.color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
    display: block;
}

.color:hover {
    border-color: #007cba;
    transform: scale(1.1);
}

/* Dual color support - split circles */
/*.color.dual-color {
    background: none !important;
}*/

.color.dual-color:hover {
    border-color: #007cba;
    transform: scale(1.1);
}

/* Color classes for consistent color display - all diacritics stripped */
.color.color-bila { background-color: #ffffff !important; }
.color.color-cerna { background-color: #2c2c2c !important; }
.color.color-cervena { background-color: #e74c3c !important; }
.color.color-modra { background-color: #3498db !important; }
.color.color-svetlemodra { background-color: #85c1e9 !important; }
.color.color-zelena { background-color: #27ae60 !important; }
.color.color-zluta { background-color: #f1c40f !important; }
.color.color-ruzova { background-color: #e91e63 !important; }
.color.color-fialova { background-color: #9b59b6 !important; }
.color.color-oranzova { background-color: #ff6b35 !important; }
.color.color-mentol { background-color: #1abc9c !important; }
.color.color-mentolova { background-color: #1abc9c !important; }
.color.color-tyrkys { background-color: #17a2b8 !important; }
.color.color-tyrkysova { background-color: #17a2b8 !important; }
.color.color-seda { background-color: #7f8c8d !important; }
.color.color-bezova { background-color: #d2b48c !important; }
.color.color-hneda { background-color: #8b4513 !important; }
.color.color-merunkova { background-color: #ffab91 !important; }

/* Handle encoding-damaged colors that lose initial characters */
.color.color-erna { background-color: #2c2c2c !important; } /* Černá → erna */
.color.color-ervena { background-color: #e74c3c !important; } /* Červená → ervena */
.color.color-eda { background-color: #7f8c8d !important; } /* Šedá → eda */
.color.color-luta { background-color: #f1c40f !important; } /* Žlutá → luta */
.color.color-uzova { background-color: #e91e63 !important; } /* Růžová → uzova */

/* Legacy color dot styles for backward compatibility */
.color-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-dot:hover {
    border-color: #007cba;
    transform: scale(1.1);
}

/* Product Info Section */

.product-title {
    font-size: 14px;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.product-title a {
    text-decoration: none;
    color: #333;
}

.product-title a:hover {
    color: #007cba;
}

.material-composition {
    font-size: 11px;
    color: #666;
    margin-bottom: 4px;
    font-style: italic;
}

/* Rating and availability row - on same line */
.rating-availability-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

/* Star Rating */
.product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    min-width: 40px;
}

.product-rating .stars {
    display: flex;
    gap: 2px;
}

.product-rating .stars i {
    color: #ffc107;
    font-size: 12px;
}

.product-rating .review-count {
    font-size: 11px;
    color: #666;
}

/* Availability badge - only one shown */
.availability-badge {
    flex-shrink: 0;
}

.availability-badge .badge {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 8px;
    text-transform: uppercase;
    display: inline-block;
    color: #FFF;
    line-height: 18px;
}

.availability-badge .badge.skladem {
    background-color: #25a722 !important;
}

.availability-badge .badge.do-tydne {
    background-color: #25a722 !important;
}

.availability-badge .badge.do-mesice {
    background-color: #8B9467 !important; /* Khaki green for 3-4 týdny */
}

.availability-badge .badge.vyprodano {
    background-color: #F70000 !important;
}

.availability-badge .badge.brzy {
    background-color: #626262 !important;
}

.availability-badge .badge.nedostupne {
    background-color: #333333 !important;
}

/* Wishlist button */
.wishlist-button {
    flex-shrink: 0;
    min-width: 50px;
}

/* Marketing Labels */
.marketing-labels {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.marketing-label {
    font-size: 9px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
}

.marketing-label.new {
    background: #007bff;
    color: white;
}

.marketing-label.sale {
    background: #dc3545;
    color: white;
}

.marketing-label.clearance {
    background: #dc3545;
    color: white;
}

/* Enhanced Pricing */
.enhanced-pricing {
    margin-bottom: 8px;
}

.price-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ACF discount - vertical layout */
.price-container.acf-discount {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.current-price {
    font-weight: bold;
    font-size: 16px;
    color: #007cba;
}

.savings {
    background: #28a745;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
}

.savings-amount {
    font-size: 13px;
    color: white;
    font-weight: 600;
    width: 100px;
    padding: 3px 5px;
    text-align: center;
    background: red;
    border-radius: 4px;
}

/* Product Actions */
.product-actions {
    text-align: center;
    margin-top: 8px;
}

.detail-button {
    background: white;
    color: #8ab822 !important;
    padding: 8px 20px !important;
    border: 2px solid #8ab822 !important;
    border-radius: 4px !important;
    width: 100px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem !important;
    text-transform: uppercase;
    transition: all 0.3s ease;
    display: inline-block;
}

.detail-button:hover {
    background: #8ab822 !important;
    color: white !important;
    text-decoration: none;
}

/* Product Bottom - Price and Detail button on same line */
.product-bottom {
    padding: 0 12px 12px 12px;
    flex-shrink: 0;
    min-height: 88px;
    align-content: end;
}

.price-detail-row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
}

.price-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.detail-column {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.price-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    margin-bottom: 4px;
}

/* Main price (with tax) - larger and prominent */
.current-price {
    font-weight: bold;
    font-size: 18px;
    color: #007cba;
    line-height: 1.2;
    display: block;
    width: 100%;
}

/* Ensure WooCommerce price elements display properly */
.price-container .woocommerce-Price-amount,
.price-excl-tax .woocommerce-Price-amount {
    display: inline;
}

/* Original price for sale items */
.original-price {
    text-decoration: line-through;
    color: #007cba;
    font-size: 14px;
    order: -1; /* Show above current price when on sale */
}

/* Savings badge */
.savings {
    background: #28a745;
    color: white;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 3px;
    font-weight: 600;
    margin-top: 2px;
}

/* Price without tax - smaller and below main price */
.price-excl-tax {
    font-size: 12px;
    line-height: 1.2;
    display: block;
    width: 100%;
}

.price-excl-tax .amount bdi {
    font-size: 12px;
    color: #1D1D1D;
    font-weight: 600;
}

.price-excl-tax .price-amount {
    font-weight: bold;
}

.price-excl-tax .price-label {
    font-weight: normal;
}

/* Sale price layout - stack vertically */
.price-container.on-sale {
    gap: 1px;
}

.price-container.on-sale .original-price {
    font-size: 14px;
    margin-bottom: 2px;
}

.detail-button-container {
    flex-shrink: 0;
    width: 100px;
}


/* Responsive Design */
@media (max-width: 768px) {
    .product-card {
        margin-bottom: 16px;
    }

    .product-image-section {
        min-height: 250px;
    }

    .free-shipping-banner {
        font-size: 11px;
        padding: 4px;
    }

    .marketing-badges {
        top: 28px; /* Adjust for smaller banner */
    }

    .marketing-badges.with-manufacturer-logo {
        top: 50px;
    }

    .manufacturer-logo {
        width: 32px;
        height: 32px;
        padding: 3px;
    }

    .product-info {
        padding: 10px;
    }

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

    .rating-availability-row {
        flex-direction: row;
        align-items: center;
        gap: 6px;
    }

    .wishlist-button {
        margin-left: 0;
        align-self: flex-end;
    }

    .product-bottom {
        padding: 10px;
    }

    .price-detail-row {
        flex-direction: row;
        align-items: stretch;
        gap: 8px;
    }

    .savings-amount {
        text-align: left;
        margin-top: 4px;
    }

    .detail-button {
        text-align: center;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .product-image-section {
        min-height: 200px;
    }

    .free-shipping-banner {
        font-size: 10px;
        padding: 3px;
    }

    .marketing-badges {
        top: 22px;
    }

    .marketing-badges.with-manufacturer-logo {
        top: 42px;
    }

    .marketing-badges .marketing-label {
        font-size: 9px;
        padding: 2px 6px;
    }

    .manufacturer-logo {
        width: 28px;
        height: 28px;
        padding: 2px;
        top: 8px;
        left: 8px;
    }

    .discount-overlay {
        top: 8px;
        right: 8px;
        font-size: 11px;
        padding: 3px 6px;
    }
}

/* =============================================================================
   FILTER SECTIONS AND CHOICES
   ============================================================================= */

/* Make filter sections use flexbox for vertical layout */
.filter-section fieldset {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: none;
    padding: 0;
    margin: 0;
}

/* Make each filter choice display on one line */
.filter-section fieldset label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    cursor: pointer;
}

/* Style the checkbox input */
.filter-section fieldset label input[type="checkbox"] {
    margin: 0;
    flex-shrink: 0;
}

/* Make the text and count stay on the same line */
.filter-section fieldset label .jet-checkboxes-list__input {
    margin-right: 8px;
}

/* Ensure more-options sections also use flexbox */
.more-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* =============================================================================
   LOADING ANIMATION
   ============================================================================= */

/* Loading overlay for filters */
.ppservis-catalog-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ppservis-catalog-loading.active {
    opacity: 1;
    visibility: visible;
}

/* Loading spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Make catalog container relative for absolute positioning */
.ppservis-catalog-container {
    position: relative;
}

/* =============================================================================
   PRICE RANGE SLIDER
   ============================================================================= */

/* Override any flex styling on price section */
.filter-section.price-section {
    display: block !important;
    flex-direction: unset !important;
}

/* Container for dual range inputs */
.price-section fieldset {
    position: relative;
    display: block !important;
    height: 40px;
    margin: 15px 0;
    padding: 0;
    border: none;
    flex-direction: unset !important;
}

/* Visual track behind sliders */
.price-section fieldset::before {
    content: '';
    position: absolute;
    top: 17px;
    left: 0;
    right: 0;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    z-index: 1;
}

/* Active range track (will be updated by JavaScript) */
.price-section fieldset::after {
    content: '';
    position: absolute;
    top: 17px;
    height: 6px;
    background: #0073aa;
    border-radius: 3px;
    z-index: 2;
    left: 0%;
    width: 100%;
}

/* Base styling for both range inputs */
.price-min-input,
.price-max-input {
    position: absolute;
    width: 100%;
    height: 40px;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
    pointer-events: auto;
    margin: 0;
    top: -7px;
    z-index: 3;
}

/* Max input slightly higher z-index for easier grabbing */
.price-max-input {
    z-index: 4;
}

/* Enable pointer events for thumbs */
.price-min-input::-webkit-slider-thumb,
.price-max-input::-webkit-slider-thumb {
    pointer-events: all;
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0073aa;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.price-max-input::-webkit-slider-thumb {
    background: #005580;
}

/* Firefox styles */
.price-min-input::-moz-range-thumb,
.price-max-input::-moz-range-thumb {
    pointer-events: all;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0073aa;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    cursor: pointer;
}

.price-max-input::-moz-range-thumb {
    background: #005580;
}

/* Track styling - hide native tracks since we use custom ones */
.price-min-input::-webkit-slider-runnable-track,
.price-max-input::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    background: transparent;
    border: none;
    border-radius: 3px;
}

.price-min-input::-moz-range-track,
.price-max-input::-moz-range-track {
    width: 100%;
    height: 6px;
    background: transparent;
    border: none;
    border-radius: 3px;
}

/* Hide native track progress in Firefox */
.price-min-input::-moz-range-progress,
.price-max-input::-moz-range-progress {
    background: transparent;
}

/* Price display styling */
.price-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    margin-top: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.price-display span {
    color: #333;
    transition: color 0.3s ease;
}

/* Active price filter styling */
.price-section.price-active .price-display {
    background: #f0f8ff;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #0073aa;
}

.price-section.price-active .price-display span {
    color: #0073aa;
    font-weight: 600;
}

/* Visual indicator for filtered state */
.price-section.price-active h4::after {
    content: ' ✓';
    color: #0073aa;
    font-size: 16px;
}

/* =============================================================================
   FILTER TOGGLE BUTTON
   ============================================================================= */

.show-more-toggle {
    display: inline-block;
    margin-top: 10px;
    color: #0073aa;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: underline;
    transition: color 0.2s;
}

.show-more-toggle:hover {
    color: #005580;
    text-decoration: none;
}

.show-more-toggle .more-count {
    color: #666;
    font-size: 12px;
    font-weight: normal;
    margin-left: 2px;
}

.more-options + .more-options {
    margin-top: 0;
}

/* =============================================================================
   SUBCATEGORIES SECTION
   ============================================================================= */

.ppservis-subcategories {
    margin-bottom: 2rem;
}

.subcategories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.subcategory-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.subcategory-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.subcategory-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.subcategory-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.subcategory-placeholder {
    width: 100%;
    height: 150px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.subcategory-title {
    padding: 1rem;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.subcategory-count {
    padding: 0 1rem 1rem;
    color: #666;
    font-size: 0.9rem;
}

/* =============================================================================
   FILTERS SECTION - MATCH ORIGINAL JETENGINE STYLING
   ============================================================================= */

.ppservis-filters {
    background: transparent;
    padding: 0;
    border-radius: 0;
    margin-bottom: 2rem;
}

.filter-section {
    margin-bottom: 1.5rem;
}

.filter-section:last-child {
    margin-bottom: 0;
}

.filter-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

/* Ordering Section */
.ordering-section {
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.ordering-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.ordering-section select {
    width: 100%;
    max-width: 300px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

/* Filter Options - JetEngine Style */
.filter-option {
    display: block;
    margin-bottom: 0.25rem;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.filter-option input[type="checkbox"] {
    margin-right: 0.5rem;
    width: 16px;
    height: 16px;
}

.filter-option .count {
    color: #666;
    font-size: 0.9rem;
}

/* JetEngine-style checkbox with SVG */
.filter-option input[type="checkbox"] {
    appearance: none;
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: white;
    position: relative;
    margin-right: 8px;
    vertical-align: middle;
}

.filter-option input[type="checkbox"]:checked {
    background: #28a745;
    border-color: #28a745;
}

.filter-option input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    background-image: url('data:image/svg+xml;utf8,<svg width="28" height="28" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg"><path d="M26.109 8.844c0 0.391-0.156 0.781-0.438 1.062l-13.438 13.438c-0.281 0.281-0.672 0.438-1.062 0.438s-0.781-0.156-1.062-0.438l-7.781-7.781c-0.281-0.281-0.438-0.672-0.438-1.062s0.156-0.781 0.438-1.062l2.125-2.125c0.281-0.281 0.672-0.438 1.062-0.438s0.781 0.156 1.062 0.438l4.594 4.609 10.25-10.266c0.281-0.281 0.672-0.438 1.062-0.438s0.781 0.156 1.062 0.438l2.125 2.125c0.281 0.281 0.438 0.672 0.438 1.062z" fill="white"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
}

/* Price Filter */
.price-filter-wrapper {
    max-width: 300px;
}

.range-slider {
    position: relative;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    margin: 1rem 0;
}

.range-slider input[type="range"] {
    position: absolute;
    top: -6px;
    width: 100%;
    height: 18px;
    background: transparent;
    appearance: none;
    pointer-events: none;
}

.range-slider input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    background: #28a745;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
}

.price-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}

.price-separator {
    color: #666;
}

/* Attribute Filters */
.attribute-options {
    max-height: 200px;
    overflow-y: auto;
}

/* Filter Actions */
.filter-actions {
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.btn-clear-filters,
.btn-apply-filters {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-clear-filters:hover {
    background: #f8f9fa;
}

.btn-apply-filters {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.btn-apply-filters:hover {
    background: #218838;
}

/* =============================================================================
   PRODUCTS SECTION
   ============================================================================= */

.ppservis-products {
    position: relative;
}

.ppservis-products.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255,255,255,0.9);
    padding: 1rem 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 10;
}

.products-grid {
    display: grid;
    margin-bottom: 2rem;
    gap: 5px;
}

/* Grid columns based on data attribute */
.ppservis-products[data-columns="1"] .products-grid {
    grid-template-columns: 1fr;
}

.ppservis-products[data-columns="2"] .products-grid {
    grid-template-columns: repeat(2, 1fr);
}

.ppservis-products[data-columns="3"] .products-grid {
    grid-template-columns: repeat(3, 1fr);
}

.ppservis-products[data-columns="4"] .products-grid {
    grid-template-columns: repeat(4, 1fr);
}

/* Product Cards */
.product-card {
    background: white;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid #eaeaea;
    border-radius: 5px;
}

/* Stock Badges - Tasks #463, #464 */
.stock-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    z-index: 2;
}

.stock-badge.in-stock {
    background-color: #28a745; /* Green */
    color: white;
}

.stock-badge.weeks-1-2 {
    background-color: #28a745; /* Same green as in-stock (Task #464) */
    color: white;
}

.stock-badge.weeks-3-4 {
    background-color: #6b8e23; /* Khaki green (Task #464) */
    color: white;
}

.stock-badge.coming-soon {
    background-color: #ffc107;
    color: #333;
}

/* Dynamic badges from simple_badges function */
.product-card .product-badges {
    position: absolute;
    left: 10px;
    top: 10px;
    z-index: 2;
}

.product-card .product-badges .badges {
    position: static;
    margin: 0;
    padding: 0;
    list-style-type: none;
}

/* Discount Badges - Task #355 + Omnibus */
.discount-badges {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 13;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* When free shipping banner is present, push discount badges down */
.jet-woo-product-thumbnail:has(.free-shipping-banner) .discount-badges {
    top: 40px;
}

.discount-badge {
    display: block;
    background: #dc3545;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.discount-badge.percent {
    background: #dc3545; /* Red for percentage */
}

.discount-badge.amount {
    background: #28a745; /* Green for amount */
}

/* Legacy support */
.discount-percent,
.discount-amount {
    display: block;
    background: #dc3545;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 2px;
}

/* Product Image */
.product-image {
    position: relative;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-image img.loading {
    opacity: 0.5;
}

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

/* Product Info */
.product-info:not(.elementor-element-4aac0cb) {
    padding: 0 1rem;
}

.product-title {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    display: flex;
    justify-content: center;

}

.product-title a {
    text-decoration: none;
    color: #333;
    transition: color 0.2s;
}

.product-title a:hover {
    color: #28a745;
}

/* Manufacturer Logo - Moved to line 340 */

/* Price Section */
.price-section {
    display: flex;
    justify-content: space-between;
    align-items: start;
}

.price-display {
    flex: 1;
}

.regular-price {
    text-decoration: line-through;
    color: #999;
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

/*.sale-price,
.current-price {
    font-weight: bold;
    color: #333;
    font-size: 1.1rem;
}

.sale-price {
    color: #dc3545;
}*/

/* Color Swatches */
.color-swatches {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: transform 0.2s;
}

.color-swatch:hover {
    transform: scale(1.1);
    border-color: #28a745;
}

/* Review Cards - Task #413 */
.review-card {
    background: #f8f9fa;
    border: 2px dashed #28a745;
}

.review-card .review-content {
    padding: 2rem;
    text-align: center;
}

.review-card .review-content h3 {
    color: #28a745;
    margin-bottom: 1rem;
}

/* No Products Found */
.no-products-found {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.no-products-found p {
    font-size: 1.1rem;
    margin: 0;
}

/* Filter Error */
.filter-error {
    background: #f8d7da;
    color: #721c24;
    padding: 0.75rem;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin-bottom: 1rem;
}

/* =============================================================================
   RESPONSIVE DESIGN
   ============================================================================= */

@media (max-width: 768px) {
    .subcategories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .ppservis-products[data-columns="3"] .products-grid,
    .ppservis-products[data-columns="4"] .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ppservis-filters {
        padding: 1rem;
    }

    .filter-actions {
        flex-direction: column;
    }

    .btn-clear-filters,
    .btn-apply-filters {
        width: 100%;
    }

    .price-section {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }

    .detail-button {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .subcategories-grid {
        grid-template-columns: 1fr;
    }

    .ppservis-products[data-columns="2"] .products-grid,
    .ppservis-products[data-columns="3"] .products-grid,
    .ppservis-products[data-columns="4"] .products-grid {
        grid-template-columns: 1fr;
    }

    .product-image img {
        height: 200px;
    }
}

/* =============================================================================
   MOBILE FILTER PANEL
   ============================================================================= */

@media (max-width: 768px) {
    .ppservis-filters {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 350px;
        height: 100vh;
        background: white;
        z-index: 1000;
        transition: left 0.3s;
        overflow-y: auto;
        border-radius: 0;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }

    .ppservis-filters.active {
        left: 0;
    }

    .filter-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        display: none;
    }

    .filter-overlay.active {
        display: block;
    }

    .filter-toggle {
        background: #28a745;
        color: white;
        border: none;
        padding: 0.75rem 1.5rem;
        border-radius: 4px;
        margin-bottom: 1rem;
        cursor: pointer;
        font-weight: bold;
    }
}

/* =============================================================================
   LOADING STATES
   ============================================================================= */

.product-card.loading {
    opacity: 0.6;
}

.color-swatch.loading {
    animation: pulse 1s infinite;
}

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

/* =============================================================================
   ACCESSIBILITY
   ============================================================================= */

.filter-option:focus-within {
    outline: 2px solid #28a745;
    outline-offset: 2px;
}

.detail-button:focus,
.btn-clear-filters:focus,
.btn-apply-filters:focus {
    outline: 2px solid #28a745;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .stock-badge,
    .discount-badges span {
        border: 1px solid currentColor;
    }

    .product-card {
        border: 2px solid #333;
    }
}

/* Load More Button */
.ppservis-load-more {
    text-align: center;
    margin: 2rem 0;
    height: auto !important;
    min-height: 0 !important;
}

/* Override Elementor widget container heights for load more */
.elementor-widget-shortcode .elementor-shortcode .ppservis-load-more {
    height: auto !important;
    min-height: 0 !important;
}

.elementor-widget-shortcode:has(.ppservis-load-more) {
    min-height: 0 !important;
}

.elementor-widget-shortcode:has(.ppservis-load-more) .elementor-widget-container {
    min-height: 0 !important;
}

.ppservis-load-more .btn,
.ppservis-load-more .load-more-btn {
    background: #e5e5e5;
    color: #1D1D1D;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.ppservis-load-more .btn:hover,
.ppservis-load-more .load-more-btn:hover {
    background: #1D1D1D;
    color: white;
}

.ppservis-load-more .btn:disabled,
.ppservis-load-more .load-more-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.load-more-error {
    background: #dc3545;
    color: white;
    padding: 10px;
    margin: 1rem 0;
    border-radius: 4px;
    text-align: center;
}

/* Pagination */
.ppservis-pagination {
    margin: 2rem 0;
    text-align: center;
    position: relative;
}

.ppservis-pagination .pagination-nav {
    display: inline-block;
}

.ppservis-pagination .page-numbers {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.5rem;
    justify-content: center;
}

.ppservis-pagination .page-numbers li {
    margin: 0;
}

.ppservis-pagination .page-numbers a,
.ppservis-pagination .page-numbers span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 35px;
    height: 35px;
    padding: 0;
    text-decoration: none;
    border: 2px solid transparent;
    color: #1d1D1D;
    background: transparent;
    transition: all 0.3s ease;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
}

.ppservis-pagination .page-numbers a:hover {
    background: #eaeaea;
    color: #1d1D1D;
    border-color: #eaeaea;
}

.ppservis-pagination .page-numbers .current {
    background: transparent;
    color: #1d1D1D;
    border-color: #eaeaea;
}

.ppservis-pagination .page-numbers .dots {
    border: none;
    background: transparent;
    color: #666;
}

/* Pagination loading state */
.ppservis-pagination.loading {
    opacity: 0.6;
    pointer-events: none;
}

.pagination-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 10;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .product-card,
    .subcategory-card,
    .detail-button,
    .color-swatch {
        transition: none;
    }

    .product-image img {
        transform: none;
    }

    .product-card:hover .product-image img {
        transform: none;
    }
}

/* =============================================================================
   ACTIVE FILTERS DISPLAY
   ============================================================================= */

/* Active Filters Display */
.active-filters {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid #0073aa;
    display: none; /* Hidden by default, shown when filters are active */
}

.active-filters-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.active-filters-label {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

.active-filters-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex: 1;
}

.active-filter-tag {
    display: inline-flex;
    align-items: center;
    background: #0073aa;
    color: white;
    padding: 0.4rem 0.6rem;
    border-radius: 20px;
    font-size: 0.85rem;
    line-height: 1;
    gap: 0.4rem;
    max-width: 200px;
}

.active-filter-tag .tag-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.active-filter-tag .remove-filter {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.active-filter-tag .remove-filter:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.active-filter-tag .remove-filter svg {
    width: 12px;
    height: 12px;
}

.clear-all-filters {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: background-color 0.2s ease;
    margin-left: auto;
}

.clear-all-filters:hover {
    background: #c82333;
}

.clear-all-filters svg {
    width: 14px;
    height: 14px;
}

/* Filter type specific colors */
.active-filter-tag[data-type="price"] {
    background: #28a745;
}

.active-filter-tag[data-type="category"] {
    background: #6f42c1;
}

.active-filter-tag[data-type="attribute"] {
    background: #fd7e14;
}

.active-filter-tag[data-type="order"] {
    background: #17a2b8;
}

/* Mobile responsive for active filters */
@media (max-width: 768px) {
    .active-filters-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .active-filters-label {
        margin-bottom: 0.25rem;
    }

    .clear-all-filters {
        margin-left: 0;
        margin-top: 0.5rem;
    }

    .active-filter-tag {
        max-width: 100%;
    }
}

/* WC Price History (Omnibus Directive) Styling */
.wc-price-history-lowest {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
    font-style: italic;
}

.wc-price-history-lowest-raw-value {
    font-weight: 600;
    color: #333;
}

/* Omnibus on product detail page */
.product-detail .wc-price-history-lowest {
    font-size: 13px;
    margin-top: 8px;
    padding: 8px;
    background: #f8f9fa;
    border-left: 3px solid #007bff;
    border-radius: 4px;
}

.product-detail .wc-price-history-lowest-raw-value {
    color: #007bff;
}

/* ============================================
   Product Specs List
   ============================================ */

.product-specs-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.product-specs-list .spec-item {
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.product-specs-list .spec-item:last-child {
    border-bottom: none;
}

.product-specs-list .spec-label {
    font-weight: 600;
    color: #3E3E3E;
    flex-shrink: 0;
}

.product-specs-list .spec-value {
    color: #7A7A7A;
    text-align: right;
}

/* ============================================
   Product Key Characteristics
   ============================================ */

.product-key-characteristics {
    list-style: none;
    margin: 0;
    padding: 0;
}

.product-key-characteristics .key-characteristic-item {
    padding: 8px 0 8px 25px;
    position: relative;
    color: #3E3E3E;
    line-height: 1.6;
}

.product-key-characteristics .key-characteristic-item:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #4CAF50;
    font-weight: bold;
    font-size: 18px;
}
