:root {
  --tm-bg: #FFF;
  --tm-surface-low: #f5f4ef;
  --tm-surface-high: #e9e8e3;
  --tm-surface-dark: #1c1c1c;
  --tm-text: #1b1c19;
  --tm-muted: #56423c;
  --tm-primary: #9c3f1a;
  --tm-primary-hover: #7f2a05;
  --tm-outline: #8a726a;
  --tm-outline-variant: #ddc0b7;
  --nav-height: 90px;
}

/* P3 Color Gamut Optimization for Apple Displays */
@media (color-gamut: p3) {
  :root {
    --tm-primary: color(display-p3 0.612 0.247 0.102);
    --tm-primary-hover: color(display-p3 0.512 0.187 0.062);
  }
}

html,
body.teamilk-body {
  margin: 0;
  background: var(--tm-bg);
  color: var(--tm-text);
  font-family: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow-x: hidden;
  position: relative;
  width: 100%;
  /* macOS Font Smoothing */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.material-symbols-outlined {
  font-variation-settings:
    "FILL" 0,
    "wght" 400,
    "GRAD" 0,
    "opsz" 24;
  line-height: 1;
}

h1,
h2,
h3,
h4,
.brand-title,
.section-title,
.section-title-light,
.display-title,
.testimonial-copy {
  font-family: "Playfair Display", serif;
}

.teamilk-container {
  max-width: 1320px;
}

@media (max-width: 767.98px) {
  .container:not(.no-mobile-padding),
  .container-fluid:not(.no-mobile-padding) {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
  }
  
  .no-mobile-padding {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

.main-content {
  padding-top: var(--nav-height);
}

.site-header {
  background: rgba(248, 247, 242, 0.95);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-color: #e7e5e4;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  /* Stabilize rendering */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transition: background 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

.site-header.header-scrolled {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.brand-title {
  color: #1c1917;
  font-size: 2rem;
  font-weight: 700;
  text-decoration: none;
}

.nav-link {
  color: #44403c;
  font-family: "Playfair Display", serif;
  font-size: 1rem;
  position: relative;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--tm-primary);
  transition: width 0.3s ease;
}

.nav-link:hover {
  color: var(--tm-primary);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link.nav-link-active {
  color: var(--tm-primary);
}

.nav-link.nav-link-active::after {
  width: 100%;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100%;
  background: #FAF9F4; /* Light cream background */
  z-index: 2000;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  padding: 2rem;
}

.mobile-menu-overlay.active {
  right: 0;
}

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.mobile-menu-header .brand-title {
  font-size: 1.75rem;
}

.mobile-menu-header .close-btn {
  background: none;
  border: none;
  color: #1c1917;
  cursor: pointer;
  padding: 0.5rem;
}

.mobile-menu-header .close-btn span {
  font-size: 2rem;
}

.mobile-menu-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  text-align: center;
}

.mobile-nav a {
  font-family: "Playfair Display", serif;
  font-size: 1.5rem;
  font-weight: 500;
  color: #1c1917;
  text-decoration: none;
  letter-spacing: 0.1em;
  transition: color 0.3s ease;
}

.mobile-nav a:hover {
  color: var(--tm-primary);
}

.mobile-menu-footer {
  text-align: center;
  padding-bottom: 1rem;
}

.mobile-menu-footer p {
  font-size: 0.75rem;
  color: #78716c;
  letter-spacing: 0.05em;
}

@media (min-width: 768px) {
  .mobile-menu-overlay {
    display: none;
  }
}

.btn.btn-primary,
.btn.btn-primary:focus,
.btn.btn-primary:active {
  background: var(--tm-primary);
  border-color: var(--tm-primary);
}

.btn.btn-primary:hover {
  background: var(--tm-primary-hover);
  border-color: var(--tm-primary-hover);
}

.btn-pill {
  border-radius: 999px;
  font-size: 1.15rem;
  font-weight: 600;
  padding: 0.6rem 2.5rem;
  letter-spacing: 0.03em;
  text-transform: none;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 1199.98px) {
  .btn-pill {
    padding: 0.6rem 1.5rem;
    font-size: 1rem;
  }
}

@media (max-width: 767.98px) {
  .btn-pill {
    padding: 0.5rem 1.25rem;
    font-size: 0.95rem;
  }
}

/* Navbar specific button adjustment */
.site-header .btn-pill {
  padding: 0.5rem 1.25rem;
  font-size: 1rem;
}

@media (min-width: 1200px) {
  .site-header .btn-pill {
    padding: 0.6rem 2rem;
    font-size: 1.05rem;
  }
}

.btn-outline-theme {
  color: var(--tm-text);
  border: 2px solid var(--tm-outline);
  background: transparent;
}

.btn-outline-theme:hover {
  color: var(--tm-primary);
  border-color: var(--tm-primary);
}

.section-spacing {
  padding: 120px 0;
}

.section-spacing-sm {
  padding: 90px 0;
}

.floating-order-btn {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 70px;
  height: 70px;
  background: var(--tm-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  z-index: 1000;
  border-radius: 8px 0 0 8px;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.05em;
}

.floating-order-btn:hover {
  background: var(--tm-primary-hover);
  color: #fff;
}

.hero-section {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  /* Fix animation flicker */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  perspective: 1000px;
}

@media (min-width: 768px) {
  .hero-section {
    height: calc(100vh - var(--nav-height));
    min-height: 600px;
    max-height: 690px;
    overflow: hidden;
  }
}

.hero-copy {
  max-width: 600px;
  width: 100%;
}

.hero-copy-wrap {
  padding: 0 5%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

@media (min-width: 1400px) {
  .hero-copy-wrap {
    padding-right: 100px;
  }
}

.display-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.lead-copy {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--tm-muted);
  margin-bottom: 2rem;
}

@media (max-width: 767.98px) {
  .lead-copy {
    margin-bottom: 2rem;
  }
}

.hero-image-wrap {
  overflow: hidden;
  width: 100%;
}

@media (min-width: 768px) {
  .hero-image-wrap {
    height: calc(100vh - var(--nav-height));
    min-height: 600px;
    max-height: 690px;
  }
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 10s linear;
}

.swiper-slide-active .hero-image {
  transform: scale(1.15);
}

.about-image-wrap {
  height: 600px;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.09);
  position: relative;
}

.reveal-holder {
  position: relative;
  overflow: hidden;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1.2s cubic-bezier(0.19, 1, 0.22, 1);
}

.reveal-holder.aos-animate {
  clip-path: inset(0 0 0 0);
}

.about-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.5s ease;
}

.reveal-holder.aos-animate img {
  transform: scale(1.05);
}

.feature-section,
.menu-section {
  background: var(--tm-surface-low);
}

.feature-item {
  transition: transform 0.4s ease;
  padding: 1.5rem;
  border-radius: 1rem;
}

.feature-item:hover {
  transform: translateY(-10px);
  background: #fff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.05);
}

.feature-item h3 {
  margin: 0.4rem 0;
  font-size: 1.4rem;
}

.feature-item p {
  margin: 0;
  color: var(--tm-muted);
}

.icon-badge {
  width: 4rem;
  height: 4rem;
  margin: 0 auto;
  border-radius: 999px;
  background: rgba(156, 63, 26, 0.1);
  display: grid;
  place-items: center;
  color: var(--tm-primary);
  transition: all 0.4s ease;
}

.feature-item:hover .icon-badge {
  background: var(--tm-primary);
  color: #fff;
  transform: rotateY(180deg);
}

.icon-badge .material-symbols-outlined {
  font-size: 2rem;
}

.section-tag {
  color: var(--tm-primary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.85rem;
  font-weight: 600;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.2;
  margin: 1rem 0 1.5rem;
}

.section-text,
.menu-item p {
  color: var(--tm-muted);
  line-height: 1.7;
}

.section-quote {
  color: var(--tm-muted);
  font-style: italic;
  margin-bottom: 1.75rem;
}

.menu-item h3,
.menu-item span {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: 1.5rem;
  background: var(--tm-surface-low);
  position: relative;
  z-index: 1;
}

.menu-item span {
  color: var(--tm-primary);
}

.menu-line {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 0.4rem;
}

.menu-line::after {
  content: "";
  flex: 1;
  border-bottom: 2px dotted var(--tm-outline-variant);
  transform: translateY(-5px);
}

.menu-section,
.gallery-section,
.testimonial-section,
.newsletter-section,
.site-footer {
  overflow: hidden;
}

/* Tab Transition Animation - Staggered Zoom-In */
.tab-content > .tab-pane {
  display: none;
  opacity: 0;
}

.tab-content > .tab-pane.active {
  display: block;
  opacity: 1;
}

.tab-pane.active .gallery-item {
  animation: tm-zoom-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Staggered Delays for Gallery Items (up to 16 items) */
.tab-pane.active .col-6:nth-child(1) .gallery-item { animation-delay: 0.1s; }
.tab-pane.active .col-6:nth-child(2) .gallery-item { animation-delay: 0.2s; }
.tab-pane.active .col-6:nth-child(3) .gallery-item { animation-delay: 0.3s; }
.tab-pane.active .col-6:nth-child(4) .gallery-item { animation-delay: 0.4s; }
.tab-pane.active .row:nth-child(2) .col-6:nth-child(1) .gallery-item { animation-delay: 0.5s; }
.tab-pane.active .row:nth-child(2) .col-6:nth-child(2) .gallery-item { animation-delay: 0.6s; }
.tab-pane.active .row:nth-child(2) .col-6:nth-child(3) .gallery-item { animation-delay: 0.7s; }
.tab-pane.active .row:nth-child(2) .col-6:nth-child(4) .gallery-item { animation-delay: 0.8s; }
/* Row 3 (for "All" tab) */
.tab-pane.active .row:nth-child(3) .col-6:nth-child(1) .gallery-item { animation-delay: 0.9s; }
.tab-pane.active .row:nth-child(3) .col-6:nth-child(2) .gallery-item { animation-delay: 1.0s; }
.tab-pane.active .row:nth-child(3) .col-6:nth-child(3) .gallery-item { animation-delay: 1.1s; }
.tab-pane.active .row:nth-child(3) .col-6:nth-child(4) .gallery-item { animation-delay: 1.2s; }
/* Row 4 */
.tab-pane.active .row:nth-child(4) .col-6:nth-child(1) .gallery-item { animation-delay: 1.3s; }
.tab-pane.active .row:nth-child(4) .col-6:nth-child(2) .gallery-item { animation-delay: 1.4s; }
.tab-pane.active .row:nth-child(4) .col-6:nth-child(3) .gallery-item { animation-delay: 1.5s; }
.tab-pane.active .row:nth-child(4) .col-6:nth-child(4) .gallery-item { animation-delay: 1.6s; }

@keyframes tm-zoom-in {
  from {
    opacity: 0;
    transform: scale(0.6) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.gallery-item {
  opacity: 0; /* Hidden by default, revealed by animation */
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 0.5rem;
  display: block;
  position: relative;
}

.premium-tabs {
  display: inline-flex;
  background: var(--tm-surface-high);
  padding: 0.4rem;
  border-radius: 99px;
  gap: 0.5rem;
  max-width: 100%;
}

.premium-tabs .nav-link {
  border: none;
  background: transparent;
  color: var(--tm-muted);
  font-family: "Playfair Display", serif;
  font-size: 1.15rem;
  padding: 0.6rem 2.5rem;
  border-radius: 99px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 0;
}

.premium-tabs .nav-link:hover {
  color: var(--tm-primary);
}

.premium-tabs .nav-link.active {
  color: #fff;
  background: var(--tm-primary);
  box-shadow: 0 4px 15px rgba(156, 63, 26, 0.25);
}

.premium-tabs .nav-link::after {
  display: none;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.testimonial-section {
  background: var(--tm-bg);
  overflow: hidden;
}

.testimonialSwiper {
  padding-bottom: 2rem;
}

.testimonial-prev,
.testimonial-next {
  cursor: pointer;
  z-index: 10;
}

/* Hero Swiper Pagination */
.hero-pagination {
  bottom: 30px !important;
}

.hero-pagination .swiper-pagination-bullet {
  width: 10px;
  height: 10px;
  background: var(--tm-primary);
  opacity: 0.3;
  transition: all 0.3s ease;
  margin: 0 6px !important;
}

.hero-pagination .swiper-pagination-bullet-active {
  opacity: 1;
  background: var(--tm-primary);
  width: 24px;
  border-radius: 5px;
}

@media (max-width: 767.98px) {
  .hero-pagination {
    bottom: 20px !important;
  }
}

.narrow-container {
  max-width: 860px;
}

.rating-stars {
  color: var(--tm-primary);
  display: flex;
  justify-content: center;
  gap: 0.2rem;
}

.rating-stars .filled {
  font-variation-settings:
    "FILL" 1,
    "wght" 400,
    "GRAD" 0,
    "opsz" 24;
}

.testimonial-copy {
  font-size: clamp(1.3rem, 3vw, 2rem);
  line-height: 1.5;
  font-style: italic;
  margin-bottom: 2.5rem;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  object-fit: cover;
}

.avatar-name {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.875rem;
  font-weight: 600;
}

.avatar-role {
  margin: 0.15rem 0 0;
  color: var(--tm-muted);
  font-size: 0.875rem;
}

.icon-btn {
  border: 0;
  background: transparent;
  color: var(--tm-muted);
}

.icon-btn:hover {
  color: var(--tm-primary);
}

.icon-btn .material-symbols-outlined {
  font-size: 2rem;
}

.video-banner {
  position: relative;
  min-height: 600px;
  overflow: hidden;
}

.banner-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.banner-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
}

.banner-content {
  position: relative;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #fff;
  z-index: 2;
  max-width: 1320px;
}

.play-btn {
  width: 4rem;
  height: 4rem;
  border: 2px solid #fff;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  margin-bottom: 1.75rem;
  transition: all 0.25s ease;
}

.play-btn:hover {
  background: #fff;
  color: #000;
}

.play-btn .material-symbols-outlined {
  font-size: 2rem;
  font-variation-settings:
    "FILL" 1,
    "wght" 400,
    "GRAD" 0,
    "opsz" 24;
}

.section-tag-light {
  color: #f5f5f4;
}

.banner-title {
  max-width: 840px;
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 1.15;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.newsletter-section {
  position: relative;
  background: var(--tm-surface-high);
  overflow: hidden;
}

.newsletter-bg {
  position: absolute;
  inset: 0;
}

.newsletter-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.2;
}

.newsletter-section::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(28, 25, 23, 0.65);
}

.newsletter-section .container {
  z-index: 2;
}

.section-title-light {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.2;
}

.newsletter-copy {
  color: #d6d3d1;
  margin: 1rem auto 2rem;
  max-width: 700px;
}

.newsletter-form {
  display: flex;
  gap: 0;
  max-width: 640px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.newsletter-input {
  flex: 1 1 320px;
  border-radius: 0;
  border: 1px solid #78716c;
  background: transparent;
  color: #fff;
  padding: 0.9rem 1.25rem;
}

.newsletter-input::placeholder {
  color: #a8a29e;
}

.newsletter-input:focus {
  color: #fff;
  background: transparent;
  border-color: var(--tm-primary);
  box-shadow: 0 0 0 0.2rem rgba(156, 63, 26, 0.25);
}

.newsletter-btn {
  border-radius: 0;
  padding: 0.9rem 1.5rem;
}

.site-footer {
  background: var(--tm-surface-dark);
  color: #a8a29e;
  padding: 5rem 0;
  font-family: "Playfair Display", serif;
}

.site-footer h4 {
  color: #fff;
  margin-bottom: 1.3rem;
  font-size: 1.1rem;
}

.footer-brand {
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.footer-brand span {
  color: var(--tm-primary);
}

.site-footer a {
  color: #fff;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--tm-primary);
}

.footer-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.footer-phone {
  color: #fff;
  font-weight: 600;
}

.footer-bottom {
  border-top: 1px solid #292524;
  padding-top: 1.8rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  text-align: center;
}

.footer-bottom p {
  margin: 0;
}

.footer-legal {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

@media (max-width: 767.98px) {
  .main-content {
    padding-top: 88px;
  }

  .section-spacing,
  .section-spacing-sm {
    padding: 72px 0;
  }

  .hero-image-wrap,
  .about-image-wrap,
  .video-banner,
  .banner-content {
    min-height: 420px;
    height: 420px;
  }

  .gallery-offset {
    margin-top: 0;
  }

  .newsletter-form {
    gap: 1rem;
  }

  .newsletter-btn,
  .newsletter-input {
    width: 100%;
  }

  .hero-copy-wrap {
    padding: 60px 1.5rem;
    justify-content: center;
    text-align: center;
  }

  .hero-copy .d-flex {
    justify-content: center;
  }

  #about {
    text-align: center;
  }

  .about-image-wrap {
    margin-bottom: 2.5rem;
  }

  .hero-copy {
    max-width: 100%;
  }

  .hero-image-wrap {
    min-height: 350px;
  }

  .premium-tabs .nav-link {
    padding: 0.6rem 1.25rem;
    font-size: 1rem;
  }
}

@media (min-width: 768px) {
  .gallery-offset {
    margin-top: 2rem;
  }
}
