
/* Universal Anti-Overflow & Auto Word-Wrap for All Frontend Elements */
*, *::before, *::after {
  box-sizing: border-box;
  overflow-wrap: anywhere;
}

body, h1, h2, h3, h4, h5, h6, p, span, div, a, li, dt, dd, td, th, blockquote, label,
.faq-question, .faq-answer, .series-desc, .project-detail-desc, .article-body-rich,
.card-desc, .product-card, .table-container, table, .faq-item, .contact-card, .footer {
  overflow-wrap: anywhere;
}

/* Global Layout Safety */
html, body {
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100vw !important;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

*, *:before, *:after {
  box-sizing: border-box;
}

:root {
  /* Warm Natural Living Palette */
  --primary: #2d3339;          /* Deep warm charcoal */
  --primary-light: #434b54;
  --accent: #b38b59;           /* Warm earth honey / champagne */
  --accent-hover: #9c7545;
  --bg-main: #faf9f6;          /* Warm linen / soft ivory */
  --bg-surface: #ffffff;
  --bg-subtle: #f3f0ea;        /* Soft travertine / natural stone */
  --border: #e6e2d8;
  --border-light: #f0ece3;
  --text-main: #2b3036;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 4px 16px -2px rgba(45, 51, 57, 0.05);
  --shadow-lg: 0 12px 32px -4px rgba(45, 51, 57, 0.12);
  --font-serif: "Noto Serif TC", "Songti TC", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang TC", "Microsoft JhengHei", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
  object-fit: cover;
}

/* Header & Nav */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 249, 246, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  max-width: 1380px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  gap: 1rem;
}

.logo-area {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  white-space: nowrap;
}

.logo-brand {
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--primary);
  font-family: var(--font-serif);
  white-space: nowrap;
}

.logo-sub {
  font-size: 0.68rem;
  letter-spacing: 1.5px;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

.nav-menu {
  display: flex;
  gap: 1.15rem;
  list-style: none;
  flex-shrink: 0;
  align-items: center;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
  position: relative;
  padding: 0.3rem 0;
  transition: color 0.2s;
  white-space: nowrap;
  display: inline-block;
  word-break: keep-all;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.wishlist-nav-btn {
  white-space: nowrap;
}

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

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background-color: var(--accent);
  transition: width 0.2s;
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-primary {
  background-color: var(--primary);
  color: #fff;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  background-color: var(--accent);
  color: #fff;
}

.btn-gold {
  background-color: var(--accent);
  color: #fff;
  border: none;
  padding: 0.7rem 1.6rem;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-gold:hover {
  background-color: var(--accent-hover);
}

.btn-outline {
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--primary);
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.wishlist-nav-btn {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius);
  background: var(--bg-subtle);
  color: var(--primary);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s;
}

.wishlist-nav-btn:hover {
  background: #e9e4d9;
}

.wishlist-count-badge {
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 10px;
  padding: 0.1rem 0.45rem;
  margin-left: 0.4rem;
}

/* Page Banner */
.page-banner {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  padding: 3.5rem 2rem;
  text-align: center;
}

.page-banner-tag {
  color: var(--accent);
  font-size: 0.82rem;
  letter-spacing: 2px;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
  display: block;
}

.page-banner-title {
  font-size: 2.2rem;
  font-family: var(--font-serif);
  color: var(--primary);
  margin-bottom: 0.6rem;
}

.page-banner-desc {
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto;
  font-size: 0.95rem;
}

/* Sections */
.section {
  padding: 4rem 2rem;
  max-width: 1320px;
  margin: 0 auto;
}

/* Filter Box */
.filter-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  align-items: center;
  margin-bottom: 1.1rem;
}

.filter-row:last-child {
  margin-bottom: 0;
}

.filter-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary);
  min-width: 80px;
}

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-tag {
  padding: 0.4rem 0.95rem;
  font-size: 0.82rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-tag.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.search-input-box {
  flex: 1;
  min-width: 250px;
  position: relative;
}

.search-input-box input {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  outline: none;
  background: #fafaf9;
}

.search-input-box input:focus {
  border-color: var(--accent);
  background: #fff;
}

/* Product Card */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 2rem;
}

.product-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s, box-shadow 0.25s;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-img-container {
  position: relative;
  width: 100%;
  height: 250px;
  overflow: hidden;
  background: #f1eee7;
}

.card-img {
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease;
}

.product-card:hover .card-img {
  transform: scale(1.05);
}

.card-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-badge {
  padding: 0.25rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}

.card-badge-gold {
  background: var(--accent);
  color: #fff;
}

.card-badge-origin {
  background: rgba(45, 51, 57, 0.85);
  color: #fff;
}

.card-badge-pattern {
  background: #0284c7;
  color: #fff;
}

.card-wishlist-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: all 0.2s;
}

.card-wishlist-toggle:hover, .card-wishlist-toggle.active {
  color: #e11d48;
  background: #ffffff;
}

.card-body {
  padding: 1.3rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-category {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
  font-family: var(--font-serif);
}

.card-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}

.card-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1.2rem;
  flex: 1;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-light);
  padding-top: 0.8rem;
  font-size: 0.82rem;
}

/* Calculator Component */
.calc-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 1.8rem 0;
}

.calc-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.calc-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.calc-result-box {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  justify-content: space-around;
  text-align: center;
}

.calc-result-item span {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: block;
}

.calc-result-item strong {
  font-size: 1.3rem;
  color: var(--accent);
}

/* Form Styles */
.form-group {
  margin-bottom: 1.2rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--primary);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  font-size: 0.9rem;
  outline: none;
  font-family: inherit;
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(179, 139, 89, 0.15);
}

/* ==========================================================================
   MODAL DIALOG & LIGHTBOX SYSTEM (Fix for exposed edit forms)
   ========================================================================== */
.modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(18, 22, 28, 0.72) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 99999 !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: opacity 0.25s ease, visibility 0.25s ease !important;
  padding: 1.5rem !important;
}

.modal-backdrop.open {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.modal-dialog {
  background: #ffffff !important;
  border-radius: var(--radius-lg) !important;
  max-width: 820px !important;
  width: 100% !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35) !important;
  position: relative !important;
  border: 1px solid var(--border) !important;
  transform: translateY(20px) !important;
  transition: transform 0.25s ease !important;
}

.modal-backdrop.open .modal-dialog {
  transform: translateY(0) !important;
}

.modal-close-btn {
  position: absolute !important;
  top: 16px !important;
  right: 16px !important;
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: none !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.3rem !important;
  z-index: 20 !important;
  transition: background 0.15s, color 0.15s !important;
}

.modal-close-btn:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

/* Footer */
.footer {
  background: var(--primary);
  color: #d1d5db;
  padding: 4.5rem 2rem 2.5rem;
  margin-top: 5rem;
}

.footer-container {
  max-width: 1320px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-col h4 {
  color: #ffffff;
  font-size: 1.05rem;
  margin-bottom: 1.2rem;
  font-family: var(--font-serif);
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.6rem;
  font-size: 0.88rem;
}

.footer-col a:hover {
  color: var(--accent);
}

.footer-bottom {
  max-width: 1320px;
  margin: 0 auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: #9ca3af;
}

/* Responsive */
@media (max-width: 992px) {
  .footer-container {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    display: none;
  }
  .footer-container {
    grid-template-columns: 1fr;
  }
}


/* ==========================================================================
   MOBILE RESPONSIVE HAMBURGER & DRAWER NAVIGATION
   ========================================================================== */
.mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem 0.6rem;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--primary);
  line-height: 1;
}

.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.mobile-drawer-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100vh;
  background: #ffffff;
  z-index: 99999;
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
}

.mobile-drawer.open {
  right: 0;
}

.mobile-drawer-close {
  align-self: flex-end;
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.mobile-nav-link {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary);
  display: block;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border-light);
}

.mobile-nav-link:hover {
  color: var(--accent);
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE SYSTEM (Eliminates white columns & squashing)
   ========================================================================== */
@media (max-width: 1180px) {
  .nav-menu {
    display: none !important;
  }
  .mobile-menu-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 992px) {
  .wishlist-grid-layout {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }
  .showroom-home-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }
  .series-hero-gallery {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 768px) {
  .header {
    padding: 0.6rem 0.8rem !important;
  }
  .nav-container {
    padding: 0 !important;
    gap: 0.4rem !important;
  }
  .logo-brand {
    font-size: 0.95rem !important;
    white-space: nowrap !important;
  }
  .logo-sub {
    font-size: 0.58rem !important;
    letter-spacing: 0.5px !important;
  }
  .nav-actions {
    gap: 0.4rem !important;
  }
  /* Hide the text "後台管理" on mobile, it is in drawer */
  .nav-actions .btn-outline {
    display: none !important;
  }
  /* Keep only red heart and badge for Wishlist on mobile */
  .wishlist-nav-btn {
    padding: 0.35rem 0.55rem !important;
    font-size: 0.75rem !important;
  }
  .wishlist-nav-btn span:not(.wishlist-count-badge) {
    display: none !important;
  }

  /* Section and Page Banner Paddings */
  .section {
    padding: 2.5rem 1rem !important;
  }
  .page-banner {
    padding: 2.5rem 1rem !important;
  }
  .page-banner-title {
    font-size: 1.6rem !important;
    line-height: 1.3 !important;
  }
  .page-banner-desc {
    font-size: 0.88rem !important;
  }

  /* Product & Card Grids */
  .product-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  /* Hero Section */
  #hero-banner-section {
    min-height: 460px !important;
    padding: 2.5rem 0 !important;
  }
  #hero-title {
    font-size: 1.85rem !important;
    line-height: 1.3 !important;
  }
  #hero-subtitle {
    font-size: 0.92rem !important;
    line-height: 1.6 !important;
    margin-bottom: 1.5rem !important;
  }

  /* Form Containers */
  .contact-outer-box {
    padding: 1.5rem 0.8rem !important;
  }
  .contact-form-box {
    padding: 1.5rem 1rem !important;
  }
  .form-row-2col {
    grid-template-columns: 1fr !important;
    gap: 0.8rem !important;
  }

  /* Modal Dialogs */
  .modal-dialog {
    max-width: 95% !important;
    padding: 1.2rem !important;
    margin: 1rem auto !important;
  }
}


.logo-brand {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--primary);
  font-family: var(--font-serif);
  white-space: nowrap;
}

.logo-sub {
  font-size: 0.68rem;
  letter-spacing: 1.5px;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .logo-brand {
    font-size: 1.05rem !important;
    white-space: nowrap !important;
  }
  .logo-sub {
    font-size: 0.58rem !important;
    letter-spacing: 0.5px !important;
    white-space: nowrap !important;
  }
  .header {
    padding: 0.6rem 1rem !important;
  }
  .nav-container {
    padding: 0 !important;
    gap: 0.5rem !important;
  }
  .home-showroom-container {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
  .home-showroom-container + div, section[style*="padding:3.5rem 2.5rem"] {
    padding: 2rem 1.2rem !important;
  }
}

/* Mandatory Password Change Close Button Override */
#pwd-close-btn.hidden-force,
#pwd-close-btn[style*="display: none"],
#pwd-close-btn[style*="display:none"],
#pwd-cancel-btn.hidden-force,
#pwd-cancel-btn[style*="display: none"],
#pwd-cancel-btn[style*="display:none"],
.modal-close-btn.hidden-force {
  display: none !important;
}

/* Ensure touch targets >= 34px on mobile and touch devices */
.filter-tag, .btn-outline, .btn-primary, .btn-gold, button, .pagination-btn {
  min-height: 34px;
}

@media (max-width: 768px) {
  .filter-tag, .btn-outline, .btn-primary, .btn-gold, button {
    min-height: 38px;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
  }
}

/* RBAC: Staff / non-super_admin delete buttons protection */
body.role-staff [data-action="delete-product"],
body.role-staff [data-action="delete-showroom"],
body.role-staff [data-action="delete-faq"],
body.role-staff [data-action="delete-article"],
body.role-staff [data-action="delete-user"],
body.role-staff [data-action="delete-project"],
body.role-staff [data-action="delete-inquiry"],
body.role-staff [data-action="delete-tag"],
body.role-staff .btn-delete,
body.role-staff .super-admin-only {
  display: none !important;
}

/* Catalog Filter Responsive & Desktop Collapse */
.mobile-filter-bar {
  display: none;
}
.filter-advanced-section {
  display: none;
}
.filter-advanced-section.expanded {
  display: block;
}

@media (max-width: 768px) {
  .mobile-filter-bar {
    display: block;
    margin-bottom: 1rem;
  }
  .filter-wrapper {
    display: none;
  }
  .filter-wrapper.mobile-expanded {
    display: block;
  }
  .advanced-filter-toggle-container {
    display: none;
  }
  .filter-advanced-section {
    display: block !important;
  }
}

/* Ensure all interactive targets on catalog & all pages >= 36px */
.filter-tag, .btn-outline, .btn-primary, .btn-gold, button, .pagination-container a, select, input {
  min-height: 36px;
  box-sizing: border-box;
}

/* Footer tap target enlargement (>= 36px) */
.footer-col ul li a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  line-height: 24px;
  padding: 8px 0;
  box-sizing: border-box;
  text-decoration: none;
}
.footer-col ul li {
  margin-bottom: 0.2rem;
}
.footer-bottom a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  line-height: 24px;
  padding: 8px 12px;
  box-sizing: border-box;
  text-decoration: none;
}


/* Minimalist Series Sub-Item Cards (Shared across series_detail & product_detail) */
.item-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}
.item-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}
.item-card-imgs {
  height: 240px;
  position: relative;
  background: #f5f3ef;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}
.item-card-imgs a {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.item-card-imgs img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  transition: transform 0.3s ease, opacity 0.2s ease;
}
.item-card-imgs img.is-tile-photo {
  max-width: 85%;
  max-height: 205px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.1));
}
.item-card-thumbs {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: flex;
  gap: 5px;
  background: rgba(0,0,0,0.5);
  padding: 3px 6px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}
.item-thumb-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid #fff;
}
.item-card-body {
  padding: 1rem 1.25rem 1.15rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}


/* Fullscreen Image Lightbox Modal */
.img-lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  user-select: none;
}
.img-lightbox-overlay.open {
  display: flex;
}
.img-lightbox-content {
  position: relative;
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.img-lightbox-content img {
  width: auto;
  height: auto;
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  cursor: zoom-in;
  transition: transform 0.25s ease;
}
.img-lightbox-content img.zoomed {
  transform: scale(1.65);
  cursor: zoom-out;
}
.img-lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 10001;
}
.img-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}
.img-lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 1.6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 10001;
}
.img-lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.3);
}
.img-lightbox-prev { left: 24px; }
.img-lightbox-next { right: 24px; }
.img-lightbox-counter {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  z-index: 10001;
}
