/* Reusable inquiry ("Anfragen") popup - native <dialog>, shared by the
   search result hover button and the detail page trigger. */

/* Isolates the modal from the active theme's global CSS - see the matching
   block at the top of search-app.css for why `all: revert` is used and why
   it must stay the first rule in this file. This dialog is appended
   directly to <body> (see inquiry-modal.js), outside both
   .nivoda-diamond-search and .nivoda-diamond-detail, so it needs its own
   copy of this reset rather than inheriting theirs. ::backdrop isn't
   matched by the `*` here (pseudo-elements need their own explicit
   selector), so its own rule below is untouched by this. */
.nivoda-inquiry-dialog,
.nivoda-inquiry-dialog * {
    all: revert;
    box-sizing: border-box;
}

/* Name/E-Mail/Telefon specifically kept showing the theme's own field
   styling (border/background/padding) despite the revert above - a theme's
   global form-field CSS (e.g. normalizing every input[type=text]/[type=
   email]/[type=tel] site-wide, common for WooCommerce-adjacent themes like
   Flatsome) can carry higher specificity than the plain-class revert rule,
   which still has to WIN the cascade like any other declaration - `revert`
   isn't automatically unbeatable. `!important` makes it so, since an
   !important author declaration always beats a normal one regardless of
   specificity - but that means every rule below that actually needs to
   style an input/textarea/select now has to be !important too, or it would
   just as easily be the one that loses to THIS revert. */
.nivoda-inquiry-dialog input,
.nivoda-inquiry-dialog textarea,
.nivoda-inquiry-dialog select {
    all: revert !important;
    box-sizing: border-box !important;
}

/* Belt and braces against the theme's own "sunken field" inset box-shadow
   on every control, not just the ones .nivoda-inquiry-field already covers
   (e.g. the captcha number field). */
.nivoda-inquiry-dialog input,
.nivoda-inquiry-dialog select,
.nivoda-inquiry-dialog textarea {
    box-shadow: none !important;
}

.nivoda-inquiry-dialog {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #1c2d4a;
    /* Square corners throughout, matching the detail page's info card and
       CTA button. */
    border: none;
    border-radius: 0;
    padding: 0;
    width: min(680px, calc(100vw - 2rem));
    max-height: calc(100vh - 4rem);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    /* Appear/disappear animation - see the .is-visible toggling in
       inquiry-modal.js (openForTrigger()/closeDialog()), which waits for
       this transition to finish before actually calling dialog.close().
       Keep this duration in sync with DIALOG_ANIMATION_MS there. */
    opacity: 0;
    transform: translateY(16px) scale(0.97);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.nivoda-inquiry-dialog.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.nivoda-inquiry-dialog::backdrop {
    background: rgba(20, 26, 38, 0.55);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.nivoda-inquiry-dialog.is-visible::backdrop {
    opacity: 1;
}

.nivoda-inquiry-form {
    position: relative;
    padding: 1.75rem 1.5rem 1.5rem;
}

.nivoda-inquiry-close {
    position: absolute;
    top: 0.6rem;
    right: 0.75rem;
    border: 0;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: #667;
    padding: 0.25rem;
    z-index: 1;
}

.nivoda-inquiry-title {
    margin: 0 1.5rem 1.25rem 0;
    font-size: 1.15rem;
    color: #1c2d4a;
}

/* Two columns on desktop (stone image/facts left, form right); stacked
   on mobile, image/facts above the form. */
.nivoda-inquiry-layout {
    display: grid;
    grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
    gap: 3rem;
}

.nivoda-inquiry-stone-image {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #f2f2f2;
    margin-bottom: 0.75rem;
}

.nivoda-inquiry-stone-details {
    margin: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.35rem 0.6rem;
    font-size: 0.85rem;
}

.nivoda-inquiry-stone-details dt {
    color: #78859c;
}

.nivoda-inquiry-stone-details dd {
    margin: 0;
    color: #24344f;
    font-weight: 600;
    text-align: right;
}

.nivoda-inquiry-price-vat {
    font-weight: 400;
    font-size: 0.6em;
    color: #78859c;
}

.nivoda-inquiry-fields {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    min-width: 0;
}

.nivoda-inquiry-field label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.85rem;
    color: #445;
    font-weight: 600;
}

/* Underline-only style: no left/right/top border, just a bottom rule -
   less boxy than a fully bordered field. !important throughout: these
   properties are exactly what the !important input/textarea/select revert
   above would otherwise also strip back out on its own. */
.nivoda-inquiry-field input,
.nivoda-inquiry-field textarea {
    font: inherit !important;
    box-sizing: border-box !important;
    width: 100% !important;
    padding: 0.3rem 0.1rem !important;
    border: 0 !important;
    border-bottom: 1px solid #d7dde5 !important;
    border-radius: 0 !important;
    background: #fff !important;
    resize: vertical !important;
}

.nivoda-inquiry-field input:focus,
.nivoda-inquiry-field textarea:focus {
    outline: none !important;
    border-bottom-color: #1c2d4a !important;
    box-shadow: 0 1px 0 0 #1c2d4a !important;
}

.nivoda-inquiry-privacy label {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 400;
    color: #445;
    white-space: nowrap;
}

.nivoda-inquiry-privacy input[type="checkbox"] {
    width: auto !important;
    margin: 0 !important;
    flex-shrink: 0;
}

.nivoda-inquiry-privacy a {
    color: #1c2d4a;
    font-weight: 600;
}

@media (max-width: 640px) {
    .nivoda-inquiry-layout {
        grid-template-columns: 1fr;
    }

    .nivoda-inquiry-stone-image {
        max-width: 220px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Honeypot: kept in the layout and in the tab order's absence (tabindex
   -1), not display:none/hidden - some scraping bots skip fields a plain
   CSS/attribute check flags as invisible, so this pushes it off-screen
   instead while it stays a "real", fillable field to naive form-filling
   scripts. */
.nivoda-inquiry-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.nivoda-inquiry-captcha input {
    max-width: 6rem !important;
}

.nivoda-inquiry-status {
    min-height: 1.2em;
    font-size: 0.85rem;
}

.nivoda-inquiry-status.is-error {
    color: #b3261e;
}

.nivoda-inquiry-status.is-success {
    color: #1e7a4a;
}

.nivoda-inquiry-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 0.25rem;
}

.nivoda-inquiry-cancel,
.nivoda-inquiry-submit {
    padding: 0.65rem 1.25rem;
    border-radius: 0;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    cursor: pointer;
}

.nivoda-inquiry-cancel {
    border: 1px solid #d7dde5;
    background: #fff;
    color: #445;
}

.nivoda-inquiry-submit {
    border: 1px solid #1c2d4a;
    background: #1c2d4a;
    color: #fff;
}

.nivoda-inquiry-submit:disabled {
    opacity: 0.6;
    cursor: default;
}

/* ---------- Hover trigger button (search result cards) ---------- */

/* A white bordered "extension panel" pinned just below the card's own box
   (top: 100%), NOT a normal in-flow child - it stays out of the grid's
   row-height calculation entirely, so revealing it never pushes the row
   below down (the card visually growing overlaps that row instead, see
   .nivoda-diamond-card:hover). It shares the card's background/border so
   there's no visible seam - it reads as the same white card, not a
   separate floating button underneath it. The actual button sits inside
   this panel with real inset padding, matching the card's own content
   padding. */
.nivoda-diamond-card-inquiry-panel {
    position: absolute;
    left: -1px;
    right: -1px;
    top: 100%;
    z-index: 1;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid var(--nivoda-border);
    border-top: 0;
    padding: 0.75rem;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transition: max-height 0.2s ease, opacity 0.2s ease;
}

.nivoda-diamond-card:hover .nivoda-diamond-card-inquiry-panel,
.nivoda-diamond-card-inquiry-panel:focus-within {
    max-height: 4.5rem;
    opacity: 1;
    pointer-events: auto;
}

.nivoda-diamond-card-inquiry {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 0.65rem 0.9rem;
    border: 0;
    border-radius: 0;
    background: rgba(28, 45, 74, 0.95);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-align: center;
    cursor: pointer;
}

/* ---------- Static trigger button (detail page) ---------- */

.nivoda-diamond-detail-inquiry {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-top: 1.5rem;
    padding: 0.9rem 1.75rem;
    border: 0;
    border-radius: 0;
    background: #1c2d4a;
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    text-align: center;
    cursor: pointer;
}
