/* ============================================================================
   Mobile homepage UX refinements - dailyxedien.vn
   Scope: small mobile only, child-theme isolated.
   ============================================================================ */

@media (max-width: 549px) {
  :root {
    --dxd-blue: #1e73be;
    --dxd-blue-dark: #155a96;
    --dxd-orange: #f59e0b;
    --dxd-red: #e11d48;
    --dxd-ink: #172033;
    --dxd-muted: #667085;
    --dxd-line: #e8edf3;
    --dxd-soft: #f4f6f8;
    --dxd-card: #fff;
    --dxd-shadow: 0 8px 22px rgba(23, 32, 51, 0.07);
  }

  body.home {
    background: var(--dxd-soft) !important;
    color: var(--dxd-ink);
    -webkit-font-smoothing: antialiased;
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .home #main,
  .home #content {
    background: var(--dxd-soft) !important;
  }

  .home .section {
    background: transparent !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
  }

  .home .container,
  .home .row {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  .home .section-title,
  .home .section-titlelo {
    margin: 8px 0 10px !important;
    border: 0 !important;
  }

  .home .section-title-main,
  .home span.section-titlelo-main,
  .home .section-title span {
    color: var(--dxd-ink) !important;
    font-size: 16px !important;
    line-height: 1.25 !important;
    font-weight: 800 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
  }

  .home .section-title b,
  .home .section-titlelo b {
    display: none !important;
  }

  /* Header */
  .header-main {
    height: 54px !important;
    background: rgba(255, 255, 255, 0.98) !important;
    border-bottom: 1px solid rgba(232, 237, 243, 0.9) !important;
    box-shadow: 0 2px 12px rgba(23, 32, 51, 0.05) !important;
  }

  #logo img {
    max-height: 44px !important;
  }

  .header-main .nav > li > a {
    min-height: 44px !important;
  }

  /* Hero */
  .home .slider-wrapper,
  .home .banner-slider {
    margin: 6px 8px 10px !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    background: #fff !important;
    box-shadow: var(--dxd-shadow) !important;
  }

  .home .flickity-page-dots {
    bottom: 8px !important;
  }

  .home .flickity-page-dots .dot {
    width: 6px !important;
    height: 6px !important;
    margin: 0 3px !important;
    border: 0 !important;
    background: rgba(255, 255, 255, 0.62) !important;
    opacity: 1 !important;
  }

  .home .flickity-page-dots .dot.is-selected {
    width: 18px !important;
    border-radius: 999px !important;
    background: #fff !important;
  }

  /* Search */
  .dxd-mobile-search {
    height: 44px !important;
    display: grid !important;
    grid-template-columns: 24px minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 8px 8px 10px !important;
    padding: 5px 5px 5px 12px !important;
    background: #fff !important;
    border: 1px solid rgba(30, 115, 190, 0.16) !important;
    border-radius: 12px !important;
    box-shadow: 0 5px 16px rgba(23, 32, 51, 0.06) !important;
  }

  .dxd-mobile-search__icon {
    width: 20px !important;
    height: 20px !important;
    display: block !important;
  }

  .dxd-mobile-search__input {
    width: 100% !important;
    min-width: 0 !important;
    height: 34px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--dxd-ink) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 34px !important;
  }

  .dxd-mobile-search__input::placeholder {
    color: #8a94a6 !important;
    opacity: 1 !important;
    font-weight: 500 !important;
  }

  .dxd-mobile-search__input:focus {
    outline: 0 !important;
    box-shadow: none !important;
  }

  .dxd-mobile-search__submit {
    min-width: 52px !important;
    height: 34px !important;
    margin: 0 !important;
    padding: 0 12px !important;
    border: 0 !important;
    border-radius: 9px !important;
    background: var(--dxd-blue) !important;
    color: #fff !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 34px !important;
    text-transform: none !important;
  }

  /* Quick category rail */
  .dxd-mobile-categories-row {
    display: grid !important;
    grid-auto-flow: column !important;
    grid-auto-columns: 72px !important;
    gap: 8px !important;
    overflow-x: auto !important;
    overscroll-behavior-x: contain !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-snap-type: x proximity !important;
    margin: 0 8px 8px !important;
    padding: 10px 8px 8px !important;
    background: var(--dxd-card) !important;
    border: 1px solid var(--dxd-line) !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 14px rgba(23, 32, 51, 0.05) !important;
  }

  .dxd-mobile-categories-row::-webkit-scrollbar {
    display: none !important;
  }

  .dxd-category-item {
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 6px !important;
    color: var(--dxd-ink) !important;
    text-align: center !important;
    text-decoration: none !important;
    scroll-snap-align: start !important;
    -webkit-tap-highlight-color: transparent;
  }

  .dxd-category-icon-holder {
    width: 48px !important;
    height: 48px !important;
    display: grid !important;
    place-items: center !important;
    border-radius: 14px !important;
    color: var(--dxd-blue) !important;
    background: linear-gradient(145deg, #f1f7fd, #ffffff) !important;
    border: 1px solid rgba(30, 115, 190, 0.14) !important;
    box-shadow: inset 0 -1px 0 rgba(30, 115, 190, 0.08) !important;
    transition: transform 0.16s ease, background 0.16s ease !important;
  }

  .dxd-category-item:active .dxd-category-icon-holder {
    transform: scale(0.94) !important;
    background: #eaf4ff !important;
  }

  .dxd-category-icon-holder img {
    width: 28px !important;
    height: 28px !important;
    display: block !important;
    object-fit: contain !important;
  }

  .dxd-category-label {
    width: 100% !important;
    height: 28px !important;
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    overflow: hidden !important;
    color: var(--dxd-ink) !important;
    font-size: 10.5px !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
  }

  .dxd-mobile-trust-strip {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;
    margin: 0 8px 12px !important;
  }

  .dxd-mobile-trust-chip {
    min-width: 0 !important;
    min-height: 42px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    padding: 7px 5px !important;
    border: 1px solid #e8edf3 !important;
    border-radius: 10px !important;
    background: linear-gradient(180deg, #fff 0%, #fbfcfe 100%) !important;
    color: #314056 !important;
    box-shadow: 0 4px 12px rgba(23, 32, 51, 0.045) !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    line-height: 1.15 !important;
    text-align: left !important;
  }

  .dxd-mobile-trust-chip img {
    width: 20px !important;
    height: 20px !important;
    flex: 0 0 20px !important;
    object-fit: contain !important;
  }

  .dxd-mobile-trust-chip span {
    min-width: 0 !important;
    display: block !important;
  }

  /* Product cards */
  .home .products .row,
  .home .products .row-slider {
    padding-left: 4px !important;
    padding-right: 4px !important;
  }

  .home .products .product-small.col {
    padding: 5px !important;
  }

  .home .products .product-small .col-inner {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    background: var(--dxd-card) !important;
    border: 1px solid var(--dxd-line) !important;
    border-radius: 10px !important;
    box-shadow: 0 5px 16px rgba(23, 32, 51, 0.06) !important;
    transition: transform 0.16s ease, box-shadow 0.16s ease !important;
  }

  .home .products .product-small .col-inner:active {
    transform: translateY(1px) scale(0.99) !important;
    box-shadow: 0 3px 10px rgba(23, 32, 51, 0.05) !important;
  }

  .home .products .product-small .box-image {
    position: relative !important;
    aspect-ratio: 1 / 1 !important;
    padding-top: 0 !important;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%) !important;
    border-bottom: 1px solid #f0f3f7 !important;
    overflow: hidden !important;
  }

  .home .products .product-small .box-image a {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
  }

  .home .products .product-small .box-image img {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 88% !important;
    height: 88% !important;
    object-fit: contain !important;
  }

  .home .products .product-small .box-image .image-tools {
    display: none !important;
  }

  .home .products .product-small .badge-container {
    top: 7px !important;
    left: 7px !important;
    margin: 0 !important;
  }

  .home .products .product-small .badge-inner {
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 3px 6px !important;
    border-radius: 999px !important;
    background: var(--dxd-red) !important;
    color: #fff !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    box-shadow: 0 3px 8px rgba(225, 29, 72, 0.22) !important;
  }

  .dxd-product-chip {
    position: absolute !important;
    top: 7px !important;
    right: 7px !important;
    z-index: 3 !important;
    padding: 4px 6px !important;
    border-radius: 999px !important;
    background: #ecfdf3 !important;
    color: #027a48 !important;
    border: 1px solid #abefc6 !important;
    font-size: 9px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  .home .products .product-small .box-text {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 9px 8px 10px !important;
    background: #fff !important;
  }

  .home .products .product-small .product-title,
  .home .products .product-small .woocommerce-loop-product__title {
    min-height: 36px !important;
    max-height: 36px !important;
    margin: 0 0 7px !important;
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    overflow: hidden !important;
    color: var(--dxd-ink) !important;
    font-size: 12.5px !important;
    font-weight: 700 !important;
    line-height: 1.42 !important;
  }

  .dxd-product-meta {
    min-height: 18px !important;
    margin: 0 0 5px !important;
    color: var(--dxd-muted) !important;
    font-size: 10.5px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
  }

  .dxd-price-cta-container {
    margin-top: auto !important;
    display: flex !important;
    align-items: flex-end !important;
    justify-content: space-between !important;
    gap: 6px !important;
  }

  .home .products .product-small .price {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    min-width: 0 !important;
    margin: 0 !important;
    line-height: 1.15 !important;
  }

  .home .products .product-small ins,
  .home .products .product-small .price ins {
    text-decoration: none !important;
  }

  .home .products .product-small ins .woocommerce-Price-amount,
  .home .products .product-small .price ins,
  .home .products .product-small .price > .woocommerce-Price-amount {
    color: var(--dxd-red) !important;
    font-size: 13.5px !important;
    font-weight: 850 !important;
  }

  .home .products .product-small del,
  .home .products .product-small del .woocommerce-Price-amount {
    margin-top: 2px !important;
    color: #98a2b3 !important;
    font-size: 10.5px !important;
    font-weight: 500 !important;
  }

  .dxd-quick-view-btn {
    width: 30px !important;
    height: 30px !important;
    flex: 0 0 30px !important;
    display: grid !important;
    place-items: center !important;
    border: 0 !important;
    border-radius: 9px !important;
    background: var(--dxd-blue) !important;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(30, 115, 190, 0.23) !important;
    cursor: pointer !important;
    -webkit-tap-highlight-color: transparent;
  }

  .dxd-quick-view-btn:active {
    transform: scale(0.94) !important;
    background: var(--dxd-blue-dark) !important;
  }

  .dxd-quick-view-btn img {
    width: 16px !important;
    height: 16px !important;
    display: block !important;
    object-fit: contain !important;
  }

  /* Tabs and horizontal content */
  .home .tabbed-content .nav-tabs,
  .home .tabbed-content ul.nav {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    gap: 7px !important;
    overflow-x: auto !important;
    padding: 0 8px 10px !important;
    margin: 0 !important;
    border: 0 !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .home .tabbed-content .nav-tabs::-webkit-scrollbar,
  .home .tabbed-content ul.nav::-webkit-scrollbar {
    display: none !important;
  }

  .home .tabbed-content .nav-tabs li,
  .home .tabbed-content ul.nav li {
    flex: 0 0 auto !important;
    margin: 0 !important;
  }

  .home .tabbed-content .nav-tabs li a,
  .home .tabbed-content ul.nav li a {
    min-height: 32px !important;
    padding: 8px 13px !important;
    border: 1px solid var(--dxd-line) !important;
    border-radius: 999px !important;
    background: #fff !important;
    color: var(--dxd-muted) !important;
    font-size: 11.5px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
  }

  .home .tabbed-content .nav-tabs li.active a,
  .home .tabbed-content ul.nav li.active a {
    background: var(--dxd-blue) !important;
    border-color: var(--dxd-blue) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(30, 115, 190, 0.22) !important;
  }

  .home .from_the_blog .row {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
    overflow-x: auto !important;
    padding-bottom: 10px !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .home .from_the_blog .row::-webkit-scrollbar {
    display: none !important;
  }

  .home .from_the_blog .row > .col {
    flex: 0 0 78% !important;
    max-width: 78% !important;
  }

  .home .from_the_blog .col-inner {
    overflow: hidden !important;
    border: 1px solid var(--dxd-line) !important;
    border-radius: 10px !important;
    background: #fff !important;
    box-shadow: 0 5px 16px rgba(23, 32, 51, 0.06) !important;
  }

  /* Testimonials */
  .home .testimonial-box .col-inner,
  .home .test-col .col-inner {
    margin: 4px 6px !important;
    padding: 16px 14px !important;
    border: 1px solid var(--dxd-line) !important;
    border-radius: 10px !important;
    background: #fff !important;
    box-shadow: 0 5px 16px rgba(23, 32, 51, 0.06) !important;
  }

  .home .testimonial-box p,
  .home .test-col p,
  .home .testimonial-box .testimonial-text,
  .home .test-col .testimonial-text {
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 4 !important;
    overflow: hidden !important;
    color: #475467 !important;
    font-size: 12.5px !important;
    line-height: 1.55 !important;
  }

  /* Footer accordion */
  .footer-wrapper {
    margin: 0 !important;
    background: #132033 !important;
    color: rgba(255, 255, 255, 0.88) !important;
  }

  .footer-wrapper .section,
  .footer-wrapper .footer,
  .footer-wrapper .footer-1,
  .footer-wrapper .footer-2 {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    background: transparent !important;
  }

  .footer-wrapper .row {
    padding: 2px 12px calc(50px + env(safe-area-inset-bottom, 0px)) !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .footer-wrapper .row > .col {
    padding: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.045) !important;
  }

  .footer-wrapper .widget {
    margin: 0 !important;
    padding: 0 !important;
  }

  .footer-wrapper .dxd-footer-empty {
    display: none !important;
  }

  .footer-wrapper .widget-title {
    width: 100% !important;
    min-height: 34px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin: 0 !important;
    padding: 7px 0 !important;
    color: #fff !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    cursor: pointer !important;
  }

  .footer-wrapper .widget-title::after {
    content: "+" !important;
    color: rgba(255, 255, 255, 0.64) !important;
    font-size: 18px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
  }

  .footer-wrapper .dxd-accordion-ready.is-expanded .widget-title::after {
    content: "-" !important;
    color: var(--dxd-orange) !important;
  }

  .footer-wrapper .dxd-accordion-ready .widget-title ~ * {
    max-height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    transition: max-height 0.24s ease, opacity 0.2s ease, padding 0.2s ease !important;
  }

  .footer-wrapper .dxd-accordion-ready.is-expanded .widget-title ~ * {
    max-height: 480px !important;
    opacity: 1 !important;
    padding-bottom: 6px !important;
  }

  .footer-wrapper,
  .footer-wrapper p,
  .footer-wrapper li,
  .footer-wrapper span,
  .footer-wrapper div,
  .footer-wrapper .textwidget,
  .footer-wrapper .widget_text,
  .footer-wrapper .is-divider {
    color: rgba(255, 255, 255, 0.82) !important;
  }

  .footer-wrapper strong,
  .footer-wrapper b {
    color: #fff !important;
  }

  .footer-wrapper a,
  .footer-wrapper .menu li a,
  .footer-wrapper .widget ul li a {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
    padding: 3px 0 !important;
    text-decoration: none !important;
  }

  .footer-wrapper a:hover,
  .footer-wrapper a:focus {
    color: #fff !important;
  }

  .footer-wrapper ul,
  .footer-wrapper ol {
    margin-bottom: 0 !important;
  }

  .footer-wrapper li {
    margin-bottom: 2px !important;
  }

  .footer-wrapper input,
  .footer-wrapper textarea,
  .footer-wrapper select {
    background: #fff !important;
    color: #172033 !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
  }

  .footer-wrapper input::placeholder,
  .footer-wrapper textarea::placeholder {
    color: #667085 !important;
    opacity: 1 !important;
  }

  .footer-wrapper .button,
  .footer-wrapper button,
  .footer-wrapper input[type="submit"] {
    background: var(--dxd-blue) !important;
    color: #fff !important;
    border-color: var(--dxd-blue) !important;
  }

  .grecaptcha-badge {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
}
