/* ========================================
   Pars Plasma Taban — Premium Dark Theme
   Company Product Showcase
   ======================================== */

/* ---------- Google Font ---------- */
/* Font is loaded via <link> tags in index.html for non-render-blocking loading */

/* ---------- Custom Properties ---------- */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a26;
  --bg-card-hover: #22222f;
  --accent: #6c5ce7;
  --accent-glow: rgba(108, 92, 231, .35);
  --accent-light: #a29bfe;
  --text-primary: #f0f0f5;
  --text-secondary: #9896a8;
  --border-color: rgba(255, 255, 255, .06);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: .35s cubic-bezier(.4, 0, .2, 1);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, .4);
  --shadow-glow: 0 0 40px var(--accent-glow);
  --max-width: 1400px;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

img {
  display: block;
  max-width: 100%;
  height: auto
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none
}

a {
  text-decoration: none;
  color: inherit;
}

/* ---------- Accessibility ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Background Gradient Blobs ---------- */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(120px);
  opacity: .18;
  z-index: 0;
  will-change: transform;
  contain: strict;
}

body::before {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  top: -120px;
  left: -120px;
}

body::after {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #e17055 0%, transparent 70%);
  bottom: -100px;
  right: -100px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, .88);
  backdrop-filter: blur(10px) saturate(1.4);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  border-bottom: 1px solid var(--border-color);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* Logo area */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}

.logo-img {
  height: 56px;
  width: auto;
  object-fit: contain;
}

.logo-img-secondary {
  height: 38px;
  width: auto;
  object-fit: contain;
}

.logo-text {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -.02em;
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

/* Contact bar */
.contact-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-inline-start: auto;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  transition: all var(--transition);
  white-space: nowrap;
}

.contact-item:hover {
  color: var(--accent-light);
  background: var(--bg-card-hover);
  border-color: rgba(108, 92, 231, .3);
}

.contact-item svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ---------- Filter Bar ---------- */
.filter-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 22px 32px 0;
  position: relative;
  z-index: 2;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-btn {
  padding: 9px 22px;
  border-radius: 40px;
  font-size: .84rem;
  font-weight: 500;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  transition: all var(--transition);
  white-space: nowrap;
}

.filter-btn:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, .12);
}

.filter-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

/* ========================================
   Product Card Grid
   ======================================== */
.gallery-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px 32px;
  position: relative;
  z-index: 1;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
}

/* ---------- Category separator ---------- */
.category-separator {
  grid-column: 1 / -1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent) 50%, transparent);
  opacity: .3;
  margin: 8px 0;
}

.category-header-label {
  grid-column: 1 / -1;
  font-size: .85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent-light);
  padding: 8px 0 4px;
  border-bottom: 1px solid rgba(108, 92, 231, .15);
}

/* ---------- Product Card (Collapsed) ---------- */
.product-card {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  animation: fadeUp .5s ease both;
  position: relative;
}

.product-card:hover {
  transform: translateY(-6px) scale(1.015);
  box-shadow: var(--shadow-card), var(--shadow-glow);
  border-color: rgba(108, 92, 231, .3);
}

/* Cover image container */
.product-card .cover-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--bg-secondary);
}

.product-card .cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s ease;
}

.product-card:hover .cover-wrap img {
  transform: scale(1.06);
}

/* Gradient overlay */
.product-card .cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, .75) 100%);
  display: flex;
  align-items: flex-end;
  padding: 20px;
  opacity: 0;
  transition: opacity var(--transition);
}

.product-card:hover .cover-overlay {
  opacity: 1;
}

/* Card info bar at bottom */
.product-card .card-info {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
}

.product-card .card-info .card-title {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

/* Expand icon in overlay */
.product-card .expand-icon {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), transform var(--transition);
  z-index: 2;
  opacity: 0;
}

.product-card:hover .expand-icon {
  opacity: 1;
}

.product-card .expand-icon:hover {
  background: var(--accent);
  transform: scale(1.1);
}

.product-card .expand-icon svg {
  width: 16px;
  height: 16px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ========================================
   Expanded Card
   ======================================== */
.product-card.expanded {
  grid-column: 1 / -1;
  cursor: default;
  transform: none;
  border-color: rgba(108, 92, 231, .35);
  box-shadow: 0 8px 48px rgba(108, 92, 231, .15), var(--shadow-card);
  animation: cardExpand .4s ease both;
}

.product-card.expanded:hover {
  transform: none;
}

.product-card.expanded .cover-overlay {
  opacity: 0 !important;
}

.product-card.expanded .expand-icon {
  display: none;
}

/* Expanded inner layout */
.expanded-content {
  display: none;
}

.product-card.expanded .expanded-content {
  display: block;
}

.product-card.expanded .cover-wrap {
  aspect-ratio: auto;
}

/* Expanded header */
.expanded-header {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card);
}

.expanded-header .exp-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Expanded body: images left, description right */
.expanded-body {
  display: flex;
  gap: 0;
  min-height: 400px;
}

.expanded-images-side {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Main large image */
.expanded-main-image {
  width: 100%;
  max-height: 480px;
  overflow: hidden;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex: 1;
}

.expanded-main-image img {
  width: 100%;
  max-height: 480px;
  object-fit: contain;
  padding: 12px;
  transition: opacity .3s ease;
}

/* Close button */
.expanded-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .5);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: background var(--transition);
  border: 1px solid rgba(255, 255, 255, .1);
}

.expanded-close:hover {
  background: var(--accent);
}

.expanded-close svg {
  width: 16px;
  height: 16px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Thumbnail strip */
.thumbnail-strip {
  padding: 14px 20px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

.thumbnail-strip::-webkit-scrollbar {
  height: 6px;
}

.thumbnail-strip::-webkit-scrollbar-track {
  background: transparent;
}

.thumbnail-strip::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}

.thumbnail-item {
  flex-shrink: 0;
  width: 80px;
  height: 60px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  opacity: .55;
  background: var(--bg-card);
}

.thumbnail-item:hover {
  opacity: .85;
  border-color: rgba(255, 255, 255, .15);
}

.thumbnail-item.active {
  opacity: 1;
  border-color: var(--accent);
  box-shadow: 0 0 14px var(--accent-glow);
}

.thumbnail-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Description panel */
.expanded-description {
  width: 380px;
  flex-shrink: 0;
  padding: 24px;
  overflow-y: auto;
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  max-height: 560px;
  line-height: 1.85;
  color: var(--text-secondary);
  font-size: .85rem;
}

.expanded-description h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
  line-height: 1.5;
}

.expanded-description h4 {
  font-size: .85rem;
  font-weight: 600;
  color: var(--accent-light);
  margin-top: 16px;
  margin-bottom: 8px;
}

.expanded-description p {
  margin-bottom: 12px;
  color: var(--text-secondary);
  text-align: justify;
}

.expanded-description strong {
  color: var(--text-primary);
  font-weight: 600;
}

.expanded-description ul {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}

.expanded-description ul li {
  padding: 4px 20px 4px 0;
  position: relative;
  color: var(--text-secondary);
}

.expanded-description ul li::before {
  content: '◆';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: .55rem;
}

/* Hide collapsed elements when expanded */
.product-card.expanded .card-info {
  display: none;
}

/* ---------- No Results ---------- */
.no-results {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
  grid-column: 1 / -1;
}

.no-results svg {
  margin: 0 auto 16px;
  opacity: .4
}

.no-results h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px
}

/* ========================================
   About Us Section
   ======================================== */
.about-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 32px;
  position: relative;
  z-index: 1;
}

.about-inner {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 36px 40px;
  text-align: center;
}

.about-inner h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 18px;
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

.about-inner p {
  font-size: .92rem;
  color: var(--text-secondary);
  line-height: 2;
  max-width: 800px;
  margin: 0 auto;
}

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 32px 32px;
  font-size: .78rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-color);
  position: relative;
  z-index: 1;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-contact {
  margin-top: 8px;
  font-size: .72rem;
}

.footer-contact a {
  color: var(--accent-light);
  transition: color var(--transition);
}

.footer-contact a:hover {
  color: var(--accent);
}

/* ---------- Animations ---------- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

@keyframes cardExpand {
  from {
    opacity: .85;
    transform: scale(.97)
  }

  to {
    opacity: 1;
    transform: scale(1)
  }
}

/* stagger children */
.product-card:nth-child(1) {
  animation-delay: .02s
}

.product-card:nth-child(2) {
  animation-delay: .06s
}

.product-card:nth-child(3) {
  animation-delay: .1s
}

.product-card:nth-child(4) {
  animation-delay: .14s
}

.product-card:nth-child(5) {
  animation-delay: .18s
}

.product-card:nth-child(6) {
  animation-delay: .22s
}

.product-card:nth-child(7) {
  animation-delay: .26s
}

.product-card:nth-child(8) {
  animation-delay: .3s
}

.product-card:nth-child(9) {
  animation-delay: .34s
}

.product-card:nth-child(10) {
  animation-delay: .38s
}

.product-card:nth-child(11) {
  animation-delay: .42s
}

.product-card:nth-child(12) {
  animation-delay: .46s
}

/* ---------- Responsive ---------- */
@media(max-width:1100px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 22px
  }

  .expanded-description {
    width: 320px;
  }
}

@media(max-width:768px) {
  .header-inner {
    padding: 10px 18px;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .logo {
    gap: 8px;
  }

  .logo-img {
    height: 46px;
  }

  .logo-img-secondary {
    height: 28px;
  }

  .logo-text {
    font-size: 1rem;
  }

  .contact-bar {
    gap: 4px;
    justify-content: center;
  }

  .contact-item {
    padding: 4px 8px;
    font-size: .68rem;
  }

  .contact-item span {
    display: none;
  }

  .contact-item svg {
    width: 16px;
    height: 16px;
  }

  .filter-section,
  .gallery-section {
    padding-left: 18px;
    padding-right: 18px
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px
  }

  .expanded-body {
    flex-direction: column;
  }

  .expanded-description {
    width: 100%;
    max-height: none;
    border-right: none;
    border-top: 1px solid var(--border-color);
  }

  .expanded-main-image {
    max-height: 360px
  }

  .expanded-main-image img {
    max-height: 360px
  }

  .thumbnail-item {
    width: 72px;
    height: 54px
  }

  .about-inner {
    padding: 24px 20px;
  }

  .about-inner h2 {
    font-size: 1.1rem;
  }

  .about-inner p {
    font-size: .85rem;
  }
}

@media(max-width:480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 18px
  }

  .filter-btn {
    padding: 8px 16px;
    font-size: .78rem
  }

  .expanded-main-image {
    max-height: 280px
  }

  .expanded-main-image img {
    max-height: 280px
  }

  .thumbnail-item {
    width: 64px;
    height: 48px
  }

  .logo-img {
    height: 40px;
  }

  .logo-img-secondary {
    height: 24px;
  }
}

/* ========================================
   Content Protection — Disable Copy & Download
   ======================================== */

/* Disable text selection globally */
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Disable image dragging */
img {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  pointer-events: auto;
}

/* ========================================
   Language Toggle Button
   ======================================== */
#langToggleBtn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 40px;
  background: var(--bg-card);
  border: 1px solid rgba(108, 92, 231, .4);
  color: var(--accent-light);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .05em;
  transition: all var(--transition);
  flex-shrink: 0;
  white-space: nowrap;
}

#langToggleBtn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

#langToggleBtn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* English brand text (replaces logo2.png in EN mode) */
.lang-brand-text {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -.01em;
  background: linear-gradient(135deg, #f39c12, #e67e22);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
  font-family: 'Inter', system-ui, sans-serif;
}

/* Co., Ltd. sub-text */
.lang-subtitle-text {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  letter-spacing: .04em;
}

/* Hide contact label text for social icons (keep phone number) */
.contact-item.contact-social span {
  display: none;
}

/* ========================================
   LTR (English) mode overrides
   ======================================== */

/* Flip bullet position for LTR */
[dir="ltr"] .expanded-description ul li {
  padding: 4px 0 4px 20px;
}

[dir="ltr"] .expanded-description ul li::before {
  right: auto;
  left: 0;
}

/* Description panel border flips side in LTR */
[dir="ltr"] .expanded-description {
  border-right: none;
  border-left: 1px solid var(--border-color);
}

/* Adjust body blobs for LTR */
[dir="ltr"] body::before {
  left: auto;
  right: -120px;
}

[dir="ltr"] body::after {
  right: auto;
  left: -100px;
}

@media(max-width:768px) {
  #langToggleBtn {
    padding: 6px 12px;
    font-size: .72rem;
  }
}