/* Da Phuc: navigation bar, category drop-down, native scroll carousels, whole-card links.
   Loads after daphuc-modern.css. The theme's inline customizer CSS prints later, so
   some selectors carry "html #page" to win on specificity. */

/* ---------- Primary navigation (desktop, > 1050 px; meanmenu takes over below) ---------- */
@media (min-width: 1051px) {
    #page #masthead .head-wrap {
        display: flex;
        align-items: stretch;
        gap: 24px;
    }
    #page #masthead .head-wrap::before,
    #page #masthead .head-wrap::after { content: none; }
    #page #masthead .special-menu-container { float: none; flex: 0 0 auto; }
    #page #masthead #main-nav {
        float: none;
        flex: 1 1 auto;
        display: flex;
        align-items: stretch;
        min-width: 0;
        margin: 0;
    }
    #page #masthead #main-nav .main-navigation,
    #page #masthead #main-nav .wrap-menu-content,
    #page #masthead #main-nav .wrap-menu-content > div { display: flex; align-items: stretch; height: 100%; }
    #page #masthead .main-navigation ul.menu {
        display: flex;
        align-items: stretch;
        gap: 2px;
        margin: 0;
        padding: 0;
    }
    #page #masthead .main-navigation ul.menu > li { float: none; display: flex; }
}

/* Links: no transitions and no moving parts, so hover never flickers. Hover is a
   soft background pill; the current page keeps a static accent bar. */
html #page #masthead .main-navigation ul.menu > li > a {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    height: 56px;
    padding: 0 16px;
    color: var(--dp-text);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: .03em;
    text-transform: uppercase;
    background: transparent;
    transition: none;
}
html #page #masthead .main-navigation ul.menu > li > a::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 10px 2px;
    border-radius: 8px;
    background: transparent;
}
html #page #masthead .main-navigation ul.menu > li > a::after,
html #page #masthead .main-navigation ul.menu > li > a:hover::after {
    content: "";
    display: none;
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 0;
    width: auto;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--dp-accent);
    transform: none;
    transition: none;
}
html #page #masthead .main-navigation ul.menu > li > a:hover,
html #page #masthead .main-navigation ul.menu > li > a:focus-visible { color: var(--dp-primary-ink); }
html #page #masthead .main-navigation ul.menu > li > a:hover::before,
html #page #masthead .main-navigation ul.menu > li > a:focus-visible::before { background: var(--dp-primary-subtle); }
html #page #masthead .main-navigation ul.menu > li.current-menu-item > a,
html #page #masthead .main-navigation ul.menu > li.current_page_item > a,
html #page #masthead .main-navigation ul.menu > li.current-menu-ancestor > a { color: var(--dp-primary-ink); }
html #page #masthead .main-navigation ul.menu > li.current-menu-item > a::after,
html #page #masthead .main-navigation ul.menu > li.current_page_item > a::after,
html #page #masthead .main-navigation ul.menu > li.current-menu-ancestor > a::after { display: block; }
html body #page #masthead .main-navigation ul.menu > li > a:focus-visible { outline-offset: -6px; }

/* ---------- "Danh mục" toggle ---------- */
html #page #masthead .special-menu-container ul.special-menu-wrapper > li {
    position: relative;
    background: transparent;
}
html #page #masthead .special-menu-container ul.special-menu-wrapper a.special-menu {
    box-sizing: border-box;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 56px;
    padding: 0 48px 0 18px;
    border-radius: 10px 10px 0 0;
    background: var(--dp-action);
    color: var(--dp-on-action);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .05em;
    line-height: 1;
    transition: none;
}
html #page #masthead .special-menu-container ul.special-menu-wrapper a.special-menu:hover,
html #page #masthead .special-menu-container ul.special-menu-wrapper li:hover > a.special-menu { background: var(--dp-action-hover); }
html #page #masthead .special-menu-container ul.special-menu-wrapper li.menu-item-has-children > .angle-down {
    position: absolute;
    top: 0;
    right: 8px;
    float: none;
    width: 32px;
    height: 56px;
    line-height: 56px;
    font-size: 18px;
    z-index: 1000;
    pointer-events: none;
}
#page .special-menu-container ul.special-menu-wrapper > li { box-sizing: border-box; }

/* ---------- Category drop-down panel ---------- */
html #page .special-menu-container ul.special-menu-wrapper ul.special-sub-menu {
    /* Always in place (no left: -9999999px jump, no fade animation); only visibility
       changes. Closing waits 150 ms so the pointer can cross small gaps. */
    left: 0;
    top: 100%;
    display: block;
    width: 100%;
    max-height: var(--dp-dd-max, min(70vh, 480px));
    margin: 0;
    padding: 6px 0;
    overflow-x: hidden;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    opacity: 1;
    visibility: hidden;
    animation: none !important;
    transition: visibility 0s linear .15s;
    background: var(--dp-surface);
    border: 1px solid var(--dp-border);
    border-top: 0;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 16px 32px rgba(var(--dp-brand-surface-rgb), .14);
    scrollbar-width: thin;
    scrollbar-color: var(--dp-scrollbar) transparent;
}
/* Open states. A mouse click focuses the toggle and the theme adds .focus/.active,
   so those (and :focus-within) must not keep the panel open: the pointer uses :hover
   only, and leaving closes it after the 150 ms delay. Keyboard focus uses
   :focus-visible; JS adds .dp-open for an explicit open (click, tap, Enter) and keeps
   the theme's .active equal to it. */
html #page .special-menu-container ul.special-menu-wrapper li.menu-item-has-children:hover > ul.special-sub-menu,
html #page .special-menu-container ul.special-menu-wrapper li.menu-item-has-children.dp-open > ul.special-sub-menu {
    visibility: visible;
    transition-delay: 0s;
}
html #page .special-menu-container ul.special-menu-wrapper li.menu-item-has-children:has(:focus-visible) > ul.special-sub-menu {
    visibility: visible;
    transition-delay: 0s;
}
/* Explicit close (toggle click, Escape) wins over every open state above. */
html #page .special-menu-container ul.special-menu-wrapper li.menu-item-has-children.dp-closed > ul.special-sub-menu { visibility: hidden; transition-delay: 0s; }
/* Home: the panel is part of the hero layout and stays open (as in the theme). */
html body.home.page-template-home-template #page .special-menu-container:not(.onhover) ul.special-menu-wrapper ul.special-sub-menu {
    visibility: visible;
    max-height: none;
    overflow-y: visible !important;
    box-shadow: 0 6px 18px rgba(var(--dp-brand-surface-rgb), .06);
}
html #page .special-menu-container ul.special-sub-menu::-webkit-scrollbar { width: 8px; background: transparent; }
html #page .special-menu-container ul.special-sub-menu::-webkit-scrollbar-track { box-shadow: none; background: transparent; }
html #page .special-menu-container ul.special-sub-menu::-webkit-scrollbar-thumb {
    border: 2px solid var(--dp-surface);
    border-radius: 8px;
    background: var(--dp-scrollbar);
}
/* "More below" hint while the list can still scroll down. */
html #page .special-menu-container ul.special-sub-menu.dp-has-more::after {
    content: "\f107";
    position: sticky;
    bottom: -6px;
    display: block;
    height: 34px;
    margin: -34px 0 -6px;
    padding-top: 12px;
    font-family: FontAwesome;
    font-size: 16px;
    line-height: 1;
    text-align: center;
    color: var(--dp-primary-ink);
    background: linear-gradient(rgba(var(--dp-surface-rgb), 0), var(--dp-surface) 70%);
    pointer-events: none;
}
html #page .special-menu-container ul.special-menu-wrapper ul.special-sub-menu li {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 14px;
    letter-spacing: 0;
    text-transform: none;
}
/* Row separators are drawn by a pseudo-element that ignores the pointer, so the
   links tile the panel with no 1 px gaps: the pointer is always over exactly one
   link and the highlight never drops out between rows. */
html #page .special-menu-container ul.special-menu-wrapper ul.special-sub-menu li { position: relative; }
html #page .special-menu-container ul.special-menu-wrapper ul.special-sub-menu li + li::before {
    content: "";
    position: absolute;
    z-index: 1;
    top: 0;
    left: 18px;
    right: 18px;
    height: 1px;
    background: var(--dp-menu-separator);
    pointer-events: none;
}
html #page .special-menu-container ul.special-menu-wrapper ul.special-sub-menu li a {
    display: block;
    width: 100%;
    padding: 10px 18px;
    color: var(--dp-text);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0;
    text-transform: none;
    background: transparent;
    transition: none;
}
html #page .special-menu-container ul.special-menu-wrapper ul.special-sub-menu li:hover,
html #page .special-menu-container ul.special-menu-wrapper ul.special-sub-menu li:hover a { background: transparent; }
html #page .special-menu-container ul.special-menu-wrapper ul.special-sub-menu li a:hover,
html #page .special-menu-container ul.special-menu-wrapper ul.special-sub-menu li a:focus-visible,
html #page .special-menu-container ul.special-menu-wrapper ul.special-sub-menu li.current-menu-item > a {
    background: var(--dp-primary-subtle);
    color: var(--dp-primary-ink);
    box-shadow: inset 3px 0 0 var(--dp-primary);
}
html body #page .special-menu-container ul.special-sub-menu li a:focus-visible { outline-offset: -3px; }

/* ---------- Native scroll carousels ---------- */
.dp-carousel { position: relative; }
.dp-scroller {
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.dp-scroller::-webkit-scrollbar { display: none; }
.dp-carousel.is-dragging .dp-scroller { scroll-snap-type: none; cursor: grabbing; user-select: none; }
.dp-carousel.is-dragging .dp-scroller a { pointer-events: none; }
html body #page .dp-scroller:focus-visible { outline: 3px solid var(--dp-accent) !important; outline-offset: 3px; }

/* Hero sliders (one slide per view). The theme hides slides that are not Slick slides. */
html #page .main-slider-wrap .main-slider.dp-scroller {
    display: flex;
    border-radius: var(--dp-radius);
}
html #page .main-slider-wrap .main-slider.dp-scroller > .slide-item {
    display: block;
    flex: 0 0 100%;
    width: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}
html #page .main-slider-wrap .slide-item .slider-desc {
    left: 0;
    right: 0;
    bottom: auto;
    top: 50%;
    padding: 0 88px;
    transform: translateY(-50%);
}
html #page .main-slider-wrap .slide-item .slide-title,
html #page .main-slider-wrap .slide-item .slide-title a {
    font-size: clamp(24px, 2.6vw, 40px);
    line-height: 1.2;
    font-weight: 700;
    text-shadow: 0 2px 14px rgba(0, 0, 0, .5);
}
html #page .main-slider-wrap .slide-item .ae-overlay {
    background: linear-gradient(90deg, rgba(var(--dp-brand-surface-deep-rgb), .55) 0%, rgba(var(--dp-brand-surface-deep-rgb), .15) 60%, rgba(var(--dp-brand-surface-deep-rgb), 0) 100%);
    transition: none;
}
html #page .main-slider-wrap .slide-item:hover .ae-overlay {
    background: linear-gradient(90deg, rgba(var(--dp-brand-surface-deep-rgb), .65) 0%, rgba(var(--dp-brand-surface-deep-rgb), .25) 60%, rgba(var(--dp-brand-surface-deep-rgb), .05) 100%);
}

/* Card rows (home categories / products). Columns follow the theme's Slick settings. */
html #page ul.ae-list-items.dp-scroller {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 3 * 20px) / 4);
    gap: 20px;
    width: auto;
    margin: -8px -4px 0;
    padding: 8px 4px 12px;
    scroll-padding-inline: 4px;
    visibility: visible;
    float: none;
}
html #page ul.ae-list-items.dp-scroller > li.product {
    display: flex;
    float: none;
    width: auto;
    margin: 0;
    padding: 0;
    scroll-snap-align: start;
}
html #page ul.ae-list-items.dp-scroller > li.product .ae-woo-block-wrap { height: 100%; }
/* The theme's clearfix (::before/::after with content "") would become an empty
   grid column at the end of the track and leave a blank "page" after the last card. */
html #page ul.ae-list-items.dp-scroller::before,
html #page ul.ae-list-items.dp-scroller::after { content: none; display: none; }
/* The last card snaps to the right edge, so the final position is the last full
   group of cards (also with the phone "peek" layout), never a half-empty view. */
html #page ul.ae-list-items.dp-scroller > li.product:last-child { scroll-snap-align: end; }
@media (max-width: 991px) { html #page ul.ae-list-items.dp-scroller { grid-auto-columns: calc((100% - 2 * 16px) / 3); gap: 16px; } }
@media (max-width: 767px) { html #page ul.ae-list-items.dp-scroller { grid-auto-columns: calc((100% - 16px) / 2); gap: 16px; } }
/* Phones: one card and a peek of the next, so the row reads as scrollable. */
@media (max-width: 479px) { html #page ul.ae-list-items.dp-scroller { grid-auto-columns: 84%; gap: 12px; } }
html #page .ae-carousel-wrap { float: none; width: 100%; }

/* Arrows: round, centred icon, same look on every carousel. */
html #page .dp-carousel button.dp-carousel__arrow {
    position: absolute;
    z-index: 4;
    top: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: -22px 0 0;
    padding: 0;
    border: 1px solid rgba(var(--dp-brand-surface-rgb), .08);
    border-radius: 50%;
    background: rgba(var(--dp-surface-rgb), .92);
    color: var(--dp-brand-surface);
    box-shadow: 0 4px 16px rgba(var(--dp-brand-surface-rgb), .18);
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
html #page .dp-carousel button.dp-carousel__arrow:hover,
html #page .dp-carousel button.dp-carousel__arrow:focus-visible { background: var(--dp-action); color: var(--dp-on-action); }
.dp-carousel__arrow svg,
.dp-vertical-arrow svg {
    display: block;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}
html #page .dp-carousel--hero button.dp-carousel__arrow--prev { left: 16px; }
html #page .dp-carousel--hero button.dp-carousel__arrow--next { right: 16px; }
/* Card rows: arrows sit on the image band, half outside the row. */
html #page .dp-carousel--cards button.dp-carousel__arrow { top: 38%; }
html #page .dp-carousel--cards button.dp-carousel__arrow--prev { left: -18px; }
html #page .dp-carousel--cards button.dp-carousel__arrow--next { right: -18px; }
.dp-carousel.is-static .dp-carousel__arrow,
.dp-carousel.is-static .dp-carousel__dots { display: none !important; }

/* Dots: 24 px hit area, small visible pill. */
.dp-carousel__dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
    margin-top: 16px;
}
html #page .dp-carousel__dots button.dp-carousel__dot {
    position: relative;
    width: 24px;
    height: 24px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
}
html #page .dp-carousel__dots button.dp-carousel__dot::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    border-radius: 50%;
    background: rgba(var(--dp-brand-surface-rgb), .25);
}
/* Active dot: a larger circle (real width/height, no scale), so it stays round. */
html #page .dp-carousel__dots button.dp-carousel__dot[aria-current="true"]::after {
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
    border-radius: 50%;
    background: var(--dp-action);
    transform: none;
}
html body #page .dp-carousel__dots button.dp-carousel__dot:focus-visible { outline-offset: -2px; }
.dp-carousel--hero .dp-carousel__dots {
    position: absolute;
    z-index: 4;
    left: 50%;
    bottom: 12px;
    margin: 0;
    padding: 0 6px;
    border-radius: 14px;
    background: rgba(var(--dp-brand-surface-deep-rgb), .35);
    transform: translateX(-50%);
}
html #page .dp-carousel--hero .dp-carousel__dots button.dp-carousel__dot::after { background: rgba(var(--dp-on-brand-rgb), .6); }
html #page .dp-carousel--hero .dp-carousel__dots button.dp-carousel__dot[aria-current="true"]::after { background: var(--dp-on-brand); }

/* Vertical (Slick) slider arrows on the home hero. */
html #page .slider-section-right .verticle-slider .slick-arrow.dp-vertical-arrow {
    display: flex !important;
    align-items: center;
    justify-content: center;
    top: auto;
    bottom: auto;
    left: 50%;
    right: auto;
    width: 36px;
    height: 36px;
    margin: 0 0 0 -18px;
    padding: 0;
    border-radius: 50%;
    background: rgba(var(--dp-surface-rgb), .92);
    color: var(--dp-brand-surface);
    box-shadow: 0 4px 14px rgba(var(--dp-brand-surface-rgb), .2);
    font-size: 0;
    line-height: 1;
    opacity: 0;
    transform: none;
    transition: opacity .15s ease, background-color .15s ease, color .15s ease;
    cursor: pointer;
}
html #page .slider-section-right .verticle-slider .slick-arrow.dp-vertical-arrow.prev { top: 10px; }
html #page .slider-section-right .verticle-slider .slick-arrow.dp-vertical-arrow.next { bottom: 10px; }
html #page .slider-section-right .verticle-slider:hover .slick-arrow.dp-vertical-arrow,
html #page .slider-section-right .verticle-slider:focus-within .slick-arrow.dp-vertical-arrow { opacity: 1; }
html #page .slider-section-right .verticle-slider .slick-arrow.dp-vertical-arrow:hover,
html #page .slider-section-right .verticle-slider .slick-arrow.dp-vertical-arrow:focus-visible { background: var(--dp-action); color: var(--dp-on-action); }
.dp-vertical-arrow svg { width: 18px; height: 18px; }

@media (max-width: 767px) {
    /* Phones: arrows move to the bottom-right corner so they never cover the caption. */
    html #page .main-slider-wrap .slide-item .slider-desc { padding: 0 20px 36px; }
    html #page .dp-carousel--hero button.dp-carousel__arrow { top: auto; bottom: 10px; margin: 0; width: 38px; height: 38px; }
    html #page .dp-carousel--hero button.dp-carousel__arrow--prev { left: auto; right: 56px; }
    html #page .dp-carousel--hero button.dp-carousel__arrow--next { right: 12px; }
    html #page .dp-carousel--hero .dp-carousel__dots { left: 12px; bottom: 17px; transform: none; }
    html #page .dp-carousel--cards button.dp-carousel__arrow { width: 38px; height: 38px; margin-top: -19px; }
    html #page .dp-carousel--cards button.dp-carousel__arrow--prev { left: 4px; }
    html #page .dp-carousel--cards button.dp-carousel__arrow--next { right: 4px; }
}

/* ---------- Whole-card links ----------
   The card's own title link is stretched over the card with ::after, so the image
   and empty space are part of one real <a> (middle/modifier clicks work, no JS,
   no nested anchors). Buttons inside the card sit above it. */
#page li.product .ae-woo-block-wrap { position: relative; }
html #page li.product .product-info-wrap > a:first-child { position: static; }
html #page li.product .product-info-wrap > a:first-child::after {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 0;
    border-radius: var(--dp-radius);
}
html #page li.product .add-to-cart-wrap,
html #page li.product .view-details-wrap { position: relative; z-index: 2; }
/* Quick view eye removed from every card (hover, focus, list view). */
html body #page li.product a.yith-wcqv-button,
html body #page li.product:hover a.yith-wcqv-button,
html body #page li.product:focus-within a.yith-wcqv-button { display: none !important; }
/* The theme's hover-only image link is covered by the card link now. */
html #page li.product .product-thumb-wrap a.ae-product-link { display: none; }
html body #page li.product .product-info-wrap > a:first-child:focus-visible { outline: none !important; }
html body #page li.product .product-info-wrap > a:first-child:focus-visible::after {
    outline: 3px solid var(--dp-accent);
    outline-offset: -3px;
}

@media (prefers-reduced-motion: reduce) {
    .dp-scroller { scroll-behavior: auto; }
}

/* ---------- Header icons ----------
   Top bar, social and hotline icons are inline SVG (see daphuc_icon()). The other
   theme-chrome icons still use .fa with Font Awesome 4 codes; Elementor pages that
   load Font Awesome 5 redefine .fa, so pin the chrome back to FA4 (loaded everywhere). */
.dp-icon {
    display: inline-block;
    flex-shrink: 0;
    width: 1em;
    height: 1em;
    fill: currentColor;
    vertical-align: -0.14em;
}
#page #top-bar .top-left-inner span .dp-icon { margin-right: 6px; color: var(--dp-on-brand); opacity: .75; }
#page #top-bar .top-header-social-icons ul li a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 43px;
    color: rgba(var(--dp-on-brand-rgb), .86);
}
#page #top-bar .top-header-social-icons ul li a:hover,
#page #top-bar .top-header-social-icons ul li a:focus-visible { color: var(--dp-on-brand); }
#page #top-bar .top-header-social-icons .dp-icon { width: 16px; height: 16px; }
.dp-hotline__icon .dp-icon { width: 20px; height: 20px; }
@media (max-width: 767px) { .dp-hotline__icon .dp-icon { width: 18px; height: 18px; } }
html body #page #top-bar .fa,
html body #page .mid-header .fa,
html body #page #masthead .fa,
html body #page #sidebar-primary .fa,
html body #page #footer-widgets .fa,
html body #page #colophon .fa,
html body #page li.product .fa {
    font-family: FontAwesome !important;
    font-weight: normal !important;
    font-style: normal;
}
