:root {
  --c-bg: #fff;
  --c-text: #0a0a0a;
  --c-muted: #727272;
  --c-accent: #111827;
  --c-accent-2: #2563eb;
  --c-border: #e5e7eb;
  --c-success: #059669;
  --c-error: #dc2626;
  
  --container: 1200px;
  --radius: 10px;
  --radius-sm: 6px;
  
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  
  --transition: all 0.2s ease-in-out;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--c-accent-2);
}

button {
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
}

/* Container */
.qm-container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.qm-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--c-border);
  backdrop-filter: blur(8px);
}

.qm-header .qm-container {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 64px;
}

.qm-header__left {
  flex: 0 0 auto;
}

.qm-nav {
  flex: 1;
}

.qm-nav__menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.qm-nav a {
  font-weight: 500;
  padding: 8px 0;
}

.qm-header__right {
  display: flex;
  gap: 14px;
  align-items: center;
}

.qm-cart {
  position: relative;
}

.qm-cart .count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--c-accent-2);
  color: #fff;
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
  line-height: 1;
}

/* Hero Slider */
.qm-hero {
  position: relative;
  overflow: hidden;
  background: #000;
  color: #fff;
}

.qm-hero__slider {
  position: relative;
}

.qm-slide {
  position: relative;
  min-height: 64vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 80px 16px;
  background-size: cover;
  background-position: center;
  background-image: var(--bg);
  opacity: 0;
  transform: translateX(2%);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.qm-slide::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.2) 100%);
}

.qm-slide > * {
  position: relative;
  z-index: 2;
}

.qm-slide.is-active {
  opacity: 1;
  transform: none;
}

.qm-slide__title {
  font-size: clamp(28px, 4vw, 54px);
  margin: 0.3em 0;
  font-weight: 800;
  line-height: 1.1;
}

.qm-slide__subtitle {
  color: #e5e7eb;
  margin-bottom: 18px;
  font-size: 1.125rem;
}

.qm-slide__layer {
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #cbd5e1;
  font-size: 0.875rem;
  font-weight: 600;
}

.qm-anim-up {
  opacity: 0;
  transform: translateY(8px);
  transition: transform 0.5s ease, opacity 0.5s ease;
  transition-delay: var(--delay, 0ms);
}

.qm-slide.is-active .qm-anim-up {
  opacity: 1;
  transform: none;
}

.qm-btn {
  display: inline-block;
  background: var(--c-accent-2);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  border: 2px solid transparent;
}

.qm-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.qm-hero__prev,
.qm-hero__next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 28px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  backdrop-filter: blur(8px);
  z-index: 10;
}

.qm-hero__prev:hover,
.qm-hero__next:hover {
  background: rgba(255, 255, 255, 0.25);
}

.qm-hero__prev {
  left: 20px;
}

.qm-hero__next {
  right: 20px;
}

/* Sections */
.qm-section {
  padding: 60px 0;
}

.qm-section__header {
  text-align: center;
  margin-bottom: 40px;
}

.qm-section__header h2 {
  font-size: 2.25rem;
  font-weight: 700;
  margin: 0 0 16px 0;
}

/* Product Grid */
.woocommerce ul.products {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Product Cards */
.qm-product {
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
}

.qm-product:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--c-accent-2);
}

.qm-product__thumb {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #f7f7f7;
  position: relative;
}

.qm-product__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.qm-product:hover .qm-product__thumb img {
  transform: scale(1.05);
}

.qm-product__body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.qm-product__title {
  font-weight: 600;
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
}

.qm-product__actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: auto;
}

.qm-product .button {
  background: var(--c-accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.875rem;
  font-weight: 500;
  flex: 1;
}

.qm-product .button:hover {
  background: var(--c-accent-2);
}

.qm-product .price {
  color: var(--c-accent-2);
  font-weight: 700;
  font-size: 1.125rem;
}

.qm-product__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--c-success);
  color: white;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 2;
}

.qm-product__badge--sale {
  background: var(--c-error);
}

.star-rating {
  margin: 8px 0;
}

/* Shop Tools */
.qm-shop-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 24px 0;
  gap: 16px;
  flex-wrap: wrap;
}

.qm-grid-toggle {
  display: flex;
  gap: 8px;
}

.qm-grid-toggle button {
  border: 1px solid var(--c-border);
  background: #fff;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.qm-grid-toggle .is-active {
  background: var(--c-accent);
  color: #fff;
  border-color: var(--c-accent);
}

/* Offcanvas */
.qm-offcanvas {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: none;
  z-index: 100;
}

.qm-offcanvas[aria-hidden="false"] {
  display: block;
}

.qm-offcanvas__inner {
  position: absolute;
  top: 0;
  right: 0;
  width: min(90vw, 360px);
  height: 100%;
  background: #fff;
  padding: 24px;
  overflow: auto;
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
}

.qm-offcanvas[aria-hidden="false"] .qm-offcanvas__inner {
  transform: translateX(0);
}

.qm-offcanvas__close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 28px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Single Product */
.qm-single {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: start;
}

/* Footer */
.qm-footer {
  border-top: 1px solid var(--c-border);
  padding: 40px 0;
  margin-top: 60px;
  color: var(--c-muted);
  font-size: 0.875rem;
  background: #f8fafc;
}

/* List view for grid toggle */
.products.qm-grid-list {
  grid-template-columns: 1fr !important;
  gap: 1rem;
}

.products.qm-grid-list .qm-product {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1rem;
  align-items: start;
}

.products.qm-grid-list .qm-product__thumb {
  aspect-ratio: 1;
}

.products.qm-grid-list .qm-product__body {
  padding: 1rem 1rem 1rem 0;
}

/* Responsive */
@media (max-width: 1024px) {
  .woocommerce ul.products {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}

@media (max-width: 900px) {
  .qm-single {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  
  .woocommerce ul.products {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .qm-nav__menu {
    gap: 12px;
  }
  
  .products.qm-grid-list .qm-product {
    grid-template-columns: 80px 1fr;
  }
}

@media (max-width: 640px) {
  .qm-section {
    padding: 40px 0;
  }
  
  .woocommerce ul.products {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .qm-shop-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .qm-grid-toggle {
    justify-content: center;
  }
  
  .qm-hero__prev,
  .qm-hero__next {
    width: 40px;
    height: 40px;
    font-size: 24px;
  }
  
  .qm-slide {
    min-height: 50vh;
    padding: 60px 16px;
  }
  
  .products.qm-grid-list .qm-product {
    grid-template-columns: 1fr;
  }
  
  .products.qm-grid-list .qm-product__body {
    padding: 1rem;
  }
}

/* Utility Classes */
.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;
}

.text-center {
  text-align: center;
}