.derma-aside {
  width: 340px;
  height: 100vh;
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
  position: sticky;
  top: 0;
  align-self: flex-start;
  left: 10px;
  z-index: 10;
}

.derma-aside-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  box-sizing: border-box;
}

.derma-aside-img {
  width: 100%;
  height: calc(100vh - 310px);
  max-height: 822px;
  min-height: 400px;
  position: relative;
  overflow: hidden;
}

.derma-aside-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

/* ==========================================================================
   PC 전용 Ambilight Video / 모바일 전용 사이드 배너·이미지
   - PC(≥769px): 언어별 video 항상 표시 (사이드 배너 유무 무관)
     · 배경 video: 영역 가득 채움 + 강한 블러 처리 (Ambilight 효과)
     · 메인 video: 비율 유지 + Ambilight 위에 표시
   - 모바일(≤768px): 사이드 배너 swiper 또는 fallback 이미지 표시
   ========================================================================== */
/* 기본(모바일 우선): video 모두 숨김, 사이드 배너 wrapper·fallback 이미지 표시 */
.derma-aside-img .derma-aside-fallback-video,
.derma-aside-img .derma-aside-video-bg {
  display: none;
}
.derma-aside-img .derma-aside-fallback-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* 모바일에서 사이드 배너 wrapper 표시 (기본값) */

/* PC (≥769px): Ambilight 효과 - 배경 video(블러) + 메인 video(contain) */
@media (min-width: 769px) {
  .derma-aside-img {
    position: relative;
    overflow: hidden;
  }
  /* Ambilight 배경 video — 영역 가득 채우고 강한 블러 처리 */
  .derma-aside-img .derma-aside-video-bg {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* 강한 블러로 영상 색감만 살리고 디테일 흐림 */
    filter: blur(30px) brightness(0.95);
    /* 블러로 인한 가장자리 노출 방지 */
    transform: scale(1.15);
    z-index: 0;
    pointer-events: none;
  }
  /* 메인 video — 잘림 없이 영상 전체 표시 (Ambilight 위에 배치) */
  .derma-aside-img .derma-aside-fallback-video {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: transparent;
    z-index: 1;
  }
  .derma-aside-img .derma-aside-fallback-img {
    display: none;
  }
  .derma-aside-img .side-banner-wrapper {
    display: none;
  }
}

/* ==========================================================================
   Glassmorphism Premium — Actions / SNS / Language
   ========================================================================== */

/* 상담·전화·오시는길 (3 액션) — 퍼플-핑크 그라디언트 카드 + 유리 아이콘 */
.derma-aside-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  background: linear-gradient(135deg, #7c5dfa 0%, #ec4899 100%);
  border-radius: 18px;
  padding: 16px 10px;
  width: calc(100% - 20px);
  margin: 20px 0 0;
  box-sizing: border-box;
  box-shadow: 0 12px 28px rgba(124, 93, 250, 0.28);
  position: relative;
  overflow: hidden;
}
.derma-aside-actions::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15), transparent 70%);
  pointer-events: none;
}

.derma-aside-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 6px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
  text-align: center;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  z-index: 1;
}

.derma-aside-action:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

/* 유리 프레임 — img 의 filter 영향을 피하기 위해 pseudo 로 분리 */
.derma-aside-action::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 50%;
  width: 44px;
  height: 44px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.25s ease;
  pointer-events: none;
  z-index: 0;
}

.derma-aside-action:hover::before {
  background: rgba(255, 255, 255, 0.38);
  transform: translateX(-50%) scale(1.08);
  border-color: rgba(255, 255, 255, 0.3);
}

.derma-aside-action img {
  width: 44px;
  height: 44px;
  padding: 10px;
  box-sizing: border-box;
  object-fit: contain;
  display: block;
  filter: brightness(0) invert(1) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
  transition: transform 0.25s ease;
  position: relative;
  z-index: 1;
}

.derma-aside-action:hover img {
  transform: scale(1.08);
}

.derma-aside-action span {
  position: relative;
  z-index: 1;
}

/* 그라디언트 카드에서는 divider 불필요 — 기존 마크업 유지용으로 숨김 */
.derma-aside-divider {
  display: none;
}

/* SNS — 백색 카드 + 원형 아이콘 (브랜드 컬러 호버) */
.derma-aside-sns {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 14px 12px;
  width: calc(100% - 20px);
  box-sizing: border-box;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.sns-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: #4b5563;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.02em;
  transition: all 0.25s ease;
  padding: 4px;
}

.sns-link:hover {
  color: #111;
  transform: translateY(-2px);
}

.sns-link img {
  width: 24px;
  height: 24px;
  padding: 9px;
  box-sizing: content-box;
  background: #f3f4f6;
  border-radius: 50%;
  object-fit: contain;
  transition: all 0.3s ease;
}

.sns-link:hover img {
  background: #e5e7eb;
  transform: scale(1.05);
}

/* 브랜드 컬러 hover (URL 기반 자동 매칭) */
.sns-link[href*="tiktok"]:hover img {
  background: #000;
}
.sns-link[href*="instagram"]:hover img,
.sns-link[href*="instagram.com"]:hover img {
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
}
.sns-link[href*="youtube"]:hover img {
  background: #ff0000;
}
.sns-link[href*="wa.me"]:hover img {
  background: #25d366;
}
.sns-link[href*="line.me"]:hover img {
  background: #06c755;
}
.sns-link[href*="x.com"]:hover img,
.sns-link[href*="twitter"]:hover img {
  background: #000;
}
.sns-link[href*="xiaohongshu"]:hover img {
  background: #ff2442;
}
.sns-link[href*="douyin"]:hover img {
  background: #000;
}
.sns-link.wechat:hover img {
  background: #07c160;
}
.sns-link[href*="facebook"]:hover img {
  background: #1877f2;
}

/* SNS divider 제거 (space-around 로 간격 자연 분배) */
.sns-divider {
  display: none;
}

.derma-aside-family {
  display: none; /* 추후 오픈할 경우 flex로 수정 */
  justify-content: center;
  gap: 12px;
  padding: 16px 20px;
  width: calc(100% - 20px);
  box-sizing: border-box;
  background: #ffffff;
  border-radius: 16px;
  margin: 10px auto 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* Language — 백색 카드 + 5개 국기(둥근 사각형) grid + active 인디케이터 */
.derma-aside-lang {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 14px 10px 12px;
  width: calc(100% - 20px);
  box-sizing: border-box;
  background: #ffffff;
  border-radius: 18px;
  margin: 10px auto 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.derma-aside-lang a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 2px;
  text-decoration: none;
  color: #6b7280;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: -0.02em;
  border-radius: 10px;
  transition: all 0.25s ease;
  position: relative;
  /* 기존 box-shadow·overflow:hidden 재설정 */
  box-shadow: none;
  overflow: visible;
}

/* 언어별 라벨 (data-lang 으로 자동 부여) */
.derma-aside-lang a[data-lang="ko"]::after { content: '한국어'; }
.derma-aside-lang a[data-lang="en"]::after { content: 'EN'; }
.derma-aside-lang a[data-lang="ja"]::after { content: '日本語'; }
.derma-aside-lang a[data-lang="ru"]::after { content: 'RU'; }
.derma-aside-lang a[data-lang="zh"]::after { content: '简体'; }
.derma-aside-lang a[data-lang="zh-TW"]::after { content: '繁體'; }
.derma-aside-lang a[data-lang="th"]::after { content: 'ไทย'; }
.derma-aside-lang a::after {
  display: block;
}

.derma-aside-lang a:hover {
  background: #f3f4f6;
  color: #111;
  transform: none;  /* 기존 translateY(-2px) 오버라이드 */
}

/* 국기 — 원형 대신 둥근 사각형(3:2 비율) 으로 전체 모양 보존 */
.derma-aside-lang img {
  width: 42px;
  height: 28px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: all 0.25s ease;
}

.derma-aside-lang a:hover img {
  transform: translateY(-1px);
  border-color: #7c5dfa;
  box-shadow: 0 4px 10px rgba(124, 93, 250, 0.2);
}

/* 현재 선택된 언어 — 그라디언트 배경 + 체크 인디케이터 */
.derma-aside-lang a.active {
  background: linear-gradient(135deg, #f3e8ff, #fce7f3);
  color: #7c5dfa;
}

.derma-aside-lang a.active img {
  border-color: #7c5dfa;
  box-shadow: 0 0 0 2px #7c5dfa, 0 2px 6px rgba(124, 93, 250, 0.2);
}

.derma-aside-lang a.active::before {
  content: '';
  position: absolute;
  top: 3px;
  right: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #7c5dfa;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(124, 93, 250, 0.4);
}

/* 가맹점 */
.family-select-wrap {
  position: relative;
  width: 100%;
}

.family-trigger {
  width: 100%;
  padding: 10px 36px 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #2d3748;
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  text-align: center;
  position: relative;
  transition: color 0.3s;
}

.family-trigger::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #4a5568;
  transform: translateY(-50%);
  transition: transform 0.3s;
}

.family-select-wrap.open .family-trigger::after {
  transform: translateY(-50%) rotate(180deg);
}

.family-trigger:hover {
  color: var(--point-color);
}

.family-popup {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  width: calc(100% + 40px);
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  padding: 6px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.family-select-wrap.open .family-popup {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.family-item {
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s;
}

.family-item:hover {
  background: #f9fafb;
}

.family-item.active {
  color: var(--point-color);
  font-weight: 600;
  background: rgba(155, 109, 255, 0.06);
}

.family-item.active::after {
  content: '\2713';
  color: var(--point-color);
  font-weight: 700;
  font-size: 14px;
}

/* 스크롤바 스타일링 */
.derma-aside::-webkit-scrollbar {
  width: 6px;
}

.derma-aside::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.derma-aside::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.derma-aside::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 사이드 배너 Swiper 스타일 */
.side-banner-swiper {
  width: 100%;
  height: 100%;
}

.side-banner-swiper .swiper-slide {
  width: 100%;
  height: 100%;
  position: relative;
}

.side-banner-swiper .swiper-pagination {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

.side-banner-swiper .swiper-pagination-bullet {
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.5);
  margin: 0 4px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
}

.side-banner-swiper .swiper-pagination-bullet-active {
  background: #ffffff;
  transform: scale(1.2);
}

/* 기존 사이드 배너 스타일 유지 */
.side-banner-wrapper {
  width: 100%;
  height: 100%;
  position: relative;
}

.banner-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.banner-video {
  width: 100%;
  height: 100%;
  position: relative;
}

.banner-video-iframe {
  width: 100%;
  height: 100%;
  border: none;
  object-fit: cover;
}

.side-banner-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: white;
  padding: 20px;
  z-index: 5;
}

.side-banner-content {
  text-align: center;
}

.side-banner-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: white;
}

.side-banner-description {
  font-size: 14px;
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.4;
}

.side-banner-link-btn {
  display: inline-block;
  padding: 8px 16px;
  background: var(--primary, #3b82f6);
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.side-banner-link-btn:hover {
  background: var(--primary-hover, #2563eb);
  color: white;
  text-decoration: none;
}

@media (max-width: 1280px) {
  .derma-aside {
    display: none;
  }
}

@media (min-width: 1920px) {
  .derma-aside {
    width: 400px;
    margin-right: -3px;
  }
}

@media (max-height: 800px) {
  .derma-aside-img {
    height: calc(100vh - 350px);
    min-height: 300px;
  }
  
  .derma-aside-inner {
    padding: 16px 0;
  }
  
  .derma-aside-actions,
  .derma-aside-sns,
  .derma-aside-lang {
    margin: 12px 20px;
    padding: 16px;
  }
}