/* ═══════════════════════════════════════════════════════════
   MyDeal Legal — Topic Hub (e.g. External Stores legal center)
   Header (logo + language dropdown) mirrors exactly the structure
   used by themes/one-page-express-child/help_center_user/help-center.css
═══════════════════════════════════════════════════════════ */
.mdp-topics-hub {
    --mth-bg:        #f7faff;
    --mth-text:      #07195e;
    --mth-muted:     #58627d;
    --mth-border:    #dfe7f5;
    --mth-blue:      #0878ff;
    --mth-blue-dark: #07195e;
    --mth-soft-blue: #eef6ff;
    --mth-shadow:       0 18px 42px rgba(15, 34, 87, 0.08);
    --mth-shadow-hover: 0 22px 52px rgba(8, 120, 255, 0.14);

    width: min(100%, 1080px);
    margin: 0 auto;
    padding: 42px 24px 56px;
    color: var(--mth-text);
    text-align: left;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    overflow-x: hidden;
}

.mdp-topics-hub *,
.mdp-topics-hub *::before,
.mdp-topics-hub *::after { box-sizing: border-box; }

/* Neutralize decorative ::before/::after the parent theme injects into
   generic headers/lists/sections — this component defines none itself. */
.mdp-topics-hub *::before,
.mdp-topics-hub *::after {
    content: none !important;
    display: none !important;
}

.mdp-topics-hub a { color: inherit; }

/* ===== Horizontal-scroll fix (same pattern used by
   themes/one-page-express-child/shortcodes/landings_servicios) =====
   WPBakery gives .vc_row-fluid negative side margins (-15px/side) and
   .vc_column-inner side padding (15px/side) that normally cancel out. On a
   full-width page like this one, the leftover from those margins causes
   horizontal scroll on mobile; but constraining the row's own width instead
   breaks the balance and leaves blank space on the other side. Correct fix:
   nullify BOTH (the row's negative margins and the column's padding) only on
   the row/column wrapping THIS component (via :has), so content aligns to
   the real viewport width without overflowing or leaving a gap. Side
   spacing comes from .mdp-topics-hub's own padding above. Every shortcode
   in this plugin renders a `.mdp-topics-hub` root, so this single rule set
   covers all of them (document pages, category hubs, and topic hubs). */
.vc_row-fluid:has(.mdp-topics-hub) { margin-left: 0 !important; margin-right: 0 !important; }
.wpb_column:has(.mdp-topics-hub),
.vc_column_container:has(.mdp-topics-hub) > .vc_column-inner { padding-left: 0 !important; padding-right: 0 !important; }
.entry-content:has(.mdp-topics-hub),
.wpb-content-wrapper:has(.mdp-topics-hub) { overflow-x: clip; }

/* ─── Topbar: logo + language (mirrors .md-help__topbar) ──── */
.mdp-topics-hub__topbar {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.mdp-topics-hub__logo {
    width: clamp(188px, 24vw, 280px);
    height: auto;
    display: block;
    margin: 0;
    flex-shrink: 0;
}

.mdp-topics-hub__lang { margin: 0; flex-shrink: 0; }

.mdp-topics-hub__switch {
    position: relative;
    display: inline-block;
    width: 142px;
}

.mdp-topics-hub__lang-selected {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #e5eaf4;
    border-radius: 12px;
    background: #ffffff;
    color: #0f1b3d;
    font-size: 14px;
    font-weight: 750;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    line-height: 1;
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.mdp-topics-hub__lang-selected:hover,
.mdp-topics-hub__lang-selected:focus-visible {
    border-color: rgba(8, 120, 255, 0.34);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.11);
    transform: translateY(-1px);
}

.mdp-topics-hub__lang-globe {
    font-size: 18px; line-height: 1; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; width: 18px; min-width: 18px;
}

.mdp-topics-hub__lang-text { line-height: 1; display: flex; align-items: center; white-space: nowrap; }

.mdp-topics-hub__lang-arrow {
    font-size: 15px; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
    height: 15px; transition: transform 0.2s ease;
}

.mdp-topics-hub__switch.open .mdp-topics-hub__lang-arrow { transform: rotate(180deg); }

.mdp-topics-hub__lang-options {
    position: absolute;
    top: 44px; left: 0; width: 100%;
    background: #ffffff;
    border: 1px solid #e5eaf4;
    border-top: none;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
    overflow: hidden;
    display: none;
    z-index: 9999;
}

.mdp-topics-hub__switch.open .mdp-topics-hub__lang-options { display: block; }
.mdp-topics-hub__switch.open .mdp-topics-hub__lang-selected { border-radius: 12px 12px 0 0; }

.mdp-topics-hub__lang-options button {
    width: 100%; height: 42px; padding: 0 10px;
    background: #ffffff; border: none; border-top: 1px solid #e5eaf4;
    color: #0f1b3d; font-size: 14px; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 6px; line-height: 1;
}

.mdp-topics-hub__lang-options button:hover { background: #f6f9ff; }

/* ─── Language content blocks ──────────────────────────────── */
.mdp-topics-hub__lang-block { display: none; }
.mdp-topics-hub__lang-block.active { display: block; }

/* ─── Hero + search ─────────────────────────────────────────── */
.mdp-topics-hub__hero { position: relative; max-width: 760px; margin-bottom: 24px; margin-top: 28px;}

.mdp-topics-hub__eyebrow {
    display: block; margin: 0 0 10px; color: var(--mth-blue);
    font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
}

.mdp-topics-hub__hero h1 {
    margin: 0; color: var(--mth-text); text-transform: none !important;
    font-size: clamp(28px, 4.5vw, 42px); line-height: 1.1; font-weight: 850; letter-spacing: -0.02em;
}

.mdp-topics-hub__hero p {
    width: min(100%, 620px); margin: 10px 0 0; color: var(--mth-muted);
    font-size: clamp(15px, 1.8vw, 17px); line-height: 1.55; font-weight: 400;
}

.mdp-topics-hub__search {
    display: flex; align-items: center; gap: 12px; min-height: 54px;
    width: min(100%, 760px); margin-top: 28px; padding: 0 18px;
    border: 1px solid rgba(8, 120, 255, 0.18); border-radius: 14px;
    background: rgba(255, 255, 255, 0.96); box-shadow: var(--mth-shadow);
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.mdp-topics-hub__search:focus-within {
    border-color: rgba(8, 120, 255, 0.45);
    box-shadow: 0 18px 42px rgba(8, 120, 255, 0.12);
    transform: translateY(-1px);
}

.mdp-topics-hub__search svg {
    flex: 0 0 22px; width: 22px; height: 22px;
    stroke: var(--mth-blue); stroke-width: 2; fill: none;
}

.mdp-topics-hub__search input {
    -webkit-appearance: none; appearance: none;
    width: 100%; min-width: 0; height: 100%;
    border: none !important; outline: none !important; box-shadow: none !important;
    border-radius: 0 !important; background: transparent !important;
    color: var(--mth-text); font: inherit; font-size: clamp(13px, 3.6vw, 15px); font-weight: 650; margin: 0; padding: 0;
}

.mdp-topics-hub__search input::placeholder { color: #7883a0; opacity: 1; }

/* Remove native browser chrome for type="search" (would otherwise draw its
   own inset box/clear button, making the field look nested inside the bar). */
.mdp-topics-hub__search input::-webkit-search-decoration,
.mdp-topics-hub__search input::-webkit-search-cancel-button,
.mdp-topics-hub__search input::-webkit-search-results-button,
.mdp-topics-hub__search input::-webkit-search-results-decoration {
    -webkit-appearance: none;
    display: none;
}

/* ─── Topics list ────────────────────────────────────────────── */
.mdp-topics-hub__topics { margin-top: 34px; }

.mdp-topics-hub__topics h2 {
    margin-bottom: 20px; color: var(--mth-text);
    font-size: clamp(20px, 2.4vw, 26px); line-height: 1.15; font-weight: 850; letter-spacing: -0.01em;
}

.mdp-topics-hub__topics > p {
    margin: 6px 0 20px; color: var(--mth-muted); font-size: 14px; line-height: 1.5; font-weight: 400;
}

.mdp-topics-hub__list {
    display: grid; grid-template-columns: 1fr; gap: 16px;
}

.mdp-topics-hub__card {
    position: relative; display: grid;
    grid-template-columns: 62px minmax(0, 1fr) 22px;
    align-items: center; gap: 14px; min-height: 132px; padding: 22px;
    color: inherit; text-decoration: none;
    border: 1px solid rgba(223, 231, 245, 0.92); border-radius: 18px; background: #ffffff;
    box-shadow: 0 12px 28px rgba(15, 34, 87, 0.045);
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, background-color 180ms ease;
}

.mdp-topics-hub__card:hover,
.mdp-topics-hub__card:focus-visible {
    border-color: rgba(8, 120, 255, 0.28);
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    box-shadow: var(--mth-shadow-hover);
    transform: translateY(-3px);
    text-decoration: none;
}

.mdp-topics-hub__card[hidden] { display: none; }

.mdp-topics-hub__icon {
    display: grid; place-items: center; width: 56px; height: 56px;
    border: 1px solid #e8f0fb; border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, var(--mth-soft-blue) 100%);
    box-shadow: inset 0 -1px 0 rgba(8, 120, 255, 0.06);
}

.mdp-topics-hub__icon svg {
    width: 32px; height: 32px; stroke: var(--mth-blue);
    stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; fill: none;
}

.mdp-topics-hub__copy { display: grid; gap: 7px; min-width: 0; }

.mdp-topics-hub__title {
    color: var(--mth-text); font-size: clamp(16px, 1.8vw, 19px); line-height: 1.2;
    font-weight: 700; letter-spacing: -0.01em;
}

.mdp-topics-hub__desc {
    max-width: 430px; color: var(--mth-muted); font-size: 14px; line-height: 1.45; font-weight: 600;
}

.mdp-topics-hub__arrow {
    justify-self: end; color: var(--mth-blue); font-size: 34px; line-height: 1;
    font-weight: 300; opacity: 0.84; transition: transform 180ms ease, opacity 180ms ease;
}

.mdp-topics-hub__card:hover .mdp-topics-hub__arrow,
.mdp-topics-hub__card:focus-visible .mdp-topics-hub__arrow { transform: translateX(4px); opacity: 1; }

.mdp-topics-hub__empty {
    display: none; padding: 24px; text-align: center; color: var(--mth-muted); font-size: 14px;
}

/* ─── Help footer ─────────────────────────────────────────────── */
.mdp-topics-hub__help {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px;
    margin-top: 32px; padding-top: 24px;
    border-top: 1px solid rgba(223, 231, 245, 0.92);
    color: var(--mth-muted); font-size: 13.5px; text-align: center;
}

.mdp-topics-hub__help svg {
    flex-shrink: 0; width: 17px; height: 17px;
    stroke: var(--mth-blue); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; fill: none;
}

.mdp-topics-hub__help a {
    color: var(--mth-blue) !important;
    font-weight: 700;
    text-decoration: none !important;
}

.mdp-topics-hub__help a:hover {
    color: var(--mth-blue-dark) !important;
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (min-width: 640px) {
    .mdp-topics-hub__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
    .mdp-topics-hub { padding: 28px 16px 40px; }
    .mdp-topics-hub__topbar { gap: 16px; }
    .mdp-topics-hub__logo { width: 176px; }
    .mdp-topics-hub__switch { width: 118px; }
    .mdp-topics-hub__lang-selected,
    .mdp-topics-hub__lang-options,
    .mdp-topics-hub__lang-options button { width: 118px; box-sizing: border-box; }
    .mdp-topics-hub__lang-selected { height: 34px; font-size: 12px; padding: 0 8px; gap: 5px; }
    .mdp-topics-hub__lang-options { top: 34px; }
    .mdp-topics-hub__lang-options button { height: 34px; font-size: 12px; padding: 0 8px; gap: 5px; }
    .mdp-topics-hub__lang-globe { font-size: 15px; width: 15px; min-width: 15px; }
    .mdp-topics-hub__search { min-height: 48px; gap: 9px; padding: 0 14px; margin-top: 22px; }
    .mdp-topics-hub__search svg { flex-basis: 19px; width: 19px; height: 19px; }
    .mdp-topics-hub__search input { font-size: 13px; }
    .mdp-topics-hub__card {
        grid-template-columns: 54px minmax(0, 1fr) 20px;
        min-height: 102px; gap: 12px; padding: 16px 14px;
    }
    .mdp-topics-hub__icon { width: 48px; height: 48px; }
    .mdp-topics-hub__icon svg { width: 26px; height: 26px; }
    .mdp-topics-hub__title { font-size: 13.5px; line-height: 1.25; }
    .mdp-topics-hub__desc { font-size: 12px; line-height: 1.35; }
}
