.swarm-add-to-quote { margin-left: .5rem; }

/* Single-product purchase actions. The archive-page quote button is deliberately
 * disabled so customers open the product before requesting a quote. */
.single-product .swarm-product-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
    clear: both;
    margin-top: 1rem;
}

.single-product .swarm-product-actions .single_add_to_cart_button,
.single-product .swarm-product-actions .swarm-add-to-quote--single,
.single-product .swarm-product-actions .single_add_to_cart_button:hover,
.single-product .swarm-product-actions .swarm-add-to-quote--single:hover,
.single-product .swarm-product-actions .single_add_to_cart_button:focus,
.single-product .swarm-product-actions .swarm-add-to-quote--single:focus,
.single-product .swarm-product-actions .single_add_to_cart_button:active,
.single-product .swarm-product-actions .swarm-add-to-quote--single:active {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    min-height: 60px;
    margin: 0 !important;
    padding: .85rem 1.25rem !important;
    border-radius: 6px !important;
    font-weight: 700;
    line-height: 1.2 !important;
    text-align: center;
    text-decoration: none;
    transform: none !important;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease !important;
}

.single-product .swarm-product-actions .single_add_to_cart_button,
.single-product .swarm-product-actions .single_add_to_cart_button:hover,
.single-product .swarm-product-actions .single_add_to_cart_button:focus,
.single-product .swarm-product-actions .single_add_to_cart_button:active {
    background: #f4c722 !important;
    border: 2px solid #f4c722 !important;
    color: #111827 !important;
}

.single-product .swarm-product-actions .single_add_to_cart_button:hover,
.single-product .swarm-product-actions .single_add_to_cart_button:focus {
    background: #e4b916 !important;
    border-color: #e4b916 !important;
}

.single-product .swarm-product-actions .swarm-add-to-quote--single,
.single-product .swarm-product-actions .swarm-add-to-quote--single:hover,
.single-product .swarm-product-actions .swarm-add-to-quote--single:focus,
.single-product .swarm-product-actions .swarm-add-to-quote--single:active {
    background: #ffffff !important;
    border: 2px solid #111827 !important;
    color: #111827 !important;
}

.single-product .swarm-product-actions .swarm-add-to-quote--single:hover,
.single-product .swarm-product-actions .swarm-add-to-quote--single:focus {
    background: #f3f4f6 !important;
}

.single-product .swarm-product-actions .single_add_to_cart_button::before,
.single-product .swarm-product-actions .single_add_to_cart_button::after,
.single-product .swarm-product-actions .swarm-add-to-quote--single::before,
.single-product .swarm-product-actions .swarm-add-to-quote--single::after {
    content: none !important;
    display: none !important;
}

@media (max-width: 560px) {
    .single-product .swarm-product-actions {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* Quote page layout: override common theme content/sidebar splits only on the
 * connector-created quote page. */
body.swarm-cms-quote-page #primary,
body.swarm-cms-quote-page .site-content .content-area,
body.swarm-cms-quote-page .site-content main.site-main {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    flex: 0 0 100% !important;
}

body.swarm-cms-quote-page #secondary,
body.swarm-cms-quote-page .site-content .widget-area,
body.swarm-cms-quote-page .site-content .sidebar {
    display: none !important;
}

.swarm-quote-request {
    box-sizing: border-box;
    width: 100%;
    max-width: 1280px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.swarm-quote-request h2 {
    margin-bottom: 1rem;
}

.swarm-quote-table {
    margin-bottom: 1.5rem;
}

.swarm-quote-table td,
.swarm-quote-table th {
    vertical-align: middle;
}

.swarm-quote-form {
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 18px;
    box-shadow: 0 14px 40px rgba(0,0,0,.08);
    padding: 1.5rem;
}

.swarm-quote-form .swarm-quote-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.25rem;
}

.swarm-quote-form .swarm-field-full {
    grid-column: 1 / -1;
}

.swarm-quote-form p {
    margin: 0;
}

.swarm-quote-form label {
    display: block;
    font-weight: 600;
    color: #1f2937;
}

.swarm-quote-form input,
.swarm-quote-form textarea,
.swarm-quote-form select {
    width: 100%;
    max-width: none;
    margin-top: .4rem;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    padding: .8rem .9rem;
    background: #fff;
    line-height: 1.4;
}

.swarm-quote-form textarea {
    min-height: 110px;
    resize: vertical;
}

.swarm-quote-form small {
    display: block;
    margin-top: .35rem;
    color: #6b7280;
}

.swarm-quote-form .required {
    color: #b91c1c;
}

.swarm-quote-form .swarm-quote-submit {
    margin-top: 1.25rem;
}

.swarm-quote-form .swarm-quote-submit button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    width: 100%;
    border-radius: 10px !important;
    padding: .95rem 1.25rem;
    font-weight: 700;
    background: #f4c722 !important;
    border-color: #f4c722 !important;
    color: #111827 !important;
}

.swarm-quote-form .swarm-quote-submit button:hover,
.swarm-quote-form .swarm-quote-submit button:focus,
.swarm-quote-form .swarm-quote-submit button:active {
    border-radius: 10px !important;
    background: #e4b916 !important;
    border-color: #e4b916 !important;
    color: #111827 !important;
}

.swarm-quote-form .swarm-quote-submit button.is-loading {
    cursor: wait;
    opacity: .86;
}

.swarm-quote-spinner {
    display: none;
    width: 1.05em;
    height: 1.05em;
    flex: 0 0 auto;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: swarm-quote-spin .7s linear infinite;
}

.swarm-quote-submit-loading-label {
    display: none;
}

.swarm-quote-submit button.is-loading .swarm-quote-spinner,
.swarm-quote-submit button.is-loading .swarm-quote-submit-loading-label {
    display: inline-block;
}

.swarm-quote-submit button.is-loading .swarm-quote-submit-label {
    display: none;
}

@keyframes swarm-quote-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 720px) {
    .swarm-quote-form {
        padding: 1rem;
        border-radius: 14px;
    }

    .swarm-quote-form .swarm-quote-form-grid {
        grid-template-columns: 1fr;
    }
}


body.swarm-quote-modal-open {
    overflow: hidden;
}

.swarm-quote-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
}

.swarm-quote-modal.is-open {
    display: block;
}

.swarm-quote-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(3px);
}

.swarm-quote-modal__dialog {
    position: relative;
    width: min(92vw, 520px);
    margin: 10vh auto 0;
    background: #ffffff;
    color: #111827;
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.32);
    padding: 1.5rem 1.5rem 1.35rem;
}

.swarm-quote-modal__close {
    position: absolute;
    top: .8rem;
    right: .8rem;
    width: 40px;
    height: 40px;
    border: 0;
    background: #f3f4f6;
    color: #374151;
    border-radius: 999px;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

.swarm-quote-modal__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 999px;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(34, 197, 94, 0.28);
    margin-bottom: 1rem;
}

.swarm-quote-modal__title {
    margin: 0 0 .45rem;
    font-size: 1.6rem;
    line-height: 1.2;
    color: #111827;
}

.swarm-quote-modal__message,
.swarm-quote-modal__meta {
    margin: 0;
    color: #4b5563;
}

.swarm-quote-modal__meta {
    margin-top: .65rem;
    font-weight: 600;
    color: #111827;
}

.swarm-quote-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 1.35rem;
}

.swarm-quote-modal__button {
    flex: 1 1 220px;
    min-height: 48px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 999px !important;
    font-weight: 700;
    text-decoration: none;
}

.swarm-quote-modal__button--secondary {
    background: #f3f4f6 !important;
    color: #111827 !important;
    border: 1px solid #d1d5db !important;
}

.swarm-quote-modal__button--primary {
    background: #111827 !important;
    color: #ffffff !important;
    border: 1px solid #111827 !important;
}

@media (max-width: 640px) {
    .swarm-quote-modal__dialog {
        width: min(94vw, 520px);
        margin-top: 6vh;
        padding: 1.2rem 1rem 1rem;
        border-radius: 18px;
    }

    .swarm-quote-modal__title {
        font-size: 1.35rem;
    }

    .swarm-quote-modal__actions {
        flex-direction: column;
    }
}


/* Stabilise popup button alignment across themes and on hover/focus states. */
.swarm-quote-modal__button,
.swarm-quote-modal__button:hover,
.swarm-quote-modal__button:focus,
.swarm-quote-modal__button:active {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    min-height: 48px;
    padding: .95rem 1.4rem !important;
    line-height: 1.2 !important;
    white-space: normal;
    word-break: normal;
    transform: none !important;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease !important;
}

.swarm-quote-modal__button::before,
.swarm-quote-modal__button::after,
.swarm-quote-modal__button:hover::before,
.swarm-quote-modal__button:hover::after,
.swarm-quote-modal__button:focus::before,
.swarm-quote-modal__button:focus::after {
    content: none !important;
    display: none !important;
}

.swarm-quote-modal__button--secondary:hover,
.swarm-quote-modal__button--secondary:focus {
    background: #e5e7eb !important;
    color: #111827 !important;
    border-color: #cbd5e1 !important;
}

.swarm-quote-modal__button--primary:hover,
.swarm-quote-modal__button--primary:focus {
    background: #1f2937 !important;
    color: #ffffff !important;
    border-color: #1f2937 !important;
}


/* Keep standard quote form controls compact and consistent. */
.swarm-quote-form input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
.swarm-quote-form select {
    box-sizing: border-box;
    height: 40px;
    min-height: 40px;
    padding: .45rem .75rem;
}

.swarm-quote-form .swarm-quote-item-qty {
    width: 88px !important;
    max-width: 88px !important;
    margin-top: 0;
}


/* Structured shipping address block on the quote form. */
.swarm-quote-form .swarm-address-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1rem 1.25rem;
}

.swarm-quote-form .swarm-address-grid p {
    grid-column: span 3;
}

.swarm-quote-form .swarm-address-grid .swarm-address-street {
    grid-column: 1 / -1;
}

.swarm-quote-form .swarm-address-grid p:nth-child(n+4) {
    grid-column: span 2;
}

.swarm-quote-form input[readonly] {
    background: #f8fafc;
    color: #374151;
}

@media (max-width: 720px) {
    .swarm-quote-form .swarm-address-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .swarm-quote-form .swarm-address-grid p,
    .swarm-quote-form .swarm-address-grid .swarm-address-street,
    .swarm-quote-form .swarm-address-grid p:nth-child(n+4) {
        grid-column: 1;
    }
}


/* Single-product quote button: match the requested clean outlined control and
 * prevent theme button rules from changing its geometry. */
.single-product .swarm-product-actions .swarm-add-to-quote--single,
.single-product .swarm-product-actions .swarm-add-to-quote--single:hover,
.single-product .swarm-product-actions .swarm-add-to-quote--single:focus,
.single-product .swarm-product-actions .swarm-add-to-quote--single:active {
    box-sizing: border-box !important;
    min-height: 60px !important;
    padding: 0 24px !important;
    border: 2px solid #111111 !important;
    border-radius: 6px !important;
    background: #ffffff !important;
    color: #111111 !important;
    box-shadow: none !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    line-height: 1.2 !important;
    appearance: none;
    -webkit-appearance: none;
}

.single-product .swarm-product-actions .swarm-add-to-quote--single:hover,
.single-product .swarm-product-actions .swarm-add-to-quote--single:focus {
    background: #f7f7f7 !important;
    border-color: #111111 !important;
    color: #111111 !important;
}


/* Quote submission processing and completion states. */
.swarm-quote-modal__spinner {
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 3px solid rgba(255,255,255,.45);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: swarm-quote-spin .75s linear infinite;
}

.swarm-quote-modal.is-processing .swarm-quote-modal__icon {
    background: linear-gradient(135deg, #f4c722, #e0ac00);
    box-shadow: 0 10px 24px rgba(244, 199, 34, .3);
}

.swarm-quote-modal.is-processing .swarm-quote-modal__dialog {
    cursor: wait;
}

.swarm-quote-modal.is-error .swarm-quote-modal__icon {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    box-shadow: 0 10px 24px rgba(239, 68, 68, .25);
}

.swarm-quote-empty {
    padding: 1rem 0;
    font-weight: 600;
}
