/* -------------------------
    Thong-iōng goân-kiāⁿ
---------------------------*/

@media (max-width: 1024px) {
  .btn-main {
    padding: 1rem 2rem;
    font-size: 1.1rem;
  }
}

.tag {
  border: 1px solid #ccc;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* Side-by-side on desktop */
  margin-bottom: 2.5rem;
  padding-left: 1rem;
  /* Space from the accent line */
  border-left: 4px solid var(--accent-green);
  /* Global shared accent line */
  position: relative;
}

.section-title,
.section-header h1,
.section-header h2,
.section-header h3 {
  font-family: "Charis", "Noto Serif TC", serif;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-dark);
  margin: 0;
  line-height: 1.2;
}

/* Legacy accent line removed in favor of global .section-header border */

.section-sub {
  color: #9ca3af;
  opacity: 0.8;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  font-weight: 500;
  text-transform: uppercase;
  white-space: normal;
  /* Allow wrapping */
  transition: all 0.3s ease;
  font-family: var(--font-ui);
  line-height: 1.6;
}

.section-header:hover .section-sub {
  color: var(--accent-green);
  transform: translateX(8px);
  opacity: 1;
}

@media (max-width: 768px) {
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    margin-bottom: 2rem;
  }

  .section-title,
  .section-header h1,
  .section-header h2,
  .section-header h3 {
    font-size: 1.75rem;
    text-align: left !important;
    /* Force left alignment on mobile */
  }

  .section-sub {
    transform: none !important;
    text-align: left !important;
  }
}

/* ---------------------------------------------------
    Floating Action Bubble (FAB) 🫧
-----------------------------------------------------*/
.fab-container {
  position: fixed;
  bottom: 1.25rem;
  /* Tighter to corner */
  right: 1.25rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  pointer-events: none;
}

.fab-main-btn {
  order: 2;
  /* Ensure main button is ALWAYS at the bottom */
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #ffffff !important;
  /* Changed to white for high visibility */
  color: var(--text-dark) !important;
  /* Dark icon */
  border: 1px solid rgba(0, 0, 0, 0.08);
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  /* Stronger shadow */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  pointer-events: auto;
}

@media (hover: hover) {
  .fab-main-btn:hover {
    transform: scale(1.1);
    background: var(--accent-green);
  }
}

.fab-main-btn:active {
  transform: scale(0.9);
  background: var(--accent-green);
  transition: all 0.05s ease-out;
}

.fab-container.expanded .fab-main-btn {
  transform: rotate(90deg);
  background: #f3f4f6 !important;
  /* Subtle gray when expanded */
  color: var(--accent-green) !important;
  /* Change icon color when expanded */
}

.fab-actions {
  order: 1;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(30px) scale(0.6);
  /* Pop up from below */
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  /* Bouncy spring */
  pointer-events: none;
}

.fab-container.expanded .fab-actions {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.fab-btn {
  width: 56px;
  height: 56px;
  border-radius: 50% !important;
  /* Force circular shape */
  background: #ffffff !important;
  /* Force solid white */
  backdrop-filter: none !important;
  /* Remove blur to prevent transparency look */
  -webkit-backdrop-filter: none !important;
  border: 1px solid rgba(0, 0, 0, 0.1);
  /* Slightly more defined border */
  color: var(--text-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  font-size: 1.25rem;
  /* Slightly larger icons */
}

@media (hover: hover) {
  .fab-btn:hover {
    background: white;
    color: var(--accent-green);
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  }
}

.fab-btn:active {
  transform: scale(0.9);
  transition: transform 0.1s;
  background: #f3f4f6 !important;
}

.fab-item {
  position: relative;
}

/* Float-specific Member Menu position & Style Unification */
.fab-container .member-menu {
  position: absolute;
  bottom: 0;
  right: 72px;
  /* Adjusted for larger buttons */
  top: auto;
  margin-top: 0;
  width: 220px;
  background: #ffffff;
  /* Solid white to match buttons */
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  transform: translateX(20px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.fab-container .member-menu.show {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.fab-container .member-link {
  padding: 14px 20px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-dark);
  border-bottom: 2px solid transparent;
  /* Use transparent border to hold space if needed, or just remove. 
     User dislikes "gray edges", so removing visible borders. */
  transition: all 0.2s ease;
  border-radius: 0 !important;
  /* Ensure it fills the container corners */
}

@media (hover: hover) {
  .fab-container .member-link:hover {
    background: transparent;
    color: var(--accent-green);
    /* padding-left: 24px; Removed slide effect preference */
  }
}

.fab-container .member-link:active {
  color: var(--accent-green);
  opacity: 0.7;
  transition: opacity 0.1s;
}

.fab-container .member-info {
  padding: 16px 20px;
  background: transparent;
  /* Was gray */
  border-bottom: 1px solid #f5f5f5;
  /* Lighter border */
}

/* Badge for FAB cart - High Visibility Mode */
.fab-container .cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #65a30d;
  /* Slightly more vibrant green */
  color: white;
  font-size: 0.85rem;
  font-weight: 800;
  min-width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2.5px solid white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(101, 163, 13, 0.4);
  }

  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 10px rgba(101, 163, 13, 0);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(101, 163, 13, 0);
  }
}

/* Hide main badge when expanded to avoid clutter */
.fab-container.expanded .main-cart-badge {
  opacity: 0;
  visibility: hidden;
  transform: scale(0.5);
  pointer-events: none;
}

.main-cart-badge {
  z-index: 10;
}

@media (max-width: 768px) {
  .fab-container {
    bottom: 1.5rem;
    right: 1.5rem;
  }
}

.member-dropdown {
  position: relative;
}

.member-menu {
  position: absolute;
  top: 50%;
  right: 100%;
  /* Pop to the left of the button */
  left: auto;
  margin-right: 12px;
  /* Spacing from button */

  width: max-content;
  /* Hug the content */
  min-width: 0;
  max-width: calc(100vw - 120px);
  white-space: nowrap;
  /* Prevent wrapping */

  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 2rem;
  /* Bubble shape */
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.12);

  overflow: hidden;

  /* Sprouting Animation Initial State */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-50%) scale(0.8);
  transform-origin: right center;
  /* Grow from the button side */
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  /* Bouncy sprout */
  z-index: 1000;
  pointer-events: none;
}

.member-menu-inner {
  overflow: hidden;
  border-radius: 2rem;
  /* Match parent */
}

/* Side Bridge (Connects Menu to Button) */
.member-menu::before {
  content: "";
  position: absolute;
  top: -10px;
  /* Extend vertical catch area */
  bottom: -10px;
  left: 100%;
  /* Start from right edge */
  width: 30px;
  /* Wider bridge to overlap heavily with button */
  background: transparent;
  pointer-events: none;
  z-index: 1200;
  /* Ensure it sits on top of everything */
}

.member-menu.show::before {
  pointer-events: auto;
}

/* Active State */
.member-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) scale(1);
}

.member-menu-title {
  margin: 0;
  padding: 12px 20px 8px;
  /* Top padding */
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-dark);
  border-bottom: 1px solid #f5f5f5;
  background: #ffffff;
  text-align: center;
}

.member-info {
  padding: 8px 20px 12px;
  border-bottom: 1px solid #eee;
  text-align: center;
}

.member-email {
  font-size: 0.85rem;
  color: #9ca3af;
  font-weight: 500;
  cursor: default;
  display: block;
}

.member-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.member-links li {
  padding: 0;
  margin: 0;
  display: block;
}

/* Member Link (Static List Style - No Movement) */
.member-link {
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 14px 24px !important;
  /* Force consistency */
  margin: 0 !important;
  border: none !important;
  /* Ensure no border by default */
  text-decoration: none;
  color: #333;
  font-weight: 600 !important;
  font-size: 0.95rem !important;
  /* Reduced from 1.05rem */
  line-height: 1.2 !important;
  transition: color 0.1s ease;
  /* Fast color only */
  width: 100% !important;
  box-sizing: border-box !important;
  /* Prevent padding growth */
  background: transparent !important;
  /* Ensure base is transparent */
}

/* Hover: ONLY Change Color. Absolutely NO Layout Properties. */
.member-link:hover {
  color: var(--accent-green) !important;
  background: transparent !important;
  transform: none !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 14px 24px !important;
  border: none !important;
}

.member-link:active {
  transform: none !important;
  color: var(--accent-green) !important;
  opacity: 0.8;
}

/* Specific styling for Logout - Red Text + Light Red Hover */
.logout-item {
  color: #ef4444 !important;
  background: transparent !important;
  border-top: 1px solid #f5f5f5 !important;
  /* Match header separator */
}

/* Restore original specific styling for generic Logout button */
#logout-btn {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
  border-radius: 12px;
  padding: 0.8rem 1.2rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* FAB specific logout button - High Specificity */
#logout-btn-fab {
  border-radius: 0 !important;
  /* Square corners, relies on parent clip */
  margin-bottom: -5px !important;
  /* LARGE bleed to guarantee coverage */
  padding-bottom: 18px !important;
  /* Compensation for bleed */
}

/* FAB Logout Hover: STATIC (No movement, flat color) */
.fab-container .logout-item:hover,
#logout-btn-fab:hover {
  background-color: #fef2f2 !important;
  color: #dc2626 !important;
  border-top-color: #f5f5f5 !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Generic Logout Button Hover: ANIMATED (Pop effect) */
#logout-btn:hover {
  background-color: #ef4444 !important;
  /* Solid Red */
  color: white !important;
  border-color: #ef4444 !important;
  transform: none !important;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3) !important;
}

#logout-btn:active {
  transform: none !important;
  opacity: 0.8;
}

/* Google Link Button - Official Style */
.btn-google-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  /* More spacing as requested */
  background-color: #ffffff;
  color: #3c4043;
  border: 1px solid #dadce0;
  border-radius: 4px;
  /* Standard Google radius, or 999px if user prefers round */
  padding: 0.5rem 1rem;
  font-family: var(--font-ui);
  /* Or "Roboto" if available */
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-google-link i {
  color: #4285F4;
  /* Google Blue Brand Color */
  font-size: 1rem;
}

.btn-google-link:hover {
  background-color: #f8faff;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.3);
  border-color: #d2e3fc;
  color: #1a73e8;
}

.btn-google-link:active {
  background-color: #ecf3fe;
  box-shadow: none;
}

/* Auth state helpers */
.login-only {
  display: block;
}

.auth-only {
  display: none;
}

body.is-auth .login-only {
  display: none;
}

body.is-auth .auth-only {
  display: block;
}

/* ------------------------------
    Product Grid (Glass Cards)
--------------------------------*/
.product-section {
  padding: 3rem 0;
  /* Reduced from 4rem */
  /* Parent main handles max-width and horizontal padding */
}

.product-page-list,
.blog-page-list {
  width: 100%;
  padding-bottom: 4rem;
}

/* Filter Tabs */
.product-filter-tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.filter-tab {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 0.6rem 1.5rem;
  border-radius: 9999px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #6b7280;
  /* Gray text */
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-ui);
}

.filter-tab:hover {
  background: #f9fafb;
  color: var(--text-dark);
  border-color: rgba(0, 0, 0, 0.2);
}

.filter-tab.active {
  background: var(--text-dark);
  color: white;
  border-color: var(--text-dark);
}

/* Desktop: 4 Columns */
/* Match Blog Grid RWD (3-2-1) */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  /* Same as blog-grid */
  gap: 2rem;
  width: 100%;
}

@media (max-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .product-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* Mobile: 1 Column */
@media (max-width: 600px) {

  /* Stack section headers vertically for mobile */
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    /* Align text to the left */
  }
}

/* Small Mobile: 1 Column (optional, if card is too small) */
@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: 1fr;
    /* Single column for better readability */
    gap: 1.5rem;
  }

  /* Address Modal RWD: Stack Name/Phone on mobile */
  .address-form-grid {
    grid-template-columns: 1fr !important;
  }

  /* CVS Row: Button goes full width */
  .cvs-input-row {
    flex-direction: column;
  }

  .cvs-input-row input {
    width: 100%;
  }

  .cvs-input-row button {
    width: 100%;
    justify-content: center;
  }

  /* Address View Card: Stack label/value on mobile */
  .address-view-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0.3rem 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  .address-view-grid>div {
    margin-bottom: 0.5rem;
  }

  /* Style value cells with background */
  .address-view-grid>div:nth-child(even) {
    background: #f8fafc;
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    margin-bottom: 1rem;
    word-break: break-word;
    max-width: 100%;
    box-sizing: border-box;
  }
}

/* Product Card - UI details remain the same */
.product-image-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 0.5rem;
  background-color: #f3f4f6;
  aspect-ratio: 1 / 1;
  /* Made square for a cleaner look */
  margin-bottom: 0.75rem;
  cursor: pointer;
}

.product-card {
  background: var(--card-bg);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  /* Fill the track like blog cards */
}

@media (hover: hover) {
  .product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
  }
}

.product-card:active {
  transform: scale(0.99);
}

/* Deepen link color on card hover */
.product-card:hover .learn-more-link {
  color: #5a8700;
}

.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover .product-img {
  transform: scale(1.08);
  /* More pronounced zoom */
}

.add-to-cart-btn,
.app-badge-btn,
.service-action-btn {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text-dark);
  padding: 0.65rem 1rem;
  border-radius: 9999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  font-weight: 600;
  font-size: 0.85rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
  cursor: pointer;
  z-index: 2;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.product-actions-overlay {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  right: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  opacity: 0;
  transform: translateY(1.5rem);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover .product-actions-overlay {
  opacity: 1;
  transform: translateY(0);
}

.add-to-cart-btn:hover,
.app-badge-btn:hover,
.service-action-btn:hover {
  background-color: var(--accent-green);
  color: white;
}

/* Mobile menu background fix */
.menu-mobile {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid #eee;
  padding-bottom: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.product-info {
  padding: 1.25rem 1.5rem 1.5rem;
  /* Tighter padding for a more compact card */
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-grow: 1;
  /* Fill the card */
}

.product-info h3 {
  font-family: "Noto Serif TC", serif;
  font-size: clamp(1.4rem, 5vw, 1.6rem);
  /* Significantly larger on mobile per user request */
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
  line-height: 1.4;
}

.product-info p {
  font-size: clamp(1.1rem, 3.5vw, 1.15rem);
  /* Larger body text on mobile for readability */
  color: #6b7280;
  margin: 0;
  opacity: 0.8;
  letter-spacing: 0.02em;
}

.product-price {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: clamp(1rem, 3vw, 1.15rem);
  /* Responsive: 1rem on mobile -> 1.15rem desktop */
  color: #ea580c;
  /* Brighter Rust Orange */
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.2rem;
}

.learn-more-link {
  margin-top: 0.5rem;
  display: inline-flex;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-green);
  text-decoration: none;
  transition: all 0.2s ease;
  border-bottom: 1px solid transparent;
  width: fit-content;
}

.learn-more-link:hover {
  border-bottom-color: #5a8700;
  /* Subtle arrow movement nudge on hover */
}

@media (max-width: 1024px) {
  .learn-more-link {
    font-size: 1rem;
    /* Larger size for touch/reading on mobile/tablet */
    padding: 0.2rem 0;
    /* Touch target padding */
  }
}

.original-price {
  font-size: 0.85em;
  color: #9ca3af;
  text-decoration: line-through;
  font-weight: 400;
}

/* Auth Pages (Login/Register/Account) Card Style */
.auth-page,
.account-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  /* Ensure it takes up vertical space */
  padding: 2rem 1rem;
}

.auth-card,
.account-content {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 2.2rem 2.5rem 3.5rem;
  /* Less top padding, more bottom */
  border-radius: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.5);
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-card-subtitle {
  margin-bottom: 1.8rem;
  font-size: 0.95rem;
  color: #666;
  line-height: 1.5;
  /* Reduced visual distance to top */
  margin-top: -0.2rem;
}

.auth-header h1,
.section-header h2 {
  margin-bottom: 0.5rem;
  font-family: var(--font-heading);
  color: var(--text-dark);
}

/* RWD for Auth Header Title (Prevent taking up too much screen space) */
@media (max-width: 1024px) {
  .auth-header h1 {
    font-size: 1.5rem;
    /* Significantly reduced for tablet/mobile */
  }
}

@media (max-width: 480px) {

  .auth-page,
  .account-page {
    padding: 1.5rem 1rem;
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
  }

  .auth-card,
  .account-content {
    padding: 2rem 1.8rem 2.5rem;
    box-sizing: border-box;
    overflow: hidden;
  }

  .auth-divider {
    align-items: center;
    max-width: 100%;
  }

  .auth-divider span {
    white-space: normal !important;
    text-align: center;
    padding: 0 0.5rem;
    word-break: break-word;
    overflow-wrap: break-word;
    flex-shrink: 1;
    min-width: 0;
  }

  .auth-divider::before,
  .auth-divider::after {
    flex: 1;
    min-width: 15px;
  }

  .social-login-group {
    flex-wrap: wrap;
    gap: 1rem;
  }

  /* Typography Refinements for Mobile */
  .modal-card h3,
  .auth-header h1 {
    font-size: 1.6rem !important;
  }

  .form-group label,
  .form-group-alt label {
    font-size: 1rem !important;
  }

  .form-control,
  .form-control-alt {
    font-size: 1.1rem !important;
    padding: 0.8rem 1rem !important;
  }

  .form-help-text {
    font-size: 0.9rem !important;
    line-height: 1.4;
  }

  .btn-main,
  .btn-main-outline {
    font-size: 1.1rem !important;
    padding: 0.8rem 1.2rem !important;
  }

  /* Connection Action Buttons & Badges */
  .badge-linked,
  .provider-unlink-btn,
  .btn-main-outline.sm {
    font-size: 1rem !important;
  }

  /* Specific style for mobile Unlink button: text + underline */
  /* ONLY apply to touch devices (no hover) to avoid affecting desktop */
  @media (hover: none) {
    .provider-unlink-btn {
      background: transparent !important;
      border: none !important;
      text-decoration: underline !important;
      opacity: 1 !important;
      visibility: visible !important;
      color: #ef4444 !important;
      /* red-500 */
      position: static !important;
      width: auto !important;
      height: auto !important;
      padding: 0 !important;
      margin: 0.5rem auto 0 !important;
      /* Center and move further down */
      text-align: center;
    }

    .provider-unlink-btn i {
      display: none !important;
      /* Hide icon on mobile */
    }

    .provider-linked-status {
      width: auto !important;
      height: auto !important;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 0;
      /* Let button margin handle spacing */
    }
  }
}

.form-help-text {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-top: 0.4rem;
  display: block;
}

.form-group {
  margin-bottom: 1rem;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: #555;
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 0.5rem;
  font-size: 1rem;
  background: white;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--accent-green);
  outline: none;
  box-shadow: 0 0 0 3px rgba(124, 187, 0, 0.1);
}

.btn-main,
.google-btn {
  width: 100%;
  padding: 0.75rem;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.btn-main {
  background-color: var(--text-dark);
  color: white;
}

@media (hover: hover) {
  .btn-main:hover {
    background-color: black;
    transform: translateY(-1px);
  }
}

.btn-main:active {
  transform: scale(0.98);
  transition: transform 0.1s;
}

/* Auth Divider with lines */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 2.5rem 0 1.5rem;
  color: #a0aec0;
  font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid #e2e8f0;
}

.auth-divider span {
  padding: 0 1rem;
  white-space: nowrap;
}

/* Social Login Buttons */
.social-login-group {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 1.25rem;
  margin: 1rem 0 0.5rem;
}

.social-btn {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  position: relative;
  border: 1px solid transparent;
  flex-shrink: 0;
}

@media (hover: hover) {
  .social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  }
}

.social-btn:active {
  transform: scale(0.95);
  transition: transform 0.1s;
}

.social-btn.is-full {
  background: transparent !important;
  border: none !important;
  padding: 0;
  overflow: hidden;
  box-shadow: none !important;
  border-radius: 0 !important;
  outline: none;
}

.social-btn.is-full svg {
  width: 100%;
  height: 100%;
}

/* Google Style Button */
.google-btn {
  border: 1px solid rgba(0, 0, 0, 0.12);
  /* Subtle border for definition */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.google-btn:hover {
  border-color: rgba(0, 0, 0, 0.18);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* LINE Style Button */
.line-btn {
  box-shadow: 0 2px 8px rgba(6, 199, 85, 0.15);
}

.line-btn:hover {
  box-shadow: 0 4px 12px rgba(6, 199, 85, 0.25);
}

/* Facebook Style Button */
.facebook-btn {
  box-shadow: 0 2px 8px rgba(8, 102, 255, 0.15);
}

.facebook-btn:hover {
  box-shadow: 0 4px 12px rgba(8, 102, 255, 0.25);
}

/* RWD: Social Buttons Larger on Mobile/Tablet */
@media (max-width: 1024px) {
  .social-login-group {
    gap: 1.5rem;
  }

  .social-btn {
    width: 52px;
    height: 52px;
    border-radius: 14px;
  }

  .social-btn svg {
    width: 26px;
    height: 26px;
  }

  /* Keep is-full buttons frameless on mobile */
  .social-btn.is-full {
    border-radius: 0;
    box-shadow: none !important;
    border: none;
  }

  .social-btn.is-full svg {
    width: 100%;
    height: 100%;
  }
}



/* ---------------------------------------------------
    6. Home Blog Section (Glass Cards)
-----------------------------------------------------*/

.home-blog {
  padding-block: 2.5rem;
  /* Reduced from 4rem */
}

.blog-list {
  padding-block: 2.5rem;
  /* Reduced from 4rem */
}

/* Home blog grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

@media (max-width: 1024px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* ===== Blog Card ===== */
/* Cover image */
.blog-card-cover {
  width: 100%;
  height: 180px;
  overflow: hidden;
  margin: 0;
  object-fit: cover;
  display: block;
}

.blog-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Single card */
.blog-card {
  border-radius: 20px;
  position: relative;
  background: var(--card-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  height: 100%;
}

@media (hover: hover) {
  .blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
  }
}

.blog-card:active {
  transform: scale(0.99);
}

.blog-card-link {
  display: block;
  height: 100%;
  border-radius: 20px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: transform 0.35s ease, box-shadow 0.35s ease, background 0.35s ease;
}

/* Text */
.blog-card-title {
  font-size: clamp(1rem, 3vw, 1.15rem);
  /* Responsive: smaller on mobile, larger on desktop */
  margin: 0.4rem 0 0.6rem;
  line-height: 1.45;
  font-weight: 700;
}

/* Body */
.blog-card-body {
  padding: 1.4rem 1.5rem 1.6rem;
}

.blog-card-date {
  font-size: clamp(0.75rem, 2vw, 0.85rem);
  /* Responsive date */
  opacity: 0.65;
  letter-spacing: 0.05em;
  color: var(--text-light);
  display: block;
  margin-bottom: 0.4rem;
}

.blog-card-excerpt {
  font-size: clamp(0.85rem, 2.5vw, 0.9rem);
  /* Responsive excerpt */
  color: #555;
  line-height: 1.7;
  margin-bottom: 1rem;
  opacity: 0.85;
}

/* Read more */
.blog-card-cta {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-green);
  opacity: 0.7;
  align-self: flex-start;
  margin-top: 0.9rem;
  transition: opacity 0.25s ease;
}

.blog-card-link:hover .blog-card-cta {
  opacity: 1;
}

/* CTA button */
.home-blog-more {
  text-align: center;
  margin-top: 40px;
}

/* Tag UI */
.tag-filter {
  margin-bottom: 32px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.tag {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
  font-size: 0.85rem;
}

/* ---------------------------------------------------
    About Section (Kài-siāu & Liân-lo̍k)
-----------------------------------------------------*/
.about-contact {
  background-color: #fff;
  padding: 60px 20px;
  text-align: center;
  margin-top: 50px;
  border-top: 1px solid var(--border-blue);
}

/* ---------------------------------------------------
    Social Icons
-----------------------------------------------------*/
.social-links {
  margin-top: 20px;
}

.social-links a {
  display: inline-block;
  margin: 0 10px;
  color: var(--accent-green);
  font-weight: bold;
}

/* ------------------------------
    Account Dashboard
--------------------------------*/
.account-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 800px;
  margin-bottom: 2rem;
  gap: 1rem;
}

/* ---------------------------------------------------
   ACCOUNT PAGE
--------------------------------------------------- */
/* ---------------------------------------------------
   ACCOUNT PAGE
--------------------------------------------------- */
.account-page-list,
.account-page-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-inline: 1.5rem !important;
  /* Standardize with Home Page container */
  padding-top: 3rem;
  padding-bottom: 6rem;
}

/* 
   Account Header Alignment 
   Standard flex layout for title only
*/
.account-page-list .section-header,
.account-page-container .section-header {
  display: flex;
  align-items: flex-start;
  margin-bottom: 2rem;
  text-align: left;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 768px) {

  .account-page-list,
  .account-page-container {
    padding-inline: 1.5rem !important;
    /* Match mobile breathability of Home Page logo/container */
    padding-top: 2rem;
  }

  .account-card {
    padding: 1.5rem;
    /* More internal padding */
    margin-bottom: 1.5rem;
    max-height: none;
    /* Allow full height on mobile if content overflows slightly */
    border-radius: 16px;
    /* Ensure cards remain rounded */
  }
}

/* Sidebar Logout Button Styling */
.dashboard-sidebar #logout-btn {
  width: 100%;
  /* Fill sidebar width */
  background-color: #ffdce0;
  /* Light red bg */
  color: #d32f2f;
  /* Red text */
  border-color: #ffcdd2;
  font-weight: 600;

  margin-top: 1rem;
  /* Separation from nav */

  /* Sizing Enhancements */
  font-size: 1.05rem;
  padding-block: 0.85rem;
  letter-spacing: 0.02em;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 8px rgba(211, 47, 47, 0.1);
}

.dashboard-sidebar #logout-btn:hover {
  background-color: #ffcdd2;
  border-color: #e57373;
  transform: none;
  box-shadow: 0 4px 12px rgba(211, 47, 47, 0.15);
}

/* Dashboard Grid: Content Left, Sidebar Right */
.account-dashboard-wrapper {
  display: grid;
  grid-template-columns: 1fr 260px;
  /* Sidebar fixed width */
  gap: 4rem;
  align-items: start;
}

/* On mobile, stack vertically and flip order */
@media (max-width: 1024px) {
  .account-dashboard-wrapper {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
    width: 100%;
    overflow-x: hidden;
  }

  .dashboard-sidebar {
    order: -1;
    /* Place sidebar (menu) on TOP */
    width: 100%;
    margin-bottom: 1rem;
  }
}

/* Content Area Centering */
.account-content-centered {
  max-width: 600px;
  margin: 0 auto;
  /* Center within the left column */
  width: 100%;
}

/* Sidebar Navigation Vertical Styling - MOVED AND CONSOLIDATED AT END OF FILE */


/* Order Details Modal Styling */
.order-modal-card {
  max-width: 800px;
  padding: 0;
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: #333;
}

.close-icon-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #aaa;
  cursor: pointer;
  padding: 0.2rem;
  transition: color 0.2s;
}

.close-icon-btn:hover {
  color: #555;
}

.order-details-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #f0f0f0;
  background: #fafafa;
  text-align: right;
}

.order-item-row {
  display: flex;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #f0f0f0;
  align-items: flex-start;
}

.order-item-row:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.order-item-thumb {
  width: 64px;
  height: 64px;
  background: #f8f8f8;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid #eee;
}

.order-item-info {
  flex: 1;
}

.order-item-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: #333;
  margin-bottom: 0.25rem;
  display: block;
}

.order-item-meta {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.25rem;
}

.order-item-price {
  font-weight: 600;
  font-size: 0.95rem;
  color: #333;
  text-align: right;
  min-width: 80px;
}

.order-summary-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
  background: #fdfdfd;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  padding: 1.5rem;
}

@media (max-width: 700px) {
  .order-summary-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.summary-block h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #999;
  margin-bottom: 0.8rem;
  font-weight: 600;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  font-size: 0.95rem;
  color: #555;
}

.summary-row.total {
  border-top: 1px solid #ddd;
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  font-weight: 700;
  color: #222;
  font-size: 1.1rem;
}

.info-text {
  font-size: 0.9rem;
  color: #444;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.status-badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-badge.completed {
  background: #dcfce7;
  color: #166534;
}

.status-badge.processing {
  background: #dbeafe;
  color: #1e40af;
}

.status-badge.cancelled {
  background: #fce7f3;
  color: #9d174d;
}

.account-nav-link i {
  width: 24px;
  text-align: center;
  font-size: 1.1rem;
  color: #94a3b8;
  /* Muted icon */
}

.account-nav-link:hover i,
.account-nav-link.is-active i {
  color: var(--accent-green);
}

/* --- Account Welcome Banner --- */
.account-welcome-banner {
  margin-bottom: 2.5rem;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  border-left: 5px solid var(--accent-green);
  border-radius: 16px;
  padding: 2rem 2.5rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
  display: block;
}

.account-welcome-banner .banner-watermark {
  position: absolute;
  right: -20px;
  bottom: -20px;
  pointer-events: none;
  transform: rotate(-15deg);
  z-index: 0;
}

.account-welcome-banner .welcome-banner-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
}

.account-welcome-banner .welcome-text-group {
  display: flex;
  flex-direction: column;
}

.account-welcome-banner .welcome-label {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.4rem;
}

.account-welcome-banner .user-name {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0;
  font-family: var(--font-serif);
  line-height: 1.2;
}

@media (max-width: 768px) {
  .account-welcome-banner {
    padding: 1.5rem 1.75rem;
    margin-bottom: 2rem;
    border-left-width: 4px;
  }

  .account-welcome-banner .welcome-label {
    font-size: 0.9rem;
  }

  .account-welcome-banner .user-name {
    font-size: 1.5rem;
  }

  .account-welcome-banner .banner-watermark svg {
    width: 100px;
    height: 100px;
  }
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  width: 100%;
  max-width: 900px;
  /* 2 columns for cleaner layout */
}

@media (max-width: 1024px) {
  .account-grid {
    grid-template-columns: 1fr 1fr;
  }

  .account-card h4 {
    font-size: 1.25rem !important;
  }

  .profile-info-row {
    font-size: 1.05rem !important;
  }

  .form-control-alt {
    font-size: 1.05rem !important;
  }

  .form-group-alt label {
    font-size: 0.95rem !important;
  }

  .btn-main-outline.sm {
    font-size: 1rem !important;
  }
}

@media (max-width: 768px) {
  .account-grid {
    grid-template-columns: 1fr;
  }
}

.account-card {
  background: white;
  padding: 0.8rem 1.2rem 1.2rem;
  border-radius: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border: 1px solid #eee;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Already handled by .account-card */
.order-card,
.address-book-card {}

@media (max-width: 600px) {
  .account-card {
    padding: 1rem;
  }
}

@media (hover: hover) {
  .account-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  }
}

.account-card:active {
  transform: scale(0.99);
}

.account-card h4 {
  margin-bottom: 0.8rem;
  font-size: 1.1rem;
  /* Match connection sections */
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-dark);
  margin-top: 0.2rem;
  /* Pull up towards top edge */
}

.point-value {
  font-size: 2rem;
  font-weight: bold;
  color: var(--accent-green);
  text-align: center;
  width: 100%;
}

.empty-state {
  color: #999;
  padding: 2rem 0;
  text-align: center;
}

/* Profile Section Styles */
.profile-info-row {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f5f5f5;
  font-size: 0.95rem;
}

.profile-info-row .label {
  color: #888;
  font-weight: 500;
}

.profile-info-row .value {
  color: #333;
  font-weight: 600;
  text-align: right;
  font-family: "Charis", "Noto Serif TC", serif;
}

@media (max-width: 600px) {
  .profile-info-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }

  .profile-info-row .label {
    font-size: 0.95rem;
    color: #999;
  }

  .profile-info-row .value {
    text-align: left;
    font-size: 1.2rem;
    width: 100%;
  }
}

.form-group-alt {
  margin-bottom: 1rem;
  text-align: left;
}

/* Remove double margin when inside address modal grid */
.address-form-grid .form-group-alt {
  margin-bottom: 0;
}

/* Add consistent gap after the grid */
.address-form-grid {
  margin-bottom: 1rem;
}

.form-group-alt label {
  display: block;
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.form-control-alt {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.6rem 0.8rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #f8fafc;
}

.form-control-alt:focus {
  outline: none;
  border-color: var(--accent-green);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1);
}

.form-control-alt.is-readonly {
  background-color: #f8fafc !important;
  color: #94a3b8 !important;
  cursor: not-allowed;
  border-color: #e2e8f0 !important;
  user-select: none;
}

.btn-main-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: transparent;
  color: var(--accent-green);
  border: 1px solid var(--accent-green);
  padding: 0.5rem 1.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
}

@media (hover: hover) {
  .btn-main-outline:hover {
    background: rgba(16, 185, 129, 0.08);
    transform: translateY(-1px);
  }
}

.btn-main-outline:active {
  transform: scale(0.98);
  transition: transform 0.1s;
}

.btn-main-outline.sm {
  padding: 0.2rem 1rem;
  font-size: 0.85rem;
  border-radius: 0.5rem;
  width: 160px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.2;
}

#add-address-btn {
  margin-top: auto;
  font-size: 0.9rem;
  width: 100%;
  border-style: solid;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.2rem;
}

.order-table-wrapper {
  overflow-x: auto;
  margin-top: 0.5rem;
}

.order-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

.order-table th {
  padding: 0.8rem;
  background: #fafafa;
  color: #666;
  font-weight: 600;
  border-bottom: 2px solid #eee;
}

.order-table td {
  padding: 1rem 0.8rem;
  border-bottom: 1px solid #eee;
  color: #444;
  font-family: "Charis", "Noto Serif TC", serif;
}

.status-pill {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-pill.completed {
  background: #dcfce7;
  color: #166534;
}

.status-pill.pending {
  background: #fef9c3;
  color: #854d0e;
}

.status-pill.cancelled {
  background: #fee2e2;
  color: #991b1b;
}

.status-pill.shipped {
  background: #dbeafe;
  color: #1e40af;
}

.address-items {
  max-height: 300px;
  overflow-y: auto;
}

.delivery-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-weight: 500;
}

.delivery-badge.mail {
  background: #dbeafe;
  color: #1d4ed8;
}

.delivery-badge.cvs {
  background: #ffedd5;
  color: #c2410c;
}

.address-item {
  padding: 1.2rem;
  background: #fdfdfd;
  border: 1px solid #f0f0f0;
  border-radius: 1rem;
  margin-bottom: 0.8rem;
  font-size: 0.95rem;
  text-align: left;
  position: relative;
  transition: all 0.2s ease;
  font-family: "Charis", "Noto Serif TC", serif;
}

.address-item:hover {
  border-color: var(--accent-green);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.address-item .recipient {
  display: block;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.2rem;
}

.address-item .addr-text {
  display: block;
  font-size: 0.9rem;
  color: #666;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.address-actions {
  display: flex;
  gap: 1.2rem;
  border-top: 1px solid #f5f5f5;
  padding-top: 0.8rem;
}

.address-actions button {
  background: none;
  border: none;
  font-size: 0.85rem;
  color: #666;
  cursor: pointer;
  padding: 0;
  font-weight: 500;
  transition: color 0.2s;
}

.address-actions button:hover {
  color: var(--accent-green);
  text-decoration: underline;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  transition: all 0.3s ease-out;
}

.modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal-card {
  background: white;
  padding: 2.5rem;
  border-radius: 1.5rem;
  width: 100%;
  max-width: 450px;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: scale(1);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-card .btn-group {
  display: flex;
  gap: 0.5rem;
}

.modal-card .btn-group button:first-child {
  flex: 2;
  /* Save button is larger */
}

.modal-card .btn-group button:last-child {
  flex: 1;
  /* Cancel button is smaller */
}

.modal-overlay.hidden .modal-card {
  transform: scale(0.9) translateY(20px);
}

.modal-card h3 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--text-dark);
}

/* ---------------------------------------------------
   PRODUCT SINGLE PAGE
--------------------------------------------------- */
.product-page-container {
  padding-top: 3rem;
  padding-bottom: 6rem;
}

.product-single-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 4rem;
  align-items: start;
}

@media (max-width: 992px) {
  .product-single-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.product-main-img {
  width: 100%;
  border-radius: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  background: white;
}

.product-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--text-dark);
}

.product-meta {
  margin-bottom: 1.5rem;
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.product-category-badge {
  background: var(--accent-green);
  color: white;
  padding: 0.2rem 0.8rem;
  border-radius: 2rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.product-tag {
  color: #888;
  font-size: 0.9rem;
}

.product-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ea580c;
  /* Brighter Rust Orange */
  margin-bottom: 0.8rem;
  white-space: nowrap;
  /* Keep single line on desktop */
}

@media (max-width: 600px) {
  .product-price {
    white-space: normal;
    /* Allow wrap on small screens */
  }
}

.product-price-large {
  font-size: 2rem;
  font-weight: 700;
  color: #ea580c;
  /* Brighter Rust Orange */
  margin-bottom: 2rem;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .product-price-large {
    white-space: normal;
  }
}

.product-short-desc {
  font-size: 1.1rem;
  line-height: 1.7;
  color: #555;
  margin-bottom: 2.5rem;
}

.purchase-zone {
  background: #fdfdfd;
  padding: 2rem;
  border-radius: 1rem;
  border: 1px solid #f0f0f0;
  margin-bottom: 3rem;
}

.add-to-cart-btn-large {
  width: 100%;
  background: var(--text-dark);
  color: white;
  padding: 1.2rem;
  border-radius: 0.8rem;
  font-size: 1.2rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

/* Responsive Scaling for Section Headers */
.option-guides h4,
.product-description-content h4 {
  font-size: clamp(1.4rem, 5vw, 1.8rem);
  /* Adjusted: Larger on mobile/tablet (min 1.4rem) per request */
  margin-bottom: 1rem;
}

.guide-item h5 {
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
}

.add-to-cart-btn-large:hover {
  background: var(--accent-green);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.2);
}

.purchase-note {
  text-align: center;
  font-size: 0.85rem;
  color: #999;
  margin-top: 1rem;
}

.product-description-content {
  line-height: 1.8;
}

.product-description-content h4 {
  margin-bottom: 1rem;
  font-size: 1.4rem;
  border-bottom: 2px solid #eee;
  padding-bottom: 0.5rem;
}

.option-guides h4 {
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
}

.guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.guide-item h5 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: #666;
}

.guide-thumb {
  width: 100%;
  border-radius: 0.8rem;
  border: 1px solid #eee;
  cursor: zoom-in;
  transition: transform 0.2s;
}

.guide-thumb:hover {
  transform: scale(1.02);
}

.breadcrumb {
  font-size: 0.9rem;
  color: #bbb;
  margin-bottom: 1.5rem;
}

.breadcrumb a {
  color: #888;
}

.breadcrumb a:hover {
  color: var(--accent-green);
}

/* ------------------------------
    Snipcart Font & Style Overrides
--------------------------------*/
#snipcart *:not([class^="fa-"]),
.snipcart-modal *:not([class^="fa-"]) {
  font-family: var(--font-body) !important;
  /* Use the POJ-friendly fonts defined in base.css */
  font-feature-settings: "cv01", "ss01" !important;
  -webkit-font-smoothing: antialiased !important;
}

/* Snipcart Header Sticky Fix - Force it by making the modal a flex container */
/* Snipcart Modal Overlay - Dimmed Background */
#snipcart .snipcart-modal__container {
  display: flex;
  /* Removed !important so Snipcart can hide it */
  flex-direction: column !important;
  overflow: hidden !important;
  height: 100vh !important;
  width: 100% !important;

  /* Default Backdrop (Main Cart) */
  background: rgba(0, 0, 0, 0.5) !important;
  backdrop-filter: blur(4px) !important;
}

/* Independent Backdrop for "Side/Edit" Panel */
/* Uses :has() to detect if the container holds a side-panel content */
#snipcart .snipcart-modal__container:has(.snipcart-layout__content--side) {
  background: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.5) 100%) !important;
  /* Transparency-based gradient: left (transparent) to right (dark) */
  backdrop-filter: blur(2px) !important;
  /* Subtle blur */
  align-items: flex-end !important;
  /* Maintain right alignment */
}

#snipcart {
  background: transparent !important;
  height: 100vh !important;
  width: 100vw !important;
  position: fixed !important;
  top: 0;
  left: 0;
  z-index: 9000;
  /* Level 1: Overlay */
  pointer-events: none !important;
  /* Critical: Allow clicks to pass through to underlying page! */
}

/* Ensure ALL interactive children inside Snipcart allow clicks */
#snipcart .snipcart-modal__container,
#snipcart .snipcart-layout,
#snipcart .snipcart-cart__content,
#snipcart .snipcart-payment-method,
#snipcart .snipcart-payment-methods-list-item,
#snipcart .snipcart-base-button,
#snipcart button,
#snipcart a,
#snipcart input {
  pointer-events: auto !important;
  cursor: pointer;
}

#snipcart input {
  cursor: text;
}

/* Re-enable clicks on the implementation itself (defaults) */
#snipcart .snipcart-modal__container {
  pointer-events: auto !important;
}

#snipcart .snipcart-layout {
  pointer-events: auto !important;
}

/* Integrated Layout Container for Header AND Content */
#snipcart .snipcart-layout {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
  background: #fff !important;
  /* Default for full-screen cart */
  box-shadow: none !important;
  height: 100vh !important;
  max-height: 100vh !important;
  overflow-y: scroll !important;
  /* FORCE SCROLL (Performance Optimization) */
  overflow-x: hidden !important;
  position: absolute !important;
  right: 0 !important;
  top: 0 !important;
  left: 0 !important;
}

/* Side/Edit Panel Specific: Remove background, allow click-through, LOCK PARENT SCROLL */
#snipcart .snipcart-layout:has(.snipcart-layout__content--side) {
  background: transparent !important;
  pointer-events: none !important;
  overflow: hidden !important;
  /* Lock parent scroll to prevent breakage */
}

/* LOCK to 1100px ONLY during Checkout (Desktop) */
#snipcart .snipcart-layout:has(.snipcart-checkout__content) {
  width: 1100px !important;
  max-width: 1100px !important;
  margin: 0 auto !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  right: auto !important;
  overflow-y: scroll !important;
  /* ENABLE SCROLL */
}

#snipcart .snipcart-layout__content {
  border-radius: 0 !important;
  /* Flush edges */
  box-shadow: var(--shadow-soft) !important;

  /* Shared Mechanics: FIXED UNIFIED SCROLL AREA */
  flex: 1 1 auto !important;
  display: block !important;
  overflow: visible !important;
  /* ALLOW CONTENT TO EXPAND */
  min-height: 0 !important;
  /* Critical for flex scroll */
  overscroll-behavior: contain;

  /* Global Content Padding */
  padding: 0 !important;
  /* Columns will handle their own internal spacing */
}

/* Side Panel Override: SIDEBAR STATE (Cart Preview) */
#snipcart .snipcart-layout__content--side {
  width: 520px !important;
  max-width: 95vw !important;
  margin-left: auto !important;
  margin-right: 0 !important;
  padding: 0 !important;
  /* padding-bottom moved to inner content for scroll safety */
  padding-top: 0 !important;
  /* Remove the ugly gap */
  background: #fff !important;
  /* Force white background for the actual panel */
  pointer-events: auto !important;
  /* Re-enable clicks for the panel itself */
  border-radius: 0 !important;
  /* 去掉圓角，貼住右邊 */
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1) !important;
  /* Removed global overflow: hidden to fix Cart Summary */
  /* Display handled by Snipcart defaults or above flex rules */
  display: flex !important;
  flex-direction: column !important;
  position: absolute !important;
  right: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  z-index: 9200 !important;
  /* Higher than Main Header (9100) */
}

/* EDIT MODE ONLY: Lock Parent to fix Sticky Header */
#snipcart .snipcart-layout__content--side:has(.snipcart-form) {
  overflow: hidden !important;
}

/* EDIT MODE ONLY: Inner Content Scroll Wrapper */
#snipcart .snipcart-layout__content--side:has(.snipcart-form) .snipcart-cart__content {
  overflow-y: auto !important;
  overscroll-behavior: contain;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  /* Critical for Flexbox scrolling to work properly */
  height: auto !important;
  /* Let Flex handle the height */
  padding-bottom: 120px !important;
  /* Restored padding as primary spacer */
}

/* Force bottom spacing using pseudo-element (Backup) */
#snipcart .snipcart-layout__content--side:has(.snipcart-form) .snipcart-cart__content::after {
  content: "" !important;
  display: block !important;
  height: 1px !important;
  /* Just a tiny pusher if padding fails */
  width: 100% !important;
  flex-shrink: 0 !important;
}

/* CSS Rule Removed to resolve conflict. Inner scroll is now strictly scoped to Edit Mode above. */

/* Fixed Confirm Button Styles */
.antigravity-confirm-btn {
  position: fixed !important;
  bottom: 2rem !important;
  right: 1rem !important;
  width: calc(520px - 2rem) !important;
  /* Match desktop panel width */
  height: 50px !important;
  line-height: 50px !important;
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  padding: 0 !important;
  z-index: 9999 !important;
  /* Highest priority */
  text-align: center !important;
  cursor: pointer !important;
  display: block !important;
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1) !important;
  /* Subtle shadow lift */
}

@media (max-width: 520px) {
  .antigravity-confirm-btn {
    width: calc(100% - 2rem) !important;
  }
}

/* Side Cart Header - Fixed at top (ONLY for side cart) */
#snipcart .snipcart-layout__content--side .snipcart-cart-header {
  flex-shrink: 0 !important;
  background: #fff !important;
  border-bottom: 1px solid #eee !important;
  padding: 1rem 1.5rem !important;
  z-index: 9201 !important;
  position: relative !important;
}

/* Side Cart Header Title - Centered */
#snipcart .snipcart-cart__secondary-header {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  text-align: center !important;
}

#snipcart .snipcart-cart__secondary-header-title {
  text-align: center !important;
  width: 100% !important;
}

/* Side Cart Scrollable Content Area */
#snipcart .snipcart-layout__content--side .snipcart-cart__content {
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  padding: 1.5rem !important;
  min-height: 0 !important;
}

/* Side Cart Footer - Fixed at bottom (ONLY for side cart) */
#snipcart .snipcart-layout__content--side .snipcart-cart__footer {
  position: sticky !important;
  bottom: 0 !important;
  flex-shrink: 0 !important;
  background: #fff !important;
  border-top: 1px solid #eee !important;
  padding: 0.75rem 1rem !important;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05) !important;
  z-index: 100 !important;
}

/* Side Cart RWD - Mobile ONLY (不再縮窄 tablet) */
@media (max-width: 768px) {
  #snipcart .snipcart-layout__content--side {
    width: 100% !important;
    max-width: 100% !important;
    padding: 1rem !important;
    border-radius: 0 !important;
  }
}

/* Ensure inner Snipcart content doesn't break our scroll */
/* Force all checkout-related wrappers to NOT have their own scroll/height constraints */
#snipcart .snipcart-cart__content,
#snipcart .snipcart-checkout,
#snipcart .snipcart-checkout-step,
#snipcart .snipcart-checkout__content,
#snipcart .snipcart-cart__content--checkout,
#snipcart .snipcart-checkout-container,
#snipcart .snipcart-order-confirm {
  flex: 1 1 auto !important;
  height: auto !important;
  min-height: min-content !important;
  /* Force grow to trigger parent scroll */
  max-height: none !important;
  overflow: visible !important;
  display: block !important;
}

/* Maintain Flex Grid for Desktop Columns (ABSOLUTE 68/32 LOCK) */
#snipcart .snipcart-layout__cols,
#snipcart .snipcart-checkout__cols {
  display: flex !important;
  flex-wrap: nowrap !important;
  flex: 1 1 auto !important;
  width: 100% !important;
  max-width: 1100px !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  gap: 0 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  overflow-x: clip !important;
  /* ABSOLUTE Containment - clip prevents any child protrusion */
}

/* 1. General Column Baseline */
#snipcart .snipcart-layout__col {
  padding: 1.5rem !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* 2. SPECIFIC Overrides */
/* Large Column (Desktop): 68% share of 1100px */
#snipcart .snipcart-layout__col--large {
  display: block !important;
  flex: 0 0 68% !important;
  width: 68% !important;
  max-width: 68% !important;
  height: auto !important;
  min-height: 0 !important;
  min-width: 0 !important;
  overflow: hidden !important;
  /* Visual Gutter: 5rem provides perfect alignment for step icons */
  padding: 2rem 1rem 0 5rem !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

/* Side Column (Desktop): 32% share of 1100px */
#snipcart .snipcart-layout__col--side {
  flex: 0 0 32% !important;
  width: 32% !important;
  max-width: 32% !important;
  height: auto !important;
  overflow: hidden !important;
  min-width: 0 !important;
  padding: 1.5rem 0 1.5rem 1.5rem !important;
  /* Zero right side protrusion */
  margin: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box !important;
}

/* Order Summary Styling (Solid Background & Containment) */
#snipcart .snipcart-cart-summary,
#snipcart .snipcart-cart-summary__content {
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  background: #f8f8f8 !important;
  /* Restore Solid Background */
  border: none !important;
  display: block !important;
  overflow: hidden !important;
}

/* Wrapper Force-Wrapping */
.snipcart-cart-summary-items-list,
.snipcart-cart-summary-item__title {
  max-width: 100% !important;
  overflow: hidden !important;
  overflow-wrap: break-word !important;
  word-wrap: break-word !important;
  white-space: normal !important;
}

/* Ensure first step doesn't have top margin if it's the only one */
#snipcart .snipcart-checkout-step:first-child {
  margin-top: 0 !important;
}

/* -----------------------------------------------------------
   ISOLATED SETTINGS: Order Summary / Side Panel
   Prevent "cramped" look by using compact specific padding
----------------------------------------------------------- */
@media (max-width: 768px) {

  /* Mobile check for Summary */
  #snipcart .snipcart-cart-summary {
    padding: 1rem !important;
  }

  /* Base Mobile Overrides (Max-Width) */
  #snipcart .snipcart-layout {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  #snipcart .snipcart-layout__content {
    border-radius: 0 !important;
    padding: 1rem !important;
  }
}

/* Ensure footer and summary fees have padding and don't touch edges */
.snipcart-summary-fees,
.snipcart-cart-summary-fees--reverse,
.snipcart-cart-summary-fees--reverse,
.snipcart-cart__footer,
.snipcart-cart__footer-buttons {
  padding-left: 1rem !important;
  padding-right: 1rem !important;
  width: 100% !important;
  max-width: 768px !important;
  margin: 0 0 0 auto !important;
}

.snipcart-base-button__label {
  font-size: 1rem !important;
}

@media (max-width: 1024px) {

  .snipcart-summary-fees,
  .snipcart-cart-summary-fees--reverse,
  .snipcart-cart__footer {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    width: 100% !important;
    max-width: 768px !important;
    margin: 0 auto !important;
    /* Center the container */
  }
}

/* Force centering for Footer Elements matching mobile layout */
/* Global Footer (Main Cart) - Not sticky, follows content flow */
#snipcart .snipcart-cart__footer {
  position: relative !important;
  background: #fff !important;
  padding: 1rem !important;
  border-top: 1px solid #eee !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  box-shadow: none !important;
}

/* Slim down the bottom spacing inside the footer */
#snipcart .snipcart-featured-payment-methods {
  margin-top: 1.5rem !important;
  margin-bottom: 2rem !important;
}

/* Reduce gap above footer (product list bottom) */
#snipcart .snipcart-item-list {
  margin-bottom: 0.5rem !important;
}

/* Inner footer elements - no sticky, just centering */
.snipcart-cart__footer-col {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  width: 100% !important;
}

/* 1. Reduce outer page margins to gain space */
#snipcart .snipcart-checkout__content {
  margin-left: 1.5rem !important;
  margin-right: 1.5rem !important;
  max-width: none !important;
}

/* 2. Adjust flex balance between main column and sidebar */
#snipcart .snipcart-layout__col--large {
  flex-basis: 60% !important;
  /* Reduced from 68% */
  max-width: 60% !important;
  padding-left: 2rem !important;
  /* Reduced from 80px */
}

#snipcart .snipcart-layout__sidebar {
  flex-basis: 35% !important;
  /* Increased basis */
  min-width: 320px !important;
  /* Ensure a minimum width */
  flex-grow: 1 !important;
}

/* 3. Container refinements - Use ID prefix for maximum specificity */
#snipcart .snipcart-layout__col {
  padding: 4rem 3.5rem !important;
  /* Increased top and horizontal padding */
}

/* 4. Remove Snipcart's default width restrictions on the summary block */
#snipcart .snipcart-cart-summary,
#snipcart .snipcart-cart-summary-items,
#snipcart .snipcart-summary-fees,
#snipcart .snipcart-cart-summary-items-list {
  width: 100% !important;
  max-width: 100% !important;
}

#snipcart .snipcart-cart-summary__title {
  margin-top: 1.5rem !important;
  /* Gap from top of container */
  margin-bottom: 2.5rem !important;
  line-height: 1.4 !important;
  letter-spacing: 0.02em !important;
  font-family: inherit !important;
  padding-right: 5rem !important;
  /* More room for EDIT button */
}

.snipcart-button-link {
  text-decoration: none !important;
  text-transform: uppercase !important;
  font-size: 0.75rem !important;
  letter-spacing: 0.1em !important;
  opacity: 0.8 !important;
  transition: opacity 0.2s !important;
  color: var(--color-primary, #1a4db3) !important;
}

.snipcart-button-link:hover {
  opacity: 1 !important;
  text-decoration: none !important;
}

/* Items in summary */
.snipcart-cart-summary-item {
  margin-bottom: 1.25rem !important;
  border-bottom: 1px solid #f2f2f2 !important;
  padding-bottom: 1rem !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: baseline !important;
  width: 100% !important;
}

.snipcart-cart-summary-item__name {
  line-height: 1.5 !important;
  margin-bottom: 0 !important;
  display: block !important;
  font-weight: 500 !important;
  flex-grow: 1 !important;
  padding-right: 2rem !important;
  /* Ensure gap from price */
}

.snipcart-cart-summary-item__quantity,
.snipcart-cart-summary-item__price {
  font-size: 0.85rem !important;
  color: #666 !important;
  white-space: nowrap !important;
  text-align: right !important;
}

/* Totals */
.snipcart-summary-fees__item {
  padding: 0.75rem 0 !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 2rem !important;
  width: 100% !important;
}

.snipcart-summary-fees__label,
.snipcart-summary-fees__item--total .snipcart-summary-fees__label {
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  text-align: left !important;
}

.snipcart-summary-fees__amount,
.snipcart-cart-summary-item__price {
  text-align: right !important;
  flex-basis: auto !important;
  flex-grow: 1 !important;
  white-space: nowrap !important;
}

.snipcart-summary-fees__item--total {
  margin-top: 1.5rem !important;
  padding-top: 1.5rem !important;
  border-top: 1px solid #ddd !important;
}

.snipcart-summary-fees__item--total .snipcart-summary-fees__label {
  font-size: 1.2rem !important;
  font-weight: 600 !important;
}

.snipcart-summary-fees__item--total .snipcart-summary-fees__amount {
  font-size: 1.35rem !important;
  color: #000 !important;
  font-weight: 700 !important;
}

/* Ensure buttons inside stretch or center? Usually center for 'mobile' look */
.snipcart-cart__footer-col .snipcart-button {
  width: 100% !important;
  /* Re-added !important to Force full width */
  max-width: 100% !important;
  /* Allow full width as requested */
}

/* Force Summary Title Small via HIGH SPECIFICITY */
.snipcart-cart-summary__title,
.snipcart-layout__content .snipcart-cart-summary__title,
section.snipcart-cart-summary h1,
section.snipcart-cart-summary h2 {
  font-size: 1.25rem !important;
  margin-top: 0 !important;
  margin-bottom: 1rem !important;
}

/* Hide duplicated contact fields in Snipcart checkout (billing step)
   These are overridden by our custom address-fields template */
#snipcart-billing-form fieldset.snipcart-form__set {
  display: none;
}

/* Main Cart Title (Desktop First Default) */
.snipcart-cart__title,
.snipcart-modal__header-title,
.snipcart-cart__header-title {
  font-size: 2.8rem !important;
  font-weight: 700 !important;
  margin-bottom: 2rem !important;
  margin-top: 1.5rem !important;
  display: block !important;
}

/* Mobile Title Overrides (Downgrade to 2rem) */
@media (max-width: 1024px) {

  .snipcart-cart__title,
  .snipcart-modal__header-title,
  .snipcart-cart__header-title {
    font-size: 2rem !important;
    margin-top: 0 !important;
    margin-bottom: 1.5rem !important;
  }
}

/* Fix Summary Fees (not too big) */
.snipcart-summary-fees__title,
.snipcart-summary-fees__amount {
  font-size: 1rem !important;
  font-weight: 500 !important;
}

.snipcart-summary-fees__total .snipcart-summary-fees__title,
.snipcart-summary-fees__total .snipcart-summary-fees__amount {
  font-size: 1.25rem !important;
  font-weight: 700 !important;
}


/* Integrated Header: Wider and Grid Aligned */
/* Integrated Header: Perfectly matched to layout & Sticky */
/* Integrated Header: Perfectly matched to layout & Sticky */
/* Consolidated all variations with ULTRA-HIGH SPECIFICITY to ensure thick look and stable flow */
#snipcart .snipcart-cart-header,
#snipcart .snipcart-modal__header,
#snipcart .snipcart-cart__header,
#snipcart .snipcart-checkout__header,
#snipcart .snipcart-header,
#snipcart .snipcart-layout__header,
#snipcart .snipcart-layout__header--fixed {
  flex: 0 0 auto !important;
  z-index: 9100 !important;
  background-color: #fff !important;
  border-bottom: 1px solid #eee !important;

  /* Positioning Flow Fix (Prevents Floating Up) */
  position: sticky !important;
  /* STICKY HEADER */
  top: 0 !important;
  left: 0 !important;
  transform: none !important;
  /* Neutralize any JS-driven sliding */
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;

  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box !important;

  /* Force Thick Header */
  padding: 1.5rem 3rem !important;
  min-height: 80px !important;
  /* Guaranteed thickness for desktop */

  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}

/* Ensure inner options don't override the thickness or cause shifts */
#snipcart .snipcart-cart-header__options,
#snipcart .snipcart-header__options {
  padding: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex: 1 1 auto !important;
}

/* Ensure inner options don't override the thickness or cause shifts */
#snipcart .snipcart-cart-header__options {
  padding: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex: 1 1 auto !important;
}

/* Also ensure the inner options container doesn't collapse or hide padding */
.snipcart-cart-header__options {
  padding: 0 !important;
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
}

/* Left Column - Continue Shopping */
.snipcart-cart-header__close-button,
.snipcart-modal__header-buttons {
  z-index: 10 !important;
  position: absolute !important;
  /* Force it out of flow */
  left: 1.5rem !important;
  /* Match container padding */
  top: 50% !important;
  transform: translateY(-50%) !important;
  justify-content: flex-start !important;
}

/* Center Column - Title (Absolute) */
.snipcart-cart-header__title,
.snipcart-modal__header-title,
.snipcart-cart__header-title {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: auto !important;
  white-space: nowrap !important;
  display: block !important;
  z-index: 1 !important;
  font-size: 1.25rem !important;
  margin: 0 !important;
  order: 2 !important;
  /* Just in case */
}

/* Ensure step icons don't drift into padding area on Desktop */
/* Snipcart puts these icons in a header with potential negative margins */
#snipcart .snipcart-checkout-step__header {
  margin-left: 0 !important;
  padding-left: 0 !important;
  /* Rely on column padding now */
  display: flex !important;
  align-items: center !important;
}

#snipcart .snipcart-checkout-step__icon {
  position: static !important;
  /* Force out of absolute if it was there */
  margin-right: 1.25rem !important;
}

/* Fix "Edit" Side Panel Z-Index to be ABOVE Header */
.snipcart-item-configuration,
.snipcart-side-cart,
.snipcart-layout__content--side {
  z-index: 9200 !important;
  /* Level 3: Sidebar */
  /* Must be > 9100 */
  position: relative !important;
}

/* Billing Content Adjustments - Background stabilization */
#snipcart .snipcart-layout__content {
  background-color: #fff !important;
}

@media (max-width: 1024px) {

  /* Tablet RWD: Stack columns vertically */
  #snipcart .snipcart-layout:has(.snipcart-checkout__content) {
    width: 100% !important;
    max-width: 100% !important;
    left: 0 !important;
    transform: none !important;
    right: 0 !important;
  }

  #snipcart .snipcart-layout__cols,
  #snipcart .snipcart-checkout__cols {
    flex-direction: column !important;
    max-width: 100% !important;
  }

  #snipcart .snipcart-layout__col--large {
    flex: 1 1 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    order: 1 !important;
  }

  #snipcart .snipcart-layout__col--side {
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 1rem !important;
    order: 2 !important;
    margin-top: 1.5rem !important;
  }

  /* Reduce oversized white background - tighter padding */
  #snipcart .snipcart-layout__content {
    padding: 1.5rem !important;
  }

  /* Summary background - more compact */
  #snipcart .snipcart-cart-summary,
  #snipcart .snipcart-cart-summary__content {
    padding: 1rem !important;
    border-radius: 0.75rem !important;
  }
}

@media (max-width: 768px) {

  /* Mobile RWD: Standard approved padding */
  #snipcart .snipcart-layout__content {
    padding: 2.5rem 1.5rem 1.5rem !important;
    /* Top 2.5rem, Horizontal 1.5rem */
  }
}

@media (max-width: 768px) {

  #snipcart .snipcart-modal__header,
  #snipcart .snipcart-cart__header {
    border-radius: 0 !important;
    padding: 1rem !important;
  }
}

/* Special Case: Flex Layout specifically for Empty Cart Vertical Centering */
#snipcart .snipcart-layout__content:has(.snipcart-empty-cart) {
  display: flex !important;
  flex-direction: column !important;
}

/* Snipcart Empty Cart Line Breaks & Centering */
/* Snipcart Empty Cart Container - Vertical & Horizontal Center */
.snipcart-empty-cart,
.snipcart-cart-empty {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  /* Vertical Center */
  align-items: center !important;
  /* Horizontal Center */
  flex-grow: 1 !important;
  /* Grow to fill parent height */
  width: 100% !important;
  text-align: center !important;
  height: auto !important;
  /* Let flex handle height */
  margin: 0 !important;
  /* Remove potential margins */
}

/* Hide Empty Cart Icon to prevent Top-Spacing */
.snipcart-empty-cart__icon,
.snipcart-cart-empty__icon {
  display: none !important;
}

/* Empty Cart Title */
.snipcart-empty-cart__title,
.snipcart-cart-empty__title {
  white-space: pre-line !important;
  line-height: 1.5 !important;
  margin-bottom: 2rem !important;
  /* Space between title and button */
  display: block !important;
  width: 100% !important;
}

/* Empty Cart Button Center */
.snipcart-empty-cart .snipcart-button-secondary,
.snipcart-cart-empty .snipcart-button-secondary {
  margin: 0 auto !important;
  display: inline-flex !important;
  /* or flex depending on button properties */
}

/* Taiwan Address Format Reordering & Flex Layout (Apply to ALL forms) */
.snipcart-address-form,
.snipcart-billing-address,
.snipcart-customer-address-form,
.snipcart-address-fields {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: space-between !important;
  gap: 20px 2% !important;
  /* Increased gap slightly */
  margin-top: 1rem !important;
}

/* FORCE ALL FIELDS TO SHOW AND BE FORMATTED */
.snipcart-form__field,
.snipcart-form__field--hidden,
[data-test^="snipcart-address-form__"],
[data-test^="snipcart-billing-address__"] {
  display: block !important;
  flex: 1 1 100% !important;
  margin-bottom: 15px !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Hide the toggle buttons that Snipcart uses to hide fields */
.snipcart-billing-address__manual-entry,
.snipcart-address-form__dont-see-address,
button.snipcart-button--link,
[data-test$="manual-entry"],
[data-test$="dont-see-address"] {
  display: none !important;
}

/* Adjust Billing Area specifically to be wider or fuller */
.snipcart-billing-address {
  width: 100% !important;
  max-width: 100% !important;
}

/* Row 1: Name & Phone */
.snipcart-form__field[data-test$="name"],
.snipcart-form__field[data-test$="phone"] {
  flex: 1 1 48% !important;
  order: 1 !important;
  min-width: 140px !important;
}

/* Row 2: Postal Code, County/City, Township/District (One line) */
.snipcart-form__field[data-test$="postalCode"] {
  flex: 1 1 20% !important;
  order: 3 !important;
  min-width: 80px !important;
}

.snipcart-form__field[data-test$="province"] {
  flex: 1 1 38% !important;
  order: 4 !important;
  min-width: 110px !important;
}

.snipcart-form__field[data-test$="city"] {
  flex: 1 1 38% !important;
  order: 5 !important;
  min-width: 110px !important;
}

/* Row 3: Country (Forced full width or separate) */
.snipcart-form__field[data-test$="country"] {
  flex: 1 1 100% !important;
  order: 2 !important;
}

/* Row 4: Detailed Address (One line 100%) */
.snipcart-form__field[data-test$="address1"] {
  flex: 1 1 100% !important;
  order: 6 !important;
}

/* Row 5: Notes (One line 100%) */
.snipcart-form__field[data-test$="address2"] {
  flex: 1 1 100% !important;
  order: 7 !important;
}

/* Fix "Missing Inputs" - make sure internal inputs inside the fields are visible */
.snipcart-form__field input,
.snipcart-form__field select,
.snipcart-form__field textarea,
.snipcart-textbox {
  display: block !important;
  width: 100% !important;
  min-height: 48px !important;
  /* Slightly taller */
  visibility: visible !important;
}

/* Custom Field Layout in Cart Summary */
.snipcart-item-details__custom-fields {
  display: block !important;
  font-size: 0.85rem !important;
  color: #666 !important;
}

.snipcart-checkout {
  font-family: var(--font-ui) !important;
}

/* Ensure Layout Remains Scrollable even during Loading/Processing */
#snipcart .snipcart-layout.snipcart-layout--loading,
#snipcart .snipcart-layout--processing,
#snipcart .snipcart-layout--disabled {
  overflow-y: scroll !important;
  pointer-events: auto !important;
}

/* Ensure the mask doesn't block scroll events on the container */
.snipcart-loading-overlay,
.snipcart-spinner-container {
  pointer-events: none !important;
  /* Allow scroll through mask */
}

/* NUCLEAR OPTION: Force HTML/Body to yield scroll control to Snipcart Layout */
html.snipcart-html-lock,
body.snipcart-body-lock,
html:has(#snipcart .snipcart-layout--processing),
body:has(#snipcart .snipcart-layout--processing) {
  overflow: hidden !important;
  /* Let layout handle it, but don't double scroll */
  height: 100% !important;
}

/* FAB Menu Bridge Fix (Only Bridge, No Layout/Position overrides)
   Ensures the mouse can travel from main button to actions without closing the menu.
*/

.fab-actions::after {
  content: '';
  position: absolute;
  bottom: -60px;
  /* Extend deep down to cover the gap */
  left: -30px;
  /* Wide catch area */
  right: -30px;
  height: 80px;
  background: transparent;
  pointer-events: none;
  z-index: -1;
}

.fab-container.expanded .fab-actions::after {
  pointer-events: auto;
}

/* --- Social Connections Section --- */
.social-connections-card {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.social-connections-card .section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
}

.profile-connections {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* --- Account Connection Card (Google Binding) --- */
.connection-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  margin-top: 1rem;
  transition: all 0.3s ease;
}

.connection-card:hover {
  border-color: var(--accent-green);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.connection-info {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.connection-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #f1f5f9;
  flex-shrink: 0;
  overflow: hidden;
  /* Ensure rounded corners clip full-bleed content */
  transition: all 0.2s ease;
}

.connection-icon.is-full {
  background: none;
  border: none;
  padding: 0;
}

.connection-icon.is-full svg {
  width: 100%;
  height: 100%;
  display: block;
}

.connection-text h5 {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.2;
}

.connection-text p {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.4;
}

.connection-action {
  text-align: right;
  flex-shrink: 0;
}

.badge-linked {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background-color: #f0fdf4;
  color: #16a34a;
  padding: 0 1rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid #dcfce7;
  width: 100%;
  height: 42px;
  transition: all 0.2s ease;
  text-align: center;
  line-height: 1.2;
}

.provider-linked-status {
  position: relative;
  display: inline-block;
  width: 160px;
  height: 42px;
  /* Matches .btn-main-outline.sm approx */
  vertical-align: middle;
}

.provider-unlink-btn {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background-color: #fef2f2;
  color: #dc2626;
  border: 1px solid #fee2e2;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  text-align: center;
  line-height: 1.2;
}

@media (hover: hover) {
  .provider-linked-status:hover .badge-linked {
    opacity: 0;
    visibility: hidden;
  }

  .provider-linked-status:hover .provider-unlink-btn {
    opacity: 1;
    visibility: visible;
  }

  .provider-unlink-btn:hover {
    background-color: #fee2e2;
    border-color: #fecaca;
    color: #b91c1c;
  }
}

.provider-unlink-btn:active {
  transform: scale(0.98);
  transition: transform 0.1s;
}

/* Touch Device Support: Show unlink option explicitly since hover isn't available */
@media (hover: none) {
  .provider-linked-status {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    height: auto;
    width: 160px;
  }

  .badge-linked {
    position: static;
    opacity: 1 !important;
    visibility: visible !important;
    width: 100%;
    justify-content: center;
  }

  .provider-unlink-btn {
    position: static;
    opacity: 1 !important;
    visibility: visible !important;
    width: 100%;
    height: 42px;
    padding: 0 1rem;
  }

  .provider-linked-status:hover .badge-linked {
    opacity: 1;
    visibility: visible;
  }
}

@media (max-width: 600px) {
  .connection-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
  }

  .connection-action {
    width: 100%;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .provider-link-btn,
  .provider-linked-status {
    width: 100% !important;
  }

  .btn-unlink {
    margin-left: 0;
  }
}

/* --- Account Navigation Container (Mobile Dropdown Support) --- */
.account-nav-container {
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-mobile-toggle {
  display: none;
  /* Hidden on desktop */
  width: 100%;
  padding: 1.2rem;
  background: #ffffff;
  border: none;
  cursor: pointer;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  color: var(--text-dark);
  font-size: 1rem;
  transition: background 0.2s;
}

.sidebar-mobile-toggle span i {
  color: var(--accent-green);
  margin-right: 0.8rem;
}

.sidebar-mobile-toggle .chevron-icon {
  transition: transform 0.3s ease;
  color: #94a3b8;
}

.sidebar-nav-content {
  padding: 0.8rem;
}

.account-nav-list,
.account-nav-item {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.account-nav-link {
  display: flex !important;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #64748b;
  font-weight: 500;
  transition: all 0.2s ease;
  text-decoration: none !important;
}

.account-nav-link i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.account-nav-link:hover,
.account-nav-link.is-active {
  background: #ffffff;
  border-color: #e5e5e5;
  color: var(--accent-green);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.account-nav-link.is-active i {
  color: var(--accent-green);
}

.sidebar-logout-btn {
  margin-top: 1rem;
  width: 100%;
}

@media (max-width: 1024px) {
  .sidebar-mobile-toggle {
    display: flex;
    /* Show toggle on mobile/tablet */
  }

  /* Default state: Collapsed */
  .sidebar-nav-content {
    max-height: 0;
    padding: 0 0.8rem;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Expanded State */
  .account-nav-container.is-expanded {
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  }

  .account-nav-container.is-expanded .sidebar-nav-content {
    max-height: 500px;
    /* Large enough for menu */
    padding: 0.8rem;
    opacity: 1;
    border-top: 1px solid #f1f5f9;
  }

  .account-nav-container.is-expanded .sidebar-mobile-toggle {
    background: #f8fafc;
  }

  .account-nav-container.is-expanded .chevron-icon {
    transform: rotate(180deg);
  }

  .account-nav-link {
    background: #f8fafc;
  }
}

/* ---------------------------------------------------
    Auth Feedback Modal (Account Linking) 🔗
-----------------------------------------------------*/
.auth-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.auth-modal {
  background: var(--bg-card);
  width: 90%;
  max-width: 480px;
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transform: scale(0.9) translateY(20px);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}

.auth-modal-overlay.active .auth-modal {
  transform: scale(1) translateY(0);
}

.auth-modal-icon {
  width: 64px;
  height: 64px;
  background: var(--accent-green-soft);
  color: var(--accent-green);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 1.5rem;
}

.auth-modal h3 {
  font-family: var(--font-fancy);
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-dark);
}

.auth-modal p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.auth-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.auth-modal-btn {
  padding: 1rem;
  border-radius: 14px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-family: var(--font-ui);
}

.auth-modal-btn-primary {
  background: var(--accent-green);
  color: white;
}

.auth-modal-btn-primary:hover {
  background: var(--accent-green-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--accent-green-shadow);
}

.auth-modal-btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}

.auth-modal-btn-secondary:hover {
  background: var(--bg-soft);
  color: var(--text-dark);
}