a {
  text-decoration: none !important;
  color: var(--wp--preset--color--primary, #43593b);
}
/* --- Custom Mini Cart Slide --- */
.woofc-area-top {
  background-color: var(
    --wp--preset--color--light-secondary,
    #f0f0d8
  ) !important;
}
.woofc-area-bot {
  padding-top: 20px;
  border-width: 1px 0 0 0;
  border-color: #f9e9de;
  border-style: solid;
}

/* --- Promotion Swiper Carousel --- */
.promotion-swiper {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  border-radius: 16px;
  aspect-ratio: 1200 / 630;
  isolation: isolate;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  mask-image: -webkit-radial-gradient(white, black);
}

.promotion-swiper br {
  display: none !important;
}

.promotion-swiper .swiper-wrapper {
  display: flex;
  margin: 0 !important;
  padding: 0 !important;
  height: 100%;
}

.promotion-swiper .swiper-slide {
  flex-shrink: 0;
  width: 100%;
  height: 100%;
  position: relative;
  border-radius: inherit;
}

/* --- Promotion Card Layout --- */
.promotion-card {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #0d0d0d;
  cursor: pointer;
  text-decoration: none;
  border-radius: inherit;
}

.promotion-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
  transition:
    transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Mini Zoom & Intensity Effect on Hover --- */
.promotion-card:hover .promotion-card__image {
  transform: scale(1.03);
  filter: brightness(0.88) contrast(1.05);
}

/* --- Swiper Navigation Buttons --- */
.promotion-swiper .swiper-button-prev,
.promotion-swiper .swiper-button-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  margin-top: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.promotion-swiper .swiper-button-prev::after,
.promotion-swiper .swiper-button-next::after {
  font-size: 16px !important;
  font-weight: bold;
  color: #ffffff;
}

.promotion-swiper .swiper-button-prev:hover,
.promotion-swiper .swiper-button-next:hover {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.promotion-swiper .swiper-button-prev:hover::after,
.promotion-swiper .swiper-button-next:hover::after {
  color: #000000;
}

.promotion-swiper .swiper-button-prev {
  left: 24px;
}

.promotion-swiper .swiper-button-next {
  right: 24px;
}

/* --- Swiper Pagination Dots --- */
.promotion-swiper .swiper-pagination {
  bottom: 20px !important;
  left: 50% !important;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  z-index: 10;
  width: auto !important;
}

.promotion-swiper .swiper-pagination-bullet {
  background-color: rgba(255, 255, 255, 0.45);
  opacity: 1;
  border: 0;
  margin: 0 !important;
  padding: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.promotion-swiper .swiper-pagination-bullet-active {
  background-color: #ffffff !important;
  width: 24px;
  border-radius: 12px;
}

.embla__dot:hover {
  background-color: rgba(255, 255, 255, 0.7);
}

.embla__dot--selected {
  background-color: #ffffff;
  width: 20px;
  border-radius: 4px;
}

/* --- Mobile Custom Styles --- */
@media (max-width: 768px) {
  .embla-promotion {
    border-radius: 12px;
  }
  .embla__button {
    width: 32px;
    height: 32px;
  }
  .embla__button--prev {
    left: 8px;
  }
  .embla__button--next {
    right: 8px;
  }
  .embla__dots {
    bottom: 12px;
  }
}

/* Custom Mobile Product Card */
@media (max-width: 600px) {
  .wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .product-card-button a.button {
    font-size: 0.9rem !important;
    white-space: nowrap !important;
    padding: 12px 12px !important;
  }
  .product-card-button a.button::after {
    width: 16px;
    height: 16px;
  }
}

/* --- Highlight Underline (Hand-drawn style) --- */
.text-highlight-underline {
  position: relative;
  display: inline-block;
  z-index: 1;
}

.text-highlight-underline::after {
  content: "";
  position: absolute;
  left: -2%;
  bottom: -6px;
  width: 104%;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 15' preserveAspectRatio='none'%3E%3Cpath d='M1,12 Q30,2 50,9 T99,11' fill='none' stroke='%2382cf61' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  z-index: -1;
}

/* --- Katanyu User Menu --- */
.katanyu-user-menu {
  display: flex;
  align-items: center;
}

.katanyu-user-login-link,
.katanyu-user-profile {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  color: var(--wp--preset--color--text, #626262);
  text-decoration: none;
  font-family: var(
    --wp--preset--font-family--mn-kai-thot,
    "MN-Kai-thot",
    sans-serif
  );
  font-size: 1rem;
  transition: opacity 0.3s ease;
}

.katanyu-user-login-link:hover,
.katanyu-user-profile:hover {
  opacity: 0.8;
  color: var(--wp--preset--color--text, #626262);
}

.katanyu-user-login-link br {
  display: none !important;
}

.katanyu-user-login-link span {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.katanyu-user-action-link {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.katanyu-user-action-link:hover {
  opacity: 0.8;
  color: var(--wp--preset--color--text, #626262);
}

.katanyu-user-icon {
  width: 14px;
  height: 14px;
}

.katanyu-user-sep {
  margin: 0 3px;
  opacity: 0.5;
}

.katanyu-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.katanyu-user-greeting {
  font-weight: 500;
  line-height: 1;
  transform: translateY(-2px); /* Adjust for Thai font baseline */
}

.katanyu-desktop-user-menu {
  display: flex;
  align-items: center;
}

/* Hide desktop user menu on mobile */
@media (max-width: 767.98px) {
  .katanyu-desktop-user-menu {
    display: none !important;
  }
}

.katanyu-header-placeholder {
  width: 100%;
  box-sizing: border-box;
}

/* Ensure WordPress site block wrappers do not trap fixed/sticky headers */
.wp-site-blocks,
header.wp-block-template-part {
  overflow: visible !important;
}

/* --- Fixed Main White Header On Scroll --- */
#gspb_row-id-katanyu-main-header.is-fixed,
.gspb_row-id-katanyu-main-header.is-fixed,
#katanyu-main-header.is-fixed {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 9999 !important;
  background-color: #ffffff !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
  animation: katanyuHeaderSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@keyframes katanyuHeaderSlideDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

/* --- 404 Page Styling --- */
.katanyu-404-wrapper {
  padding: 60px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 350px);
}

.katanyu-404-container {
  max-width: 620px;
  width: 100%;
  text-align: center;
  background: #ffffff;
  border-radius: 24px;
  padding: 48px 36px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
}

.katanyu-404-badge {
  font-size: 5.5rem;
  font-weight: 800;
  line-height: 1;
  color: var(--wp--preset--color--primary, #43593b);
  letter-spacing: -2px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #43593b 0%, #acad79 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.katanyu-404-title {
  font-size: 1.65rem;
  font-weight: 700;
  color: #121212;
  margin: 0 0 12px 0;
  line-height: 1.3;
}

.katanyu-404-description {
  font-size: 0.98rem;
  color: var(--wp--preset--color--text, #626262);
  margin: 0 0 28px 0;
  line-height: 1.6;
  max-width: 480px;
}

/* WordPress Search Form inside 404 */
.katanyu-404-search,
.wp-block-search.katanyu-404-search {
  width: 100%;
  max-width: 440px;
  margin-bottom: 32px;
}

.katanyu-404-search .wp-block-search__inside-wrapper {
  display: flex;
  align-items: center;
  background: #fdfbf7;
  border: 1px solid #e8d7b9;
  border-radius: 14px;
  padding: 4px 6px 4px 14px;
  transition: all 0.2s ease;
}

.katanyu-404-search .wp-block-search__inside-wrapper:focus-within {
  background: #ffffff;
  border-color: #43593b;
  box-shadow: 0 0 0 3px rgba(67, 89, 59, 0.12);
}

.katanyu-404-search input.wp-block-search__input {
  border: none !important;
  background: transparent !important;
  font-size: 0.95rem;
  color: #121212;
  width: 100%;
  outline: none !important;
  box-shadow: none !important;
  padding: 8px 0 !important;
}

.katanyu-404-search button.wp-block-search__button {
  background: #43593b !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 10px !important;
  padding: 10px 18px !important;
  cursor: pointer;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.katanyu-404-search button.wp-block-search__button:hover {
  background: #34472d !important;
}

/* 404 Action Buttons */
.katanyu-404-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.katanyu-404-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: all 0.25s ease;
}

.katanyu-404-btn-primary {
  background-color: #43593b;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(67, 89, 59, 0.2);
}

.katanyu-404-btn-primary:hover {
  background-color: #34472d;
  color: #ffffff !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(52, 71, 45, 0.3);
}

.katanyu-404-btn-secondary {
  background-color: #fdfbf7;
  color: #43593b !important;
  border: 1px solid #e8d7b9;
}

.katanyu-404-btn-secondary:hover {
  background-color: #f0f0d8;
  color: #43593b !important;
  transform: translateY(-2px);
}

@media (max-width: 576px) {
  .katanyu-404-container {
    padding: 36px 20px;
    border-radius: 18px;
  }

  .katanyu-404-badge {
    font-size: 4.2rem;
  }

  .katanyu-404-title {
    font-size: 1.35rem;
  }

  .katanyu-404-actions {
    flex-direction: column;
  }

  .katanyu-404-btn {
    width: 100%;
    justify-content: center;
  }
}

/* --- Global Safe Overflow & Layout Containment Guard --- */
html,
body {
  max-width: 100vw;
  overflow-x: clip;
}

img,
svg,
video,
canvas,
iframe,
object,
embed {
  max-width: 100%;
  height: auto;
}

p,
h1,
h2,
h3,
h4,
h5,
h6,
span,
a,
li,
blockquote,
td,
th {
  overflow-wrap: break-word;
  word-break: break-word;
}

.wp-site-blocks,
.wp-block-group,
.wp-block-columns,
.wp-block-column,
.gspb_row,
.gspb_container,
.gspb_row__content {
  max-width: 100%;
  box-sizing: border-box;
}

table {
  max-width: 100%;
}

.wp-block-table,
.woocommerce table.shop_table_responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  display: block;
}

/* Forminator Custom */

.forminator-ui {
  margin: 0 !important;
}
