/* Ăn Tiệm G — layout overrides (Studio.Design clone) */

:root {
  --panel-bg: rgba(245, 240, 232, 0.97);
  --panel-ink: #4a3f35;
}

/* Hero tagline fallback */
#top .sd [style*="vertical-rl"] {
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
}

/* Sweets — image/text rows */
#sweets img,
#sweets .sd img {
  object-fit: cover !important;
  object-position: center center !important;
  align-self: flex-start !important;
}

#sweets .sd [style*="background-image"],
#sweets [class*="sd"] div[style*="background"] {
  background-position: center center !important;
  background-size: cover !important;
}

/* Combo 3-column block — keep visible above previous section */
#sweets > div:nth-child(3) {
  background: #41342b !important;
  overflow: visible !important;
  position: relative !important;
  z-index: 1 !important;
}

/* Combo cards — equal image height */
#sweets > div:nth-child(3) > div:nth-child(2) .image.sd,
#sweets > div:nth-child(3) > div:nth-child(2) div.image,
#sweets img[src*="long-lon.jpg"],
#sweets img[src*="sua-chua.jpg"],
#sweets img[src*="dat-ban.jpg"] {
  width: 100% !important;
  height: 300px !important;
  min-height: 300px !important;
  max-height: 300px !important;
  object-fit: cover !important;
  object-position: center center !important;
  display: block !important;
  align-self: stretch !important;
  background-size: cover !important;
  background-position: center center !important;
}

@media (max-width: 840px) {
  #sweets > div:nth-child(3) > div:nth-child(2) .image.sd,
  #sweets > div:nth-child(3) > div:nth-child(2) div.image,
  #sweets img[src*="long-lon.jpg"],
  #sweets img[src*="sua-chua.jpg"],
  #sweets img[src*="dat-ban.jpg"] {
    height: 240px !important;
    min-height: 240px !important;
    max-height: 240px !important;
  }
}

#drink > div.sd.appear > div:nth-child(1) > div:nth-child(2) > h3,
#drink > div.sd.appear > div:nth-child(1) p,
#drink > .sd > div:nth-child(1) > div:nth-child(2) {
  display: none !important;
}

/* Drink — hide hours block */
#drink > .sd.appear > div:nth-child(4),
#drink > .sd > div:nth-child(4) {
  display: none !important;
}

/* Space — sub-02 banner height */
#space > img[src*="sub-02"],
#space > .sd > img[src*="sub-02"] {
  height: 360px !important;
  max-height: 360px !important;
  width: 100% !important;
  object-fit: cover !important;
  object-position: center center !important;
  display: block !important;
}

/* Sweets — push titles/descriptions below image edge */
#sweets img[src*="cha-ca-01"],
#sweets img[src*="com-gia-dinh-01"] {
  align-self: flex-start !important;
}

/* Space — hide removed contact blocks */
#space > .sd.appear > div > div > div:nth-child(1) > div:nth-child(2),
#space > .sd.appear > div > div > div:nth-child(2) > div > p,
#space > .sd.appear > div > div > div:nth-child(3) > div {
  display: none !important;
}

/* Shop — SNS icons only */
#shop > .sd.appear > div > div > p,
#shop > .sd > div > div > p {
  display: none !important;
}

#shop .fa-facebook,
#shop .fa-instagram {
  font-size: 1.75rem !important;
  color: var(--panel-ink) !important;
}

#shop img[src*="icon-tiktok"] {
  width: 1.75rem !important;
  height: 1.75rem !important;
  filter: brightness(0) saturate(100%) invert(24%) sepia(12%) saturate(800%)
    hue-rotate(346deg) brightness(95%) contrast(90%);
}

/* SNS — 3 separate boxes in a row */
#shop > .sd.appear > div > div > div[style*="flex-direction: row"] > div,
#shop > .sd > div > div > div[style*="flex-direction: row"] > div {
  margin: 0 0.25rem !important;
}

header .fa-instagram,
header .fa-facebook,
header img[src*="icon-tiktok"],
header a:has(.fa-instagram),
header a:has(.fa-facebook),
header a:has(img[src*="icon-tiktok"]) {
  display: none !important;
}

#shop > div:nth-child(1) {
  padding-top: 2.5rem !important;
  padding-bottom: 2.5rem !important;
}

/* Fixed header — light panel */
header {
  background: var(--panel-bg) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 14px rgba(0, 0, 0, 0.1) !important;
  border-bottom: 1px solid rgba(65, 52, 43, 0.12) !important;
}

header a,
header h4,
header .sd,
header .sd * {
  color: var(--panel-ink) !important;
}

header .fa-instagram,
header .fa-bars {
  color: var(--panel-ink) !important;
}

header img[src*="logo.png"] {
  width: 96px !important;
  max-width: 96px !important;
  height: auto !important;
}

/* Language switcher */
.atg-lang-switch {
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 6px !important;
  flex: none !important;
  pointer-events: auto !important;
  white-space: nowrap;
}

@media (min-width: 841px) {
  header .atg-lang-switch {
    order: 2;
    margin-left: auto !important;
    margin-right: 0 !important;
  }
}

@media (max-width: 840px) {
  header .atg-lang-switch {
    position: static !important;
    z-index: 65 !important;
    align-self: center !important;
  }

  html.mobile-nav-open header .atg-lang-switch {
    position: fixed !important;
    top: 18px !important;
    right: 68px !important;
    left: auto !important;
    margin: 0 !important;
    z-index: 62 !important;
  }
}

.atg-lang-switch__sep {
  color: rgba(65, 52, 43, 0.35);
  font-size: 10px;
  font-weight: 400;
  line-height: 1;
  padding: 0 1px;
  user-select: none;
}

.atg-lang-switch__btn {
  appearance: none !important;
  display: inline-flex !important;
  flex: none !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  border: 1px solid rgba(65, 52, 43, 0.22) !important;
  background: rgba(255, 255, 255, 0.55) !important;
  color: var(--panel-ink) !important;
  font-family: inherit !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.04em !important;
  line-height: 1 !important;
  min-width: 2rem !important;
  width: auto !important;
  padding: 6px 8px !important;
  margin: 0 !important;
  border-radius: 4px !important;
  cursor: pointer !important;
}

.atg-lang-switch__btn.is-active {
  background: var(--panel-ink);
  border-color: var(--panel-ink);
  color: #f5f0e8;
}

.atg-lang-switch__btn:hover {
  background: #fff;
}

.atg-source-fallback {
  display: none;
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 20px 80px;
  color: #4a3f35;
}

.atg-source-fallback__hero,
.atg-source-fallback__section {
  background: rgba(245, 240, 232, 0.96);
  border-radius: 28px;
  box-shadow: 0 16px 40px rgba(67, 52, 43, 0.12);
}

.atg-source-fallback__hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  overflow: hidden;
}

.atg-source-fallback__hero-media img {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
}

.atg-source-fallback__hero-copy,
.atg-source-fallback__section {
  padding: 32px;
}

.atg-source-fallback__hero-copy h1,
.atg-source-fallback__section h2,
.atg-source-fallback__section h3 {
  margin: 0;
  color: #43342c;
  line-height: 1.3;
}

.atg-source-fallback__hero-copy h1 {
  font-size: clamp(2.4rem, 4vw, 4rem);
  margin-top: 8px;
}

.atg-source-fallback__hero-copy p,
.atg-source-fallback__hero-copy li,
.atg-source-fallback__section p,
.atg-source-fallback__section li {
  font-size: 1.5rem;
  line-height: 1.8;
  color: #5c4d43;
}

.atg-source-fallback__hero-copy ul,
.atg-source-fallback__contact ul {
  margin: 18px 0 0;
  padding-left: 20px;
}

.atg-source-fallback__section {
  margin-top: 20px;
}

.atg-source-fallback__heading {
  margin-bottom: 20px;
}

.atg-source-fallback__heading p {
  margin: 0 0 8px;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8b4b33;
}

.atg-source-fallback__lead {
  font-size: 1.8rem !important;
  color: #43342c !important;
}

.atg-source-fallback__story,
.atg-source-fallback__contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.92fr);
  gap: 24px;
}

.atg-source-fallback__stack {
  display: grid;
  gap: 16px;
}

.atg-source-fallback__stack img,
.atg-source-fallback__cards img,
.atg-source-fallback__contact img {
  width: 100%;
  border-radius: 20px;
  object-fit: cover;
}

.atg-source-fallback__cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.atg-source-fallback__cards article,
.atg-source-fallback__services article {
  background: #fffdfa;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(67, 52, 43, 0.08);
}

.atg-source-fallback__cards article div,
.atg-source-fallback__services article {
  padding: 18px;
}

.atg-source-fallback__cards h3,
.atg-source-fallback__services h3 {
  margin-bottom: 10px;
}

.atg-source-fallback__services {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.atg-source-fallback__contact ul li + li {
  margin-top: 8px;
}

@media (max-width: 840px) {
  .atg-source-fallback {
    padding: 20px 12px 48px;
  }

  .atg-source-fallback__hero,
  .atg-source-fallback__story,
  .atg-source-fallback__contact,
  .atg-source-fallback__cards,
  .atg-source-fallback__services {
    grid-template-columns: 1fr;
  }

  .atg-source-fallback__hero-copy,
  .atg-source-fallback__section {
    padding: 20px;
  }

  .atg-source-fallback__hero-media img {
    min-height: 260px;
  }
}

/* Desktop — horizontal top nav, hide hamburger */
@media (min-width: 841px) {
  header {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  header > div:first-child {
    flex: 0 0 auto !important;
    justify-content: flex-start !important;
  }

  header > *:has(h4) {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 0.25rem 1.25rem !important;
    width: auto !important;
    flex: 1 1 auto !important;
  }

  header > .fa-bars,
  header > .fa-times,
  #mobile-nav-toggle {
    display: none !important;
  }
}

/* Sidebar / footer — light panel separation */
footer {
  background: var(--panel-bg) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 2px 0 18px rgba(0, 0, 0, 0.1) !important;
  border-right: 1px solid rgba(65, 52, 43, 0.12) !important;
}

footer .sd,
footer p,
footer span {
  color: var(--panel-ink) !important;
}

footer img[src*="logo.png"] {
  width: 88px !important;
  max-width: 88px !important;
  height: auto !important;
}

@media (max-width: 840px) {
  footer img[src*="logo.png"],
  header img[src*="logo.png"] {
    width: 72px !important;
    max-width: 72px !important;
  }

  header {
    background: rgba(245, 240, 232, 0.96) !important;
    z-index: 55 !important;
    overflow: hidden !important;
    max-height: 4.75rem !important;
    display: grid !important;
    grid-template-columns: auto 1fr auto auto !important;
    grid-template-areas: "logo space lang menu" !important;
    align-items: center !important;
    column-gap: 8px !important;
    padding: 12px 16px !important;
  }

  header > div:first-child {
    grid-area: logo !important;
  }

  header .atg-lang-switch {
    grid-area: lang !important;
    margin: 0 !important;
    justify-self: end !important;
  }

  header > .fa-bars,
  header > .fa-times,
  header > #mobile-nav-toggle {
    grid-area: menu !important;
    margin: 0 !important;
    justify-self: end !important;
  }

  header > *:has(h4),
  header .atg-mobile-nav,
  header > .mobile-drawer-nav {
    grid-area: space !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  header > * {
    pointer-events: none !important;
  }

  header > div:first-child,
  header .atg-lang-switch,
  header .atg-lang-switch *,
  header > .fa-bars,
  header > .fa-times,
  header > #mobile-nav-toggle {
    pointer-events: auto !important;
  }

  html:not(.mobile-nav-open) header > div:first-child {
    flex: 0 0 auto !important;
    justify-content: flex-start !important;
    margin: 0 !important;
  }

  html:not(.mobile-nav-open) header > .fa-bars,
  html:not(.mobile-nav-open) header > .fa-times,
  html:not(.mobile-nav-open) header > #mobile-nav-toggle {
    flex: 0 0 auto !important;
    margin-left: 0 !important;
    display: flex !important;
  }

  html:not(.mobile-nav-open) header > .fa-bars,
  html:not(.mobile-nav-open) header > .fa-times,
  html:not(.mobile-nav-open) header > #mobile-nav-toggle {
    order: 4;
    margin-left: 0 !important;
    align-self: center !important;
  }

  #mobile-nav-toggle,
  header > .fa-bars,
  header > .fa-times {
    z-index: 61 !important;
    pointer-events: auto !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    margin: 0 !important;
    flex: 0 0 48px !important;
    width: 48px !important;
    max-width: 48px !important;
  }

  html.mobile-nav-open .atg-lang-switch {
    display: inline-flex !important;
  }

  header > .fa-bars,
  header > .fa-times {
    position: relative !important;
    z-index: 61 !important;
    pointer-events: auto !important;
  }

  /* Closed — compact top bar: hamburger + logo only */
  html:not(.mobile-nav-open) header a:has(h4),
  html:not(.mobile-nav-open) header h4,
  html:not(.mobile-nav-open) header h5,
  html:not(.mobile-nav-open) header .mobile-drawer-nav,
  html:not(.mobile-nav-open) header .fa-instagram,
  html:not(.mobile-nav-open) header .fa-facebook,
  html:not(.mobile-nav-open) header img[src*="icon-tiktok"],
  html:not(.mobile-nav-open) header a:has(.fa-instagram),
  html:not(.mobile-nav-open) header a:has(.fa-facebook),
  html:not(.mobile-nav-open) header a:has(img[src*="icon-tiktok"]) {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  html:not(.mobile-nav-open) header .atg-mobile-nav,
  html:not(.mobile-nav-open) header > *:has(h4),
  html:not(.mobile-nav-open) header > .mobile-drawer-nav {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    flex: 0 0 0 !important;
    width: 0 !important;
    min-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  html:not(.mobile-nav-open) header a:has(img[src*="logo.png"]) {
    display: block !important;
  }

  html:not(.mobile-nav-open) header .fa-bars {
    display: flex !important;
  }

  html:not(.mobile-nav-open) header img[src*="logo.png"] {
    display: block !important;
  }

  header .fa-bars {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 48px !important;
    height: 48px !important;
    font-size: 22px !important;
    cursor: pointer !important;
  }

  /* Sidebar drawer — off-canvas when closed */
  footer {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    height: 100dvh !important;
    width: min(82vw, 300px) !important;
    max-width: min(82vw, 300px) !important;
    margin: 0 !important;
    padding: 4.5rem 0 2rem !important;
    transform: translateX(-105%) !important;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    z-index: 35 !important;
    flex: none !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18) !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  html.mobile-nav-open footer {
    transform: translateX(0) !important;
    visibility: visible !important;
    pointer-events: none !important;
    justify-content: flex-end !important;
    align-items: flex-start !important;
    padding: 0 1.5rem 2rem !important;
  }

  /* Open — nav lives in header, drawer panel is footer background */
  html.mobile-nav-open header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: min(82vw, 300px) !important;
    max-width: min(82vw, 300px) !important;
    height: 100dvh !important;
    max-height: none !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    padding: 4.75rem 0 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    overflow: hidden !important;
    z-index: 36 !important;
    pointer-events: none !important;
  }

  html.mobile-nav-open header a:has(h4),
  html.mobile-nav-open header .mobile-drawer-nav,
  html.mobile-nav-open header > .fa-bars,
  html.mobile-nav-open header > .fa-times,
  html.mobile-nav-open header > #mobile-nav-toggle {
    pointer-events: auto !important;
  }

  html.mobile-nav-open header > .fa-bars,
  html.mobile-nav-open header > .fa-times,
  html.mobile-nav-open header > #mobile-nav-toggle {
    position: fixed !important;
    top: 18px !important;
    right: 16px !important;
    left: auto !important;
    margin: 0 !important;
    z-index: 60 !important;
  }

  html.mobile-nav-open header > div:first-child {
    display: none !important;
  }

  html.mobile-nav-open header .atg-mobile-nav,
  html.mobile-nav-open header > *:has(h4),
  html.mobile-nav-open header .mobile-drawer-nav {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  html.mobile-nav-open footer * {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  html.mobile-nav-open footer {
    display: block !important;
    visibility: visible !important;
    pointer-events: none !important;
  }

  html.mobile-nav-open footer a:has(h4),
  html.mobile-nav-open footer h4,
  html.mobile-nav-open footer h5,
  html.mobile-nav-open footer p,
  html.mobile-nav-open footer a[href*="#"],
  html.mobile-nav-open footer img {
    display: none !important;
    visibility: hidden !important;
  }

  #mobile-nav-backdrop {
    position: fixed;
    top: 4.75rem;
    right: 0;
    bottom: 0;
    left: min(82vw, 300px);
    background: rgba(31, 24, 18, 0.45);
    z-index: 34;
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
  }

  #mobile-nav-backdrop[hidden] {
    display: none !important;
  }

  /* Mobile drawer panel — logo on top, nav below */
  #atg-mobile-drawer {
    display: none;
    box-sizing: border-box;
    pointer-events: auto;
  }

  #atg-mobile-drawer:not([hidden]) {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 1.25rem !important;
    position: fixed !important;
    top: 4.75rem !important;
    left: 0 !important;
    width: min(82vw, 300px) !important;
    max-width: min(82vw, 300px) !important;
    padding: 1.25rem 1.5rem 2rem !important;
    z-index: 38 !important;
    background: var(--panel-bg) !important;
  }

  #atg-mobile-drawer:not([hidden]) * {
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .atg-mobile-drawer__logo {
    display: block !important;
    width: 100%;
    padding-bottom: 0.25rem;
  }

  .atg-mobile-drawer__logo img {
    display: block !important;
    width: 72px !important;
    max-width: 72px !important;
    height: auto !important;
  }

  #atg-mobile-drawer-nav {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    width: 100%;
    box-sizing: border-box;
    pointer-events: auto;
  }

  .atg-mobile-drawer-nav__item {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--panel-ink) !important;
    font-family: inherit;
    font-size: 15px;
    font-weight: 200;
    letter-spacing: 0.08em;
    line-height: 1.8;
    text-align: left;
    width: 100%;
    padding: 0.35rem 0;
    margin: 0;
    cursor: pointer;
  }

  .atg-mobile-drawer-nav__item:hover,
  .atg-mobile-drawer-nav__item:focus-visible {
    color: #41342b !important;
    outline: none;
  }

  main {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
  }

  body > div > div:has(> footer):has(> main),
  body > div:has(> footer):has(> main) {
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  html:not(.mobile-nav-open) footer {
    transform: translateX(-105%) !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  footer.sd,
  footer > .sd {
    flex-direction: column !important;
    align-items: flex-start !important;
    padding: 0 1.5rem !important;
  }

  html:not(.mobile-nav-open) footer h4,
  html:not(.mobile-nav-open) footer a:has(h4),
  html:not(.mobile-nav-open) footer a[href*="#"] {
    display: none !important;
  }

  footer h4,
  footer h5 {
    font-size: 15px !important;
    letter-spacing: 0.08em !important;
    line-height: 1.8 !important;
    margin: 0.35rem 0 !important;
  }

  footer h4 + div,
  footer h5 + div {
    display: none !important;
  }
}
