/* HG Parts Inquiry – Frontend styles */

/* ── Fieldsets ─────────────────────────────────────────────── */
.hg-inquiry-form fieldset {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1.5rem 1.5rem 0.5rem;
    margin-bottom: 1.5rem;
}

.hg-inquiry-form legend {
    float: none;
    width: auto;
    padding: 0 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
}

/* ── Utilities ─────────────────────────────────────────────── */
.hg-hidden {
    display: none;
}

/* ── Item rows ─────────────────────────────────────────────── */
.hg-item-row {
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    background: #fafbfc;
}

.hg-item-row:last-child {
    margin-bottom: 0.5rem;
}

.hg-item-row .hg-remove-item {
    padding: 0.25rem 0.5rem;
    font-size: 1.1rem;
    line-height: 1;
}

.hg-inquiry-form .form-text {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #6c757d;
}

/* ── Buttons ───────────────────────────────────────────────── */
.hg-inquiry-form .btn-outline-danger {
    color: #dc3545;
    background-color: transparent;
    border: 1px solid #dc3545;
    border-radius: 0.25rem;
    cursor: pointer;
    min-width: 0;
    transition: color 0.15s ease-in-out,
                background-color 0.15s ease-in-out,
                border-color 0.15s ease-in-out;
}

.hg-inquiry-form .btn-outline-danger:hover,
.hg-inquiry-form .btn-outline-danger:focus {
    color: #fff;
    background-color: #dc3545;
    border-color: #dc3545;
}

/* ── Alerts ────────────────────────────────────────────────── */
.hg-inquiry-form .alert {
    position: relative;
    padding: 1rem 1.25rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
}

.hg-inquiry-form .alert-danger {
    color: #842029;
    background-color: #f8d7da;
    border-color: #f5c2c7;
}

.hg-inquiry-form .alert-danger ul {
    margin: 0;
    padding-left: 1.25rem;
}

.hg-inquiry-form .alert-success {
    color: #0f5132;
    background-color: #d1e7dd;
    border-color: #badbcc;
}

/* ── text-danger helper ────────────────────────────────────── */
.hg-inquiry-form .text-danger {
    color: #dc3545;
}

/* ── Tooltip ────────────────────────────────────────────────── */
.hg-tooltip {
    position: relative;
    display: inline-block;
    margin-left: 4px;
    vertical-align: middle;
}

.hg-tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #6c757d;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    cursor: help;
}

.hg-tooltip-content {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 6px;
    width: 280px;
}

.hg-tooltip-content img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 0.25rem;
}

.hg-tooltip:hover .hg-tooltip-content,
.hg-tooltip:focus-within .hg-tooltip-content {
    display: block;
}

/* ── Spacing & alignment helpers ───────────────────────────── */
.hg-inquiry-form .mt-3 {
    margin-top: 1rem;
}

.hg-inquiry-form .text-center {
    text-align: center;
}

/* ── Category group ──────────────────────────────────────────── */
.hg-category-group {
    margin-bottom: 1rem;
}

.hg-category-group:last-child {
    margin-bottom: 0;
}

.hg-category-group__heading {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6c757d;
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #e9ecef;
}

/* ── Category grid ───────────────────────────────────────────── */
.hg-category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

@media (min-width: 600px) {
    .hg-category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 992px) {
    .hg-category-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ── Category cards ─────────────────────────────────────────── */
.hg-category-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 1rem 0.625rem 0.875rem;
    border: 2px solid #dee2e6;
    border-radius: 0.5rem;
    cursor: pointer;
    text-align: center;
    font-weight: 500;
    font-size: 0.8rem;
    line-height: 1.3;
    min-height: 96px;
    width: 100%;
    background: #fff;
    color: #495057;
    transition: border-color 0.15s ease-in-out,
                background-color 0.15s ease-in-out,
                color 0.15s ease-in-out;
    margin: 0;
    user-select: none;
    box-sizing: border-box;
}

.hg-category-card input[type="checkbox"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hg-category-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #6c757d;
    transition: color 0.15s ease-in-out;
}

.hg-category-card__icon svg {
    width: 28px;
    height: 28px;
}

.hg-category-card__label {
    font-weight: 500;
    font-size: 0.8rem;
    line-height: 1.3;
}

.hg-category-card:hover {
    border-color: #00c47a;
    background: #edfbf4;
}

.hg-category-card:hover .hg-category-card__icon {
    color: #00A670;
}

.hg-category-card--active,
.hg-category-card:has(input:checked) {
    border-color: #00A670;
    background: #e6f7f1;
    color: #00A670;
}

.hg-category-card--active .hg-category-card__icon,
.hg-category-card:has(input:checked) .hg-category-card__icon {
    color: #00A670;
}

.hg-category-card:has(input:focus-visible) {
    outline: 2px solid #00A670;
    outline-offset: 2px;
}

/* ── Advanced toggle block ──────────────────────────────────── */
.hg-advanced-toggle {
    background-color: #f8f9fa;
}

.hg-advanced-toggle .form-check-label {
    font-size: 1rem;
    cursor: pointer;
}

/* ── Advanced section heading ───────────────────────────────── */
.hg-advanced-heading {
    font-size: 1.15rem;
    font-weight: 700;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 1.5rem;
}

/* ── Intro block ────────────────────────────────────────────── */
.hg-inquiry-intro {
    background: #f0f6ff;
    border-color: #b3d1f5 !important;
    font-size: 0.95rem;
    color: #1a3a5c;
}

.hg-inquiry-intro p {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.hg-inquiry-intro__list {
    margin: 0;
    padding-left: 1.25rem;
}

.hg-inquiry-intro__list li {
    margin-bottom: 0.2rem;
    color: #2c5282;
}

/* ── Section intro paragraph ────────────────────────────────── */
.hg-section-intro {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: -0.25rem;
}

/* ── Required-hint text ─────────────────────────────────────── */
.hg-required-hint {
    color: #856404;
    font-weight: 500;
}

/* ── Post-submit note ───────────────────────────────────────── */
.hg-submit-note {
    margin-top: 0.625rem;
    font-size: 0.85rem;
    color: #6c757d;
}

/* ═══════════════════════════════════════════════════════════════
   Bootstrap-compatible utility stubs
   Applied when no Bootstrap is loaded by the active theme.
   ═══════════════════════════════════════════════════════════════ */

/* ── Spacing ─────────────────────────────────────────────────── */
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-1 { margin-top: 0.25rem !important; }
.p-3  { padding: 1rem !important; }
.p-4  { padding: 1.5rem !important; }

/* ── Border & shape ──────────────────────────────────────────── */
.border  { border: 1px solid #dee2e6 !important; }
.rounded { border-radius: 0.375rem !important; }

/* ── Typography ──────────────────────────────────────────────── */
.fw-semibold { font-weight: 600 !important; }

