/* ============================================
   東光化学 WordPress Theme - Components
   Reusable UI components
   ============================================ */

/* ── Reset & Base ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--lh-normal);
  color: var(--text-body);
  background-color: var(--white);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  color: var(--text-dark);
}

/* ── Container ── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container--wide {
  max-width: var(--container-wide);
}

.container--narrow {
  max-width: var(--container-narrow);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-8);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--gradient-shimmer);
  transition: left var(--duration-slow) var(--ease-out);
}

.btn:hover::after {
  left: 100%;
}

.btn--primary {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}

.btn--primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.btn--outline {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
}

.btn--outline:hover {
  background: var(--white);
  color: var(--primary);
  transform: translateY(-2px);
}

.btn--outline-dark {
  background: transparent;
  color: var(--text-dark);
  border-color: var(--text-dark);
}

.btn--outline-dark:hover {
  background: var(--text-dark);
  color: var(--white);
  transform: translateY(-2px);
}

.btn--lg {
  padding: var(--space-4) var(--space-10);
  font-size: var(--text-base);
}

.btn--icon {
  padding: var(--space-3);
  border-radius: var(--radius-full);
}

/* ── Section Titles ── */
.section-title {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-title__label {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-3);
  position: relative;
}

.section-title__label::before,
.section-title__label::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 30px;
  height: 1px;
  background: var(--accent);
}

.section-title__label::before {
  right: calc(100% + 12px);
}

.section-title__label::after {
  left: calc(100% + 12px);
}

.section-title__heading {
  font-size: var(--text-4xl);
  font-weight: var(--fw-bold);
  margin-bottom: var(--space-4);
}

.section-title__desc {
  font-size: var(--text-lg);
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* ── Product Cards ── */
.product-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow-card);
  transition: all var(--duration-normal) var(--ease-out);
  cursor: pointer;
}

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

.product-card__image {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
}

.product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out);
}

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

.product-card__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-8) var(--space-6) var(--space-6);
  background: var(--gradient-card);
  color: var(--white);
}

.product-card__badge {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  background: var(--accent);
  color: var(--white);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-2);
}

.product-card__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--fw-bold);
  margin-bottom: var(--space-2);
  color: var(--white);
}

.product-card__subtitle {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.8);
  line-height: var(--lh-relaxed);
}

.product-card__arrow {
  position: absolute;
  bottom: var(--space-4);
  right: var(--space-4);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-full);
  color: var(--white);
  font-size: var(--text-lg);
  transition: all var(--duration-normal) var(--ease-out);
}

.product-card:hover .product-card__arrow {
  background: var(--accent);
  transform: translateX(4px);
}

/* ── Promo Card (3-column compact) ── */
.promo-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  transition: all var(--duration-normal) var(--ease-out);
  cursor: pointer;
}

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

.promo-card--dark {
  background: var(--gradient-hero);
  color: var(--white);
}

.promo-card--light {
  background: var(--bg-light);
  color: var(--text-dark);
}

.promo-card--accent {
  background: linear-gradient(135deg, #00a0aa 0%, #007080 100%);
  color: var(--white);
}

.promo-card__content {
  flex: 1;
  padding: var(--space-6) var(--space-6) var(--space-4);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.promo-card__label {
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-3);
}

.promo-card--dark .promo-card__label,
.promo-card--accent .promo-card__label {
  color: var(--accent-light);
}

.promo-card__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--fw-extrabold);
  line-height: var(--lh-tight);
  margin-bottom: var(--space-3);
}

.promo-card--dark .promo-card__title,
.promo-card--accent .promo-card__title {
  color: var(--white);
}

.promo-card__desc {
  font-size: var(--text-sm);
  line-height: var(--lh-relaxed);
  margin-bottom: var(--space-4);
  max-width: 100%;
}

.promo-card--dark .promo-card__desc {
  color: var(--text-on-dark-muted);
}

.promo-card__image {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
  max-height: 200px;
  overflow: hidden;
}

.promo-card__image img {
  max-height: 180px;
  object-fit: contain;
  transition: transform var(--duration-slow) var(--ease-out);
}

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

/* ── News Cards ── */
.news-card {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--border-light);
  transition: all var(--duration-fast) var(--ease-out);
}

.news-card:hover {
  padding-left: var(--space-3);
}

.news-card__date {
  flex-shrink: 0;
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: var(--fw-medium);
  min-width: 110px;
}

.news-card__tag {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  background: var(--accent);
  color: var(--white);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  border-radius: var(--radius-full);
  min-width: 60px;
  justify-content: center;
}

.news-card__title {
  font-size: var(--text-base);
  font-weight: var(--fw-medium);
  color: var(--text-dark);
  transition: color var(--duration-fast) var(--ease-out);
}

.news-card:hover .news-card__title {
  color: var(--accent);
}

/* ── Tab Navigation ── */
.tabs {
  display: flex;
  justify-content: center;
  gap: var(--space-1);
  margin-bottom: var(--space-10);
  background: var(--bg-light);
  border-radius: var(--radius-full);
  padding: var(--space-1);
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.tab-btn {
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-dark);
}

.tab-btn.active {
  background: var(--white);
  color: var(--text-dark);
  box-shadow: var(--shadow-sm);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: grid;
  animation: fadeInUp var(--duration-normal) var(--ease-out);
}

/* ── Scroll Indicator ── */
.scroll-indicator {
  position: absolute;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  color: rgba(255, 255, 255, 0.6);
  font-size: var(--text-xs);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  animation: float 2s ease-in-out infinite;
}

.scroll-indicator__line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.6), transparent);
}

/* ── Back to Top ── */
.back-to-top {
  position: fixed;
  bottom: var(--space-8);
  right: var(--space-8);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--duration-normal) var(--ease-out);
  z-index: var(--z-sticky);
  font-size: var(--text-xl);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--accent-hover);
  transform: translateY(-4px);
}

/* ── Animations ── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-8px); }
}

@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ── Scroll Animation Utility ── */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.animate-on-scroll.delay-1 { transition-delay: 100ms; }
.animate-on-scroll.delay-2 { transition-delay: 200ms; }
.animate-on-scroll.delay-3 { transition-delay: 300ms; }
.animate-on-scroll.delay-4 { transition-delay: 400ms; }

/* ── Loading Skeleton ── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-light) 25%,
    var(--bg-section) 50%,
    var(--bg-light) 75%
  );
  background-size: 2000px 100%;
  animation: shimmer 2s infinite linear;
  border-radius: var(--radius-md);
}
