/* ═══════════════════════════════════════════════
 *  Marlin Make An Offer — Frontend Styles
 * ═══════════════════════════════════════════════ */

/* ── Trigger button ──
 * Designed to sit inline next to WooCommerce's Add to Cart button.
 * Matches the height and font of the theme's default button, but uses
 * an outlined (secondary) style so the two are visually distinct while
 * still reading as a matched pair.
 * ─────────────────────────────────────────────── */
#marlin-mao-btn {
    /* Inherit sizing from theme's .button class, then override */
    display: inline-block;
    vertical-align: top;
    margin-left: 8px !important;
    margin-top: 0 !important;
    padding: 12px 24px !important;
    background-color: #fff !important;
    color: #000 !important;
    border: 2px solid #000 !important;
    border-radius: 0 !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: normal !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    box-shadow: none !important;
    /* Match Add to Cart button height precisely */
    box-sizing: border-box;
    height: auto;
}

#marlin-mao-btn:hover:not(:disabled) {
    background-color: #000 !important;
    color: #fff !important;
}

#marlin-mao-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Hint text below button when variation not selected */
.marlin-mao-select-hint {
    font-size: 12px;
    color: #888;
    margin-top: 8px;
    margin-bottom: 0;
    font-style: italic;
}

/* On very narrow screens, stack instead of inline */
@media (max-width: 480px) {
    #marlin-mao-btn {
        display: block;
        width: 100%;
        margin-left: 0 !important;
        margin-top: 10px !important;
    }
}

/* ── Modal overlay ── */
#marlin-mao-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

/* ── Modal box ── */
#marlin-mao-modal {
    background: #fff;
    border-radius: 8px;
    padding: 32px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 12px 48px rgba(0,0,0,0.25);
    font-family: Georgia, "Times New Roman", serif;
}

#marlin-mao-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    color: #888;
    padding: 0;
}
#marlin-mao-close:hover { color: #222; }

.marlin-mao-title {
    margin: 0 0 12px;
    color: #4a1a1a;
    font-size: 20px;
}

/* ── Rifle info bar ── */
.marlin-mao-rifle-info {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    background: #f9f6f4;
    border: 1px solid #e8ddd8;
    border-radius: 4px;
    padding: 10px 14px;
    margin-bottom: 20px;
    font-size: 13px;
    gap: 12px;
    flex-wrap: wrap;
}
#marlin-mao-rifle-label {
    font-weight: bold;
    color: #333;
}
.marlin-mao-asking-wrap {
    color: #555;
    white-space: nowrap;
}
#marlin-mao-asking-price {
    color: #4a1a1a;
}

/* ── Form fields ── */
.marlin-mao-field {
    margin-bottom: 14px;
}
.marlin-mao-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #333;
}
.mao-req {
    color: #c0392b;
}
.marlin-mao-field input[type="text"],
.marlin-mao-field input[type="email"],
.marlin-mao-field input[type="number"],
.marlin-mao-field input[type="tel"],
.marlin-mao-field textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.marlin-mao-field input:focus,
.marlin-mao-field textarea:focus {
    outline: none;
    border-color: #4a1a1a;
    box-shadow: 0 0 0 2px rgba(74,26,26,0.1);
}

/* Two-column row */
.marlin-mao-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}
@media (max-width: 400px) {
    .marlin-mao-row-2 { grid-template-columns: 1fr; }
}

/* ── Price hint ── */
.marlin-mao-hint {
    display: block;
    font-size: 11px;
    color: #888;
    margin-top: 3px;
}
.mao-hint-warn {
    color: #c0392b !important;
    font-weight: bold;
}

/* ── Error notice ── */
.marlin-mao-notice {
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 12px;
}
.marlin-mao-error {
    background: #fdf0ef;
    border: 1px solid #e0b4b4;
    color: #a94442;
}

/* ── Submit button ── */
#marlin-mao-submit {
    width: 100%;
    background: #4a1a1a;
    color: #fff;
    border: none;
    padding: 12px;
    font-size: 15px;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: background 0.2s;
    margin-top: 4px;
}
#marlin-mao-submit:hover:not(:disabled) { background: #6a2a2a; }
#marlin-mao-submit:disabled { opacity: 0.6; cursor: wait; }

/* ── Disclaimer ── */
.marlin-mao-disclaimer {
    font-size: 11px;
    color: #aaa;
    text-align: center;
    margin-top: 10px;
}

/* ── Success state ── */
#marlin-mao-success {
    text-align: center;
    padding: 20px 0;
}
.marlin-mao-checkmark {
    font-size: 52px;
    color: #008a20;
    line-height: 1;
    margin-bottom: 10px;
}
#marlin-mao-success h3 {
    color: #222;
    margin-bottom: 8px;
    font-size: 20px;
}
#marlin-mao-success p {
    color: #555;
    font-size: 14px;
}
