/*
Theme Name: Z Layer Commerce
Theme URI: https://example.com/z-layer-commerce
Author: OpenAI
Description: WordPress theme converted from the Z Layer storefront into an affiliate-ready catalog and editorial theme.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: zlc
*/

:root {
  --background: #0a0a0a;
  --foreground: #f2f2f2;
  --card: #121212;
  --card-foreground: #f2f2f2;
  --secondary: #1f1f1f;
  --muted: #8c8c8c;
  --accent: #ffcc33;
  --accent-foreground: #111111;
  --border: #262626;
  --radius: 4px;
  --container: 1200px;
  --header-height: 72px;
  --font-body: "Inter", sans-serif;
  --font-display: "Cinzel", serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-body);
  line-height: 1.6;
}

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

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

button,
input,
textarea,
select {
  font: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6,
.font-display {
  font-family: var(--font-display);
}

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

.screen-reader-text:focus {
  clip: auto;
  clip-path: none;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  width: auto;
}

.container {
  width: min(calc(100% - 2rem), var(--container));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  background: rgba(10, 10, 10, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-nav {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.brand-mark img,
.custom-logo {
  max-height: 48px;
  width: auto;
}

.custom-logo-link {
  display: inline-flex;
  align-items: center;
}

.brand-text {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.9rem;
}

.menu-toggle {
  display: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--foreground);
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius);
}

.primary-menu,
.footer-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.primary-menu a,
.footer-menu a,
.term-chip,
.button,
.wp-block-button__link {
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.primary-menu a {
  color: var(--muted);
  font-size: 0.78rem;
  transition: color 0.25s ease;
}

.primary-menu a:hover,
.primary-menu .current-menu-item > a,
.primary-menu .current-menu-ancestor > a {
  color: var(--foreground);
}

.site-main {
  min-height: calc(100vh - var(--header-height));
}

.hero {
  position: relative;
  min-height: calc(100vh - var(--header-height));
  display: grid;
  place-items: center;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--hero-background);
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
  filter: saturate(0.95) contrast(1.02);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.78);
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 4rem 0;
}

.eyebrow {
  margin: 0 0 1.25rem;
  color: var(--accent);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.45em;
}

.hero-logo {
  margin: 0 auto 1.5rem;
  max-height: 240px;
  width: auto;
}

.hero .custom-logo-link,
.hero .custom-logo {
  display: inline-block;
}

.hero .custom-logo {
  max-height: 240px;
  width: auto;
}

.hero-logo img,
.hero .brand-mark img,
.hero .custom-logo {
  max-height: 240px;
  width: auto;
  margin: 0 auto;
}

.hero-copy {
  width: min(100%, 38rem);
  margin: 0 auto 2rem;
  color: #c8c8c8;
  font-size: clamp(1rem, 1.3vw, 1.2rem);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.button,
.wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--foreground);
  padding: 0.9rem 1.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.25s ease;
}

.button:hover,
.wp-block-button__link:hover {
  transform: translateY(-1px);
}

.button-primary,
.wp-block-button__link {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-foreground);
  box-shadow: 0 0 20px rgba(255, 204, 51, 0.35);
}

.button-secondary {
  background: transparent;
}

.section {
  padding: 5rem 0;
}

.section-alt {
  background: rgba(255, 255, 255, 0.03);
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2,
.archive-header h1,
.entry-title {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: clamp(2rem, 4vw, 3.5rem);
}

.section-divider {
  width: 48px;
  height: 2px;
  background: var(--accent);
  margin: 1rem auto 0;
}

.archive-header {
  padding: 3.5rem 0 2rem;
}

.archive-header p,
.entry-meta,
.muted {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.product-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.category-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.post-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.product-card,
.post-card,
.content-card,
.category-card {
  display: block;
}

.product-card-media,
.post-card-media,
.category-card-media,
.gallery-main {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--secondary);
}

.product-card-media {
  aspect-ratio: 3 / 4;
  margin-bottom: 1rem;
}

.post-card-media {
  aspect-ratio: 16 / 10;
  margin-bottom: 1rem;
}

.category-card {
  position: relative;
  min-height: 260px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.category-card-media {
  position: absolute;
  inset: 0;
}

.category-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.28;
  transition: transform 0.45s ease, opacity 0.45s ease;
}

.category-card:hover .category-card-media img {
  transform: scale(1.05);
  opacity: 0.42;
}

.category-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.58);
}

.category-card-content {
  position: relative;
  z-index: 1;
  min-height: 260px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.65s ease;
}

.product-card:hover .card-image,
.post-card:hover .card-image {
  transform: scale(1.05);
}

.product-card a,
.post-card a {
  text-decoration: none;
}

.product-card-title,
.post-card-title,
.category-card-title {
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.product-card-title {
  font-size: 0.95rem;
}

.post-card-title {
  font-size: 1.6rem;
}

.category-card-title {
  font-size: 1.6rem;
}

.price-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.price {
  color: var(--foreground);
  font-weight: 600;
}

.price-compare {
  color: var(--muted);
  text-decoration: line-through;
  font-size: 0.9rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-foreground);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.term-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.term-chip {
  display: inline-flex;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.7rem;
  transition: all 0.2s ease;
}

.term-chip:hover,
.term-chip.is-active {
  border-color: var(--accent);
  color: var(--accent);
}

.product-single {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  padding: 3.5rem 0 5rem;
}

.gallery-main {
  aspect-ratio: 4 / 5;
  max-height: 680px;
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-thumbs {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
  overflow-x: auto;
}

.gallery-thumb {
  flex: 0 0 72px;
  border: 2px solid var(--border);
  background: transparent;
  padding: 0;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
}

.gallery-thumb.is-active {
  border-color: var(--accent);
}

.gallery-thumb img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.single-price {
  font-size: 2rem;
  font-weight: 700;
  margin: 1rem 0;
}

.entry-content,
.page-content {
  color: #d3d3d3;
}

.entry-content > *:first-child,
.page-content > *:first-child {
  margin-top: 0;
}

.entry-content img,
.page-content img {
  border-radius: var(--radius);
}

.journal-single {
  width: min(calc(100% - 2rem), 820px);
  margin: 0 auto;
  padding: 3.5rem 0 5rem;
}

.journal-cover {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--secondary);
  border-radius: var(--radius);
  margin: 2rem 0;
}

.journal-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 3rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  padding: 3.5rem 0;
}

.footer-copy {
  color: var(--muted);
  max-width: 34rem;
}

.footer-title {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

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

.footer-list li + li {
  margin-top: 0.6rem;
}

.footer-list a {
  color: var(--muted);
}

.footer-list a:hover {
  color: var(--foreground);
}

.site-info {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.25rem 0 2rem;
  color: var(--muted);
  text-align: center;
  font-size: 0.78rem;
}

.content-shell {
  width: min(calc(100% - 2rem), 900px);
  margin: 0 auto;
  padding: 3.5rem 0 5rem;
}

.content-shell h1 {
  margin-top: 0;
}

.empty-state {
  text-align: center;
  padding: 4rem 0;
  color: var(--muted);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  padding-top: 2rem;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 42px;
  padding: 0 0.75rem;
  border: 1px solid var(--border);
  color: var(--muted);
}

.pagination .current,
.pagination .page-numbers:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.wp-block-group,
.wp-block-columns,
.wp-block-cover,
.wp-block-image {
  margin-bottom: 1.5rem;
}

@media (max-width: 960px) {
  .product-single,
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 782px) {
  .menu-toggle {
    display: inline-flex;
  }

  .nav-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(10, 10, 10, 0.98);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1rem;
    display: none;
  }

  .nav-panel.is-open {
    display: block;
  }

  .primary-menu {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-logo {
    max-height: 180px;
  }
}

@media (max-width: 640px) {
  .button-row {
    flex-direction: column;
  }

  .product-grid,
  .post-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 4rem 0;
  }
}
