/**
 * RW Get Quote - Modern Modal & Single Product Styles
 */

/* ==========================================================================
   Hide Availability, Quantity & Standard Add to Cart on Quote Products
   ========================================================================== */
body.rw-quote-product .availability,
body.rw-quote-product .stock-availability,
body.rw-quote-product .product-stock,
body.rw-quote-product .stock-status,
body.rw-quote-product .product-stock-status,
body.rw-quote-product .product_meta .availability,
body.rw-quote-product .summary .stock,
body.rw-quote-product .entry-summary .stock,
body.rw-quote-product p.stock,
body.rw-quote-product span.stock,
body.rw-quote-product [class*="availability"],
body.rw-quote-product [class*="product-stock"],
body.rw-quote-product .rw-hidden-availability {
    display: none !important;
}

/* Hide Quantity field completely */
body.rw-quote-product form.cart .quantity,
body.rw-quote-product .single_variation_wrap .quantity,
body.rw-quote-product .woocommerce-variation-add-to-cart .quantity,
body.rw-quote-product div.quantity,
body.rw-quote-product .quantity input.qty {
    display: none !important;
}

/* Hide the native Add to Cart button */
body.rw-quote-product form.cart .single_add_to_cart_button:not(.rw-quote-trigger),
body.rw-quote-product form.cart button.single_add_to_cart_button:not(.rw-quote-trigger),
body.rw-quote-product form.cart button[name="add-to-cart"]:not(.rw-quote-trigger),
body.rw-quote-product .woocommerce-variation-add-to-cart .single_add_to_cart_button:not(.rw-quote-trigger),
body.rw-quote-product .single_variation_wrap .single_add_to_cart_button:not(.rw-quote-trigger) {
    display: none !important;
}

/* Hide price and stock in product loops/cards if quote enabled */
.product.rw-quote-enabled .price,
.product.rw-quote-enabled .stock {
    display: none !important;
}

/* ==========================================================================
   Single Product "Get Quote" Action Button (Positioned Down)
   ========================================================================== */
.rw-single-quote-action {
    display: block;
    margin: 18px 0 !important;
    clear: both;
}

.rw-quote-trigger {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s ease-in-out;
}

.rw-btn-single {
    padding: 13px 30px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    border-radius: 30px !important;
    line-height: 1.4 !important;
    text-transform: none !important;
    box-shadow: none !important;
    outline: none !important;
    border: none !important;
}

.rw-btn-quote-icon {
    display: inline-flex;
    align-items: center;
    margin-right: 6px;
}

.rw-btn-loop {
    border-radius: 20px;
    font-size: 13px;
    padding: 8px 16px;
}

/* ==========================================================================
   Modal Overlay & Backdrop
   ========================================================================== */
.rw-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.rw-modal-overlay.rw-modal-open {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   Modal Container
   ========================================================================== */
.rw-modal-container {
    background: #ffffff;
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    border-radius: 14px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.28);
    overflow-y: auto;
    position: relative;
    padding: 32px 36px;
    transform: translateY(20px) scale(0.98);
    transition: transform 0.25s ease;
    box-sizing: border-box;
    font-family: inherit;
    color: #1e293b;
}

.rw-modal-overlay.rw-modal-open .rw-modal-container {
    transform: translateY(0) scale(1);
}

/* Close Button */
.rw-modal-close {
    position: absolute;
    top: 18px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
}

.rw-modal-close:hover {
    color: #0f172a;
    background: #f1f5f9;
}

/* ==========================================================================
   Modal Header & Product Preview
   ========================================================================== */
.rw-modal-header {
    margin-bottom: 20px;
    padding-right: 30px;
}

.rw-modal-title {
    margin: 0 0 6px !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    letter-spacing: -0.3px;
}

.rw-modal-subtitle {
    margin: 0 !important;
    font-size: 13.5px !important;
    color: #64748b !important;
    line-height: 1.4;
}

.rw-product-summary {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 24px;
}

.rw-product-thumb {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rw-product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rw-product-info {
    flex: 1;
    min-width: 0;
}

.rw-product-title {
    margin: 0 0 4px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    line-height: 1.3 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rw-product-sku {
    font-size: 12px;
    color: #64748b;
    display: block;
}

/* ==========================================================================
   Alert Notice Box
   ========================================================================== */
.rw-modal-notice {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.rw-modal-notice.rw-notice-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.rw-modal-notice.rw-notice-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* ==========================================================================
   Form Grid & Fields
   ========================================================================== */
.rw-form-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 24px;
}

.rw-field-group {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.rw-full-width {
    width: 100%;
}

.rw-half-width {
    width: calc(50% - 7px);
}

.rw-third-width {
    width: calc(33.333% - 10px);
}

.rw-field-group label {
    font-size: 13px !important;
    font-weight: 600 !important;
    margin-bottom: 6px !important;
    color: #334155 !important;
}

.rw-field-group label .required {
    color: #ef4444;
}

.rw-field-group label .optional {
    color: #94a3b8;
    font-weight: 400;
}

.rw-field-group input[type="text"],
.rw-field-group input[type="email"],
.rw-field-group input[type="tel"],
.rw-field-group input[type="number"],
.rw-field-group select,
.rw-field-group textarea {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 10px 14px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    background: #ffffff !important;
    color: #0f172a !important;
    outline: none !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
    box-shadow: none !important;
    height: auto !important;
}

.rw-field-group input:focus,
.rw-field-group select:focus,
.rw-field-group textarea:focus {
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
}

.rw-field-group textarea {
    resize: vertical;
    min-height: 70px;
}

/* ==========================================================================
   Submit Button & Spinner
   ========================================================================== */
.rw-form-actions {
    display: flex;
    justify-content: flex-end;
}

.rw-btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #0284c7;
    color: #ffffff;
    border: none;
    padding: 13px 28px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    min-width: 180px;
}

.rw-btn-submit:hover {
    background: #0369a1;
}

.rw-btn-submit:active {
    transform: translateY(1px);
}

.rw-btn-submit:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

/* Spinner */
.rw-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: rw-spin 0.7s linear infinite;
}

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

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */
@media (max-width: 600px) {
    .rw-modal-container {
        padding: 24px 20px;
    }
    .rw-half-width,
    .rw-third-width {
        width: 100%;
    }
    .rw-btn-submit {
        width: 100%;
    }
}
