/**
 * Shop by Date - Styles
 */

.sbd-date-filter-wrapper {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.sbd-date-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.sbd-filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Button group - display buttons inline */
.sbd-button-group {
    flex-direction: row;
    align-items: flex-end;
    gap: 10px;
}

.sbd-button-group .sbd-filter-button,
.sbd-button-group .sbd-clear-button {
    flex: 1 1 0;
    min-width: 0;
    width: 100%;
}

.sbd-filter-group label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 5px;
}

.sbd-date-type,
.sbd-date-input {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    min-width: 150px;
    transition: border-color 0.3s ease;
}

.sbd-date-type:focus,
.sbd-date-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.sbd-filter-button,
.sbd-clear-button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    box-sizing: border-box;
    height: 42px;
    line-height: 22px;
    white-space: nowrap;
    overflow: visible;
    min-width: 180px;
}

.sbd-filter-button {
    background: #0073aa;
    color: #fff;
}

.sbd-filter-button:hover {
    background: #005a87;
    color: #fff;
}

.sbd-filter-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.sbd-clear-button {
    background: #666;
    color: #fff;
    margin-left: 0;
}

.sbd-clear-button:hover {
    background: #444;
    color: #fff;
}

/* Loading state */
.sbd-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.sbd-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive design */
@media (max-width: 768px) {
    .sbd-date-filter-form {
        flex-direction: column;
    }

    .sbd-filter-group {
        width: 100%;
    }

    .sbd-date-type,
    .sbd-date-input {
        width: 100%;
    }

    .sbd-button-group {
        flex-direction: column;
        align-items: stretch;
    }

    .sbd-filter-button,
    .sbd-clear-button {
        width: 100%;
        margin-left: 0;
        margin-top: 10px;
    }

    .sbd-filter-button {
        margin-top: 0;
    }
}

/* Integration with WooCommerce shop page */
.woocommerce .sbd-date-filter-wrapper {
    margin-bottom: 30px;
}

/* Ensure filter appears before products */
.woocommerce-products-header + .sbd-date-filter-wrapper {
    margin-top: 0;
}
