/* Main Wrapper */
.ips-wrapper {
    /* グリッドレイアウトはテーマに合わせるため削除、あるいはサイドバーのみのスタイルとして保持 */
    max-width: 100%;
}

/* サイドバー */
.ips-form-group {
    margin-bottom: 20px;
}

.ips-form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 16px;
    color: #333;
}

.ips-form-group input[type="text"],
.ips-form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.ips-price-range {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0;
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ips-price-range:focus-within {
    border-color: #0056b3;
    box-shadow: 0 0 0 1px #0056b3;
}

.ips-price-range input[type="number"] {
    flex: 1;
    width: 100%;
    padding: 10px 0;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 16px;
    appearance: textfield;
    -moz-appearance: textfield;
    outline: none;
}

.ips-price-range input[name="ips_min_price"] {
    padding-left: 12px;
}

.ips-price-range input[type="number"]::-webkit-outer-spin-button,
.ips-price-range input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ips-price-range input[type="number"]::placeholder {
    color: #ccc;
}

.ips-price-separator {
    color: #93c02d;
    font-weight: bold;
    margin: 0 8px;
}

.ips-price-unit {
    color: #93c02d;
    font-weight: bold;
    margin-left: auto;
    padding-left: 8px;
    padding-right: 12px;
    white-space: nowrap;
}

.ips-tags-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ips-tags-list--row {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 36px;
}

.ips-tag-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    font-weight: normal !important;
    font-size: 14px;
    cursor: pointer;
    margin: 0;
    padding: 0;
}

.ips-tag-item input[type="checkbox"] {
    margin: 0;
    width: auto !important;
    height: auto !important;
    display: inline-block !important;
}

.ips-submit-btn {
    font-family: "Zen Maru Gothic", sans-serif;
    width: 100%;
    background-color: var(--wp--preset--color--custom-accent-3);
    color: #fff;
    border: none;
    padding: 10px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ips-submit-btn:hover {
    opacity: 0.8;
}

/* 検索結果（カードスタイル）はテーマのスタイルを使用するため削除 */

/* Sort Buttons */

.ips-sort-buttons ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
}

.ips-sort-buttons li {
    margin: 0;
    min-width: 100px;
    flex: 1;
}

.ips-sort-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 40px;
    padding: 2px 8px;
    background-color: #fff;
    color: #333;
    text-decoration: none;
    border-radius: 50px;
    font-size: 12px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.ips-sort-btn:hover {
    opacity: 0.8;
}

.ips-sort-btn.is-active {
    background-color: var(--wp--preset--color--custom-accent-3);
    color: #fff;
    border-color: var(--wp--preset--color--custom-accent-3);
    pointer-events: none;
}

/* Compact Search Shortcode */
.ips-compact-container {
    width: 100%;
    margin: 0 auto;
}

.ips-compact-form {
    background: #fff;
    border-radius: 50px;
    padding: 10px 20px;
    border: 2px solid #333;
}

.ips-compact-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ips-compact-select-group {
    flex: 1;
    position: relative;
    padding: 0 15px;
}

.ips-compact-select-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.ips-compact-select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    padding: 10px 30px 10px 10px;
    cursor: pointer;
    outline: none;
}

.ips-compact-arrow {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #888;
    pointer-events: none;
}

.ips-compact-divider {
    width: 1px;
    height: 40px;
    background-color: #ddd;
}

.ips-compact-submit-group {
    margin-left: 20px;
}

.ips-compact-submit-btn {
    background-color: #4CAF50;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.3s;
}

.ips-compact-submit-btn:hover {
    background-color: #5BBF5D;
}

@media (max-width: 768px) {
    .ips-compact-form {
        border-radius: 16px;
        /* Slightly less rounded on mobile */
        padding: 20px;
        /* If the design requires the button to be outside the white box, we might need a different approach.
		   But assuming it's all in one container based on structure. 
		   If the user wants the button 'floating' or separate, I'd need to know. 
		   For now, a stack within the form is standard. */
    }

    .ips-compact-row {
        flex-wrap: wrap;
        /* Allow wrapping */
        gap: 0;
        /* Handle spacing manually for better control */
    }

    .ips-compact-select-group {
        flex: 1;
        /* Take available space */
        padding: 0 10px;
        /* Reduce padding */
        min-width: 0;
    }

    .ips-compact-select-wrap {
        border-bottom: none;
        /* Remove previous border style */
        padding-bottom: 0;
        justify-content: center;
        /* Center content if needed */
    }

    .ips-compact-select {
        text-align: left;
        /* Align text */
        padding-left: 0;
        /* Remove left padding to align with edge if desired, or keep it */
        font-size: 14px;
        /* Slightly smaller font */
    }

    .ips-compact-divider {
        display: block;
        /* Show divider */
        height: 30px;
        margin: 0;
        align-self: center;
    }

    .ips-compact-submit-group {
        width: 100%;
        flex: 0 0 100%;
        /* Force new line */
        margin-left: 0;
        margin-top: 20px;
    }

    .ips-compact-submit-btn {
        width: 100%;
        padding: 14px;
    }
}

/* Modal UI Styles */
.ips-compact-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 10px 10px 0;
    /* Align with previous select padding logic */
    cursor: pointer;
    user-select: none;
}

.ips-trigger-label {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Modal Core */
.ips-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.ips-modal.is-open {
    display: block;
}

.ips-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.ips-modal-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    /* PC Width */
    background-color: #fff;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* Modal Header */
.ips-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ips-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.ips-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #999;
}

/* Modal Body */
.ips-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* Area List Styles */
.ips-area-region {
    margin-bottom: 24px;
}

.ips-area-region-title {
    font-size: 14px;
    font-weight: bold;
    color: #4CAF50;
    /* Brand Color */
    margin-bottom: 12px;
    margin-top: 0;
}

.ips-area-items,
.ips-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Selectable Items (Pills) */
.ips-select-item {
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 50px;
    padding: 8px 16px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    /* Reset if button default */
}

.ips-select-item:hover {
    background-color: #e8e8e8;
}

.ips-select-item.is-selected {
    background-color: #4CAF50;
    color: #fff;
    border-color: #4CAF50;
}

/* Modal Footer */
.ips-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    /* Right align by default, or space-between */
    gap: 12px;
}

.ips-modal-reset {
    background: none;
    border: none;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
}

.ips-modal-confirm {
    background-color: #0073aa;
    /* WordPress Blue or Theme Blue */
    color: #fff;
    border: none;
    padding: 10px 30px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

.ips-modal-confirm:hover {
    background-color: #005177;
}

/* Mobile Adjustments for Modal */
@media (max-width: 768px) {
    .ips-modal-container {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
        top: 0;
        left: 0;
        transform: none;
    }

    .ips-area-items,
    .ips-tag-list {
        gap: 8px;
    }

    .ips-select-item {
        padding: 8px 12px;
        font-size: 13px;
    }
}