/**
 * HAI UAE — HS Codes Portal Styles (hs-codes.css)
 * Extracted from pages/hs-codes.php per DESIGN_MASTER_PLAN.md
 *
 * Version: 1.0.0 (2026.09.12)
 */

:root {
    --hs-primary: var(--link, #1d4ed8);
    --hs-primary-dark: var(--link-hover, #1e40af);
    --hs-primary-light: #eff6ff;
    --hs-accent-cyan: #0284c7;
    --hs-emerald: var(--success, #047857);
    --hs-emerald-dark: #065f46;
    --hs-emerald-light: #ecfdf5;
    --hs-navy: var(--ink-deep, #0a192f);
    --hs-navy-card: #0d213a;
    --hs-navy-light: #162a45;
    --hs-slate: var(--surface-subtle, #f8fafc);
    --hs-border: var(--dir-border, #cbd5e1);
    --hs-border-subtle: var(--dir-border-subtle, #e2e8f0);
    --hs-border-hover: #94a3b8;
    --hs-text-dark: var(--text, #0f172a);
    --hs-text-muted: var(--muted, #475569);
    --hs-shadow-sm: var(--dir-shadow-xs);
    --hs-shadow-md: var(--dir-shadow-md);
    --hs-shadow-lg: var(--dir-shadow-lg);
}

.text-emerald {
    color: var(--hs-emerald) !important;
}

.text-cyan {
    color: var(--hs-accent-cyan) !important;
}

.text-primary-blue {
    color: var(--hs-primary) !important;
}

.hs-main-wrapper {
    background-color: var(--hs-slate);
    min-height: 80vh;
    padding-bottom: 50px;
    font-family: var(--font-sans, inherit);
    color: var(--hs-text-dark);
}

/* Breadcrumbs */
.hs-breadcrumb-bar {
    padding: 18px 0 14px;
    font-size: 0.88rem;
}

.hs-breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.hs-breadcrumb-item a {
    color: var(--hs-text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
    font-weight: 500;
}

.hs-breadcrumb-item a:hover {
    color: var(--hs-primary);
}

.hs-breadcrumb-item.active {
    color: var(--hs-text-dark);
    font-weight: 700;
}

.hs-breadcrumb-sep {
    color: #cbd5e1;
}

/* Hero Dark Card */
.hs-hero-banner {
    display: block !important;
    height: auto !important;
    min-height: unset !important;
    max-height: none !important;
    box-sizing: border-box !important;
    background: radial-gradient(circle at 85% 20%, rgba(37, 99, 235, 0.18) 0%, transparent 40%), radial-gradient(circle at 15% 85%, rgba(16, 185, 129, 0.12) 0%, transparent 40%), linear-gradient(140deg, #060f1e 0%, #0a192f 45%, #0f2744 100%) !important;
    border-radius: 22px !important;
    padding: 38px 36px !important;
    color: #ffffff !important;
    box-shadow: 0 16px 36px -6px rgba(10, 25, 47, 0.22), 0 4px 14px rgba(29, 78, 216, 0.08) !important;
    margin-bottom: 24px !important;
    position: relative !important;
    overflow: hidden !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    font-family: var(--font-sans, inherit) !important;
}

.hs-hero-banner::before {
    content: "";
    position: absolute;
    top: -40%;
    right: -15%;
    width: 650px;
    height: 650px;
    background: radial-gradient(circle, rgba(12, 131, 255, 0.22) 0%, rgba(6, 182, 212, 0.08) 50%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hs-hero-banner::after {
    content: "";
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, transparent 65%);
    border-radius: 50%;
    pointer-events: none;
}

.hs-container {
    max-width: var(--dir-container-max, 1240px);
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

.hs-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(37, 99, 235, 0.18);
    border: 1px solid rgba(96, 165, 250, 0.35);
    padding: 7px 16px;
    border-radius: 30px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #93c5fd;
    margin-bottom: 16px;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}

.hs-hero-badge i {
    color: #60a5fa;
}

.hs-hero-title {
    font-family: var(--font-heading, inherit) !important;
    font-size: clamp(2rem, 3.5vw, 2.85rem) !important;
    font-weight: 800 !important;
    line-height: 1.22 !important;
    margin-bottom: 16px !important;
    padding-bottom: 0 !important;
    letter-spacing: -0.03em !important;
    color: #ffffff !important;
}

.hs-hero-title span,
.hs-title-highlight {
    display: inline !important;
    font-size: inherit !important;
    line-height: inherit !important;
    font-weight: inherit !important;
    text-transform: none !important;
    letter-spacing: inherit !important;
}

.hs-title-highlight {
    background: linear-gradient(135deg, #60a5fa 0%, #38bdf8 50%, #67e8f9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800 !important;
}

.hs-hero-lead {
    font-size: 1.05rem !important;
    line-height: 1.65 !important;
    color: #cbd5e1 !important;
    max-width: 780px;
    margin-bottom: 24px;
}

.hs-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hs-stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    padding: 9px 16px;
    font-size: 0.88rem;
    color: #e2e8f0;
    backdrop-filter: blur(8px);
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.hs-stat-chip:hover,
.hs-stat-chip:focus,
.hs-stat-chip:active {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    text-decoration: none !important;
}

.hs-stat-chip,
.hs-stat-chip:hover,
.hs-stat-chip:focus,
.hs-stat-chip:active,
.hs-stat-chip *,
.hs-stat-chip:hover * {
    text-decoration: none !important;
}

.hs-stat-chip span {
    display: inline !important;
    font-size: inherit !important;
    line-height: inherit !important;
    text-transform: none !important;
    color: inherit !important;
}

.hs-stat-chip strong {
    color: #ffffff;
    font-weight: 700;
}

/* Search Card Console */
.hs-search-card {
    background: #ffffff;
    border: 1px solid var(--hs-border);
    border-radius: 16px;
    padding: 28px 32px;
    margin-bottom: 24px;
    position: relative;
    z-index: 10;
    box-shadow: var(--hs-shadow-sm);
}

.hs-search-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.hs-search-title {
    font-family: var(--font-heading, inherit);
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--hs-navy);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hs-search-title i {
    color: var(--hs-primary);
}

.hs-search-sub {
    font-size: 0.92rem;
    color: var(--hs-text-muted);
    margin: 4px 0 0;
}

.hs-search-input-group {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 2px solid #cbd5e1;
    border-radius: 14px;
    padding: 6px 8px 6px 18px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.hs-search-input-group:focus-within {
    border-color: var(--brand, #ffcb05);
    box-shadow: var(--focus-ring);
}

.hs-search-icon {
    color: #64748b;
    font-size: 1.15rem;
    margin-right: 12px;
}

.hs-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.05rem;
    color: var(--hs-text-dark);
    background: transparent;
    padding: 10px 0;
    font-weight: 500;
}

.hs-search-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.hs-search-btn-submit {
    background: var(--brand, #ffcb05);
    color: var(--on-brand, #0f172a);
    border: 1px solid #e5b600;
    border-radius: 10px;
    padding: 13px 26px;
    font-size: 0.98rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(255, 203, 5, 0.28);
}

.hs-search-btn-submit:hover {
    background: var(--brand-hover, #e6b700);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255, 203, 5, 0.4);
    color: #000000;
}

.hs-search-btn-reset {
    background: #f1f5f9;
    color: var(--hs-text-dark);
    border: 1px solid var(--hs-border-subtle);
    border-radius: 10px;
    padding: 13px 20px;
    font-size: 0.94rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.18s ease;
    white-space: nowrap;
    margin-left: 8px;
}

.hs-search-btn-reset:hover {
    background: #e2e8f0;
    color: var(--hs-navy);
}

.hs-quick-examples {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--hs-text-muted);
}

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

.hs-example-chip:hover {
    background: var(--hs-primary-light);
    border-color: var(--hs-primary);
    color: var(--hs-primary);
    transform: translateY(-1px);
}

/* Level Navigation Pills */
.hs-level-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #f1f5f9;
}

.hs-level-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--hs-border);
    background: #ffffff;
    color: var(--hs-text-dark);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.16s ease;
}

.hs-level-pill:hover {
    border-color: var(--hs-primary);
    background: #eff6ff;
    color: var(--hs-primary);
}

.hs-level-pill.active {
    background: var(--brand, #ffcb05);
    border-color: #e5b600;
    color: var(--on-brand, #0f172a);
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(255, 203, 5, 0.28);
}

/* Results Content Section */
.hs-results-section {
    margin-top: 32px;
}

.hs-results-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    background: #ffffff;
    border: 1px solid var(--hs-border);
    border-radius: 14px;
    padding: 14px 20px;
    margin-bottom: 18px;
    box-shadow: var(--hs-shadow-sm);
}

.hs-results-count {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--hs-navy);
}

.hs-results-count span {
    color: var(--hs-primary);
}

/* Modern Data Table */
.hs-table-container {
    background: #ffffff;
    border: 1px solid var(--hs-border);
    border-radius: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: var(--hs-shadow-sm);
}

.hs-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.hs-table th {
    background: #f8fafc;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 14px 18px;
    border-bottom: 1px solid var(--hs-border);
}

.hs-table td {
    padding: 16px 18px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    font-size: 0.92rem;
    color: var(--hs-text-dark);
}

.hs-table tr:last-child td {
    border-bottom: none;
}

.hs-table tr:hover td {
    background: #f8fafc;
}

.hs-code-cell {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 700;
    font-size: 0.98rem;
}

.hs-code-link {
    color: var(--hs-navy);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.15s ease;
}

.hs-code-link:hover {
    color: var(--hs-primary);
}

.hs-btn-copy-mini {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: all 0.15s ease;
    font-size: 0.85rem;
}

.hs-btn-copy-mini:hover {
    background: #e2e8f0;
    color: var(--hs-navy);
}

.hs-desc-cell {
    max-width: 540px;
    line-height: 1.5;
}

.hs-desc-title {
    font-weight: 600;
    color: var(--hs-text-dark);
    margin-bottom: 3px;
}

.hs-desc-arabic {
    font-size: 0.84rem;
    color: #64748b;
    direction: rtl;
    text-align: right;
}

/* Duty and Level Badges */
.hs-duty-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

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

.hs-duty-standard {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.hs-duty-special {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.hs-level-tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 700;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.hs-btn-view {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--hs-primary);
    background: var(--hs-primary-light);
    border: 1px solid transparent;
    text-decoration: none;
    transition: all 0.15s ease;
}

.hs-btn-view:hover {
    background: var(--hs-primary);
    color: #ffffff;
}

/* Empty State */
.hs-empty-box {
    background: #ffffff;
    border: 1px solid var(--hs-border);
    border-radius: 16px;
    padding: 48px 24px;
    text-align: center;
    box-shadow: var(--hs-shadow-sm);
}

.hs-empty-icon {
    font-size: 2.5rem;
    color: #94a3b8;
    margin-bottom: 14px;
}

.hs-empty-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--hs-navy);
    margin-bottom: 8px;
}

.hs-empty-text {
    font-size: 0.94rem;
    color: var(--hs-text-muted);
    max-width: 500px;
    margin: 0 auto 20px;
}

/* Modern Pagination */
.hs-pagination-wrap {
    margin-top: 28px;
    display: flex;
    justify-content: center;
    gap: 6px;
}

.hs-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--hs-border);
    background: #ffffff;
    color: var(--hs-text-dark);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
}

.hs-page-link:hover {
    border-color: var(--hs-primary);
    color: var(--hs-primary);
    background: #f8fafc;
}

.hs-page-link.active {
    background: var(--brand, #ffcb05);
    border-color: #e5b600;
    color: var(--on-brand, #0f172a);
    font-weight: 700;
    box-shadow: 0 3px 8px rgba(255, 203, 5, 0.28);
}

/* Popular HS Codes Showcase */
.hs-showcase-section {
    margin-top: 48px;
    background: #ffffff;
    border: 1px solid var(--hs-border);
    border-radius: 20px;
    padding: 36px 32px;
    box-shadow: var(--hs-shadow-sm);
}

.hs-showcase-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 28px;
}

.hs-showcase-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--hs-navy);
    margin: 0 0 6px;
}

.hs-showcase-subtitle {
    font-size: 0.92rem;
    color: var(--hs-text-muted);
    margin: 0;
    max-width: 650px;
}

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

.hs-popular-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.hs-popular-card:hover {
    transform: translateY(-3px);
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: var(--hs-shadow-md);
}

.hs-pop-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.hs-pop-code {
    font-family: ui-monospace, SFMono-Regular, monospace;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--hs-primary-dark);
    background: var(--hs-primary-light);
    padding: 4px 8px;
    border-radius: 6px;
}

.hs-pop-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--hs-navy);
    margin-bottom: 6px;
    line-height: 1.4;
}

.hs-pop-desc {
    font-size: 0.82rem;
    color: var(--hs-text-muted);
    line-height: 1.5;
    flex-grow: 1;
    margin-bottom: 12px;
}

.hs-pop-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--hs-primary);
}

/* Educational Info Box */
.hs-guide-section {
    margin-top: 40px;
    background: linear-gradient(135deg, #0b1f33 0%, #162f4d 100%);
    border-radius: 18px;
    padding: 36px;
    color: #ffffff;
}

.hs-guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.hs-guide-item {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 18px;
}

.hs-guide-item h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #a7f3d0;
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hs-guide-item p {
    font-size: 0.88rem;
    line-height: 1.6;
    color: #cbd5e1;
    margin: 0;
}

/* ==========================================================================
   Responsive adjustments for Mobile & Tablets (HS Codes Portal)
   ========================================================================== */
@media (max-width: 768px) {
    .hs-container {
        padding: 0 12px;
    }

    .hs-breadcrumb-bar {
        padding: 12px 0 10px;
        font-size: 0.82rem;
    }

    .hs-hero-banner {
        padding: 22px 16px !important;
        border-radius: 16px !important;
        margin-bottom: 16px !important;
    }

    .hs-hero-badge {
        font-size: 0.72rem;
        padding: 5px 12px;
        margin-bottom: 12px;
    }

    .hs-hero-title {
        font-size: clamp(1.35rem, 5vw, 1.75rem) !important;
        line-height: 1.25 !important;
        margin-bottom: 10px !important;
    }

    .hs-hero-lead {
        font-size: 0.88rem !important;
        line-height: 1.5 !important;
        margin-bottom: 16px;
    }

    .hs-hero-stats {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        width: 100%;
    }

    .hs-stat-chip {
        width: 100%;
        padding: 8px 12px;
        font-size: 0.8rem;
        border-radius: 10px;
        box-sizing: border-box;
    }

    .hs-search-card {
        padding: 16px 14px;
        border-radius: 14px;
        margin-top: 0;
        margin-bottom: 18px;
    }

    .hs-search-title {
        font-size: 1.15rem;
    }

    .hs-search-sub {
        font-size: 0.84rem;
        line-height: 1.45;
    }

    .hs-search-input-group {
        flex-direction: column;
        align-items: stretch;
        padding: 10px;
        gap: 8px;
        border-radius: 12px;
    }

    .hs-search-icon {
        display: none;
    }

    .hs-search-input {
        padding: 6px 4px;
        font-size: 0.95rem;
        width: 100%;
    }

    .hs-search-btn-submit {
        width: 100%;
        height: 44px;
        justify-content: center;
        font-size: 0.92rem;
        border-radius: 10px;
        padding: 0;
    }

    .hs-search-btn-reset {
        margin-left: 0;
        width: 100%;
        height: 40px;
        justify-content: center;
        font-size: 0.88rem;
        border-radius: 10px;
        padding: 0;
    }

    .hs-quick-examples {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 6px;
        gap: 6px;
        margin-top: 12px;
    }

    .hs-quick-examples > span {
        white-space: nowrap;
        font-size: 0.8rem;
        flex-shrink: 0;
    }

    .hs-example-chip {
        white-space: nowrap;
        flex-shrink: 0;
        font-size: 0.78rem;
        padding: 4px 10px;
    }

    .hs-level-filter-bar {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 6px;
        gap: 6px;
        margin-top: 14px;
        padding-top: 14px;
    }

    .hs-level-filter-bar > span {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .hs-level-pill {
        white-space: nowrap;
        flex-shrink: 0;
        font-size: 0.8rem;
        padding: 6px 12px;
        border-radius: 8px;
    }

    .hs-results-section {
        margin-top: 20px;
    }

    .hs-results-bar {
        padding: 12px 14px;
        border-radius: 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .hs-results-count {
        font-size: 0.88rem;
    }

    /* Transform Table to High-Density Mobile Cards */
    .hs-table-container {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        overflow: visible !important;
        border-radius: 0 !important;
    }

    .hs-table {
        display: block !important;
        width: 100% !important;
    }

    .hs-table thead {
        display: none !important;
    }

    .hs-table tbody {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        width: 100% !important;
    }

    .hs-table tr {
        display: grid !important;
        grid-template-columns: 1fr auto !important;
        grid-template-areas:
            "code duty"
            "desc desc"
            "level action" !important;
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 14px !important;
        padding: 14px 14px !important;
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04) !important;
        gap: 8px 8px !important;
        box-sizing: border-box !important;
        width: 100% !important;
        margin-bottom: 0 !important;
    }

    .hs-table tr:hover td {
        background: transparent !important;
    }

    .hs-table td {
        display: block !important;
        padding: 0 !important;
        border: none !important;
        text-align: left !important;
        box-sizing: border-box !important;
    }

    [dir="rtl"] .hs-table td {
        text-align: right !important;
    }

    .hs-table td.hs-code-cell {
        grid-area: code;
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
    }

    .hs-table td.hs-code-cell .hs-code-link {
        font-size: 0.95rem !important;
        font-weight: 800 !important;
        color: var(--hs-navy) !important;
    }

    .hs-table td.hs-duty-cell {
        grid-area: duty;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        text-align: right !important;
    }

    .hs-table td.hs-duty-cell .hs-duty-badge {
        font-size: 0.75rem;
        padding: 3px 8px;
    }

    .hs-table td.hs-desc-cell {
        grid-area: desc;
        padding: 6px 0 !important;
        border-top: 1px solid #f1f5f9 !important;
        border-bottom: 1px solid #f1f5f9 !important;
        max-width: 100% !important;
    }

    .hs-table td.hs-desc-cell .hs-desc-title {
        font-size: 0.9rem !important;
        font-weight: 700 !important;
        line-height: 1.4 !important;
        color: #0f172a !important;
    }

    .hs-table td.hs-desc-cell .hs-desc-arabic {
        font-size: 0.82rem !important;
        line-height: 1.45 !important;
        color: #64748b !important;
        margin-top: 3px !important;
    }

    .hs-table td.hs-level-cell {
        grid-area: level;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
    }

    .hs-table td.hs-level-cell .hs-level-tag {
        font-size: 0.72rem;
        padding: 2px 6px;
    }

    .hs-table td.hs-action-cell {
        grid-area: action;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
    }

    .hs-table td.hs-action-cell .hs-btn-view {
        padding: 5px 12px !important;
        font-size: 0.82rem !important;
        border-radius: 6px !important;
    }

    .hs-showcase-section {
        padding: 22px 14px;
        border-radius: 16px;
        margin-top: 32px;
    }

    .hs-showcase-title {
        font-size: 1.25rem;
    }

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

    .hs-popular-card {
        padding: 14px;
        border-radius: 12px;
    }

    .hs-guide-section {
        padding: 22px 14px;
        border-radius: 16px;
        margin-top: 28px;
    }

    .hs-guide-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
}

/* ==========================================================================
   HS Code Detail View Styles (/trade/hs-code/{code})
   ========================================================================== */
.hs-detail-wrapper {
    background-color: var(--hs-slate);
    min-height: 85vh;
    padding-bottom: 60px;
    font-family: var(--font-sans, inherit);
    color: var(--hs-text-dark);
}

.hs-detail-hero {
    display: block !important;
    height: auto !important;
    min-height: unset !important;
    max-height: none !important;
    box-sizing: border-box !important;
    background: radial-gradient(circle at 85% 20%, rgba(37, 99, 235, 0.18) 0%, transparent 40%), radial-gradient(circle at 15% 85%, rgba(16, 185, 129, 0.12) 0%, transparent 40%), linear-gradient(140deg, #060f1e 0%, #0a192f 48%, #0f2744 100%) !important;
    border-radius: 22px !important;
    padding: 38px 36px !important;
    color: #ffffff !important;
    box-shadow: 0 16px 36px -6px rgba(10, 25, 47, 0.22), 0 4px 14px rgba(29, 78, 216, 0.08) !important;
    margin-bottom: 28px !important;
    position: relative !important;
    overflow: hidden !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.hs-detail-hero::before {
    content: "";
    position: absolute;
    top: -45%;
    right: -12%;
    width: 580px;
    height: 580px;
    background: radial-gradient(circle, rgba(12, 131, 255, 0.24) 0%, rgba(6, 182, 212, 0.08) 50%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hs-detail-hero::after {
    content: "";
    position: absolute;
    bottom: -35%;
    left: -10%;
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, transparent 65%);
    border-radius: 50%;
    pointer-events: none;
}

.hs-hero-topline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}

.hs-code-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(37, 99, 235, 0.2);
    border: 1px solid rgba(96, 165, 250, 0.4);
    padding: 8px 16px;
    border-radius: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 1.25rem;
    font-weight: 800;
    color: #93c5fd;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.15);
}

.hs-code-hero-badge span {
    display: inline !important;
    font-size: inherit !important;
    line-height: inherit !important;
    text-transform: none !important;
    color: inherit !important;
}

.hs-code-hero-badge i {
    color: #60a5fa;
}

.hs-hero-copy-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    padding: 5px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.88rem;
    transition: all 0.18s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.hs-hero-copy-btn:hover {
    background: #ffffff;
    color: var(--hs-navy);
    border-color: #ffffff;
    transform: translateY(-1px);
}

.hs-hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: 10px;
    font-size: 0.86rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #e2e8f0;
    backdrop-filter: blur(6px);
}

.hs-hero-pill span {
    display: inline !important;
    font-size: inherit !important;
    line-height: inherit !important;
    text-transform: none !important;
    color: inherit !important;
}

.hs-hero-pill-free {
    background: rgba(4, 120, 87, 0.25);
    border-color: rgba(52, 211, 153, 0.45);
    color: #6ee7b7;
}

.hs-hero-pill-duty {
    background: rgba(37, 99, 235, 0.22);
    border-color: rgba(96, 165, 250, 0.4);
    color: #93c5fd;
}

.hs-detail-title {
    font-family: var(--font-heading, inherit) !important;
    font-size: clamp(1.6rem, 2.9vw, 2.4rem) !important;
    font-weight: 800 !important;
    line-height: 1.25 !important;
    color: #ffffff !important;
    margin: 0 0 16px !important;
    padding-bottom: 0 !important;
    letter-spacing: -0.02em !important;
    position: relative !important;
    z-index: 2;
}

.hs-detail-title span {
    display: inline !important;
    font-size: inherit !important;
    line-height: inherit !important;
    font-weight: inherit !important;
    text-transform: none !important;
    color: inherit !important;
}

.hs-detail-subtitle-ar {
    font-size: 1.18rem;
    color: #f1f5f9;
    direction: rtl;
    text-align: right;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 16px 22px;
    margin-top: 18px;
    line-height: 1.75;
    position: relative;
    z-index: 2;
    backdrop-filter: blur(6px);
}

.hs-detail-subtitle-ar span {
    display: inline !important;
}

.hs-ar-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(12, 131, 255, 0.22);
    border: 1px solid rgba(12, 131, 255, 0.4);
    color: #67e8f9;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-left: 10px;
    vertical-align: middle;
}

.hs-detail-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
}

.hs-panel-card {
    background: #ffffff;
    border: 1px solid var(--hs-border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--hs-shadow-sm);
}

.hs-panel-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--hs-navy);
    margin: 0 0 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.hs-kv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.hs-kv-item {
    background: #f8fafc;
    border: 1px solid var(--hs-border);
    border-radius: 12px;
    padding: 14px 16px;
}

.hs-kv-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--hs-text-muted);
    margin-bottom: 6px;
}

.hs-kv-value {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--hs-navy);
}

.hs-kv-value code {
    font-family: ui-monospace, SFMono-Regular, monospace;
    color: var(--hs-primary-dark);
    background: var(--hs-primary-light);
    padding: 2px 6px;
    border-radius: 4px;
}

.hs-tree-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hs-tree-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.15s ease;
}

.hs-tree-step.current {
    background: var(--hs-primary-light);
    border-color: #a7f3d0;
}

.hs-tree-level-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 800;
    background: #e2e8f0;
    color: #334155;
    white-space: nowrap;
}

.hs-tree-step.current .hs-tree-level-badge {
    background: var(--hs-primary);
    color: #ffffff;
}

.hs-tree-content {
    flex: 1;
}

.hs-tree-code {
    font-family: ui-monospace, SFMono-Regular, monospace;
    font-weight: 800;
    font-size: 0.92rem;
    color: var(--hs-navy);
    margin-bottom: 2px;
}

.hs-tree-desc {
    font-size: 0.85rem;
    color: var(--hs-text-dark);
    line-height: 1.4;
}

.hs-similar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.hs-similar-card {
    background: #f8fafc;
    border: 1px solid var(--hs-border);
    border-radius: 12px;
    padding: 14px;
    text-decoration: none;
    color: inherit;
    transition: all 0.16s ease;
    display: flex;
    flex-direction: column;
}

.hs-similar-card:hover {
    transform: translateY(-2px);
    background: #ffffff;
    border-color: var(--hs-primary);
    box-shadow: var(--hs-shadow-sm);
}

.hs-sim-code {
    font-family: ui-monospace, SFMono-Regular, monospace;
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--hs-primary-dark);
    margin-bottom: 4px;
}

.hs-sim-desc {
    font-size: 0.82rem;
    color: var(--hs-text-dark);
    line-height: 1.45;
    flex-grow: 1;
    margin-bottom: 8px;
}

.hs-sim-meta {
    font-size: 0.74rem;
    color: var(--hs-text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e2e8f0;
    padding-top: 6px;
}

.hs-sidebar-widget {
    background: #ffffff;
    border: 1px solid var(--hs-border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--hs-shadow-sm);
}

.hs-widget-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--hs-navy);
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hs-btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
    margin-bottom: 10px;
    transition: all 0.16s ease;
}

.hs-btn-action-primary {
    background: var(--brand, #ffcb05);
    color: var(--on-brand, #0f172a);
    border: none;
}

.hs-btn-action-primary:hover {
    background: var(--brand-hover, #e6b700);
    box-shadow: 0 4px 12px rgba(255, 203, 5, 0.35);
    color: var(--on-brand, #0f172a);
}

.hs-btn-action-secondary {
    background: #f1f5f9;
    color: var(--hs-navy);
    border: 1px solid var(--hs-border);
}

.hs-btn-action-secondary:hover {
    background: #e2e8f0;
    color: var(--hs-navy);
}

.hs-side-search-input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.9rem;
    margin-bottom: 10px;
    outline: none;
}

.hs-side-search-input:focus {
    border-color: var(--hs-primary);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

@media (max-width: 992px) {
    .hs-detail-grid {
        grid-template-columns: 1fr;
    }

    .hs-detail-sidebar {
        order: 2;
    }
}

@media (max-width: 768px) {
    .hs-detail-wrapper {
        padding-bottom: 60px;
    }

    .hs-detail-wrapper .hs-container {
        padding: 0 12px;
    }

    .hs-breadcrumb-bar {
        padding: 10px 0 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

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

    .hs-breadcrumb-list {
        flex-wrap: nowrap;
        white-space: nowrap;
        gap: 6px;
        font-size: 0.8rem;
    }

    .hs-detail-hero {
        padding: 18px 14px !important;
        border-radius: 14px !important;
        margin-bottom: 16px !important;
    }

    /* Reduce decorative pseudo-elements to prevent horizontal overflow */
    .hs-detail-hero::before {
        width: 260px;
        height: 260px;
        top: -25%;
        right: -10%;
    }

    .hs-detail-hero::after {
        width: 220px;
        height: 220px;
        bottom: -20%;
        left: -10%;
    }

    .hs-hero-topline {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        margin-bottom: 14px;
    }

    .hs-code-hero-badge {
        font-size: 1.05rem;
        padding: 7px 12px;
        border-radius: 10px;
        width: 100%;
        box-sizing: border-box;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .hs-hero-pill {
        font-size: 0.78rem;
        padding: 6px 10px;
        border-radius: 8px;
        flex: 1 1 calc(50% - 4px);
        min-width: 120px;
        justify-content: center;
        text-align: center;
        box-sizing: border-box;
    }

    .hs-detail-title {
        font-size: 1.25rem !important;
        line-height: 1.35 !important;
        margin-bottom: 12px !important;
        word-break: break-word;
        overflow-wrap: break-word;
    }

    .hs-detail-subtitle-ar {
        font-size: 0.94rem;
        padding: 11px 14px;
        border-radius: 10px;
        margin-top: 12px;
        line-height: 1.6;
        word-break: break-word;
    }

    .hs-ar-badge {
        font-size: 0.72rem;
        padding: 2px 8px;
        margin-left: 6px;
    }

    .hs-panel-card {
        padding: 16px 14px;
        border-radius: 14px;
        margin-bottom: 16px;
    }

    .hs-panel-title {
        font-size: 1.02rem;
        margin-bottom: 12px;
        padding-bottom: 10px;
    }

    .hs-kv-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .hs-kv-item {
        padding: 10px 12px;
        border-radius: 10px;
    }

    .hs-kv-label {
        font-size: 0.7rem;
        margin-bottom: 4px;
    }

    .hs-kv-value {
        font-size: 0.88rem;
        word-break: break-word;
    }

    .hs-tree-box {
        gap: 8px;
    }

    .hs-tree-step {
        padding: 10px 12px;
        gap: 6px;
        flex-direction: column;
        align-items: flex-start;
        border-left: 3px solid #cbd5e1;
        border-radius: 10px;
    }

    .hs-tree-step.current {
        border-left: 3px solid var(--hs-primary, #00875a);
    }

    .hs-tree-level-badge {
        font-size: 0.68rem;
        padding: 2px 7px;
    }

    .hs-tree-code {
        font-size: 0.86rem;
    }

    .hs-tree-desc {
        font-size: 0.8rem;
        line-height: 1.4;
    }

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

    .hs-similar-card {
        padding: 12px;
        border-radius: 10px;
        -webkit-tap-highlight-color: transparent;
    }

    .hs-sim-code {
        font-size: 0.88rem;
    }

    .hs-sim-desc {
        font-size: 0.8rem;
        line-height: 1.4;
        margin-bottom: 6px;
    }

    .hs-sim-meta {
        font-size: 0.72rem;
        padding-top: 6px;
    }

    .hs-sidebar-widget {
        padding: 16px 14px;
        border-radius: 14px;
    }

    .hs-btn-action {
        height: 46px;
        font-size: 0.92rem;
    }

    .hs-side-search-input {
        padding: 11px 14px;
        font-size: 16px; /* Prevents auto-zoom on iOS */
        border-radius: 10px;
        box-sizing: border-box;
    }
}

/* Extra-small screens (phones in portrait) */
@media (max-width: 480px) {
    .hs-detail-hero {
        padding: 15px 12px !important;
        border-radius: 12px !important;
        margin-bottom: 12px !important;
    }

    .hs-detail-hero::before,
    .hs-detail-hero::after {
        display: none;
    }

    .hs-code-hero-badge {
        font-size: 0.95rem;
        padding: 6px 10px;
        gap: 8px;
    }

    .hs-hero-pill {
        font-size: 0.74rem;
        padding: 5px 8px;
        flex: 1 1 100%;
    }

    .hs-detail-title {
        font-size: 1.15rem !important;
        line-height: 1.35 !important;
        margin-bottom: 10px !important;
    }

    .hs-detail-subtitle-ar {
        font-size: 0.88rem;
        padding: 9px 12px;
        line-height: 1.6;
    }

    .hs-panel-card {
        padding: 12px 10px;
        border-radius: 12px;
        margin-bottom: 12px;
    }

    .hs-panel-title {
        font-size: 0.92rem;
        gap: 8px;
        margin-bottom: 10px;
    }

    .hs-panel-title i {
        font-size: 0.88rem;
    }

    .hs-kv-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .hs-kv-item {
        padding: 8px 10px;
    }

    .hs-kv-label {
        font-size: 0.66rem;
        margin-bottom: 2px;
    }

    .hs-kv-value {
        font-size: 0.84rem;
    }

    .hs-tree-step {
        padding: 8px 10px;
        gap: 4px;
        border-radius: 8px;
    }

    .hs-tree-level-badge {
        font-size: 0.64rem;
        padding: 2px 6px;
    }

    .hs-tree-code {
        font-size: 0.82rem;
    }

    .hs-tree-desc {
        font-size: 0.76rem;
    }

    .hs-similar-card {
        padding: 10px;
    }

    .hs-sim-code {
        font-size: 0.84rem;
    }

    .hs-sim-desc {
        font-size: 0.78rem;
    }

    .hs-sidebar-widget {
        padding: 14px 12px;
        border-radius: 12px;
    }

    .hs-widget-title {
        font-size: 0.92rem;
    }
}
