:root {
    --hafa-primary: #303E8C;
    --hafa-dark: #151D26;
    --hafa-light: #A3BAD9;
    --hafa-bg: #F2F2F2;
}

/* ── Add to Quote button ─────────────────────────────────────────────── */
.hafa-add-to-quote-btn {
    background: var(--hafa-primary) !important;
    color: #fff !important;
    border: none !important;
    padding: 12px 28px !important;
    border-radius: 7px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    transition: background .2s !important;
    margin-top: 16px !important;
}
.hafa-add-to-quote-btn:hover { background: var(--hafa-dark) !important; }

/* ── Quote badge ─────────────────────────────────────────────────────── */
.hafa-quote-badge-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: inherit;
    font-size: 18px;
}
.hafa-quote-count {
    background: #e07b39;
    color: #fff;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

/* ── Modal ────────────────────────────────────────────────────────────── */
.hafa-quote-modal { position: fixed; inset: 0; z-index: 99999; }
.hafa-quote-modal__backdrop { position: absolute; inset: 0; background: rgba(21,29,38,.7); }
.hafa-quote-modal__panel {
    position: relative; z-index: 1; background: #fff; max-width: 460px;
    margin: 6vh auto; border-radius: 12px; max-height: 88vh; overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.hafa-quote-modal__close {
    position: absolute; top: 12px; right: 16px; background: none; border: none;
    font-size: 28px; line-height: 1; color: #999; cursor: pointer; z-index: 2;
}
.hafa-quote-modal__close:hover { color: var(--hafa-dark); }
.hafa-quote-modal__body { padding: 0 0 24px; }
.hafa-quote-modal__image {
    background: var(--hafa-bg); height: 200px; display: flex;
    align-items: center; justify-content: center; border-radius: 12px 12px 0 0; overflow: hidden;
}
.hafa-quote-modal__image img { max-width: 100%; max-height: 100%; object-fit: contain; }
.hafa-quote-modal__info { padding: 20px 24px 0; }
.hafa-quote-modal__info h3 { font-size: 18px; color: var(--hafa-dark); margin: 0 0 4px; }
.hafa-quote-modal__supplier { font-size: 13px; color: var(--hafa-primary); font-weight: 600; margin: 0 0 16px; }

.hafa-quote-modal__attr-group { margin-bottom: 16px; }
.hafa-quote-modal__attr-group label { display: block; font-size: 12px; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.hafa-attr-options { display: flex; flex-wrap: wrap; gap: 8px; }
.hafa-attr-pill {
    border: 1.5px solid #e5e7eb; background: #fff; color: #374151;
    padding: 6px 16px; border-radius: 20px; font-size: 13px; cursor: pointer; transition: all .15s;
}
.hafa-attr-pill.active { background: var(--hafa-primary); border-color: var(--hafa-primary); color: #fff; }
.hafa-attr-pill:hover:not(.active) { border-color: var(--hafa-primary); color: var(--hafa-primary); }

.hafa-quote-modal__qty-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.hafa-quote-modal__qty-row label { font-size: 13px; font-weight: 600; color: var(--hafa-dark); }
.hafa-qty-control { display: flex; align-items: center; border: 1.5px solid #e5e7eb; border-radius: 8px; overflow: hidden; }
.hafa-qty-btn { background: var(--hafa-bg); border: none; width: 36px; height: 36px; font-size: 18px; cursor: pointer; color: var(--hafa-dark); }
.hafa-qty-btn:hover { background: var(--hafa-light); }
#hqmQty { width: 50px; text-align: center; border: none; border-left: 1px solid #e5e7eb; border-right: 1px solid #e5e7eb; height: 36px; font-size: 14px; -moz-appearance: textfield; }
#hqmQty::-webkit-outer-spin-button, #hqmQty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.hafa-quote-modal__confirm {
    width: 100%; background: var(--hafa-primary); color: #fff; border: none;
    padding: 13px; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; transition: background .2s;
}
.hafa-quote-modal__confirm:hover { background: var(--hafa-dark); }
.hafa-quote-modal__feedback { text-align: center; margin-top: 10px; font-size: 13px; min-height: 18px; }
.hafa-quote-modal__feedback.success { color: #166534; font-weight: 600; }

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

/* ── My Quote List page ──────────────────────────────────────────────── */
.hafa-quote-list-page { max-width: 900px; margin: 40px auto; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
.hafa-quote-list-page h1 { color: var(--hafa-dark); font-size: 24px; margin-bottom: 6px; }
.hafa-quote-list-page .ql-subtitle { color: #6b7280; font-size: 14px; margin-bottom: 24px; }

.hafa-quote-empty { text-align: center; padding: 60px 20px; background: var(--hafa-bg); border-radius: 12px; color: #6b7280; }
.hafa-quote-empty a { color: var(--hafa-primary); font-weight: 600; text-decoration: none; }

.ql-item {
    display: flex; gap: 16px; align-items: center; padding: 16px;
    border: 1px solid #e5e7eb; border-radius: 10px; margin-bottom: 12px; background: #fff;
}
.ql-item__img { width: 70px; height: 70px; background: var(--hafa-bg); border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ql-item__img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ql-item__info { flex: 1; min-width: 0; }
.ql-item__title { font-size: 15px; font-weight: 600; color: var(--hafa-dark); margin: 0 0 2px; }
.ql-item__supplier { font-size: 12px; color: var(--hafa-primary); margin: 0 0 4px; }
.ql-item__attrs { font-size: 12px; color: #6b7280; }
.ql-item__attrs span { background: var(--hafa-bg); padding: 2px 8px; border-radius: 10px; margin-right: 4px; display: inline-block; margin-bottom: 2px; }
.ql-item__qty { display: flex; align-items: center; border: 1.5px solid #e5e7eb; border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.ql-item__qty button { background: var(--hafa-bg); border: none; width: 30px; height: 30px; cursor: pointer; font-size: 16px; }
.ql-item__qty input { width: 42px; text-align: center; border: none; height: 30px; font-size: 13px; }
.ql-item__remove { background: none; border: none; color: #ef4444; cursor: pointer; font-size: 13px; flex-shrink: 0; padding: 8px; }
.ql-item__remove:hover { text-decoration: underline; }

.ql-summary { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; border-top: 2px solid var(--hafa-primary); margin-top: 12px; }
.ql-summary__count { font-size: 14px; color: var(--hafa-dark); font-weight: 600; }
.ql-clear-btn { background: none; border: 1px solid #e5e7eb; color: #6b7280; padding: 8px 16px; border-radius: 6px; cursor: pointer; font-size: 13px; }

.ql-form { background: var(--hafa-bg); border-radius: 12px; padding: 24px; margin-top: 24px; }
.ql-form h3 { color: var(--hafa-dark); margin-bottom: 16px; font-size: 16px; }
.ql-form .ql-field { margin-bottom: 14px; }
.ql-form label { display: block; font-size: 12px; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 5px; }
.ql-form input, .ql-form textarea {
    width: 100%; padding: 10px 12px; border: 1px solid #e5e7eb; border-radius: 7px;
    font-size: 14px; background: #fff; box-sizing: border-box; font-family: inherit;
}
.ql-form .ql-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.ql-submit-btn {
    width: 100%; background: var(--hafa-primary); color: #fff; border: none;
    padding: 14px; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 6px;
}
.ql-submit-btn:hover { background: var(--hafa-dark); }
.ql-submit-btn:disabled { opacity: .6; cursor: not-allowed; }
.ql-notice { padding: 14px 18px; border-radius: 8px; font-size: 14px; margin-bottom: 20px; }
.ql-notice.success { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.ql-notice.error { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }

@media (max-width: 600px) {
    .ql-item { flex-wrap: wrap; }
    .ql-form .ql-row-3 { grid-template-columns: 1fr; }
}
