/* Product Sorting Block Styles */
.wp-block-cakeclub-product-sorting {
    margin: 1rem 0;
    font-family: 'Mindset', 'Arial', sans-serif;
}

.product-sorting-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.sorting-label {
    font-size: 1.2rem;
    color: #EB540D;
    font-weight: 500;
    white-space: nowrap;
}

.product-sorting-form {
    display: flex;
    align-items: center;
}

/* Custom dropdown styles */
.custom-sorting-dropdown {
    position: relative;
    min-width: 200px;
    cursor: pointer;
    font-family: 'Mindset', 'Arial', sans-serif;
}

.custom-sorting-selected {
    padding: 8px 30px 8px 12px;
    background-color: transparent;
    font-size: 1.2rem;
    color: #EB540D;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: opacity 0.2s ease;
}

.custom-sorting-selected:hover {
    opacity: 0.8;
}

.custom-sorting-arrow {
    font-size: 0.8rem;
    margin-left: 8px;
    transition: transform 0.2s ease;
}

.custom-sorting-dropdown.open .custom-sorting-arrow {
    transform: rotate(180deg);
}

.custom-sorting-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #f5f4eb;
    border: 1px solid #EB540D;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    z-index: 1000;
    transition: max-height 0.3s ease, opacity 0.2s ease;
}

.custom-sorting-dropdown.open .custom-sorting-options {
    max-height: 400px;
    opacity: 1;
}

.custom-sorting-option {
    padding: 10px 12px;
    font-size: 1.2rem;
    color: #394A78;
    background-color: #f5f4eb;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-family: 'Mindset', 'Arial', sans-serif;
}

.custom-sorting-option:hover {
    background-color: #EB540D;
    color: #ffffff;
}

.custom-sorting-option.active {
    background-color: #f5f4eb;
    color: #EB540D;
    font-weight: 500;
}

.custom-sorting-option.active:hover {
    background-color: #EB540D;
    color: #ffffff;
}

.custom-sorting-dropdown:focus {
    outline: none;
}

.custom-sorting-dropdown:focus-visible .custom-sorting-selected {
    box-shadow: 0 0 0 2px rgba(235, 84, 13, 0.3);
}

/* Alignment classes */
.wp-block-cakeclub-product-sorting.has-text-align-left .product-sorting-container {
    justify-content: flex-start;
}

.wp-block-cakeclub-product-sorting.has-text-align-center .product-sorting-container {
    justify-content: center;
}

.wp-block-cakeclub-product-sorting.has-text-align-right .product-sorting-container {
    justify-content: flex-end;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .product-sorting-container {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        justify-content: flex-end;
    }
    
    .wp-block-cakeclub-product-sorting.has-text-align-left .product-sorting-container {
        justify-content: flex-end;
    }
    
    .wp-block-cakeclub-product-sorting.has-text-align-center .product-sorting-container {
        justify-content: flex-end;
    }
    
    .custom-sorting-dropdown {
        min-width: auto;
        max-width: 300px;
    }
    
    .sorting-label {
        white-space: nowrap;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .custom-sorting-selected {
        border: 2px solid #000;
    }
    
    .custom-sorting-dropdown:focus-visible .custom-sorting-selected {
        border-color: #000;
        box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.3);
    }
    
    .custom-sorting-options {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .custom-sorting-selected,
    .custom-sorting-arrow,
    .custom-sorting-options,
    .custom-sorting-option {
        transition: none;
    }
} 