/* EPD Filter Styles */
.epd-filter-container {
    margin-bottom: 30px;
    padding: 15px;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
}

.epd-filter-container h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
}

/* Product count and status display */
.epd-filter-status {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 15px;
    margin: 0 0 20px 0;
    font-size: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    width: 100%;
    box-sizing: border-box;
    position: relative;
}

.epd-product-count {
    font-weight: 600;
    color: #852D2B;
    margin-bottom: 8px;
    font-size: 16px;
}

.epd-active-filters {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.epd-active-filters .filter-item {
    display: inline-block;
    background: #852D2B;
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    margin-right: 8px;
    margin-bottom: 5px;
    font-size: 12px;
}

/* Reset All Button Styles */
.epd-reset-all {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 12px;
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.2s ease;
    z-index: 10;
}

.epd-reset-all:hover {
    color: #000 !important;
}

.epd-reset-all[style*="color: #ccc"] {
    font-weight: normal;
}

.epd-reset-all[style*="color: #ccc"]:hover {
    color: #ccc !important;
}

.epd-filter-row {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.epd-filter-item {
    flex: 1;
    width: 100%;
    margin-right: 15px;
    margin-bottom: 10px;
}

.epd-filter-item:last-child {
    margin-right: 0;
}

.epd-filter-label {
    display: block;
    margin-bottom: 3px !important;
    font-weight: 600 !important;
}

.epd-input-container {
    display: none;
}

.epd-input-container > div {
    display: none;
}

.epd-input-container > div:first-child {
    display: none;
}

.epd-input-container > div:last-child {
    display: none;
}

.epd-input {
    display: none;
}

.epd-min-label, .epd-max-label {
    display: none;
}

.epd-max-label {
    display: none;
}

.epd-range-display {
    text-align: right;
    margin-top: 8px;
    font-size: 14px;
    font-weight: 400;
    color: #333;
    text-transform: uppercase;
}

.epd-range-slider {
    margin: 15px 0 5px 0;
    height: 5px;
}

.epd-range-slider .ui-slider-handle {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #852D2B;
    border: none;
    cursor: pointer;
    top: -5px;
}

.epd-range-slider .ui-slider-range {
    background: #a54c4a;
}

/* Button Styles */
.epd-filter-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
    width: 100%;
}

/* Common button styles */
.epd-filter-button, .epd-sort-button {
    width: 100%;
    padding: 10px 15px;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    text-align: center;
    border: 2px solid #852D2B;
}

/* Primary button styles - Apply Filters & Sort buttons */
#apply-epd-filters, #apply-epd-sort, #apply-price-sort {
    background: #852D2B;
    color: white;
}

#apply-epd-filters:hover, #apply-epd-sort:hover, #apply-price-sort:hover {
    background: #000;
    border-color: #000;
    color: white;
}

/* Secondary button styles - Reset Filters */
#reset-epd-filters {
    background: transparent;
    color: #852D2B;
    border: 2px solid #852D2B;
}

#reset-epd-filters:hover {
    background: #852D2B;
    color: white;
}

.epd-loading {
    text-align: center;
    padding: 15px;
    background: #f0f0f0;
    border-radius: 3px;
    margin-top: 15px;
    font-style: italic;
}

.no-products-found {
    padding: 15px;
    background: #ffe6e6;
    border-left: 3px solid #ff8080;
    margin: 20px 0;
}

/* Price Sort Section Styles */
.epd-price-sort-section {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

/* Sort Section Styles */
.epd-sort-section {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.epd-sort-controls {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.epd-sort-field {
    flex: 1;
    min-width: 150px;
    margin-bottom: 10px;
}

.epd-sort-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.epd-sort-field select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background-color: #fff;
}

.epd-sort-button {
    margin-top: 5px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .epd-filter-row {
        flex-direction: column;
    }
    
    .epd-filter-item {
        width: 100%;
        margin-right: 0;
    }
}

/* Loading Overlay */
.epd-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.epd-loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.epd-loading-message {
    background-color: white;
    color: #852D2B;
    padding: 20px 40px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 18px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border-left: 5px solid #852D2B;
}

.epd-loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(133, 45, 43, 0.3);
    border-radius: 50%;
    border-top-color: #852D2B;
    animation: epd-spin 1s ease-in-out infinite;
    margin-right: 10px;
    vertical-align: middle;
}

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

/* Tag Filter Styles */
.epd-tag-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.epd-tag-checkbox {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
}

.epd-tag-checkbox:hover {
    background: #f5f5f5;
    border-color: #852D2B;
}

.epd-tag-checkbox input[type="checkbox"] {
    margin: 0;
    margin-right: 11px;
}

.epd-tag-checkbox input[type="checkbox"]:checked + .epd-tag-label {
    color: #852D2B;
    font-weight: 600;
}

.epd-tag-label {
    margin-right: 4px;
}

.epd-tag-count {
    color: #666;
    font-size: 11px;
}

/* Breed Filter Styles */
.epd-breed-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.epd-breed-checkbox {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
}

.epd-breed-checkbox:hover {
    background: #f5f5f5;
    border-color: #852D2B;
}

.epd-breed-checkbox input[type="checkbox"] {
    margin: 0;
    margin-right: 11px;
}

.epd-breed-checkbox input[type="checkbox"]:checked + .epd-breed-label {
    color: #852D2B;
    font-weight: 600;
}

.epd-breed-label {
    margin-right: 4px;
}

.epd-breed-count {
    color: #666;
    font-size: 11px;
}

/* Collapsible Section Styles */
.epd-collapsible-section {
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
    background: #fff;
}

.epd-section-header {
    background: #f9f9f9;
    border-bottom: 1px solid #ddd;
    padding:10px;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.epd-section-header:hover {
    background: #f0f0f0;
    border-bottom-color: #852D2B;
}

.epd-section-header.expanded {
    background: #fff;
    border-bottom-color: #852D2B;
}

.epd-section-header.expanded h3 {
    color: #852D2B;
}

.epd-section-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    transition: color 0.3s ease;
}

.epd-section-header h4 {
    margin: 0;
    font-size: 14px !important;
    font-weight: 600;
    transition: color 0.3s ease;
}

.epd-section-arrow {
    font-size: 14px;
    color: #666;
    transition: transform 0.3s ease, color 0.3s ease;
    transform: rotate(0deg);
}

.epd-section-header:hover .epd-section-arrow {
    color: #852D2B;
}

.epd-section-header.expanded .epd-section-arrow {
    transform: rotate(90deg);
    color: #852D2B;
}

.epd-section-content {
    padding: 10px;
    background: #fff;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
}

.epd-section-content.expanded {
    max-height: 1000px; /* Large enough for any content */
    padding: 10px;
}

.epd-section-content.collapsed {
    max-height: 0;
    padding: 0 10px;
}

/* Filters Section Separator */

.epd-filters-separator h2 {
    color: #222222;
  font-family: "URWDINSemiCond", Sans-serif;
  letter-spacing: 2.5px;
  font-size: 20px !important;
  font-weight: 700;
  text-transform: capitalize;
  line-height: 1.4em;
}

.epd-separator-line {
   background:#ddd;
   height:1px;
   margin: 0 0 10px 0 !important; 
   border: .5px solid #ddd;
}



/* Sort Section Styles (non-collapsible) */
.epd-price-sort-section,
.epd-sort-section {
    margin-bottom: 20px;
}

.epd-price-sort-section h3,
.epd-sort-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* ================================================================
   MOBILE FILTER TOGGLE (Portrait mode up to 767px)
   ================================================================ */

/* Mobile Toggle Button - Show Filters */
.epd-mobile-toggle-btn {
    display: none; /* Hidden by default on desktop */
    width: 100%;
    padding: 15px 20px;
    background: #852D2B;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.epd-mobile-toggle-btn:hover {
    background: #000;
}

.epd-mobile-toggle-btn svg {
    vertical-align: middle;
}

/* Mobile Close Button - Hide Filters */
.epd-mobile-close-btn {
    display: none; /* Hidden by default on desktop */
    width: 100%;
    padding: 12px 20px;
    background: transparent;
    color: #852D2B;
    border: 2px solid #852D2B;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.epd-mobile-close-btn:hover {
    background: #852D2B;
    color: white;
}

.epd-mobile-close-btn svg {
    vertical-align: middle;
}

/* Mobile Responsive Styles - Portrait Mode (up to 767px) */
@media (max-width: 767px) {
    /* Show the mobile toggle button */
    .epd-mobile-toggle-btn {
        display: flex;
    }
    
    /* Show the mobile close button inside the container */
    .epd-mobile-close-btn {
        display: flex;
    }
    
    /* Hide the filter container by default on mobile */
    .epd-filter-container {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 999999;
        background: white;
        margin: 0;
        padding: 20px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        border: none;
        border-radius: 0;
    }
    
    /* Show the filter container when active */
    .epd-filter-container.mobile-active {
        display: block;
        animation: slideInFromBottom 0.3s ease-out;
    }
    
    /* Hide the toggle button when filters are active */
    .epd-mobile-toggle-btn.hidden {
        display: none;
    }
    
    /* Animation for filter container appearing */
    @keyframes slideInFromBottom {
        from {
            transform: translateY(100%);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
    
    /* Prevent body scroll when filters are open */
    body.epd-filters-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }
    
    /* Adjust spacing for mobile filter sections */
    .epd-price-sort-section,
    .epd-sort-section,
    .epd-collapsible-section {
        margin-bottom: 15px;
    }
    
    /* Make sure all filter elements are easily tappable on mobile */
    .epd-section-header {
        padding: 15px;
        min-height: 50px;
    }
    
    .epd-tag-checkbox,
    .epd-breed-checkbox {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    /* Larger touch targets for sliders on mobile */
    .epd-range-slider .ui-slider-handle {
        width: 24px !important;
        height: 24px !important;
        top: -9px !important;
        cursor: grab;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    }
    
    /* Active state when dragging */
    .epd-range-slider .ui-slider-handle:active {
        cursor: grabbing;
        transform: scale(1.1);
        box-shadow: 0 3px 8px rgba(0,0,0,0.3);
    }
    
    /* Thicker slider bar for easier interaction */
    .epd-range-slider {
        height: 8px !important;
    }
    
    /* Filter buttons full width and larger on mobile */
    .epd-filter-button,
    .epd-sort-button {
        padding: 15px;
        font-size: 16px;
    }
}