/* Custom styles for Tempco site */

/* WP Core Buttons block */
.wp-block-button .wp-block-button__link,
.wp-block-button.is-style-outline .wp-block-button__link {
    --button-padding-x: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-transform: uppercase;
    text-decoration: none;
    padding: 17px var(--button-padding-x);
    transition: all 0.25s ease;
    position: relative;
}

.wp-block-button .wp-block-button__link {
    clip-path: polygon(0% 0%, calc(100% - 22px) 0%, 100% 27px, 100% 100%, 0% 100%, 0% 0%);
}

.wp-block-button.is-style-tempco-text-only-button .wp-block-button__link {
    transition: all 0ms ease;
}

.wp-block-button .wp-block-button__link:not(.has-background-color) {
    background-color: var(--global-palette-btn-bg);
}

.wp-block-button .wp-block-button__link:not(.has-text-color) {
    color: #fff;
}

.wp-block-button.is-style-tempco-text-only-button .wp-block-button__link,
.wp-block-button.is-style-tempco-underlined-button .wp-block-button__link,
.wp-block-button.is-style-outline .wp-block-button__link {
    background-color: transparent;
    clip-path: none;
}

.wp-block-button.is-style-tempco-text-only-button .wp-block-button__link:not(.has-text-color),
.wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color),
.wp-block-button.is-style-tempco-underlined-button .wp-block-button__link:not(.has-text-color),
.wp-block-button.is-style-tempco-text-only-button .wp-block-button__link.has-text-color:hover {
    color: #ed1c24;
}

.wp-block-button.is-style-tempco-underlined-button .wp-block-button__link:hover {
    box-shadow: none;
    color: var(--global-palette-btn-bg-hover);
}

.wp-block-button.is-style-tempco-text-only-button .wp-block-button__link:hover {
    box-shadow: none;
}

.wp-block-button.is-style-tempco-underlined-button .wp-block-button__link::after,
.wp-block-button.is-style-tempco-text-only-button .wp-block-button__link:hover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: calc(var(--button-padding-x) - 10px);
    right: calc(var(--button-padding-x) - 10px);
    width: auto;
    height: 3px;
    background-color: var(--global-palette1);
    transition: background-color 0.25s ease;
}

.wp-block-button.is-style-tempco-underlined-button .wp-block-button__link:hover::after {
    background-color: var(--global-palette-btn-bg-hover);
}

/* WP Core Buttons on red background */
.has-theme-palette-1-background-color .wp-block-button .wp-block-button__link:not(.has-background-color) {
    background-color: #000;
}

.has-theme-palette-1-background-color .wp-block-button .wp-block-button__link:not(.has-text-color),
.has-theme-palette-1-background-color .wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color) {
    color: #fff;
}

.has-theme-palette-1-background-color .wp-block-button .wp-block-button__link:not(.has-text-color):hover {
    background-color: var(--color-neutral-100);
}

.has-theme-palette-1-background-color .wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color):hover {
    color: var(--color-neutral-100);
}

.has-theme-palette-1-background-color .wp-block-button.is-style-tempco-text-only-button .wp-block-button__link {
    background-color: transparent;
}

.has-theme-palette-1-background-color .wp-block-button.is-style-tempco-text-only-button .wp-block-button__link:not(.has-text-color),
.has-theme-palette-1-background-color .wp-block-button.is-style-tempco-underlined-button .wp-block-button__link:not(.has-text-color) {
    color: #000;
    background-color: transparent;
}

.has-theme-palette-1-background-color .wp-block-button.is-style-tempco-underlined-button .wp-block-button__link::after {
    background-color: #000;
}

.has-theme-palette-1-background-color .wp-block-button.is-style-tempco-underlined-button .wp-block-button__link:hover,
.has-theme-palette-1-background-color .wp-block-button.is-style-tempco-text-only-button .wp-block-button__link:hover {
    color: var(--color-neutral-100);
}

.has-theme-palette-1-background-color .wp-block-button.is-style-tempco-text-only-button .wp-block-button__link:hover::after,
.has-theme-palette-1-background-color .wp-block-button.is-style-tempco-underlined-button .wp-block-button__link:hover::after {
    background-color: var(--color-neutral-100);
}

/* ===================================
   Kadence Search Modal Overrides
   Transforms full-screen modal to dropdown near search icon
   =================================== */

/* Remove the full-screen modal overlay */
.kb-search .kb-search-modal {
    position: absolute;
    top: 100%;
    left: auto;
    right: 0;
    width: auto;
    min-width: 350px;
    max-width: 450px;
    height: auto;
    background: transparent;
    z-index: 1000;
    padding-top: 10px;
}

/* Modal content container - styled as dropdown */
.kb-search .kb-search-modal-content {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    text-align: left;
    width: 100%;
    background: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 12px;
}

/* Form inside modal */
.kb-search .kb-search-modal-content form {
    margin: 0;
    max-width: 100%;
    position: relative;
}

/* Input wrapper - contains input and submit button */
.kb-search .kb-search-modal-content .kb-search-input-wrapper {
    position: relative;
    display: block;
    width: 100%;
    background: #f5f5f5;
    border: 1px solid #1a1a1a;
    border-radius: 3px;
}

/* Search input field */
.kb-search .kb-search-modal-input {
    padding: 12px 50px 12px 15px;
    font-size: 16px;
    width: 100%;
    border: none;
    background: transparent;
    color: #1a1a1a;
    outline: none;
    box-sizing: border-box;
}

.kb-search .kb-search-modal-input::placeholder {
    color: #666666;
}

.kb-search .kb-search-modal-input:focus {
    outline: none;
    box-shadow: none;
}

/* Submit button with red icon - positioned inside input */
.kb-search .kb-search-modal-content .kb-search-icon-submit,
.kb-search .kb-search-modal-content button[type="submit"] {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.kb-search .kb-search-modal-content .kb-search-icon-submit svg,
.kb-search .kb-search-modal-content button[type="submit"] svg,
.kb-search .kb-search-modal-content .kb-search-icon svg {
    width: 20px;
    height: 20px;
    stroke: #ed1c24;
}

/* Hide the close button */
.kb-search .kb-search-close-btn {
    display: none !important;
}

/* Ensure parent container allows absolute positioning */
.kb-search {
    position: relative;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .kb-search .kb-search-modal {
        min-width: 280px;
        max-width: calc(100vw - 40px);
        right: -10px;
    }

    .kb-search .kb-search-modal-input {
        font-size: 14px;
        padding: 10px 12px;
    }
}