/* ============================================================
   Quote Request Plugin – Frontend Styles
   ============================================================ */

/* ── Add to Quote Button ─────────────────────────────────── */
.qr-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1a3a5c;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.2s, transform 0.15s;
    font-family: inherit;
}
.qr-add-btn:hover { background: #245082; transform: translateY(-1px); }
.qr-add-btn.qr-adding { opacity: .7; pointer-events: none; }
.qr-add-btn.qr-added  { background: #27ae60; }

.qr-btn-loop {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 4px;
    justify-content: center;
}

/* ── Floating Widget ──────────────────────────────────────── */
#qr-widget {
    position: fixed;
    bottom: 28px;
    left: 24px;
    z-index: 99999;
    font-family: 'Segoe UI', Arial, sans-serif;
    direction: rtl;
}

/* Bubble */
#qr-bubble {
    width: 56px;
    height: 56px;
    background: #1a3a5c;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,.25);
    transition: transform 0.2s, background 0.2s;
    position: relative;
}
#qr-bubble:hover { background: #245082; transform: scale(1.08); }

#qr-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    transition: transform 0.3s;
}
#qr-count.bump { transform: scale(1.4); }

/* Pulse animation when has items */
#qr-widget.has-items #qr-bubble::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid #1a3a5c;
    animation: qr-pulse 2s ease-out infinite;
    opacity: 0;
}
@keyframes qr-pulse {
    0%   { transform: scale(1); opacity: .6; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* Panel */
#qr-panel {
    position: absolute;
    bottom: 68px;
    left: 0;
    width: 320px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
    overflow: hidden;
    transform: translateY(10px) scale(.95);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(.4,0,.2,1);
}
#qr-panel.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* Panel header */
.qr-panel-header {
    background: #1a3a5c;
    color: #fff;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#qr-close-panel {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    opacity: .7;
    transition: opacity .15s;
}
#qr-close-panel:hover { opacity: 1; }

/* Items list */
#qr-items-list {
    max-height: 280px;
    overflow-y: auto;
    padding: 8px 0;
}
.qr-empty { padding: 20px; text-align: center; color: #999; font-size: 13px; margin: 0; }

.qr-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
    transition: background .15s;
}
.qr-item:last-child { border-bottom: none; }
.qr-item:hover { background: #fafafa; }
.qr-item img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #eee;
    flex-shrink: 0;
}
.qr-item-info { flex: 1; min-width: 0; }
.qr-item-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #222;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 6px;
}
.qr-qty-wrap { display: flex; align-items: center; gap: 4px; }
.qr-qty-btn {
    width: 24px;
    height: 24px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    flex-shrink: 0;
}
.qr-qty-btn:hover { background: #f0f0f0; }
.qr-qty-input {
    width: 40px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 2px 4px;
    font-size: 13px;
}
.qr-remove-item {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    opacity: .5;
    transition: opacity .15s;
    padding: 0;
    margin-right: 4px;
}
.qr-remove-item:hover { opacity: 1; }

/* Panel footer */
.qr-panel-footer { padding: 12px 14px; background: #f7f9fc; border-top: 1px solid #eee; }
.qr-goto-btn {
    display: block;
    background: #27ae60;
    color: #fff;
    text-align: center;
    padding: 10px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    transition: background .2s;
}
.qr-goto-btn:hover { background: #219a52; color: #fff; }

/* Toast notification */
#qr-toast {
    position: fixed;
    bottom: 100px;
    left: 24px;
    background: #1a3a5c;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 999999;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s;
    pointer-events: none;
    direction: rtl;
}
#qr-toast.show { transform: translateY(0); opacity: 1; }

/* ── Quote Form Page ──────────────────────────────────────── */
.qr-form-wrap { direction: rtl; max-width: 800px; }
.qr-form-wrap h2 {
    font-size: 20px;
    color: #1a3a5c;
    border-bottom: 2px solid #1a3a5c;
    padding-bottom: 8px;
    margin: 24px 0 16px;
}

.qr-products-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 32px;
}
.qr-products-table th {
    background: #1a3a5c;
    color: #fff;
    padding: 10px 14px;
    text-align: right;
}
.qr-products-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #eee;
}
.qr-products-table tr:last-child td { border-bottom: none; }
.qr-products-table a { color: #1a3a5c; text-decoration: none; font-weight: 600; }

.qr-contact-form { max-width: 680px; }
.qr-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.qr-field { display: flex; flex-direction: column; gap: 6px; }
.qr-field label { font-weight: 600; font-size: 14px; color: #333; }
.qr-field input, .qr-field textarea {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color .2s;
    width: 100%;
    box-sizing: border-box;
}
.qr-field input:focus, .qr-field textarea:focus {
    outline: none;
    border-color: #1a3a5c;
    box-shadow: 0 0 0 3px rgba(26,58,92,.1);
}
.qr-field { margin-bottom: 16px; }

.qr-submit-btn {
    background: #1a3a5c;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background .2s, transform .15s;
    font-family: inherit;
    margin-top: 8px;
}
.qr-submit-btn:hover { background: #245082; transform: translateY(-1px); }

/* Notices */
.qr-notice {
    padding: 20px 24px;
    border-radius: 8px;
    margin-bottom: 24px;
}
.qr-notice-success { background: #e8f5e9; border: 1px solid #a5d6a7; color: #2e7d32; }
.qr-notice-info    { background: #e3f2fd; border: 1px solid #90caf9; color: #1565c0; }
.qr-notice-error   { background: #ffebee; border: 1px solid #ef9a9a; color: #c62828; }
.qr-notice h3      { margin: 0 0 8px; }
.qr-notice a       { color: inherit; font-weight: bold; }

/* Responsive */
@media (max-width: 600px) {
    .qr-field-row { grid-template-columns: 1fr; }
    #qr-panel { width: 290px; left: -10px; }
    #qr-widget { bottom: 16px; left: 16px; }
}

/* ── Download PDF Button ─────────────────────────────────── */
.qr-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: transparent;
    color: #2E8B7A;
    border: 2px solid #2E8B7A;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    text-decoration: none;
}
.qr-download-btn:hover {
    background: #2E8B7A;
    color: #fff;
}
.qr-download-btn.qr-loading {
    opacity: .65;
    pointer-events: none;
}
.qr-download-btn:disabled {
    opacity: .65;
    cursor: not-allowed;
}

/* Widget panel download btn */
#qr-download-widget-btn {
    display: block;
    width: 100%;
    margin-top: 8px;
    justify-content: center;
    font-size: 12px;
    padding: 7px 12px;
    border-radius: 5px;
}

/* Section header with download button */
.qr-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin: 24px 0 12px;
}
.qr-section-header h2 {
    margin: 0;
    border-bottom: none;
}

/* ── Qty controls inside the form table ─────────────────── */
.qr-qty-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.qr-qty-inline .qr-qty-input {
    width: 52px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 13px;
}
.qr-qty-inline .qr-qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    background: #f5f5f5;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    flex-shrink: 0;
}
.qr-qty-inline .qr-qty-btn:hover { background: #e0e0e0; }

/* Fix: SKU column min-width */
.qr-products-table td:nth-child(2),
.qr-products-table th:nth-child(2) {
    min-width: 90px;
}

/* ── Clear cart button ───────────────────────────────────── */
.qr-clear-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    color: #c0392b;
    border: 1px solid #e74c3c;
    border-radius: 5px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    width: 100%;
    justify-content: center;
    margin-top: 6px;
}
.qr-clear-btn:hover { background: #e74c3c; color: #fff; }

.qr-panel-footer-btns {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}
.qr-panel-footer-btns .qr-download-btn {
    width: 100%;
    justify-content: center;
    font-size: 12px;
    padding: 7px 12px;
}
