/* ============================================================
   hs-codes.css — HS codes browser + detail page styles
   Mobile-first redesign: card stacks, sticky UI, FAB, RTL.
   ============================================================ */

/* ============================================================
   HERO SECTION
   ============================================================ */
.hs-hero {
    background-color: var(--bg-page);
    padding: clamp(40px, 6vw, 60px) 0;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.hs-hero::before {
    content: '';
    position: absolute;
    top: -20%;
    left: 10%;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.04) 0%, transparent 70%);
    filter: blur(20px);
    pointer-events: none;
}

.hs-hero .hs-hero-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 18px;
    padding: clamp(28px, 4vw, 36px);
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 2;
}

.hs-hero h1, .hs-hero h2 {
    font-size: clamp(1.8rem, 5vw, 2.6rem);
    font-weight: 900;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    line-height: 1.15;
}

.hs-hero p {
    color: var(--text-secondary);
    margin-bottom: 0;
    line-height: 1.7;
    font-size: clamp(0.95rem, 2vw, 1.05rem);
}

/* ============================================================
   SUMMARY PILLS
   ============================================================ */
.hs-summary-pills {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: clamp(12px, 2vw, 16px);
    margin-top: clamp(24px, 4vw, 32px);
}

.hs-summary-pill {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    padding: clamp(12px, 2vw, 16px);
    font-size: 0.88rem;
    text-align: center;
}

.hs-summary-pill strong {
    display: block;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-weight: 700;
}

/* ============================================================
   BROWSER CARD
   ============================================================ */
.hs-browser-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.hs-browser-card:hover {
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
    border-color: var(--accent-teal);
}

.hs-browser-card .card-body {
    padding: clamp(20px, 3vw, 28px);
}

.hs-section-title {
    font-size: clamp(1.1rem, 3vw, 1.4rem);
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.hs-muted {
    color: var(--neutral-gray);
    font-size: 0.92rem;
}

/* ============================================================
   LEVEL FILTER GRID (desktop)
   ============================================================ */
.hs-level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: clamp(12px, 2vw, 16px);
    margin-top: clamp(20px, 3vw, 28px);
}

.hs-level-card {
    display: block;
    padding: clamp(16px, 2vw, 20px);
    border-radius: 14px;
    border: 1px solid #d9e6f8;
    background: linear-gradient(135deg, #f7fbff 0%, #eef5ff 100%);
    text-decoration: none;
    color: #1f3a61;
    transition: all 0.25s ease;
    height: 100%;
}

.hs-level-card.active,
.hs-level-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-teal);
    box-shadow: 0 12px 32px rgba(6, 182, 212, 0.15);
    background: linear-gradient(135deg, #eef5ff 0%, #e0f4ff 100%);
}

.hs-level-code {
    display: inline-block;
    background: linear-gradient(135deg, #daf0ff 0%, #c8e9ff 100%);
    color: var(--primary);
    border-radius: 999px;
    padding: 6px 12px;
    font-weight: 800;
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.hs-level-name {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: var(--neutral-dark);
}

.hs-level-hint {
    font-size: 0.84rem;
    color: var(--neutral-gray);
    line-height: 1.5;
}

.hs-level-total {
    font-size: 0.8rem;
    margin-top: 10px;
    color: var(--primary);
    font-weight: 600;
}

/* ============================================================
   CATEGORY CHIPS
   ============================================================ */
.hs-category-list {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(8px, 1vw, 12px);
    margin-top: 12px;
}

.hs-category-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, #f5f8fc 0%, #edf4fe 100%);
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--primary);
    font-size: 0.84rem;
    font-weight: 600;
    transition: all 0.25s ease;
}

.hs-category-chip:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, #d4e8ff 100%);
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* ============================================================
   RESULTS HEADER & CARDS
   ============================================================ */
.hs-results-header {
    padding: clamp(14px, 2vw, 18px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: linear-gradient(135deg, #fafcff 0%, #f5f8fc 100%);
    margin-bottom: clamp(16px, 2vw, 20px);
}

.hs-result-card {
    border: 1px solid #dce8f7;
    border-radius: 14px;
    transition: all 0.25s ease;
    background: #fff;
}

.hs-result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(6, 182, 212, 0.12);
    border-color: var(--accent-teal);
}

.hs-result-card .card-body {
    padding: clamp(14px, 2vw, 18px);
}

.hs-result-code {
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 800;
    line-height: 1.2;
    color: var(--primary);
}

.hs-result-meta {
    font-size: 0.78rem;
    color: var(--neutral-gray);
    margin-top: 6px;
}

/* ============================================================
   RESPONSIVE INTRO SECTION (Collapsible on Mobile)
   ============================================================ */
.hs-intro-responsive {
    transition: all 0.3s ease;
}

.hs-intro-toggle-btn {
    display: none;
    text-decoration: none;
    font-weight: 600;
}

/* ============================================================
   MOBILE CARD LIST — Enhanced Responsive Modern Card Stack
   ============================================================ */
.hs-mobile-list {
    display: none; /* shown only on mobile via media query */
}

.hs-mobile-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
    position: relative;
    overflow: hidden;
    margin-bottom: 12px;
}

.hs-mobile-card:active {
    background: #f8fafc;
    border-color: #3b82f6;
    transform: scale(0.99);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.12);
}

.hs-mobile-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.hs-mobile-card-code-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.hs-mobile-code-badge {
    display: inline-flex;
    align-items: center;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    background: #f1f5f9;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    letter-spacing: 0.02em;
}

.hs-mobile-pill {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    letter-spacing: 0.02em;
}

.hs-mobile-pill-level {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.hs-mobile-duty-badge {
    font-size: 0.74rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    letter-spacing: 0.02em;
}

.hs-mobile-duty-badge.duty-zero {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.hs-mobile-duty-badge.duty-standard {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.hs-mobile-card-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hs-mobile-desc-en {
    font-size: 0.9rem;
    font-weight: 500;
    color: #1e293b;
    line-height: 1.5;
    word-break: break-word;
}

.hs-mobile-desc-ar {
    font-size: 0.85rem;
    font-weight: 500;
    color: #64748b;
    line-height: 1.5;
    text-align: right;
    direction: rtl;
    background: #f8fafc;
    padding: 6px 10px;
    border-radius: 8px;
    border-right: 3px solid #cbd5e1;
}

.hs-mobile-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
    margin-top: 4px;
}

.hs-mobile-tags {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.hs-mobile-tag {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #475569;
}

.hs-mobile-tag-old {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.hs-mobile-tag-vgn {
    background: #f3e8ff;
    color: #7e22ce;
    border: 1px solid #e9d5ff;
}

.hs-mobile-action-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #2563eb;
    margin-left: auto;
}

.hs-mobile-card-chevron {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.hs-mobile-card:active .hs-mobile-card-chevron {
    transform: translateX(4px);
}

/* ============================================================
   MOBILE LEVEL FILTER TABS (horizontal scroll)
   ============================================================ */
.hs-level-tabs {
    display: none; /* shown only on mobile */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 8px;
    padding: 2px 0 10px;
    margin-bottom: 16px;
}

.hs-level-tabs::-webkit-scrollbar {
    display: none;
}

.hs-level-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    padding: 9px 16px;
    border-radius: 999px;
    border: 1.5px solid #d1dff0;
    background: #f5f8fc;
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.hs-level-tab.active,
.hs-level-tab:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.hs-level-tab-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.6;
}

/* ============================================================
   POPULAR HS CODES SECTION
   ============================================================ */
.popular-hs-showcase {
    padding: clamp(48px, 8vw, 72px) 0;
    background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.popular-hs-shell {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: clamp(28px, 4vw, 36px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.06);
}

.popular-hs-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: clamp(16px, 3vw, 28px);
    margin-bottom: clamp(24px, 4vw, 32px);
    flex-wrap: wrap;
}

.popular-hs-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-teal);
    margin-bottom: 8px;
}

.popular-hs-title {
    margin: 0;
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 900;
    color: var(--neutral-dark);
    line-height: 1.2;
}

.popular-hs-subtitle {
    margin: 12px 0 0;
    max-width: 700px;
    font-size: clamp(0.9rem, 2vw, 1rem);
    line-height: 1.6;
    color: var(--neutral-gray);
}

.popular-hs-header .btn {
    border-radius: 10px;
    padding: 10px 20px;
    font-weight: 700;
    white-space: nowrap;
    font-size: 0.95rem;
}

.popular-hs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: clamp(16px, 2vw, 20px);
}

.popular-hs-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: clamp(16px, 2vw, 20px);
    border-radius: 12px;
    background: linear-gradient(135deg, #fff 0%, #f9fafb 100%);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    text-decoration: none;
    color: inherit;
    transition: all 0.25s ease;
    height: 100%;
}

.popular-hs-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-teal);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

.popular-hs-card-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: flex-start;
}

.popular-hs-code-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, #daf0ff 0%, #c8e9ff 100%);
    color: var(--primary);
    font-weight: 800;
    font-size: 0.86rem;
}

.popular-hs-level {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--primary);
    background: linear-gradient(135deg, #daf0ff 0%, #c8e9ff 100%);
    border: 1px solid #b7d5f5;
    border-radius: 999px;
    padding: 6px 11px;
}

.popular-hs-oldcode {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    color: #b45309;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 5px 10px;
    border-radius: 999px;
    width: fit-content;
    font-weight: 600;
}

.popular-hs-name {
    font-size: clamp(0.9rem, 2vw, 1rem);
    font-weight: 700;
    line-height: 1.4;
    color: var(--neutral-dark);
}

.popular-hs-name-ar {
    font-size: 0.84rem;
    line-height: 1.5;
    color: var(--neutral-gray);
    direction: rtl;
    text-align: right;
    padding: clamp(8px, 1.5vw, 12px);
    background: linear-gradient(135deg, #f5f8fc 0%, #f0f4fa 100%);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.popular-hs-desc {
    font-size: 0.84rem;
    line-height: 1.6;
    color: var(--neutral-gray);
    flex-grow: 1;
}

.popular-hs-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.popular-hs-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 11px;
    border-radius: 999px;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: var(--primary);
    font-size: 0.74rem;
    font-weight: 700;
}

.popular-hs-linktext {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

/* ============================================================
   INFO SECTION (bottom banner)
   ============================================================ */
.hs-info-section {
    background: transparent;
    border: none;
    padding-top: clamp(8px, 2vw, 20px);
}

.hs-info-section::before {
    display: none;
}

.hs-info-card {
    background: var(--hero-gradient);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 14px 32px rgba(13, 71, 161, 0.22);
    padding: clamp(26px, 4vw, 38px);
    position: relative;
    overflow: hidden;
}

.hs-info-title {
    margin-bottom: clamp(20px, 3vw, 32px);
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 900;
    color: #ffffff !important;
    line-height: 1.2;
    position: relative;
    z-index: 1;
}

.hs-info-lead {
    margin-bottom: 0;
    line-height: 1.8;
    max-width: 95%;
    color: rgba(255, 255, 255, 0.95) !important;
    font-size: clamp(0.95rem, 2vw, 1.05rem);
    position: relative;
    z-index: 1;
}

.hs-info-list {
    margin-top: clamp(20px, 3vw, 28px);
}

.hs-info-list li {
    margin-bottom: clamp(12px, 2vw, 16px);
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.95);
    font-size: clamp(0.9rem, 2vw, 1rem);
    transition: all 0.25s ease;
}

.hs-info-list li:last-child {
    margin-bottom: 0;
}

.hs-info-list i {
    color: var(--accent-teal);
    margin-right: 8px;
    font-size: 1.1rem;
}

/* ============================================================
   DETAIL PAGE — STICKY MOBILE HEADER
   ============================================================ */
.hs-detail-sticky-bar {
    display: none; /* shown only on mobile */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    background: #fff;
    border-bottom: 2px solid var(--primary);
    padding: 10px 16px;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hs-detail-sticky-bar.is-visible {
    transform: translateY(0);
}

.hs-detail-sticky-code {
    font-size: 1rem;
    font-weight: 900;
    color: var(--primary);
    font-family: 'Courier New', Courier, monospace;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hs-detail-sticky-label {
    font-size: 0.72rem;
    color: var(--neutral-gray);
    display: block;
    line-height: 1.2;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.hs-detail-sticky-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1.5px solid var(--primary);
    color: var(--primary);
    background: transparent;
    text-decoration: none;
    flex-shrink: 0;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.hs-detail-sticky-btn:hover,
.hs-detail-sticky-btn:active {
    background: var(--primary);
    color: #fff;
}

/* ============================================================
   DETAIL PAGE — FLOATING ACTION BUTTON (FAB)
   ============================================================ */
.hs-fab {
    display: none; /* shown only on mobile */
    position: fixed;
    bottom: 24px;
    right: 20px;
    z-index: 1040;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.hs-fab-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary) 0%, #1a5a8f 100%);
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(30, 91, 168, 0.4);
    transition: all 0.25s ease;
    white-space: nowrap;
}

.hs-fab-btn:hover,
.hs-fab-btn:active {
    box-shadow: 0 12px 32px rgba(30, 91, 168, 0.55);
    transform: translateY(-2px);
    color: #fff;
}

.hs-fab-btn-secondary {
    background: #fff;
    color: var(--primary);
    border: 1.5px solid #d1dff0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    padding: 10px 16px;
    font-size: 0.82rem;
}

.hs-fab-btn-secondary:hover {
    background: #f0f6ff;
    color: var(--primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* ============================================================
   DETAIL PAGE — INFO PILLS & BADGES
   ============================================================ */
.hs-meta-pills-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #334155;
    text-decoration: none;
    transition: all 0.2s ease;
}

.meta-pill code {
    color: inherit;
    font-size: 0.88em;
    background: rgba(0, 0, 0, 0.05);
    padding: 1px 4px;
    border-radius: 4px;
}

.meta-pill-link:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.meta-pill-success {
    background: #dcfce7;
    border-color: #bbf7d0;
    color: #15803d;
}

.meta-pill-primary {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.meta-pill-warning {
    background: #fef3c7;
    border-color: #fde68a;
    color: #92400e;
}

.hs-detail-duty-pill {
    font-size: 0.82rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    letter-spacing: 0.01em;
}

.hs-detail-duty-pill.duty-zero {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.hs-detail-duty-pill.duty-standard {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

/* ============================================================
   DETAIL PAGE — CHILD CODES MOBILE
   ============================================================ */
.hs-child-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #dce8f7;
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    min-height: 56px;
}

.hs-child-row:hover,
.hs-child-row:active {
    background: #f0f6ff;
    border-color: var(--primary);
}

.hs-child-row + .hs-child-row {
    margin-top: 8px;
}

.hs-child-code-badge {
    flex-shrink: 0;
    background: linear-gradient(135deg, #daf0ff 0%, #c8e9ff 100%);
    color: var(--primary);
    font-weight: 800;
    font-size: 0.82rem;
    font-family: 'Courier New', Courier, monospace;
    padding: 5px 10px;
    border-radius: 8px;
    white-space: nowrap;
}

.hs-child-desc {
    flex: 1;
    font-size: 0.84rem;
    color: #374151;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ============================================================
   DETAIL PAGE — CLASSIFICATION TIPS ACCORDION (mobile)
   ============================================================ */
.hs-tips-accordion .hs-tip-toggle {
    display: none; /* shown only on mobile */
}

.hs-tip-body {
    /* always visible on desktop */
}

/* ============================================================
   MOBILE BOTTOM PADDING (avoid FAB overlap)
   ============================================================ */
@media (max-width: 767.98px) {
    /* Extra bottom padding so FAB doesn't overlap content */
    body.page-hs-code-detail .container:last-of-type {
        padding-bottom: 100px;
    }
}

/* ============================================================
   RESPONSIVE — TABLET (768px–991px)
   ============================================================ */
@media (min-width: 768px) and (max-width: 991.98px) {
    .popular-hs-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hs-level-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================================
   RESPONSIVE — MOBILE (max 767px) — MAIN OVERRIDES
   ============================================================ */
@media (max-width: 767.98px) {

    /* --- Hero --- */
    .hs-hero {
        padding: clamp(28px, 5vw, 40px) 0;
    }

    .hs-hero h1, .hs-hero h2 {
        font-size: 1.55rem;
        margin-bottom: 12px;
    }

    .hs-hero .hs-hero-panel {
        padding: 20px 18px;
        border-radius: 14px;
    }

    .hs-hero p {
        font-size: 0.92rem;
    }

    /* --- Summary pills --- */
    .hs-summary-pills {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    /* --- Collapsible Intro on Mobile --- */
    .hs-intro-responsive {
        padding: 14px 16px !important;
        margin-bottom: 16px !important;
        font-size: 0.88rem !important;
    }

    .hs-intro-responsive .hs-intro-collapse-content {
        max-height: 72px;
        overflow: hidden;
        position: relative;
        transition: max-height 0.35s ease;
        -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
        mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    }

    .hs-intro-responsive.expanded .hs-intro-collapse-content {
        max-height: 1000px;
        -webkit-mask-image: none;
        mask-image: none;
    }

    .hs-intro-toggle-btn {
        display: inline-block;
        font-size: 0.82rem;
    }

    /* --- Browser card --- */
    .hs-browser-card {
        border-radius: 12px;
    }

    .hs-browser-card .card-body {
        padding: 16px 14px;
    }

    /* --- Results: hide table, show card list --- */
    .hs-results-table-wrap {
        display: none !important;
    }

    .hs-mobile-list {
        display: block;
    }

    /* --- Pagination on mobile --- */
    .pagination {
        gap: 4px;
    }

    .pagination .page-item .page-link {
        min-width: 38px;
        height: 38px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.85rem;
        padding: 0 8px;
        border-radius: 8px !important;
    }

    #hs-search-input {
        font-size: 0.95rem;
    }

    /* --- Level filter: hide grid, show tabs --- */
    .hs-level-grid {
        display: none;
    }

    .hs-level-tabs {
        display: flex;
    }

    /* --- Section title --- */
    .hs-section-title {
        font-size: 1.05rem;
    }

    /* --- Popular codes: 2 col on mobile --- */
    .popular-hs-shell {
        padding: 18px 14px;
        border-radius: 12px;
    }

    .popular-hs-header {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .popular-hs-title {
        font-size: 1.3rem;
    }

    .popular-hs-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .popular-hs-card {
        padding: 12px 10px;
        gap: 8px;
        border-radius: 10px;
    }

    .popular-hs-card-head {
        flex-direction: column;
        gap: 5px;
    }

    .popular-hs-name {
        font-size: 0.82rem;
    }

    .popular-hs-name-ar {
        font-size: 0.76rem;
        padding: 8px;
    }

    .popular-hs-desc {
        font-size: 0.78rem;
        display: none; /* hide long desc on mobile, card is already compact */
    }

    .popular-hs-meta {
        padding-top: 8px;
    }

    /* --- Info section --- */
    .hs-info-card {
        padding: 20px 16px;
        border-radius: 12px;
    }

    .hs-info-title {
        font-size: 1.3rem;
        margin-bottom: 14px;
    }

    .hs-info-lead {
        font-size: 0.88rem;
        max-width: 100%;
        margin-bottom: 12px;
    }

    .hs-info-list {
        margin-top: 16px;
    }

    .hs-info-list li {
        font-size: 0.86rem;
        margin-bottom: 10px;
    }

    /* --- Detail page: mobile overrides --- */
    .page-hs-code-detail .hs-hero.hs-detail-hero {
        padding: 16px 14px;
        border-radius: 14px;
        margin-bottom: 16px !important;
        background: #ffffff;
        border: 1px solid #e2e8f0;
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    }

    .hs-detail-title {
        font-size: 1.25rem;
        font-weight: 800;
        line-height: 1.4;
        color: #0f172a;
        margin-top: 8px;
        margin-bottom: 4px;
    }

    .hs-detail-title-ar {
        background: #f8fafc;
        border-radius: 8px;
        border-right: 3px solid #3b82f6;
        padding: 8px 12px;
        font-size: 0.95rem;
        font-weight: 600;
        color: #334155;
        line-height: 1.6;
    }

    .hs-detail-breadcrumb-nav {
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    .hs-detail-breadcrumb-nav::-webkit-scrollbar {
        display: none;
    }

    .hs-detail-mobile-actions .btn {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.88rem;
        border-radius: 10px;
    }

    .detail-card {
        border-radius: 12px;
        border: 1px solid #e2e8f0;
        margin-bottom: 16px !important;
        overflow: hidden;
    }

    .detail-card .card-header {
        padding: 12px 16px;
        font-size: 0.95rem;
        font-weight: 700;
        background: #f8fafc;
        border-bottom: 1px solid #e2e8f0;
    }

    .detail-card .card-body {
        padding: 16px 14px;
    }

    .info-block {
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 10px 12px;
        margin-bottom: 0;
    }

    .info-block small {
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: #64748b;
        font-weight: 700;
    }

    .info-block p.lead {
        font-size: 0.95rem;
        line-height: 1.55;
        color: #1e293b;
        font-weight: 500;
    }

    .hs-child-row {
        padding: 12px 14px;
        border-radius: 10px;
        border: 1px solid #e2e8f0;
        background: #ffffff;
        margin-bottom: 8px;
        box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    }

    .hs-child-row:active {
        background: #f8fafc;
        border-color: #3b82f6;
    }

    .hs-child-code-badge {
        font-family: 'SFMono-Regular', Consolas, monospace;
        font-weight: 800;
        font-size: 0.85rem;
        background: #f1f5f9;
        color: #0f172a;
        border: 1px solid #e2e8f0;
        padding: 4px 8px;
        border-radius: 6px;
    }

    /* --- Detail page: show sticky bar and FAB --- */
    .hs-detail-sticky-bar {
        display: flex;
        height: 52px;
        padding: 6px 14px;
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border-bottom: 1px solid #e2e8f0;
        box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    }

    .hs-detail-sticky-code-num {
        font-family: 'SFMono-Regular', Consolas, monospace;
        font-weight: 800;
        font-size: 0.95rem;
        color: #0f172a;
    }

    .hs-detail-sticky-btn-contact {
        background: #2563eb !important;
        border-color: #2563eb !important;
        color: #ffffff !important;
    }

    .hs-fab {
        display: flex;
    }

    /* --- Detail page: offset for sticky bar on scroll --- */
    .hs-detail-page-spacer {
        height: 56px;
        display: block;
    }

    /* --- Tips accordion on mobile --- */
    .hs-tips-accordion .hs-tip-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 12px 14px;
        font-size: 0.88rem;
        font-weight: 700;
        color: var(--neutral-dark);
        cursor: pointer;
        margin-bottom: 6px;
        text-align: left;
    }

    .hs-tips-accordion .hs-tip-toggle.open {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        background: #eff6ff;
        border-color: #bfdbfe;
    }

    .hs-tips-accordion .hs-tip-toggle i.toggle-icon {
        transition: transform 0.25s ease;
        font-size: 0.8rem;
        color: var(--neutral-gray);
    }

    .hs-tips-accordion .hs-tip-toggle.open i.toggle-icon {
        transform: rotate(180deg);
    }

    .hs-tips-accordion .hs-tip-body {
        padding: 12px 14px;
        background: #ffffff;
        border: 1px solid #bfdbfe;
        border-top: none;
        border-bottom-left-radius: 8px;
        border-bottom-right-radius: 8px;
        font-size: 0.84rem;
        color: var(--neutral-gray);
        line-height: 1.6;
        margin-bottom: 8px;
    }

    .hs-tips-accordion .hs-tip-body.collapsed {
        display: none;
    }

    /* Hide desktop-only tip block layout, use accordion */
    .tip-block {
        padding: 0;
        border: none;
        background: none;
    }
}

/* ============================================================
   RESPONSIVE — EXTRA SMALL (max 400px)
   ============================================================ */
@media (max-width: 400px) {
    .hs-hero h1, .hs-hero h2 {
        font-size: 1.35rem;
    }

    .popular-hs-grid {
        grid-template-columns: 1fr;
    }

    .hs-mobile-card-code {
        font-size: 0.95rem;
    }

    .hs-fab-btn {
        padding: 12px 16px;
        font-size: 0.82rem;
    }
}

/* ============================================================
   RTL ADJUSTMENTS (Arabic)
   ============================================================ */
[dir="rtl"] .hs-mobile-card-chevron {
    transform: scaleX(-1);
}

[dir="rtl"] .hs-mobile-card:active .hs-mobile-card-chevron {
    transform: scaleX(-1) translateX(3px);
}

[dir="rtl"] .hs-fab {
    right: auto;
    left: 20px;
    align-items: flex-start;
}

[dir="rtl"] .hs-detail-sticky-bar {
    direction: rtl;
}

[dir="rtl"] .hs-level-tab {
    direction: rtl;
}
