/* DrugsGeneral 100.0.7 — mobile UX / layout refinement */

/* Prevent common horizontal overflow from long labels, grids and third-party widgets. */
html, body { max-width: 100%; overflow-x: clip; }
.container, .dg-home-layout, .dg-shop-layout, .dg-footer-grid, .dg-footer-bottom { min-width: 0; }
.dg-home-layout > *, .dg-shop-layout > *, .dg-main-content, .dg-shop-main { min-width: 0; }
img, svg, video, iframe { max-width: 100%; }

/* ── Footer translate: responsive, touch friendly ───────────────────── */
.dg-footer-translate { position: relative; margin-top: 12px; width: 100%; }
.dg-footer-translate-btn {
    display: inline-flex; align-items: center; gap: 7px; min-height: 44px;
    background: transparent; color: rgba(255,255,255,.78); border: 0; padding: 7px 0;
    font-family:inherit; font-size:13px; font-weight:600; line-height:1.2; cursor: pointer; white-space: nowrap;
}
.dg-footer-translate-btn:hover { color: #fff; }
.dg-footer-translate-panel {
    display: none; position: absolute; left: 0; bottom: calc(100% + 8px);
    width: min(300px, calc(100vw - 32px)); max-height: min(420px, 72vh);
    background: #fff; color: #222; border-radius: 14px;
    box-shadow: 0 16px 48px rgba(0,0,0,.25), 0 3px 10px rgba(0,0,0,.12);
    overflow: hidden; font-family: system-ui,-apple-system,sans-serif; z-index: 99991;
}
.dg-footer-translate-panel[style*="display: block"],
.dg-footer-translate-panel.dg-is-open { display: block !important; }
.dg-footer-translate-head { display:flex; align-items:center; justify-content:space-between; padding:12px 14px 10px; background:#1e3a5f; color:#fff; }
.dg-footer-translate-close { background:none; border:0; color:rgba(255,255,255,.78); font-size:18px; cursor:pointer; padding:6px; min-width:40px; min-height:40px; line-height:1; }
.dg-footer-translate-grid { display:grid; grid-template-columns:1fr 1fr; padding:8px; gap:2px; max-height:300px; overflow-y:auto; -webkit-overflow-scrolling:touch; overscroll-behavior:contain; }
.dg-footer-translate-item { display:flex; align-items:center; gap:6px; min-height:42px; padding:8px 10px; font-size:12.5px; color:#444; text-decoration:none; border-radius:8px; transition:background .12s,color .12s; white-space:nowrap; overflow:hidden; }
.dg-footer-translate-item:hover, .dg-footer-translate-item:focus-visible { background:#EFF6FF; color:#1e3a5f; }
.dg-footer-translate-foot { padding:8px 14px 10px; border-top:1px solid #F0F0F0; text-align:center; }
.dg-footer-translate-reset { display:inline-flex; align-items:center; justify-content:center; min-height:38px; padding:5px 10px; font-size:11px; color:#777; text-decoration:none; }

/* ── Mobile category circles — positioned after the first product rail ─── */
.dg-mobile-category-slider { display:none; }
@media (max-width: 767px) {
    .dg-mobile-category-slider {
        display:block;
        width:100%;
        box-sizing:border-box;
        margin:4px 0 24px;
        padding:16px 12px 12px;
        background:linear-gradient(180deg,#ffffff 0%,#F7FBFC 100%);
        border:1px solid #E3EEF0;
        border-radius:16px;
        box-shadow:0 4px 18px rgba(0,48,56,.055);
        overflow:hidden;
    }
    .dg-mobile-category-head {
        display:flex;
        align-items:center;
        justify-content:space-between;
        gap:12px;
        margin:0 0 13px;
        min-width:0;
    }
    .dg-mobile-category-title-wrap { min-width:0; }
    .dg-mobile-category-kicker {
        display:block;
        margin:0 0 3px;
        color:var(--muted,#8F9191);
        font-size:9px;
        font-weight:800;
        letter-spacing:.13em;
        line-height:1;
        text-transform:uppercase;
    }
    .dg-mobile-category-head h2 {
        margin:0;
        color:var(--ink,#0F1111);
        font:800 18px/1.15 var(--font-head,'Outfit',sans-serif);
        letter-spacing:-.01em;
    }
    .dg-mobile-category-all {
        flex:0 0 auto;
        display:inline-flex;
        align-items:center;
        justify-content:center;
        gap:4px;
        min-height:36px;
        max-width:108px;
        box-sizing:border-box;
        padding:7px 9px;
        border:1px solid #C8EBF0;
        border-radius:9px;
        background:#F4FBFC;
        color:var(--navy,#008296);
        font-size:11px;
        font-weight:800;
        line-height:1;
        text-decoration:none;
        white-space:nowrap;
    }
    .dg-mobile-category-all:active { transform:scale(.97); background:#EDF7F9; }
    .dg-mobile-category-track-wrap { position:relative; min-width:0; }
    .dg-mobile-category-track {
        display:flex;
        gap:13px;
        width:max-content;
        min-width:100%;
        overflow-x:auto;
        overflow-y:hidden;
        box-sizing:border-box;
        padding:2px 2px 10px;
        scroll-snap-type:x proximity;
        -webkit-overflow-scrolling:touch;
        overscroll-behavior-x:contain;
        scrollbar-width:none;
    }
    .dg-mobile-category-track::-webkit-scrollbar { display:none; }
    .dg-mobile-category-card {
        flex:0 0 78px;
        width:78px;
        min-width:78px;
        display:flex;
        flex-direction:column;
        align-items:center;
        gap:7px;
        color:var(--ink,#0F1111);
        text-decoration:none;
        scroll-snap-align:start;
        -webkit-tap-highlight-color:transparent;
    }
    .dg-mobile-category-icon {
        position:relative;
        width:68px;
        height:68px;
        box-sizing:border-box;
        display:flex;
        align-items:center;
        justify-content:center;
        border-radius:50%;
        background:radial-gradient(circle at 35% 25%,#fff 0%,#F8FEFF 42%,#EAF7F9 100%);
        border:1px solid #CBE9ED;
        box-shadow:0 5px 14px rgba(0,48,56,.08),inset 0 0 0 4px rgba(255,255,255,.72);
        overflow:hidden;
        transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease;
    }
    .dg-mobile-category-icon::after {
        content:"";
        position:absolute;
        inset:4px;
        border-radius:50%;
        border:1px solid rgba(0,130,150,.07);
        pointer-events:none;
    }
    .dg-mobile-category-icon img { width:100%; height:100%; object-fit:cover; display:block; }
    .dg-mobile-category-icon svg { width:42px; height:42px; max-width:70%; max-height:70%; }
    .dg-mobile-category-card:active .dg-mobile-category-icon { transform:scale(.94); box-shadow:0 3px 9px rgba(0,48,56,.08); }
    .dg-mobile-category-card.is-active .dg-mobile-category-icon {
        border-color:var(--navy,#008296);
        box-shadow:0 0 0 3px rgba(0,130,150,.11),0 6px 15px rgba(0,48,56,.10);
    }
    .dg-mobile-category-name {
        display:-webkit-box;
        width:100%;
        min-height:25px;
        box-sizing:border-box;
        color:var(--slate,#565959);
        font-size:10.5px;
        font-weight:700;
        line-height:1.22;
        text-align:center;
        overflow:hidden;
        -webkit-box-orient:vertical;
        -webkit-line-clamp:2;
        word-break:break-word;
    }
    .dg-mobile-category-card.is-active .dg-mobile-category-name { color:var(--navy,#008296); }
    .dg-mobile-category-fade {
        position:absolute;
        top:0;
        bottom:9px;
        width:22px;
        pointer-events:none;
        z-index:2;
    }
    .dg-mobile-category-fade-right {
        right:-1px;
        background:linear-gradient(90deg,rgba(247,251,252,0),rgba(247,251,252,.98));
    }
    .dg-mobile-category-scrollhint {
        display:flex;
        align-items:center;
        justify-content:center;
        gap:4px;
        height:4px;
        margin-top:1px;
    }
    .dg-mobile-category-scrollhint span {
        width:4px;
        height:4px;
        border-radius:50%;
        background:#B8DDE2;
    }
    .dg-mobile-category-scrollhint span:first-child { width:13px; border-radius:4px; background:#008296; }

    /* Homepage mobile rhythm: hero stays first; category is rendered after the first product rail. */
    .dg-home-layout { display:block !important; }
    .dg-home-layout > .dg-sidebar { display:none !important; }
    .dg-main-content { width:100% !important; max-width:none !important; min-width:0; }
    .dg-main-content > * { min-width:0; }
    .dg-section-head { gap:8px; align-items:center; }
    .dg-section-title { min-width:0; overflow-wrap:anywhere; }
    .dg-section-link { flex:0 0 auto; }
    .dg-products-section { margin-bottom:22px !important; min-width:0; }
    .dg-shop-layout { display:block !important; }
    .dg-shop-sidebar { display:none !important; }
    .dg-shop-main { width:100% !important; max-width:100% !important; box-sizing:border-box; padding-left:12px; padding-right:12px; }
    .dg-shop-toolbar { min-width:0; }
    .dg-shop-search { min-width:0; }
    .dg-shop-count { overflow-wrap:anywhere; }
    .dg-footer-grid { grid-template-columns:1fr 1fr !important; gap:24px 18px !important; }
    .dg-footer-brand { grid-column:1 / -1; }
    .dg-footer-bottom { flex-direction:column !important; align-items:flex-start !important; gap:12px !important; }
    .dg-footer-pay, .dg-footer-ships { flex-wrap:wrap !important; }
}

@media (max-width:430px) {
    .dg-mobile-category-slider { margin-bottom:20px; padding:14px 10px 10px; border-radius:14px; }
    .dg-mobile-category-head { margin-bottom:11px; }
    .dg-mobile-category-head h2 { font-size:17px; }
    .dg-mobile-category-all { min-height:34px; padding:6px 8px; font-size:10.5px; }
    .dg-mobile-category-track { gap:11px; padding-left:1px; padding-right:1px; }
    .dg-mobile-category-card { flex-basis:74px; width:74px; min-width:74px; }
    .dg-mobile-category-icon { width:64px; height:64px; }
    .dg-mobile-category-name { font-size:10px; }
}
@media (max-width:360px) {
    .dg-mobile-category-slider { padding-left:9px; padding-right:9px; }
    .dg-mobile-category-head { gap:8px; }
    .dg-mobile-category-all span:first-child { max-width:48px; overflow:hidden; text-overflow:ellipsis; }
    .dg-mobile-category-card { flex-basis:68px; width:68px; min-width:68px; }
    .dg-mobile-category-icon { width:58px; height:58px; }
    .dg-mobile-category-name { font-size:9.5px; }
    .dg-footer-grid { grid-template-columns:1fr !important; }
    .dg-footer-brand { grid-column:auto; }
}

/* ── Pagination: clean Woo/WordPress-compatible component ───────────── */
.dg-pagination-wrap { width:100%; margin:26px 0 14px !important; overflow:hidden; }
.dg-pagination-wrap .navigation.pagination { margin:0 !important; }
.dg-pagination-wrap .nav-links {
    display:flex !important; align-items:center !important; justify-content:center !important; flex-wrap:wrap !important;
    gap:7px !important; width:100%;
}
.dg-pagination-wrap .nav-links a,
.dg-pagination-wrap .nav-links span {
    display:inline-flex !important; align-items:center !important; justify-content:center !important;
    min-width:38px !important; height:38px !important; padding:0 11px !important;
    border:1px solid var(--border,#D5D9D9) !important; border-radius:9px !important;
    background:#fff !important; color:var(--navy,#008296) !important; text-decoration:none !important;
    font-size:13px !important; font-weight:750 !important; line-height:1 !important; box-shadow:0 1px 2px rgba(0,0,0,.03);
    transition:transform .12s ease,background .15s ease,color .15s ease,border-color .15s ease;
}
.dg-pagination-wrap .nav-links a:hover,
.dg-pagination-wrap .nav-links a:focus-visible { background:var(--primary-50,#EDF7F9) !important; border-color:var(--primary-200,#93D5DF) !important; color:var(--navy-deep,#005F6B) !important; transform:translateY(-1px); }
.dg-pagination-wrap .nav-links span.current { background:var(--navy,#008296) !important; border-color:var(--navy,#008296) !important; color:#fff !important; }
.dg-pagination-wrap .nav-links .dots { min-width:22px !important; padding:0 3px !important; border-color:transparent !important; background:transparent !important; color:var(--muted,#8F9191) !important; box-shadow:none; }
.dg-pagination-wrap .nav-links .prev,
.dg-pagination-wrap .nav-links .next { min-width:auto !important; padding:0 14px !important; gap:5px; }
.dg-pagination-wrap .nav-links .prev:empty,
.dg-pagination-wrap .nav-links .next:empty { display:none !important; }

@media (max-width:480px) {
    .dg-pagination-wrap { margin-top:20px !important; }
    .dg-pagination-wrap .nav-links { gap:5px !important; }
    .dg-pagination-wrap .nav-links a,
    .dg-pagination-wrap .nav-links span { min-width:34px !important; height:34px !important; padding:0 8px !important; font-size:12px !important; border-radius:8px !important; }
    .dg-pagination-wrap .nav-links .prev,
    .dg-pagination-wrap .nav-links .next { padding:0 10px !important; }
}
@media (max-width:360px) {
    .dg-mobile-category-card { flex-basis:70px; width:70px; min-width:70px; }
    .dg-mobile-category-icon { width:58px; height:58px; }
    .dg-mobile-category-name { font-size:10px; }
    .dg-footer-grid { grid-template-columns:1fr !important; }
    .dg-footer-brand { grid-column:auto; }
}

@media (prefers-reduced-motion: reduce) {
    .dg-mobile-category-icon, .dg-pagination-wrap .nav-links a { transition:none !important; }
}


/* ── Final pagination polish / mobile-safe width ─────────────────────── */
.dg-pagination-wrap { box-sizing:border-box; width:100%; max-width:100%; padding:0 2px; overflow:visible !important; }
.dg-pagination-wrap .navigation.pagination { width:100%; max-width:100%; box-sizing:border-box; }
.dg-pagination-wrap .nav-links { width:100%; max-width:100%; box-sizing:border-box; }
.dg-pagination-wrap .nav-links a,
.dg-pagination-wrap .nav-links span { box-sizing:border-box; white-space:nowrap; }
.dg-pagination-wrap .nav-links .next,
.dg-pagination-wrap .nav-links .prev { white-space:nowrap; }
@media (max-width:480px) {
    .dg-pagination-wrap { padding:0; margin:20px 0 10px !important; }
    .dg-pagination-wrap .nav-links { gap:5px !important; justify-content:center !important; }
    .dg-pagination-wrap .nav-links a,
    .dg-pagination-wrap .nav-links span { min-width:34px !important; height:34px !important; padding:0 8px !important; font-size:12px !important; }
    .dg-pagination-wrap .nav-links .prev,
    .dg-pagination-wrap .nav-links .next { padding:0 9px !important; }
}
