/* Focused responsive corrections for the built storefront.
   This file is intentionally component-scoped to avoid another broad patch layer. */

html {
  -webkit-text-size-adjust: 100%;
}

html,
body,
#root,
main {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
}

img,
video,
canvas,
svg,
iframe {
  max-width: 100%;
}

@media (max-width: 1024px) {
  .header-search {
    padding-left: 0 !important;
    padding-top: 8px !important;
  }

  .table-responsive {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
  }

  .table-responsive .cart-table {
    min-width: 680px;
  }

  .header-center .row.flex {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    row-gap: 12px;
  }

  .header-logo,
  .header-sub {
    flex: 0 0 50%;
    max-width: 50%;
  }

  .header-logo img {
    width: min(220px, 100%);
    height: auto;
  }

  .header-sub .header-sub-element.hidden-xs.hidden-sm {
    display: none !important;
  }

  .header-sub .header-sub-element.row {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-left: 0;
  }

  .header-search.hidden-sm,
  .header-search.hidden-xs.hidden-sm {
    display: block !important;
    flex: 1 0 100%;
    max-width: 100%;
    order: 3;
  }

  .header-search form,
  .header-search .searchform,
  .header-search form.searchform.ajax-search,
  .header-search #main-search-form,
  .header-search .search-input-search-form {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center;
    position: relative;
    width: 100%;
  }

  .header-search .form-control,
  .header-search input[type="text"] {
    flex: 1 1 auto;
    width: 100% !important;
    min-width: 0;
    height: 54px !important;
    padding: 0 16px !important;
    border-radius: 28px 0 0 28px !important;
  }

  .header-search .search-panel {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    flex: 0 0 144px;
    width: 144px !important;
    min-width: 144px !important;
    height: 54px !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 12px !important;
    margin-left: -1px !important;
    border-radius: 0 !important;
  }

  .header-search .search-panel > a {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-search .input-group-btn {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    flex: 0 0 54px;
    width: 54px !important;
    height: 54px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin-left: -1px !important;
  }

  .header-search .input-group-btn .button_search {
    width: 54px !important;
    height: 54px !important;
    line-height: 54px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 0 28px 28px 0 !important;
  }

  .header-search .search-loading {
    right: 66px !important;
  }

  .header-search .list-product-search {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
  }

  .header-search .tags {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center;
    gap: 0;
    margin-left: 0 !important;
    padding-top: 12px;
    white-space: nowrap;
    overflow: visible;
  }

  .header-search .tags > span {
    flex: 0 0 auto;
    font-size: 13px !important;
    font-weight: 600 !important;
    margin-right: 10px;
  }

  .header-search .tags > a {
    flex: 0 0 auto;
    font-size: 13px !important;
    line-height: 1.2;
    padding: 0 0 0 8px !important;
    border-left: 1px solid #e5e5e5;
  }

  .header-search .tags > a:first-of-type {
    border-left: 0;
    padding-left: 0 !important;
  }

  .feature {
    background: linear-gradient(135deg, #2f80ed, #1557d5) !important;
    padding-top: 22px !important;
    padding-bottom: 22px !important;
  }

  .feature .feature-inside {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .feature .feature-inside .feature-block {
    float: none !important;
    width: auto !important;
    min-width: 0;
    margin: 0 !important;
    padding: 20px 16px !important;
    border-right: 1px solid rgba(255, 255, 255, 0.28);
    border-bottom: 1px solid rgba(255, 255, 255, 0.28);
    background: transparent !important;
  }

  .feature .feature-inside .feature-block:nth-child(2n) {
    border-right: 0;
  }

  .feature .feature-inside .feature-block:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .feature .feature-info p {
    max-width: none !important;
  }

  .slide .e-slide,
  .slide .e-slide .slick-list,
  .slide .e-slide .slick-track,
  .slide .e-slide .slick-slide,
  .slide .e-slide .slick-slide > div {
    height: auto !important;
  }

  .slide .e-slide-img,
  .slide .e-slide-img > a {
    display: block !important;
  }

  .slide .e-slide .slick-slide img,
  .slide .e-slide-img img,
  .homepage-banner .banner-img2 img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  .slide .e-slide-img img {
    min-height: 220px;
    object-fit: cover;
  }

  .flash-deals .product-countd.pd-bd {
    margin-top: 0 !important;
    padding: 18px 14px !important;
  }

  .flash-deals .product-item-countd {
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .flash-deals .product-item-countd .product-head {
    margin: 0 0 14px !important;
  }

  .flash-deals .product-item-countd .product-info {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    min-width: 0;
    padding-top: 12px !important;
  }

  .flash-deals .product-item-countd .product-cate,
  .flash-deals .product-item-countd .product-title {
    margin: 0 !important;
  }

  .flash-deals .product-item-countd .product-title {
    line-height: 1.35 !important;
  }

  .flash-deals .product-item-countd .product-price {
    position: static !important;
    display: flex !important;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }

  .flash-deals .product-item-countd .deal-progress {
    padding-top: 12px !important;
    padding-bottom: 14px !important;
  }

  .flash-deals .product-item-countd .time-cound p {
    margin-bottom: 12px !important;
  }

  .more-product .slider-container,
  .mobile-you-may-like.slider-container {
    padding: 0 12px 24px !important;
    margin: 12px 0 0 !important;
    overflow: hidden;
  }

  .more-product .slick-dots,
  .you-may-like-carousel .slick-dots,
  .mobile-you-may-like-carousel .slick-dots {
    position: static !important;
    left: 0 !important;
    transform: none !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center;
    gap: 10px;
    margin: 14px 0 0 !important;
    padding: 0 !important;
    list-style: none !important;
  }

  .more-product .slick-dots li,
  .you-may-like-carousel .slick-dots li,
  .mobile-you-may-like-carousel .slick-dots li {
    margin: 0 !important;
  }

  .more-product .slick-dots li button,
  .you-may-like-carousel .slick-dots li button,
  .mobile-you-may-like-carousel .slick-dots li button {
    display: block !important;
    width: 10px !important;
    height: 10px !important;
    padding: 0 !important;
  }
}

@media (max-width: 991px) {
  .header-top-banner {
    display: none !important;
  }

  .header-search.hidden-sm,
  .header-search.hidden-xs.hidden-sm {
    display: none !important;
  }
}

@media (max-width: 767px) {
  .mobile-bottom-nav {
    width: 100vw !important;
    max-width: 100vw !important;
    left: 0 !important;
    right: 0 !important;
    padding: 8px max(0px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(0px, env(safe-area-inset-left)) !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .mobile-bottom-nav .nav-item {
    min-width: 0;
    padding: 4px 2px !important;
  }

  .mobile-bottom-nav .nav-item span {
    font-size: 10px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hide-on-mobile,
  .homepage-banner .set-w {
    display: none !important;
  }

  .mobile-full-width,
  .homepage-banner .set-w2,
  .ads-group .set-w2 {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }

  .ads-group.v3,
  .homepage-banner,
  .brand,
  .more-product,
  .banner-callus,
  footer {
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  .ads-group.v3 .container,
  .homepage-banner .container,
  .brand .container,
  .more-product .container,
  .banner-callus .container {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
    box-sizing: border-box !important;
  }

  .feature .feature-inside {
    grid-template-columns: 1fr !important;
  }

  .feature .feature-inside .feature-block {
    border-right: 0;
  }

  .feature .feature-inside .feature-block:last-child {
    border-bottom: 0;
  }

  .slide .e-slide-img img {
    min-height: 200px;
    max-height: 56vw;
  }

  .ads-group.v3 .row,
  .slide .e-slide,
  .slide .e-slide .slick-slider,
  .slide .e-slide .slick-list,
  .slide .e-slide .slick-track,
  .slide .e-slide .slick-slide,
  .slide .e-slide .slick-slide > div {
    display: block !important;
    min-height: 200px;
  }

  .ads-group.v3 .row,
  .homepage-banner .row,
  .ads-group .row {
    display: block !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .ads-group.v3 .row > [class*="col-"],
  .homepage-banner .row > [class*="col-"],
  .ads-group .row > [class*="col-"] {
    float: none !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .ads-group.v3 .slide,
  .ads-group.v3 .slide .e-slide,
  .ads-group.v3 .slide .slick-list,
  .ads-group.v3 .slide .slick-track,
  .ads-group.v3 .slide .slick-slide,
  .ads-group.v3 .slide .slick-slide > div,
  .ads-group.v3 .slide .e-slide-img,
  .ads-group.v3 .slide .e-slide-img > a {
    display: block !important;
    width: 100% !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  .ads-group.v3 .slide .slick-list {
    overflow: hidden !important;
  }

  .ads-group.v3 .slide .slick-arrow,
  .ads-group.v3 .slide .slick-dots {
    display: none !important;
  }

  .ads-group.v3 .slide .e-slide-img img {
    display: block !important;
    width: 100% !important;
    min-height: 220px !important;
    object-fit: cover !important;
    object-position: center !important;
  }

  .ads-group.v3 .ads {
    margin-top: 16px !important;
  }

  .homepage-banner .banner-img2,
  .homepage-banner .banner-img2 > a,
  .homepage-banner .banner-img2 img,
  .ads .banner-img2,
  .ads .banner-img2 > a,
  .ads .banner-img2 img {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
  }

  .ads-group.v3 .ads .banner-img2,
  .homepage-banner .banner-img2 {
    position: relative !important;
    min-height: 190px !important;
    border-radius: 12px !important;
    overflow: hidden !important;
  }

  .ads-group.v3 .ads .banner-img2::after,
  .homepage-banner .banner-img2::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0));
    pointer-events: none;
  }

  .ads-group.v3 .ads .banner-img2 > a,
  .homepage-banner .banner-img2 > a {
    display: block !important;
  }

  .homepage-banner .banner-img2 img,
  .ads .banner-img2 img {
    display: block !important;
    width: 100% !important;
    min-height: 190px !important;
    height: auto !important;
    object-fit: cover !important;
    object-position: center !important;
  }

  .ads-group.v3 .h-banner-content.v3 {
    top: auto !important;
    bottom: 18px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: calc(100% - 32px) !important;
    max-width: 280px !important;
    z-index: 2 !important;
  }

  .homepage-banner .h-banner-content,
  .homepage-banner .h-banner-content.v2 {
    top: auto !important;
    bottom: 16px !important;
    left: 16px !important;
    transform: none !important;
    max-width: calc(100% - 32px) !important;
    z-index: 2 !important;
  }

  .homepage-banner .h-banner-content .content-name,
  .ads-group.v3 .h-banner-content .content-name {
    font-size: 18px !important;
    line-height: 1.25 !important;
    margin-bottom: 6px !important;
  }

  .homepage-banner .h-banner-content .content-price,
  .ads-group.v3 .h-banner-content .content-price {
    margin-bottom: 8px !important;
  }

  .brand .brand-list {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center;
    gap: 12px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    padding: 12px 0 6px !important;
    margin: 0 !important;
    scroll-snap-type: x proximity;
  }

  .brand .brand-list::-webkit-scrollbar {
    display: none;
  }

  .brand .brand-item {
    flex: 0 0 116px !important;
    width: 116px !important;
    min-width: 116px !important;
    scroll-snap-align: start;
  }

  .brand .brand-item a,
  .brand .brand-item .hover-images {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 72px !important;
  }

  .brand .brand-item img {
    display: block !important;
    width: 100% !important;
    max-height: 56px !important;
    object-fit: contain !important;
  }

  .mobile-product-detail {
    overflow: hidden;
  }

  .mobile-product-gallery .main-img-container {
    padding: 16px !important;
  }

  .mobile-product-gallery .slide-item,
  .mobile-product-gallery .slick-slide > div {
    background: #fff !important;
  }

  .mobile-product-gallery .slide-item img,
  .mobile-product-gallery .slick-slide img {
    display: block !important;
    width: 100% !important;
    max-height: 48vh !important;
    object-fit: contain !important;
  }

  .mobile-thumbnails {
    justify-content: flex-start !important;
    padding: 12px 0 4px !important;
  }

  .thumb-item {
    width: 64px !important;
    height: 64px !important;
  }

  .mobile-best-sellers-carousel .slick-dots,
  .mobile-new-releases-carousel .slick-dots,
  .mobile-you-may-like-carousel .slick-dots {
    display: none !important;
  }

  .mobile-best-sellers-carousel .product-item,
  .mobile-new-releases-carousel .product-item,
  .mobile-you-may-like-carousel .product-item,
  .mobile-products-grid .product-item,
  .mobile-products-grid .mobile-product-item {
    min-width: 0;
  }

  .mobile-best-sellers-carousel .pd-bd,
  .mobile-new-releases-carousel .pd-bd,
  .mobile-you-may-like-carousel .pd-bd,
  .mobile-products-grid .pd-bd {
    overflow: hidden !important;
    padding: 14px 12px !important;
  }

  .mobile-best-sellers-carousel .product-img,
  .mobile-new-releases-carousel .product-img,
  .mobile-you-may-like-carousel .product-img,
  .mobile-products-grid .product-img {
    margin: 0 0 10px !important;
  }

  .mobile-best-sellers-carousel .product-info,
  .mobile-new-releases-carousel .product-info,
  .mobile-you-may-like-carousel .product-info,
  .mobile-products-grid .product-info {
    min-width: 0;
    padding: 10px 0 0 !important;
    text-align: left !important;
  }

  .mobile-best-sellers-carousel .product-title,
  .mobile-new-releases-carousel .product-title,
  .mobile-you-may-like-carousel .product-title,
  .mobile-products-grid .product-title,
  .mobile-best-sellers-carousel .product-name,
  .mobile-new-releases-carousel .product-name,
  .mobile-you-may-like-carousel .product-name,
  .mobile-products-grid .product-name {
    margin: 0 !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.35 !important;
    text-align: left !important;
  }

  .mobile-best-sellers-carousel .product-price,
  .mobile-new-releases-carousel .product-price,
  .mobile-you-may-like-carousel .product-price,
  .mobile-products-grid .product-price {
    position: static !important;
    display: flex !important;
    justify-content: flex-start !important;
    flex-wrap: wrap;
    gap: 6px;
  }
}

.footer-social.social a:not(.fa-instagram) {
  display: none !important;
}

.footer-social.social a.fa-instagram {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

@media (max-width: 926px) and (orientation: landscape) {
  .slide .e-slide-img img {
    min-height: 180px;
    max-height: 52vh;
  }

  .mobile-product-gallery .slide-item img,
  .mobile-product-gallery .slick-slide img {
    max-height: 60vh !important;
  }

  .mobile-product-info {
    padding-top: 16px !important;
  }
}

/* Fix: prevent All Department pill from being visually clipped on desktop */
@media (min-width: 992px) {
  .widget-left,
  .widget-verticalmenu,
  .vertical-wrapper,
  .ads-group .set-w {
    overflow: visible !important;
  }
}
