/* Fingerblades — light, minimal, product-focused */

:root {
  --bg: #fafafa;
  --surface: #fff;
  --text: #1a1a1a;
  --text-muted: #666;
  --border: #e5e5e5;
  --accent: #ed6933;
  --accent-hover: #d45a2b;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.06);
  --space: 1.5rem;
  --max-width: 1100px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

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

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space);
}

/* Header — inner aligned with .container (product cards) */
.header {
  --header-height: 56px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  height: var(--header-height);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.header-inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 100%;
}

.header-inner .logo {
  justify-self: start;
}

.header-inner .nav {
  justify-self: center;
}

.header-inner .cart-trigger {
  justify-self: end;
}

.logo {
  display: flex;
  align-items: center;
  height: calc(var(--header-height) * 0.9);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
}
.logo:hover {
  text-decoration: none;
  color: var(--accent);
}
.logo-img {
  height: 100%;
  width: auto;
  display: block;
  object-fit: contain;
}
.logo-text {
  display: none; /* shown via onerror when logo.png missing */
  font-size: calc(var(--header-height) * 0.9 * 0.55);
  line-height: 1;
}
.logo-text {
  display: none; /* shown via onerror when logo.png missing */
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.nav a {
  color: var(--text-muted);
  text-decoration: none;
}
.nav a:hover {
  color: var(--text);
}

.cart-trigger {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1rem;
}
.cart-trigger:hover {
  background: var(--bg);
}
.cart-count {
  min-width: 1.25rem;
  padding: 0.15rem 0.4rem;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.cart-count:empty,
body:not(.cart-has-items) .cart-count {
  display: none;
}
body.cart-has-items .cart-count {
  display: inline-block;
}

/* Hero */
.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-video-wrap {
  position: absolute;
  inset: 0;
}
.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.2), rgba(0,0,0,.5));
}
.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #fff;
  padding: 2rem;
}
.hero-title {
  margin: 0 0 0.5rem;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.hero-tagline {
  margin: 0;
  font-size: 1.15rem;
  opacity: .95;
}

/* About */
.about {
  padding: 4rem 0;
  background: var(--surface);
}
.about h2 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  text-align: center;
}
.about-lead {
  text-align: center;
  color: var(--text-muted);
  margin: 0 0 2.5rem;
  max-width: 36em;
  margin-left: auto;
  margin-right: auto;
}
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
}
.about-item {
  text-align: center;
  padding: 1rem;
}
.about-icon {
  display: block;
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--accent);
}
.about-item h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}
.about-item p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Products */
.products {
  padding: 4rem 0;
  background: var(--bg);
}
.products h2 {
  margin: 0 0 2rem;
  font-size: 1.75rem;
  text-align: center;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2rem;
}
.product-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.product-image {
  aspect-ratio: 5/3;
  background: var(--border);
  overflow: hidden;
  position: relative;
}
.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Product carousel */
.product-carousel {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
}
.product-carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
}
.product-carousel .carousel-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.product-carousel .carousel-slide.active {
  opacity: 1;
  pointer-events: auto;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0.8;
}
.carousel-btn:hover {
  opacity: 1;
  background: #fff;
}
.carousel-prev { left: 0.5rem; }
.carousel-next { right: 0.5rem; }
.carousel-dots {
  position: absolute;
  bottom: 0.5rem;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  z-index: 2;
}
.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  padding: 0;
}
.carousel-dot:hover,
.carousel-dot.active {
  background: #fff;
}
.product-name {
  margin: 1rem 1rem 0;
  font-size: 1.1rem;
}
.product-price {
  margin: 0 1rem;
  font-weight: 600;
  color: var(--accent);
}
.product-actions {
  margin-top: auto;
  padding: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.qty-control {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.qty-btn {
  width: 2rem;
  height: 2rem;
  border: none;
  background: var(--bg);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}
.qty-btn:hover {
  background: var(--border);
}
.qty-input {
  width: 2.5rem;
  height: 2rem;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  text-align: center;
  font-size: 0.95rem;
}
.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  cursor: pointer;
  font-weight: 500;
}
.btn-add {
  background: var(--accent);
  color: #fff;
}
.btn-add:hover {
  background: var(--accent-hover);
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  padding: 0.65rem 1.25rem;
  width: 100%;
}
.btn-primary:hover {
  background: var(--accent-hover);
}

/* Checkout block */
.checkout-block {
  padding: 4rem 0;
  background: var(--surface);
  text-align: center;
}
.checkout-block h2 {
  margin: 0 0 1rem;
  font-size: 1.75rem;
}
.payment-notice {
  max-width: 32em;
  margin: 0 auto 1.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.btn-checkout {
  max-width: 280px;
}

/* Cart drawer */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 380px;
  height: 100%;
  background: var(--surface);
  box-shadow: -4px 0 20px rgba(0,0,0,.1);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .25s ease;
}
.cart-drawer.is-open {
  transform: translateX(0);
}
.cart-drawer[aria-hidden="false"] {
  transform: translateX(0);
}
.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.cart-header h3 {
  margin: 0;
  font-size: 1.25rem;
}
.cart-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  color: var(--text-muted);
}
.cart-close:hover {
  color: var(--text);
}
.cart-body {
  flex: 1;
  overflow: auto;
  padding: 1rem 1.5rem;
}
.cart-empty {
  color: var(--text-muted);
  margin: 0;
}
.cart-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.cart-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  gap: 0.5rem;
}
.cart-list .cart-item-name {
  flex: 1;
}
.cart-list .cart-item-qty {
  color: var(--text-muted);
  font-size: 0.9rem;
}
.cart-list .cart-item-total {
  font-weight: 600;
}
.cart-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
}
.cart-subtotal,
.cart-shipping {
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.cart-total {
  margin: 0.5rem 0 0.75rem;
  font-size: 1.1rem;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s, visibility .2s;
}
.modal-overlay.is-open,
.modal-overlay[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  max-width: 420px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,.15);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
}
.modal-close:hover {
  color: var(--text);
}
.checkout-form {
  padding: 1.5rem;
}
.checkout-form label {
  display: block;
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  font-weight: 500;
}
.checkout-form input,
.checkout-form textarea,
.checkout-form select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  margin-bottom: 0.25rem;
}
.checkout-form select {
  cursor: pointer;
  background: var(--surface);
}
.checkout-form input:focus,
.checkout-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.checkout-form .field-error {
  display: block;
  font-size: 0.8rem;
  color: #b91c1c;
  margin-bottom: 0.75rem;
}
.checkout-form .required {
  color: #b91c1c;
}
.checkout-summary {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border-radius: var(--radius);
  font-size: 0.95rem;
}
.checkout-summary strong {
  float: right;
}
.checkout-form button[type="submit"] {
  margin-top: 1rem;
}
.form-status {
  margin: 1rem 0 0;
  font-size: 0.9rem;
  min-height: 1.2em;
}
.form-status.success {
  color: #15803d;
}
.form-status.error {
  color: #b91c1c;
}

/* Footer */
.footer {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
}

/* Responsive */
@media (max-width: 640px) {
  .nav {
    gap: 1rem;
  }
  .product-grid {
    grid-template-columns: 1fr;
  }
  .product-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .qty-control {
    justify-content: center;
  }
}
