/* =============================================================
   Horia – Quote Request  |  horia-quote.css
   Uses UiCore CSS variables from the theme
   ============================================================= */

/* ---------- Open button ---------- */
.horia-quote-open-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    margin-top: 12px;
    background-color: transparent;
    color: var(--uicore-primary-color, #0860A8);
    border: 2px solid var(--uicore-primary-color, #0860A8);
    border-radius: var(--ui-radius, 0);
    font-family: var(--uicore-primary-font-family, "Titillium Web"), sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    line-height: 1.4;
    margin-bottom: 10px;
}

.horia-quote-open-btn:hover,
.horia-quote-open-btn:focus-visible {
    background-color: var(--uicore-primary-color, #0860A8);
    color: var(--uicore-white-color, #fff);
    outline: none;
}

.horia-quote-open-btn svg { flex-shrink: 0; }

/* When injected directly after the WC checkout block button */
.wp-block-woocommerce-proceed-to-checkout + .horia-quote-open-btn {
    margin-top: 10px;
}

/* ---------- Overlay ---------- */
.horia-quote-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(7, 7, 7, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.horia-quote-overlay:not([hidden]) { opacity: 1; }
.horia-quote-overlay[hidden]        { display: none; }

/* ---------- Modal ---------- */
.horia-quote-modal {
    position: relative;
    background: var(--uicore-white-color, #fff);
    width: 100%;
    max-width: 980px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: var(--ui-radius, 0);
    box-shadow: 0 24px 64px rgba(7, 7, 7, 0.18);
    transform: translateY(24px);
    transition: transform 0.25s ease;

    scrollbar-width: thin;
    scrollbar-color: #c8d5e0 transparent;
}

.horia-quote-modal::-webkit-scrollbar       { width: 6px; }
.horia-quote-modal::-webkit-scrollbar-track  { background: transparent; }
.horia-quote-modal::-webkit-scrollbar-thumb  { background: #c8d5e0; border-radius: 99px; }
.horia-quote-modal::-webkit-scrollbar-thumb:hover { background: #9fb5c4; }

.horia-quote-overlay:not([hidden]) .horia-quote-modal {
    transform: translateY(0);
}

/* ---------- Modal header (sticky) ---------- */
.horia-quote-modal__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 20px 32px;
    background: #f9f9f9;
    position: sticky;
    top: 0;
    z-index: 1;
}

.horia-quote-close {
    margin-left: auto;
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--uicore-body-color, #596475);
    border-radius: var(--ui-radius-sm, 0);
    transition: color 0.15s ease, background 0.15s ease;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.horia-quote-close:hover {
    color: var(--uicore-dark-color, #070707);
    background: rgba(0,0,0,0.06);
}

.horia-quote-modal__header svg {
    color: var(--uicore-primary-color, #0860A8);
    flex-shrink: 0;
}

.horia-quote-modal__header h2 {
    margin: 0;
    font-family: var(--uicore-primary-font-family, "Titillium Web"), sans-serif;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--uicore-headline-color, #070707);
    line-height: 1.2;
}

/* ---------- Body ---------- */
.horia-quote-modal__body {
    padding: 28px 32px 32px;
}

/* ---------- Sections ---------- */
.horia-quote-section { margin-bottom: 28px; }
.horia-quote-section:last-child { margin-bottom: 0; }

.horia-quote-section__titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--ui-border-color, #ebebeb);
    margin-bottom: 14px;
}

.horia-quote-section__title {
    margin: 0;
    font-family: var(--uicore-primary-font-family, "Titillium Web"), sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #000000;
}

.horia-quote-section > .horia-quote-section__title {
    padding-bottom: 8px;
    border-bottom: 1px solid var(--ui-border-color, #ebebeb);
    margin-bottom: 14px;
    display: block;
}

/* ---------- Summary toggle button ---------- */
.hq-summary-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: var(--uicore-text-font-family, "Fira Sans"), sans-serif;
    font-size: 14px;
    color: var(--uicore-primary-color, #0860A8);
    transition: opacity 0.15s ease;
    white-space: nowrap;
}

.hq-summary-toggle:hover { opacity: 0.75; }

.hq-summary-toggle__icon {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.hq-summary-toggle[aria-expanded="false"] .hq-summary-toggle__icon {
    transform: rotate(180deg);
}

/* ---------- Cart summary ---------- */
.horia-quote-cart-summary {
    border: 1px solid var(--ui-border-color, #ebebeb);
    transition: none;
}

.horia-quote-cart-summary[hidden] { display: none; }

.horia-quote-loading {
    padding: 20px;
    text-align: center;
    color: var(--uicore-body-color, #596475);
    font-family: var(--uicore-text-font-family, "Fira Sans"), sans-serif;
    font-size: 14px;
}

/* Cart table */
.hq-cart-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--uicore-text-font-family, "Fira Sans"), sans-serif;
    font-size: 14px;
}

.hq-cart-table thead tr { background: #f4f4f4; }

.hq-cart-table thead th {
    padding: 10px 12px;
    text-align: left;
    font-family: var(--uicore-primary-font-family, "Titillium Web"), sans-serif;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--uicore-body-color, #596475);
    border-bottom: 1px solid var(--ui-border-color, #ebebeb);
}

.hq-cart-table thead th:last-child { text-align: right; }
.hq-cart-table thead th:nth-child(2),
.hq-cart-table tbody td:nth-child(2) { text-align: center; }

.hq-cart-table tbody tr { border-bottom: 1px solid var(--ui-border-color, #ebebeb); }
.hq-cart-table tbody tr:nth-child(even) { background: #fafafa; }

.hq-cart-table tbody td {
    padding: 10px 12px;
    vertical-align: middle;
    color: var(--uicore-body-color, #596475);
}

.hq-product-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hq-product-img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--ui-border-color, #ebebeb);
}

.hq-product-name {
    font-weight: 600;
    color: var(--uicore-dark-color, #070707);
    font-family: var(--uicore-primary-font-family, "Titillium Web"), sans-serif;
}

.hq-product-sku {
    font-size: 12px;
    color: var(--uicore-body-color, #596475);
    display: block;
}

.hq-qty-input {
    width: 64px;
    padding: 6px 8px;
    border: 1px solid var(--ui-border-color, #ebebeb);
    border-radius: var(--ui-radius-sm, 0);
    text-align: center;
    font-size: 14px;
    font-family: var(--uicore-text-font-family, "Fira Sans"), sans-serif;
    color: var(--uicore-dark-color, #070707);
    background: var(--uicore-white-color, #fff);
    transition: border-color 0.15s ease;
}

.hq-qty-input:focus {
    border-color: var(--uicore-primary-color, #0860A8);
    outline: none;
}

.hq-price-cell {
    text-align: right;
    font-weight: 500;
    color: #070707;
    white-space: nowrap;
}

.hq-price-est {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: var(--uicore-body-color, #596475);
    letter-spacing: 0.02em;
}

/* Total row */
.hq-cart-total {
    background: #f4f4f4 !important;
    border-top: 1px solid var(--ui-border-color, #ebebeb);
}

.hq-cart-total td {
    padding: 12px !important;
    font-weight: 700;
    color: var(--uicore-dark-color, #070707);
    font-family: var(--uicore-primary-font-family, "Titillium Web"), sans-serif;
}

.hq-cart-total td:last-child {
    text-align: right !important;
    color: #070707;
    font-size: 15px;
    font-weight: 700;
}

.hq-disclaimer {
    padding: 8px 12px;
    font-size: 12px;
    color: var(--uicore-body-color, #596475);
    font-style: italic;
    font-family: var(--uicore-text-font-family, "Fira Sans"), sans-serif;
    border-top: 1px solid var(--ui-border-color, #ebebeb);
}

/* ---------- Form ---------- */

.hq-row {
    display: flex;
    gap: 14px;
    margin-bottom: 14px;
    align-items: flex-end;
}

.hq-row:last-child { margin-bottom: 0; }

.hq-row > .horia-quote-field { flex: 1; min-width: 0; }

.hq-row--20-40-40 > .horia-quote-field:nth-child(1) { flex: 0 0 20%; }
.hq-row--20-40-40 > .horia-quote-field:nth-child(2) { flex: 0 0 calc(40% - 9px); }
.hq-row--20-40-40 > .horia-quote-field:nth-child(3) { flex: 1; }

.hq-row--50-50 > .horia-quote-field { flex: 1; }

@media (max-width: 640px) {
    .hq-row          { flex-wrap: wrap; }
    .hq-row > .horia-quote-field,
    .hq-row--20-40-40 > .horia-quote-field,
    .hq-row--50-50 > .horia-quote-field { flex: 0 0 100%; }
}

.horia-quote-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.horia-quote-field label {
    font-family: var(--uicore-primary-font-family, "Titillium Web"), sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--uicore-dark-color, #070707);
    letter-spacing: 0.02em;
}

.horia-quote-field label .required {
    color: #c0392b;
    margin-left: 2px;
}

.horia-quote-field input,
.horia-quote-field select,
.horia-quote-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--ui-border-color, #ebebeb);
    border-radius: var(--ui-radius-sm, 0);
    font-size: 14px;
    font-family: var(--uicore-text-font-family, "Fira Sans"), sans-serif;
    color: var(--uicore-dark-color, #070707);
    background: var(--uicore-white-color, #fff);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    line-height: 1.5;
    height: auto;
    min-height: 42px;
}

.horia-quote-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23596475' d='M0 0l6 8 6-8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding: 10px 32px 10px 12px;
    cursor: pointer;
}

.horia-quote-field textarea {
    resize: vertical;
    min-height: 90px;
}

.horia-quote-field input:focus,
.horia-quote-field select:focus,
.horia-quote-field textarea:focus {
    border-color: var(--uicore-primary-color, #0860A8);
    box-shadow: 0 0 0 3px rgba(8, 96, 168, 0.1);
    outline: none;
}

.horia-quote-field input.hq-error,
.horia-quote-field select.hq-error,
.horia-quote-field textarea.hq-error {
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.08);
}

/* Feedback message */
.horia-quote-message {
    margin-top: 20px;
    padding: 14px 16px;
    border-radius: var(--ui-radius-sm, 0);
    font-family: var(--uicore-text-font-family, "Fira Sans"), sans-serif;
    font-size: 14px;
    line-height: 1.5;
    border-left: 4px solid;
}

.horia-quote-message[hidden]      { display: none; }
.horia-quote-message--success     { background: #f0faf4; color: #155724; border-color: #27ae60; }
.horia-quote-message--error       { background: #fdf0f0; color: #721c24; border-color: #c0392b; }

/* Form footer */
.horia-quote-form__footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--ui-border-color, #ebebeb);
}

/* Submit button */
.horia-quote-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--uicore-primary-color, #0860A8);
    color: var(--uicore-white-color, #fff);
    border: none;
    border-radius: var(--ui-radius, 0);
    font-family: var(--uicore-primary-font-family, "Titillium Web"), sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.horia-quote-submit-btn:hover     { background: #064f8c; }
.horia-quote-submit-btn:active    { transform: scale(0.98); }
.horia-quote-submit-btn:disabled  { opacity: 0.65; cursor: not-allowed; transform: none; }

/* ---------- Status badges ---------- */
.horia-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    font-family: var(--uicore-primary-font-family, "Titillium Web"), sans-serif;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.horia-badge--pending  { background: #fff3cd; color: #856404; }
.horia-badge--sent     { background: #cfe2ff; color: #084298; }
.horia-badge--accepted { background: #d1e7dd; color: #0a3622; }
.horia-badge--refused  { background: #f8d7da; color: #842029; }

/* =============================================================
   My Account – Quote cards  (.haq-*)
   ============================================================= */

.horia-account-quotes {
    font-family: var(--uicore-text-font-family, "Fira Sans"), sans-serif;
    font-size: 14px;
    color: var(--uicore-body-color, #596475);
}

/* Header */
.haq-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e4ea;
}

.haq-header__title {
    display: flex;
    align-items: center;
    margin: 0;
    font-size: 20px !important;
    font-weight: 600;
    margin: 0 0 6px;
    color: #1a1a2e;
}

.haq-header__title svg {
    color: var(--uicore-primary-color, #0860A8);
    flex-shrink: 0;
}

.haq-count {
    font-family: var(--uicore-primary-font-family, "Titillium Web"), sans-serif;
    font-size: 12px;
    font-weight: 600;
    background: #e8f1fa;
    color: var(--uicore-primary-color, #0860A8);
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.03em;
}

/* Cards wrapper */
.haq-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Individual card */
.haq-card {
    background: var(--uicore-white-color, #fff);
    border: 1px solid var(--ui-border-color, #ebebeb);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.haq-card:hover {
    box-shadow: 0 2px 12px rgba(8, 96, 168, 0.07);
}

/* Card head */
.haq-card__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: #fafafa;
    border-bottom: 1px solid var(--ui-border-color, #ebebeb);
}

.haq-card__number {
    font-family: var(--uicore-primary-font-family, "Titillium Web"), sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--uicore-dark-color, #070707);
    letter-spacing: 0.02em;
}

.haq-card__date {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--uicore-body-color, #596475);
}

.haq-card__date svg { flex-shrink: 0; }

.haq-card__spacer { flex: 1; }

/* Card body */
.haq-card__body {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    padding: 14px 18px;
}

/* Products column */
.haq-products {
    flex: 1;
    min-width: 0;
}

/* Column label */
.haq-col-label {
    font-family: var(--uicore-primary-font-family, "Titillium Web"), sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--uicore-body-color, #596475);
    margin-bottom: 8px;
}

/* Single product row */
.haq-product {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid var(--ui-border-color, #ebebeb);
}

.haq-product:last-child { border-bottom: none; }

.haq-product svg {
    color: #b0bec5;
    flex-shrink: 0;
}

.haq-product__name {
    flex: 1;
    font-family: var(--uicore-primary-font-family, "Titillium Web"), sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--uicore-dark-color, #070707);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.haq-product__qty {
    flex-shrink: 0;
    font-family: var(--uicore-primary-font-family, "Titillium Web"), sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--uicore-body-color, #596475);
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 10px;
}

/* Total column */
.haq-total {
    flex-shrink: 0;
    text-align: right;
    border-left: 1px solid var(--ui-border-color, #ebebeb);
    padding-left: 20px;
    min-width: 130px;
}

.haq-total__amount {
    font-family: var(--uicore-primary-font-family, "Titillium Web"), sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--uicore-dark-color, #070707);
    line-height: 1.1;
}

.haq-total__est {
    font-size: 11px;
    font-style: italic;
    color: var(--uicore-body-color, #596475);
    margin-top: 3px;
}

/* Disclaimer */
.haq-disclaimer {
    margin-top: 12px;
    padding: 10px 14px;
    background: #f9f9f9;
    border-left: 3px solid #dde3eb;
    font-size: 12px;
    font-style: italic;
    color: var(--uicore-body-color, #596475);
    font-family: var(--uicore-text-font-family, "Fira Sans"), sans-serif;
}

/* Empty state */
.haq-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--uicore-body-color, #596475);
    font-family: var(--uicore-text-font-family, "Fira Sans"), sans-serif;
    font-size: 14px;
}

.haq-empty svg {
    color: #dde3eb;
    display: block;
    margin: 0 auto 14px;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .horia-quote-modal__header {
        padding: 20px;
    }

    .horia-quote-modal__body {
        padding: 20px 20px 24px;
    }

    .hq-cart-table thead th:nth-child(2),
    .hq-cart-table tbody td:nth-child(2) {
        display: none;
    }

    .horia-quote-form__footer {
        justify-content: stretch;
    }

    .horia-quote-submit-btn {
        width: 100%;
        justify-content: center;
    }

    /* Stack card body on mobile */
    .haq-card__body {
        flex-direction: column;
        gap: 14px;
    }

    .haq-total {
        border-left: none;
        border-top: 1px solid var(--ui-border-color, #ebebeb);
        padding-left: 0;
        padding-top: 12px;
        text-align: left;
        min-width: 0;
        width: 100%;
    }
}