/* ==========================================================================
   1) 登入 Modal（Google / LINE / Facebook）樣式
   ========================================================================== */

/* 外觀 */
.dj-modal .modal-dialog{
  max-width: 920px;                 /* 可依需要調整 */
}
.dj-modal .modal-content{
  border: 0;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  overflow: hidden;
  backdrop-filter: saturate(130%) blur(2px);
}
.dj-modal .modal-header{
  border: 0;
  padding: 10px 12px 0 12px;
}
.dj-modal .modal-body{
  padding: 10px 24px 24px 24px;
}

/* 右上角關閉 X */
.btn-close.dj-close{
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  opacity: 1 !important;
  width: 32px;
  height: 32px;
  outline: none;
}
.btn-close.dj-close:hover{
  background: #f8f9fa;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}
.btn-close.dj-close:focus{
  box-shadow: 0 0 0 3px rgba(25,135,84,.25);
}

/* 版面：左圖固定 350px，右側自動撐開 */
.dj-layout{
  display: flex;
  align-items: center;
  gap: 24px;
}
.dj-left{
  flex: 0 0 350px;                 /* 左側固定寬 */
  max-width: 350px;
}
.dj-hero{
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,.12);
  object-fit: cover;
}
.dj-right{
  flex: 1 1 auto;
  min-width: 0;
}
.dj-title{
  font-weight: 800;
  letter-spacing: .4px;
  margin-bottom: .4rem;
  color: #4f46e5;
}
.dj-sub{
  color: #667085;
  font-size: 1.1rem;
  margin: 0;
}

/* 社群登入按鈕（直式排列） */
.dj-social{
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}
.dj-social .btn{
  width: 100%;
  padding: 10px 16px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform .08s ease, box-shadow .2s ease, filter .2s ease;
  white-space: nowrap;
}
.dj-social .btn:active{ transform: translateY(1px); }

/* Google */
.btn-google{
  background: #fff;
  border: 1px solid #ddd;
  color: #3c4043;
}
.btn-google:hover{
  background: #f8f9fa;
  border-color: #cfd4da;
  box-shadow: 0 8px 18px rgba(60,64,67,.12);
}
.btn-google:focus{
  box-shadow: 0 0 0 3px rgba(66,133,244,.25);
  border-color: #b5c7f8;
}

/* LINE */
.btn-line{
  background: #06C755;
  color: #fff;
  border: none;
}
.btn-line:hover{
  filter: brightness(0.96);
  box-shadow: 0 8px 18px rgba(6,199,85,.28);
}
.btn-line:focus{
  box-shadow: 0 0 0 3px rgba(6,199,85,.3);
  color:#fff;
}

/* Facebook */
.btn-facebook{
  background: #1877F2;
  color: #fff;
  border: none;
}
.btn-facebook:hover{
  filter: brightness(0.96);
  box-shadow: 0 8px 18px rgba(24,119,242,.28);
}
.btn-facebook:focus{
  box-shadow: 0 0 0 3px rgba(24,119,242,.3);
  color:#fff;
}

/* 使用條款／隱私 */
.dj-legal{
  margin-top: 10px;
  font-size: 1rem;
  color: #6b7280;
}
.dj-legal a{
  color: #6b7280;
  text-decoration: underline;
}
.dj-legal a:hover{ color: #4b5563; }

/* 響應式：小螢幕改為上下堆疊 */
@media (max-width: 991.98px){
  .dj-modal .modal-dialog{ margin: 1rem; }
  .dj-layout{
    flex-direction: column;
    align-items: stretch;
  }
  .dj-left{ flex: 0 0 auto; max-width: 100%; }
  .dj-right{ padding-top: 6px; }
}


/* ==========================================================================
   2) 導覽列右側：頭像 + 我的商店 + 下拉選單（完整）
   ========================================================================== */

/* 讓右側容器可垂直置中（若你的主題已處理可省略） */
.topbar, .navbar, .secondary-nav, .topbar-right, .navbar .container{
  display:flex; align-items:center;
}

/* 外層容器：頭像 + 我的商店（水平排列），不撐高 nav */
.avatar-dropdown{
  display:flex;
  align-items:center;
  gap:10px;
  padding:0 !important;      /* 避免主題預設 padding 影響對齊 */
  margin:0;
}


/* 頭像外框（白底圓 + 柔陰影） */
.avatar-wrap{
  position:relative;
  display:inline-block;
  width:40px;
  height:40px;
  flex-shrink:0;
}
.avatar-wrap::before{
  content:"";
  position:absolute;
  inset:-3px;                 /* 原本 -6px → 改成 -3px，背景不會太大 */
  border-radius:9999px;
  background:#fff;
  box-shadow:0 6px 16px rgba(0,0,0,.16); /* 陰影也稍微柔和縮小 */
  z-index:0;
}
.avatar{
  position:relative;
  z-index:1;
  width:100%;
  height:100%;
  border-radius:50%;
  object-fit:cover;
  border:2px solid #fff;
}

.status-dot{
  position:absolute;
  right:2px;
  bottom:-2px;
  width:10px;
  height:10px;
  background:#22c55e;
  border:2px solid #fff;
  border-radius:50%;
  z-index:2;
}

/* 我的商店連結 */
.shop-link{
  display:flex;
  align-items:center;        /* 確保垂直置中 */
  height:40px;               /* 與頭像同高 */
  padding:0 10px;
  font-size:15px;
  font-weight:700;
  color:#222;
  text-decoration:none;
  white-space:nowrap;
  border-radius:8px;
  transition:background .15s ease, color .15s ease;

  line-height: 1.2;          /* 微調：比 1 更貼近字型高度，讓文字剛好置中 */
}
.shop-link:hover{
  background:#f5f6f8;
  color:#4f46e5;
}


/* 下拉選單（預設關閉；使用 JS 切換 .is-open） */
.avatar-menu{
  position:absolute;
  right:0;
  top:calc(100% + 10px);
  width:240px;
  background:#fff;
  border-radius:12px;
  box-shadow:0 12px 28px rgba(16,24,40,.14), 0 2px 8px rgba(16,24,40,.06);
  padding:8px 0;
  z-index:1000;

  opacity:0;
  transform:translateY(-8px) scale(.98);
  pointer-events:none;
  visibility:hidden;
  transition:opacity .16s ease, transform .18s cubic-bezier(.22,.7,.26,1), visibility .16s;
  transform-origin:top right;

  overflow:hidden;
}
.avatar-menu.is-open{
  opacity:1;
  transform:translateY(0) scale(1);
  pointer-events:auto;
  visibility:visible;
}

/* 選單的頭像＋名稱 */
.menu-header{
  display:grid;
  grid-template-columns:36px 1fr;
  align-items:center;
  gap:10px;
  padding:10px 14px 8px;
}
.menu-header-pic{
  width:36px; height:36px;
  border-radius:50%;
  object-fit:cover;
  display:block;
}
.menu-header-name{
  font-size:1.5rem;           /* 大一點更清楚 */
  font-weight:700;
  color:#222;
  line-height:1.2;
}

/* 分隔線 */
.menu-divider{
  height:1px;
  background:#eceff3;
  margin:6px 0;
}

/* 選單項目 */
.menu-item{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 14px;
  font-size:1.2rem;
  color:#374151;
  text-decoration:none;
  transition:background .15s ease, color .15s ease;
}
.menu-item:hover{
  background:#f6f7f9;
  color:#111;
}
.menu-item svg{
  color:#6b7280;
  min-width:18px;
}
.menu-item:hover svg{ color:#4f46e5; }

/* 危險操作（登出） */
.menu-item.destructive{ color:#e11d48; }
.menu-item.destructive:hover{
  background:#fff1f3;
}
.menu-item.destructive svg{ color:#e11d48; }

/* 行動裝置觸控優化 */
@media (max-width: 480px){
  .menu-item{ padding:12px 16px; font-size:1.05rem; }
  .menu-header-name{ font-size:1.1rem; }
}

/* 若主題對 nav item 統一有 padding，將頭像這顆例外掉 */
.secondary-nav .avatar-dropdown,
.navbar .avatar-dropdown{
  padding:0 !important;
}