/* --- Chat Bubble --- */
.chat-bubble-anchor { 
    position: sticky; 
    bottom: 90px; 
    margin-top: -60px; 
    float: right; 
    right: 20px; 
    z-index: 100; 
    pointer-events: none; 
}

.chat-bubble {
    border: none !important; 
    pointer-events: auto; 
    width: 60px; 
    height: 60px; 
    background: #FFF; 
    border-radius: 50%;
    transform: translateY(75%); 
    cursor: pointer; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.35);
    display: flex; 
    justify-content: center; 
    align-items: center; 
    position: relative;
}

/* The Dots (The ellipsis) */
.chat-bubble .dots {
    width: 8px;
    height: 8px;
    background: transparent !important;
    border: 1.5px solid #555;
    border-radius: 50%;
    position: relative;
    display: block;
    box-sizing: border-box;
    margin: 0 auto; 
}

.chat-bubble .dots::before,
.chat-bubble .dots::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: transparent !important;
    border: 1.5px solid #555;
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%); 
    box-sizing: border-box;
}

.chat-bubble .dots::before { left: -12px; }
.chat-bubble .dots::after { right: -12px; }

.bubble-tail {
    position: absolute; 
    width: 0; 
    height: 0; 
    border-left: 10px solid transparent; 
    border-right: 10px solid transparent; 
    border-top: 15px solid #FFF; 
    bottom: -5px; 
    right: 5px; 
    transform: rotate(-45deg);
}

/* start Modal Overlay block */

.modal-overlay { 
    display: none; 
    position: fixed; 
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0;
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.7); 
    z-index: 2000; 
    justify-content: center; 
    align-items: center; 
}

.modal-card { 
    background: #FAFAFA; 
    padding: 20px 25px; 
    border-radius: 4px; /* Industrial radius */
    position: relative; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    box-sizing: border-box;
}

/* --- Modal Header & Close Button & Buy Now Logic --- */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* Changed to flex-start for title/button stack */
    margin-bottom: 15px; /* Dropped margin */
}

.modal-header h2 {
    margin: 0;
    font-size: 1.6rem;
    color: #222;
    letter-spacing: 0.5px;
    text-align: left;
}

.modal-header-text-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal-buy-now-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-buy-now-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #FF8C00; /* Shop Orange */
    color: #FFF !important;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px; /* Specific 6px radius */
    font-size: 0.9rem;
    width: fit-content;
    transition: opacity 0.2s;
}

.form-buy-now-btn:hover { opacity: 0.9; }

.form-external-icon { 
    width: 14px; 
    height: 14px; 
}

.modal-coming-soon {
    font-size: 11px;
    color: #888;
    font-style: italic;
    opacity: 0.7;
    margin-left: 2px;
}

.close-modal {
    background: none;
    border: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    padding: 0;
    color: #666;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.close-modal svg {
    width: 100%;
    height: 100%;
    display: block;
}

.close-modal:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* --- Form Grid Layout --- */
.contact-grid-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-row {
    display: flex;
    gap: 8px;
    width: 100%;
}

/* Desktop Default: Left/Right Split */
.form-row.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center; 
    gap: 15px;
    margin-top: 10px;
}

/* Mobile: Vertical Stack */
@media (max-width: 973px) {
    .form-row.form-footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .submit-btn {
        width: 300px; /* Makes button easier to hit on mobile */
    }
}

.form-row input, 
.form-row textarea {
    width: 100%;
    padding: 15px;
    background: #FFFFFF;
    border: 1px solid #CCC;
    border-radius: 3px;
    font-size: 1rem;
    color: #333;
    box-sizing: border-box;
}

.form-row textarea {
    resize: vertical; 
    min-height: 190px;
}

.form-row input:focus, 
.form-row textarea:focus {
    outline: none;
    border-color: #888;
}

/* --- Radio Grid & Animated Fields --- */
.form-radio-grid {
    display: grid;
    /* Forces exactly 2 columns of equal width */
    grid-template-columns: repeat(2, 1fr); 
    /* 10px vertical gap, 20px horizontal gap between items */
    gap: 10px 20px; 
    background: #f0f0f0;
    padding: 15px;
    border-radius: 3px;
}

/* Individual Item Wrapper - Fixes the "sloppy" vertical alignment */
.radio-item {
    display: flex;
    align-items: center; 
    cursor: pointer;
}

/* The Radio Dot - Forces the 15px separation */
.radio-item input[type="radio"] {
    margin: 0 15px 0 0; /* Strict 15px gap to the right */
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0; /* Prevents dot from squishing */
}

/* Label text */
.radio-item span {
    font-size: 0.95rem;
    color: #333;
    line-height: 1.2; /* Allows for slightly more breathing room if text wraps */
}

/* --- Radio Grid & Animated Fields --- */
/* (Keep your working .form-radio-grid, .radio-item, etc.) */

.modal-animated-fields {
    display: flex !important; /* Must be flex for gap to work */
    flex-direction: column;
    gap: 8px !important; /* FIX #1: Forces the gap between Business Name and Website */
    
    /* Animation State */
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin-top: -15px;
    
    /* FIX #2: The Animation Rules */
    transition: 
        max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
        opacity 0.4s ease,
        margin-top 0.4s ease;
}

.modal-animated-fields.visible {
    max-height: 300px; /* Increased to ensure no clipping */
    opacity: 1;
    margin-top: 0px !important; /* Gap between the Radio Grid and the first field */
}

/* --- Viewport Logic --- */

/* #1 Desktop (min-width 974) */
@media (min-width: 974px) {
    .modal-card {
        width: 80%;
        flex: 0 0 80%;
    }
    .modal-header {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: start;
    }
}

/* #3 Mobile Landscape (max-width 973 AND max-height 480) */
@media (max-width: 973px) and (max-height: 480px) {
    .modal-card {
        width: 90%;
        flex: 0 0 90%;
        height: 105vh;
        overflow-y: auto;
        padding: 20px;
        transform: scale(0.85);
    }

    .form-row {
        flex-direction: row; 
        gap: 10px;
    }
}

/* #4 Mobile Portrait (max-width 973 AND min-height 481) */
@media (max-width: 973px) and (min-height: 481px) {
    .modal-card {
        width: 90%;
        flex: 0 0 90%; 
        padding: 25px;
    }
    
    .form-row:not(.form-footer) {
        flex-direction: column;
            }
}

/* --- Viewport Logic Mobile 973 --- */
@media (max-width: 973px) {
    .modal-header {
        margin-bottom: 8px;
    }

    /* Targeting the correct wrapper */
    .modal-buy-now-wrapper {
        display: flex;
        flex-direction: row; /* Button first, Text second */
        justify-content: flex-start; 
        align-items: center; /* Vertically centered relative to the button */
        gap: 10px;
        margin-top: 5px; /* Slight breathing room from the title above it */
    }

    /* Ensure the 'Coming Soon' text doesn't have stray margins */
    .modal-buy-now-wrapper span, 
    .modal-buy-now-wrapper p {
        margin: 0;
        font-size: 0.9rem;
        line-height: 1;
    }

    /* Reclaim vertical space */
    .form-radio-grid {
        margin-bottom: 5px !important;
    }

    /* General padding reduction for mobile rows */
    .form-row input, 
    .form-row textarea {
        padding: 10px;
        font-size:0.9em;
    }
     .form-row textarea {
    resize: vertical; 
    min-height: 150px;
    }
}

/* --- Submit Button & Turnstile --- */
.turnstile-container {
    flex: 0 1 auto;
}

.submit-btn {
    background: #333;
    color: #FFF;
    border: none;
    padding: 16px 30px; /* Wider padding for the side-by-side look */
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap; /* Prevent button text wrapping */
}

.submit-btn:hover {
    background: #000;
}
.sent-success {
    background-color: #28a745 !important;
}