/* =========================================================
   GF Catalog Popup (CF7) — UI
   Design tokens: override them from your theme if needed,
   e.g.  .gfcp-popup { --gfcp-accent: #b40d1c; }
   ========================================================= */

/* homepage banner fix */
#post-18 .et_builder_inner_content {overflow: hidden;}

/* global */
.gfcp-floating-button,
.gfcp-popup {
    --gfcp-accent: #cf1322;
    --gfcp-accent-dark: #a60e1a;
    --gfcp-surface: #e9e9e9;
    --gfcp-field: #ffffff;
    --gfcp-field-border: #ffffff;
    --gfcp-ink: #1d1d1d;
    --gfcp-ink-soft: #5f6368;
    --gfcp-placeholder: #8a8f94;
    --gfcp-radius-field: 8px;
    --gfcp-radius-panel: 14px;
    --gfcp-field-height: 52px;
}

/* ---------------------------------------------------------
   Floating trigger
   --------------------------------------------------------- */

.gfcp-floating-button {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9998;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    border: 0;
    border-radius: 999px;
    padding: 15px 26px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1;
    cursor: pointer;
    color: black;
    background: #ffcf06;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.gfcp-floating-button:hover,
.gfcp-floating-button:focus-visible {
    background: #cca604;
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.3);
}

.gfcp-floating-button:focus-visible {
    outline: 3px solid rgba(207, 19, 34, 0.35);
    outline-offset: 3px;
}

.gfcp-floating-button:active {
    transform: translateY(0);
}

.gfcp-floating-button__icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

/* ---------------------------------------------------------
   Overlay
   --------------------------------------------------------- */

.gfcp-popup {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: clamp(12px, 4vh, 48px) 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* [hidden] must beat display:flex */
.gfcp-popup[hidden] {
    display: none;
}

.gfcp-popup__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(12, 12, 12, 0.6);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    animation: gfcp-fade-in 0.25s ease both;
}

.gfcp-popup__panel {
    position: relative;
    width: min(100%, 760px);
    margin: auto;
    background: var(--gfcp-surface);
    border-radius: var(--gfcp-radius-panel);
    padding: clamp(26px, 4vw, 44px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    animation: gfcp-pop-in 0.3s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

.gfcp-popup--closing .gfcp-popup__backdrop {
    animation: gfcp-fade-in 0.18s ease reverse both;
}

.gfcp-popup--closing .gfcp-popup__panel {
    animation: gfcp-pop-in 0.18s ease reverse both;
}

@keyframes gfcp-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes gfcp-pop-in {
    from { opacity: 0; transform: translateY(16px) scale(0.985); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .gfcp-popup__backdrop,
    .gfcp-popup__panel,
    .gfcp-floating-button {
        animation: none !important;
        transition: none !important;
    }
}

/* ---------------------------------------------------------
   Close button
   --------------------------------------------------------- */

.gfcp-popup__close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #6a6a6a;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.gfcp-popup__close:hover,
.gfcp-popup__close:focus-visible {
    background: rgba(0, 0, 0, 0.07);
    color: var(--gfcp-ink);
}

.gfcp-popup__close svg {
    width: 20px;
    height: 20px;
    display: block;
}

/* ---------------------------------------------------------
   Header
   --------------------------------------------------------- */

.gfcp-popup__title {
    margin: 0 0 12px;
    padding: 0;
    font-family: inherit;
    font-size: clamp(26px, 3.4vw, 34px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--gfcp-ink);
}

.gfcp-popup__subtitle {
    margin: 0 0 28px;
    max-width: 62ch;
    font-size: 14px;
    line-height: 1.55;
    color: var(--gfcp-ink-soft);
}

.gfcp-popup__content {
    color: var(--gfcp-ink);
}

/* ---------------------------------------------------------
   Form layout (CF7 + theme grid overrides)
   --------------------------------------------------------- */

.gfcp-popup .wpcf7 {
    margin: 0;
    padding: 0;
}

.gfcp-popup .wpcf7-form > p,
.gfcp-popup .wpcf7-form > div > p {
    margin: 0 0 16px;
}

.gfcp-popup .wpcf7-form > p:empty,
.gfcp-popup .wpcf7-form p:empty {
    display: none;
}

/* Neutralise the theme's float grid and rebuild it with CSS grid */
.gfcp-popup .row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 22px;
    row-gap: 18px;
    width: auto;
    margin: 0 0 18px;
    padding: 0;
}

.gfcp-popup .row::before,
.gfcp-popup .row::after {
    content: none;
    display: none;
}

.gfcp-popup .row > .col,
.gfcp-popup .row > [class*="span_"] {
    float: none;
    width: auto;
    min-width: 0;
    margin: 0;
    padding: 0;
}

.gfcp-popup .row > .col > p,
.gfcp-popup .row > [class*="span_"] > p {
    margin: 0;
}

/* Full-width single fields */
.gfcp-popup .row > .col.span_12,
.gfcp-popup .row > [class*="span_12"] {
    grid-column: 1 / -1;
}

/* ---------------------------------------------------------
   Labels
   --------------------------------------------------------- */

.gfcp-popup .gfcp-popup__content label {
    display: block;
    margin: 0 0 7px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.01em;
    color: var(--gfcp-ink-soft) !important; /* beats the inline red in the CF7 markup */
}

/* Labels that wrap a checkbox/radio must stay inline */
.gfcp-popup .wpcf7-list-item label,
.gfcp-popup .privacy-checkbox label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-weight: 400;
}

/* Hide labels entirely when you switch to placeholder-only fields */
.gfcp-popup.gfcp-popup--placeholders .gfcp-popup__content > .wpcf7 label:not(.wpcf7-list-item label) {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* ---------------------------------------------------------
   Fields
   --------------------------------------------------------- */

.gfcp-popup .wpcf7-form-control-wrap {
    display: block;
    width: 100%;
}

.gfcp-popup input[type="text"],
.gfcp-popup input[type="email"],
.gfcp-popup input[type="tel"],
.gfcp-popup input[type="url"],
.gfcp-popup input[type="number"],
.gfcp-popup input[type="date"],
.gfcp-popup select,
.gfcp-popup textarea {
    box-sizing: border-box;
    display: block;
    width: 100% !important;
    max-width: 100%;
    min-height: var(--gfcp-field-height);
    margin: 0 !important;
    padding: 14px 18px !important;
    border: 1px solid var(--gfcp-field-border) !important;
    border-radius: var(--gfcp-radius-field) !important;
    background: var(--gfcp-field) !important;
    box-shadow: none !important;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.4;
    color: var(--gfcp-ink);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    -webkit-appearance: none;
    appearance: none;
}

.gfcp-popup textarea {
    min-height: 160px;
    resize: vertical;
}

.gfcp-popup ::placeholder {
    color: var(--gfcp-placeholder);
    opacity: 1;
}

.gfcp-popup input:focus,
.gfcp-popup select:focus,
.gfcp-popup textarea:focus {
    outline: none;
    border-color: var(--gfcp-accent) !important;
    box-shadow: 0 0 0 3px rgba(207, 19, 34, 0.14) !important;
}

.gfcp-popup .wpcf7-not-valid {
    border-color: var(--gfcp-accent) !important;
    background: #fff6f6 !important;
}

/* ---------------------------------------------------------
   Checkboxes
   --------------------------------------------------------- */

.gfcp-popup input[type="checkbox"],
.gfcp-popup input[type="radio"] {
    box-sizing: border-box;
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin: 1px 0 0;
    padding: 0;
    border: 1px solid #d4d4d4;
    border-radius: 50%;
    background-color: var(--gfcp-field);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 12px 12px;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.gfcp-popup input[type="checkbox"]:checked,
.gfcp-popup input[type="radio"]:checked {
    border-color: var(--gfcp-accent);
    background-color: var(--gfcp-accent);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.8 8.4 6.4 12 13.2 4.6'/%3E%3C/svg%3E");
}

.gfcp-popup input[type="checkbox"]:focus-visible,
.gfcp-popup input[type="radio"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(207, 19, 34, 0.22);
}

.gfcp-popup .wpcf7-checkbox,
.gfcp-popup .wpcf7-acceptance {
    display: block;
}

.gfcp-popup .wpcf7-list-item {
    display: block;
    margin: 0;
}

.gfcp-popup .wpcf7-list-item-label {
    font-size: 14px;
    line-height: 1.5;
    color: var(--gfcp-ink-soft);
}

/* Privacy row: checkbox on the left, text hanging beside it */
.gfcp-popup .privacy-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 18px 0 !important;
    font-size: 13px;
    line-height: 1.55;
    color: var(--gfcp-ink-soft) !important; /* beats the inline red in the CF7 markup */
}

.gfcp-popup .privacy-checkbox .wpcf7-form-control-wrap {
    display: inline-flex;
    width: auto;
    flex: 0 0 auto;
}

.gfcp-popup .privacy-checkbox a {
    color: var(--gfcp-ink);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.gfcp-popup .privacy-checkbox a:hover {
    color: var(--gfcp-accent);
}

/* Optional small caption above the privacy row */
.gfcp-popup__legend {
    margin: 26px 0 6px;
    font-size: 13px;
    color: var(--gfcp-ink-soft);
}

/* ---------------------------------------------------------
   Submit
   --------------------------------------------------------- */

.gfcp-popup .wpcf7-submit,
.gfcp-popup input[type="submit"] {
    display: block;
    margin: 8px 0 0 auto; /* right-aligned without :has() support */
    border: 0 !important;
    border-radius: 999px !important;
    padding: 18px 42px !important;
    width: auto !important;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    line-height: 1;
    color: #fff !important;
    background: var(--gfcp-accent) !important;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(207, 19, 34, 0.28);
    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.gfcp-popup .wpcf7-submit:hover,
.gfcp-popup .wpcf7-submit:focus-visible {
    background: var(--gfcp-accent-dark) !important;
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(207, 19, 34, 0.34);
}

.gfcp-popup .wpcf7-submit:active {
    transform: translateY(0);
}

.gfcp-popup .wpcf7-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Keep the submit and the CF7 spinner on one right-aligned row */
.gfcp-popup p:has(> .wpcf7-submit),
.gfcp-popup p:has(> input[type="submit"]) {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin: 8px 0 0 !important;
}

.gfcp-popup .wpcf7-spinner {
    margin: 0 4px;
}

/* ---------------------------------------------------------
   CF7 messages
   --------------------------------------------------------- */

.gfcp-popup .wpcf7-not-valid-tip {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--gfcp-accent);
}

.gfcp-popup .wpcf7-response-output {
    margin: 20px 0 0 !important;
    border: 0 !important;
    border-left: 4px solid var(--gfcp-accent) !important;
    border-radius: 8px;
    padding: 14px 18px !important;
    background: #fff;
    font-size: 14px;
    line-height: 1.5;
    color: var(--gfcp-ink);
}

.gfcp-popup form.sent .wpcf7-response-output {
    border-left-color: #1a8a45 !important;
}

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */

@media (max-width: 640px) {
    .gfcp-popup .row {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 14px;
        margin-bottom: 14px;
    }

    .gfcp-popup__panel {
        border-radius: 12px;
    }

    .gfcp-popup .wpcf7-submit,
    .gfcp-popup input[type="submit"] {
        width: 100% !important;
        margin-left: 0;
    }

    .gfcp-popup p:has(> .wpcf7-submit),
    .gfcp-popup p:has(> input[type="submit"]) {
        flex-wrap: wrap;
        justify-content: center;
    }

    .gfcp-floating-button {
        right: 14px;
        bottom: 14px;
        padding: 13px 20px;
        font-size: 13px;
    }
}

/* ---------------------------------------------------------
   Page state
   --------------------------------------------------------- */

body.gfcp-popup-open {
    overflow: hidden;
}

/* Requested style */
.grecaptcha-badge {
    opacity: 0;
    right: -3000px;
}
