@media (max-width: 767px) {
  body.home .sgss-mobile-inline-trigger > span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.home #content {
    --sgmh-gutter: clamp(10px, 3.3vw, 16px);
    --sgmh-ink: #382623;
    --sgmh-wine: #8a3033;
    --sgmh-line: #eaded9;
    --sgmh-paper: #fffaf7;
  }

  body.home #content > .section:nth-child(n+4):has(.sgmh-shelf) {
    /* Match the usual two rows of products before the section is rendered. */
    contain-intrinsic-size: auto 610px;
  }

  body.home #content > .section:nth-child(n+4):has(.sgmh-shelf ~ .sgmh-shelf) {
    contain-intrinsic-size: auto 1220px;
  }

  body.home #content .sgmh-hero {
    width: auto;
    margin: 8px var(--sgmh-gutter) 0;
    border: 1px solid var(--sgmh-line);
    border-radius: 17px;
    background: var(--sgmh-paper);
  }

  body.home #content .sgmh-hero .sangom-hero-section {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    gap: 11px;
    padding: 14px !important;
    height: auto;
  }

  body.home #content .sgmh-hero .hero-content { display: contents; }
  body.home #content .sgmh-hero .hero-title,
  body.home #content .sgmh-hero .hero-image {
    grid-row: 1;
    align-self: center;
    z-index: auto;
    animation: none;
  }

  body.home #content .sgmh-hero .hero-title {
    grid-column: 1;
    margin: 0 !important;
    color: var(--sgmh-wine);
    text-transform: none;
    text-align: left;
    letter-spacing: -.015em;
    line-height: 1.05 !important;
  }

  body.home #content .sgmh-hero .hero-title br { display: none; }

  body.home #content .sgmh-hero .h1-line-1 {
    display: block;
    margin-bottom: 8px;
    font-family: inherit;
    font-size: clamp(11px, 3.15vw, 14px);
    font-weight: 600;
    letter-spacing: .01em;
    line-height: 1.3;
    color: #70564b;
  }

  body.home #content .sgmh-hero .h1-line-2 {
    display: block;
    font-size: clamp(22px, 6.7vw, 33px);
    line-height: 1.05;
    text-wrap: balance;
  }

  body.home #content .sgmh-hero .hero-image {
    grid-column: 2;
    width: 100%;
    max-width: 248px;
    margin: 0;
    justify-self: center;
    height: auto;
  }

  body.home #content .sgmh-hero .image-wrapper img {
    max-height: 186px !important;
    aspect-ratio: 706 / 561;
    width: 100%;
    height: auto;
    object-fit: contain;
  }

  body.home #content .sgmh-hero .hero-buttons {
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: none;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    margin: 0 !important;
  }

  body.home #content .sgmh-hero .hero-btn {
    margin: 0;
    border-radius: 9px;
    border-width: 1px;
    font-size: 13px !important;
    line-height: 1.2;
    min-height: 44px !important;
  }

  body.home #content .sgmh-hero .hero-btn.btn-primary {
    background: var(--sgmh-wine);
    color: #fff;
  }

  body.home #content .sgmh-hero .hero-btn.btn-secondary {
    border-color: #b97773;
    color: var(--sgmh-wine);
  }

  body.home #content .sgmh-hero-details {
    grid-column: 1 / -1;
    grid-row: 3;
    border-top: 1px solid var(--sgmh-line);
    color: var(--sgmh-ink);
    text-align: left;
  }

  body.home #content .sgmh-hero-details summary {
    width: max-content;
    min-height: 44px;
    padding: 12px 5px;
    cursor: pointer;
    color: var(--sgmh-wine);
    font-size: 12px;
    font-weight: 700;
  }

  body.home #content .sgmh-hero-details .hero-description {
    display: block;
    line-height: 1.5;
  }

  body.home #content .sgmh-hero-details .hero-stats { max-width: none; }

  body.home #content .sgmh-categories {
    width: auto;
    margin: 10px var(--sgmh-gutter);
    padding: 11px 0 4px;
    border-radius: 15px;
    box-shadow: none;
  }

  body.home #content .sgmh-categories .sg-home-category-hint { padding: 0 10px 7px; }
  body.home #content .sgmh-categories .sg-home-category-hint strong { font-size: 14px; white-space: nowrap; }
  body.home #content .sgmh-categories .sg-hint-mobile { font-size: 10px; color: #76534c; white-space: nowrap; }

  body.home #content .sgmh-categories .scrollmenu-inner {
    --sgmh-category-gap: 6px;
    display: grid !important;
    grid-template-columns: none;
    grid-template-rows: repeat(2, auto);
    grid-auto-columns: calc((100% - 3 * var(--sgmh-category-gap)) / 4);
    grid-auto-flow: column;
    gap: var(--sgmh-category-gap) !important;
    padding: 0 8px 6px !important;
    scroll-padding-inline: 8px;
    overflow-x: auto !important;
    scrollbar-width: thin;
    scrollbar-color: #d6b4ac transparent;
  }

  body.home #content .sgmh-categories .scrollmenu-item {
    min-width: 0 !important;
    width: auto !important;
    height: auto !important;
    min-height: 67px;
    justify-content: center;
    border-radius: 9px;
    padding: 5px 2px;
    border: 1px solid #f1e7e4;
    box-shadow: none;
    background: #fffaf8;
    text-align: center;
  }

  body.home #content .sgmh-categories .scrollmenu-item > div {
    width: 33px;
    height: 33px;
    margin-bottom: 2px;
  }

  body.home #content .sgmh-categories .scrollmenu-item img {
    width: 33px !important;
    height: 33px !important;
    object-fit: contain;
  }

  body.home #content .sgmh-categories .scrollmenu-item p {
    margin: 0;
    font-size: 10.5px;
    font-weight: 750;
    line-height: 1.15;
    color: var(--sgmh-ink);
  }

  body.home #content #sgmh-uu-dai {
    position: absolute;
    inset: 0 auto auto 0;
    scroll-margin-top: 112px;
  }

  body.home #content .sg-home-deal-section:has(.sgmh-shelf) {
    width: auto;
    margin: 0 var(--sgmh-gutter) 5px;
    border: 1px solid #efded7;
    border-radius: 15px;
    overflow: hidden;
    padding: 10px 8px 4px !important;
  }

  body.home #content .sg-home-deal-section .sg-deal-title {
    margin: 0 0 5px;
    padding: 0;
    font-size: 17px !important;
    line-height: 1.2;
  }

  body.home #content .sg-home-deal-section .sg-deal-countdown { margin: 0 0 8px; }

  body.home #content .sg-home-deal-section .sg-deal-countdown__container {
    max-width: 100%;
    gap: 5px;
    padding: 0;
    background: transparent;
  }

  body.home #content .sg-home-deal-section .sg-deal-countdown__block {
    min-width: 0;
    padding: 4px 7px;
    border-radius: 5px;
    background: #f5e0d9;
    white-space: nowrap;
  }

  body.home #content .sg-home-deal-section .sg-deal-countdown__number {
    margin-right: 3px;
    color: var(--sgmh-wine);
    font-size: 15px;
    line-height: 1;
  }

  body.home #content .sg-home-deal-section .sg-deal-countdown__label {
    color: #60433a;
    font-size: 9px;
    opacity: 1;
  }

  body.home #content .col-trang-chu:has(.sgmh-shelf) {
    padding: 0 var(--sgmh-gutter) !important;
  }

  body.home #content .col-trang-chu > .col-inner:has(.sgmh-shelf) {
    border: 1px solid var(--sgmh-line);
    border-radius: 15px;
    box-shadow: none;
    padding: 9px !important;
  }

  body.home #content .col-trang-chu .tile-home,
  body.home #content .col-trang-chu .tile-home-h3,
  body.home #content .col-trang-chu .box-common__title {
    margin: 0 !important;
    padding: 5px 0 9px !important;
    color: var(--sgmh-ink);
    font-size: clamp(18px, 5vw, 22px) !important;
    line-height: 1.16;
    text-align: left;
  }

  body.home #content .col-trang-chu > .col-inner:has(.sgmh-shelf) > .img:has(> a[href$="/bat-dia-nha-hang-4/"]) {
    display: none;
  }

  body.home #content .col-trang-chu .box-common__title::after { display: none; }
  body.home #content .col-trang-chu .xem-them { margin-bottom: 7px; padding-left: 0; }
  body.home #content .col-trang-chu .xem-them a { min-height: 36px; padding: 6px 10px; }

  body.home #main #content .section-content .sgmh-shelf {
    --sgmh-shelf-gap: 8px;
    display: grid !important;
    grid-auto-flow: column;
    /* Leave half of the next column visible as a cue to swipe. */
    grid-auto-columns: calc((100% - 2 * var(--sgmh-shelf-gap)) / 2.5);
    grid-template-rows: auto;
    align-items: stretch;
    gap: var(--sgmh-shelf-gap);
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 0 4px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    scrollbar-color: #d6b4ac transparent;
  }

  body.home #main #content .section-content .sgmh-shelf::after { content: none; }

  body.home #main #content .section-content .sgmh-shelf > .col {
    display: flex !important;
    flex-basis: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    padding: 0 !important;
    scroll-snap-align: start;
  }

  body.home #content .sgmh-shelf > .col > .col-inner {
    display: flex;
    width: 100%;
    min-width: 0;
  }

  body.home #content .sgmh-shelf .product-small.box {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    margin: 0;
    border: 1px solid #eee2dd;
    border-radius: 10px !important;
    box-shadow: none;
    transform: none;
  }

  body.home #content .sgmh-shelf .box-image,
  body.home #content .sgmh-shelf .box-image img { border-radius: 9px 9px 0 0; }
  body.home #content .sgmh-shelf .box-image img { display: block; }

  body.home #content .sgmh-shelf .box-text {
    flex: 1;
    min-height: auto;
    padding: 7px !important;
    color: var(--sgmh-ink);
    text-align: left;
  }

  body.home #content .sgmh-shelf .product-title {
    height: auto;
    margin: 0;
    overflow: visible;
  }

  body.home #content .sgmh-shelf .product-title a {
    display: -webkit-box;
    min-height: 0;
    font-size: 13px;
    line-height: 1.33;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    overflow-wrap: anywhere;
  }

  body.home #content .sgmh-shelf .price-wrapper {
    margin-bottom: 0;
    padding-top: 6px;
  }

  body.home #content .sgmh-shelf .price,
  body.home #content .sgmh-shelf .price .amount {
    font-size: 13px;
    font-weight: 800;
    line-height: 1.28;
    color: var(--sgmh-wine);
  }

  body.home #content .sgmh-shelf .price { display: block; white-space: normal; }
  body.home #content .sgmh-shelf .price del .amount { color: #78655e; }
  body.home #content .sgmh-shelf .price ins { text-decoration: none; }

  body.home #content .sgmh-shelf .product-small a.button {
    margin: 7px 0 0;
    padding: 4px;
    border-radius: 7px;
    color: var(--sgmh-wine) !important;
    text-align: center;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.15;
    font-size: 11.5px;
  }

  body.home #content .sgmh-shelf .product-small a.button:hover,
  body.home #content .sgmh-shelf .product-small a.button:focus-visible { color: #fff !important; }

  body.home #content .sgmh-shelf-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 5px 9px;
    margin-top: 3px;
  }

  body.home #content .sgmh-shelf-nav:has(h3) {
    justify-content: flex-start;
    margin-top: 10px;
  }

  body.home #content .sgmh-shelf-nav > h3 {
    width: 100%;
    margin: 0;
    font-size: 17px;
    line-height: 1.2;
  }

  body.home #content .sgmh-shelf-nav :is(button, a) {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin: 0;
    padding: 0 7px;
    border: 0;
    color: var(--sgmh-wine);
    background: transparent;
    font-family: inherit;
    font-size: 12px;
    font-weight: 750;
    line-height: 1.2;
    text-transform: none;
    letter-spacing: 0;
    box-shadow: none;
  }

  body.home #content .sgmh-shelf-nav .sgmh-view-all {
    padding: 0 11px;
    background: #f8ece8;
    border-radius: 7px;
  }

  body.home #content .sgmh-shelf-nav :is(button, a):focus-visible,
  body.home #content .sgmh-shelf:focus-visible,
  body.home #content .sgmh-categories a:focus-visible {
    outline: 2px solid var(--sgmh-wine);
    outline-offset: -2px;
  }

  body.home #content .sgmh-shelf a { scroll-margin-bottom: 72px; }
}
