/* Lapinvilla — Arctic wool textile brand */

:root {
  --arctic: #F5F7F6;
  --pine: #1B3A2F;
  --berry: #8B3A4A;
  --pine-light: #2A5244;
  --berry-light: #A84D5F;
  --mist: #E8EDEA;
  --shadow: rgba(27, 58, 47, 0.12);
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Karla', system-ui, sans-serif;
  --max-width: 1200px;
  --header-h: 72px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--pine);
  background: var(--arctic);
  -webkit-font-smoothing: antialiased;
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ── Header ── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245, 247, 246, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(27, 58, 47, 0.08);
  height: var(--header-h);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.brand-icon {
  width: 36px;
  height: 36px;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--pine);
}

.brand-tagline {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--berry);
  margin-top: -2px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.main-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  position: relative;
  transition: color 0.2s;
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--berry);
  transition: width 0.25s ease;
}

.main-nav a:hover::after,
.main-nav a:focus-visible::after {
  width: 100%;
}

.cart-trigger {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  transition: background 0.2s;
}

.cart-trigger:hover {
  background: var(--mist);
}

.cart-trigger svg {
  width: 22px;
  height: 22px;
  stroke: var(--pine);
  fill: none;
  stroke-width: 1.8;
}

.cart-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--berry);
  color: var(--arctic);
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.2s, transform 0.2s;
}

.cart-badge.is-visible {
  opacity: 1;
  transform: scale(1);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  font-size: 1.4rem;
  color: var(--pine);
}

/* ── Hero ── */

.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--pine);
  color: var(--arctic);
}

.hero-stitches {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-evenly;
  pointer-events: none;
}

.hero-stitch {
  width: 1px;
  height: 100%;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(245, 247, 246, 0.06) 15%,
    rgba(245, 247, 246, 0.12) 50%,
    rgba(245, 247, 246, 0.06) 85%,
    transparent 100%
  );
}

.hero-stitch:nth-child(odd) {
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(139, 58, 74, 0.08) 20%,
    rgba(139, 58, 74, 0.15) 50%,
    rgba(139, 58, 74, 0.08) 80%,
    transparent 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 4rem 1.5rem;
  max-width: 720px;
}

.hero-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--berry-light);
  margin-bottom: 1.5rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.hero-subtitle {
  font-size: 1.15rem;
  line-height: 1.7;
  opacity: 0.85;
  margin-bottom: 2.5rem;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 2rem;
  background: var(--berry);
  color: var(--arctic);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  border-radius: 2px;
  transition: background 0.2s, transform 0.15s;
}

.btn-primary:hover {
  background: var(--berry-light);
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: 1.5px solid var(--pine);
  color: var(--pine);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 2px;
  transition: background 0.2s, color 0.2s;
}

.btn-secondary:hover {
  background: var(--pine);
  color: var(--arctic);
}

.hero-bottom-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to top, var(--arctic), transparent);
  pointer-events: none;
}

/* ── Sections ── */

.section {
  padding: 6rem 1.5rem;
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-label {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--berry);
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  color: var(--pine);
}

/* ── Story ── */

.story {
  background: var(--arctic);
}

.story-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.story-text p {
  margin-bottom: 1.25rem;
  color: var(--pine-light);
}

.story-text p:last-child {
  margin-bottom: 0;
}

.story-visual {
  position: relative;
  aspect-ratio: 4/3;
  background: var(--mist);
  border: 2px solid var(--pine);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.story-visual::before {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1px dashed rgba(139, 58, 74, 0.3);
}

.story-visual-inner {
  text-align: center;
  padding: 2rem;
}

.story-year {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 300;
  color: var(--berry);
  opacity: 0.4;
  line-height: 1;
}

.story-location {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 0.5rem;
  color: var(--pine);
}

/* ── Products ── */

.products {
  background: var(--mist);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.product-card {
  background: var(--arctic);
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.product-card::before {
  content: '';
  position: absolute;
  inset: -3px;
  border: 2px solid var(--pine);
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 3px,
      rgba(27, 58, 47, 0.04) 3px,
      rgba(27, 58, 47, 0.04) 4px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 3px,
      rgba(27, 58, 47, 0.04) 3px,
      rgba(27, 58, 47, 0.04) 4px
    );
  pointer-events: none;
  z-index: 1;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px var(--shadow);
}

.product-image {
  aspect-ratio: 4/3;
  overflow: hidden;
  border-bottom: 1px solid rgba(27, 58, 47, 0.1);
}

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

.product-body {
  padding: 1.5rem;
  position: relative;
  z-index: 2;
}

.product-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.product-desc {
  font-size: 0.9rem;
  color: var(--pine-light);
  margin-bottom: 1.25rem;
  line-height: 1.55;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.product-price {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--berry);
}

.btn-add {
  padding: 0.65rem 1.25rem;
  background: var(--pine);
  color: var(--arctic);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  border-radius: 2px;
  transition: background 0.2s;
  white-space: nowrap;
}

.btn-add:hover {
  background: var(--pine-light);
}

/* ── Values ── */

.values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  margin-top: 2rem;
}

.value-card {
  text-align: center;
  padding: 2rem 1.5rem;
}

.value-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--pine);
  border-radius: 50%;
}

.value-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--berry);
  fill: none;
  stroke-width: 1.8;
}

.value-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.value-text {
  font-size: 0.9rem;
  color: var(--pine-light);
  line-height: 1.6;
}

/* ── Contact ── */

.contact {
  background: var(--pine);
  color: var(--arctic);
}

.contact .section-label {
  color: var(--berry-light);
}

.contact .section-title {
  color: var(--arctic);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.contact-item svg {
  width: 20px;
  height: 20px;
  stroke: var(--berry-light);
  fill: none;
  stroke-width: 1.8;
  flex-shrink: 0;
  margin-top: 3px;
}

.contact-item a {
  color: var(--arctic);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.contact-item a:hover {
  color: var(--berry-light);
}

.legal-block {
  padding: 2rem;
  background: rgba(245, 247, 246, 0.06);
  border: 1px solid rgba(245, 247, 246, 0.12);
  font-size: 0.9rem;
  line-height: 1.8;
  opacity: 0.9;
}

.legal-block strong {
  font-weight: 600;
}

/* ── Footer ── */

.site-footer {
  padding: 2.5rem 1.5rem;
  background: #142E25;
  color: rgba(245, 247, 246, 0.7);
  font-size: 0.85rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--arctic);
}

/* ── Cart Drawer ── */

.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(27, 58, 47, 0.5);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.cart-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 100vw);
  height: 100vh;
  background: var(--arctic);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -8px 0 32px var(--shadow);
}

.cart-drawer.is-open {
  transform: translateX(0);
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid rgba(27, 58, 47, 0.1);
}

.cart-header h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
}

.cart-close {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--pine);
  border-radius: 50%;
  transition: background 0.2s;
}

.cart-close:hover {
  background: var(--mist);
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
}

.cart-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--pine-light);
  font-size: 0.95rem;
}

.cart-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(27, 58, 47, 0.08);
  align-items: center;
}

.cart-item-image {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border: 1px solid rgba(27, 58, 47, 0.1);
}

.cart-item-info h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.cart-item-price {
  font-size: 0.85rem;
  color: var(--berry);
  font-weight: 600;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.qty-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--pine);
  border-radius: 2px;
  font-size: 1rem;
  color: var(--pine);
  transition: background 0.15s;
}

.qty-btn:hover {
  background: var(--mist);
}

.qty-value {
  font-size: 0.9rem;
  font-weight: 600;
  min-width: 24px;
  text-align: center;
}

.cart-item-remove {
  color: var(--pine-light);
  font-size: 0.8rem;
  text-decoration: underline;
  margin-top: 0.35rem;
  display: inline-block;
}

.cart-item-remove:hover {
  color: var(--berry);
}

.cart-item-total {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  text-align: right;
}

.cart-footer {
  padding: 1.5rem;
  border-top: 1px solid rgba(27, 58, 47, 0.1);
  background: var(--mist);
}

.cart-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1.25rem;
}

.cart-subtotal span:first-child {
  font-size: 0.95rem;
  font-weight: 500;
}

.cart-subtotal span:last-child {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--berry);
}

.btn-checkout {
  width: 100%;
  padding: 1rem;
  background: var(--pine);
  color: var(--arctic);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 2px;
  transition: background 0.2s;
}

.btn-checkout:hover {
  background: var(--pine-light);
}

.btn-checkout:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Checkout Modal ── */

.checkout-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.checkout-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.checkout-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(27, 58, 47, 0.6);
}

.checkout-panel {
  position: relative;
  background: var(--arctic);
  padding: 2.5rem;
  max-width: 440px;
  width: 100%;
  border: 2px solid var(--pine);
  transform: translateY(20px);
  transition: transform 0.3s;
}

.checkout-modal.is-open .checkout-panel {
  transform: translateY(0);
}

.checkout-panel h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.checkout-panel p {
  font-size: 0.9rem;
  color: var(--pine-light);
  margin-bottom: 1.5rem;
}

.checkout-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.checkout-form input {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--pine);
  background: var(--arctic);
  font-family: inherit;
  font-size: 1rem;
  border-radius: 2px;
  margin-bottom: 1.25rem;
}

.checkout-form input:focus {
  outline: none;
  border-color: var(--berry);
}

.checkout-actions {
  display: flex;
  gap: 1rem;
}

.checkout-actions .btn-primary {
  flex: 1;
  justify-content: center;
}

.checkout-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--pine);
}

/* ── Success Message ── */

.success-message {
  text-align: center;
  padding: 1rem 0;
}

.success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
  border: 2px solid var(--pine);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-icon svg {
  width: 28px;
  height: 28px;
  stroke: var(--berry);
  fill: none;
  stroke-width: 2;
}

.success-message h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
  color: var(--pine);
}

.success-message p {
  font-size: 0.95rem;
  color: var(--pine-light);
  margin-bottom: 1.5rem;
}

/* ── Cookie Banner ── */

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 150;
  background: var(--pine);
  color: var(--arctic);
  padding: 1.25rem 1.5rem;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-banner.is-visible {
  transform: translateY(0);
}

.cookie-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.cookie-text {
  font-size: 0.9rem;
  line-height: 1.55;
  flex: 1;
  min-width: 280px;
}

.cookie-text a {
  color: var(--berry-light);
  text-decoration: underline;
}

.cookie-actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.btn-cookie-accept {
  padding: 0.65rem 1.5rem;
  background: var(--berry);
  color: var(--arctic);
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 2px;
  transition: background 0.2s;
}

.btn-cookie-accept:hover {
  background: var(--berry-light);
}

.btn-cookie-decline {
  padding: 0.65rem 1.5rem;
  border: 1.5px solid rgba(245, 247, 246, 0.4);
  color: var(--arctic);
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 2px;
  transition: border-color 0.2s, background 0.2s;
}

.btn-cookie-decline:hover {
  border-color: var(--arctic);
  background: rgba(245, 247, 246, 0.08);
}

/* ── Legal Pages ── */

.legal-page {
  padding: 3rem 1.5rem 5rem;
  min-height: calc(100vh - var(--header-h));
}

.legal-content {
  max-width: 760px;
  margin: 0 auto;
}

.legal-content h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--pine);
}

.legal-updated {
  font-size: 0.85rem;
  color: var(--pine-light);
  margin-bottom: 2.5rem;
}

.legal-content h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 500;
  margin: 2rem 0 1rem;
  color: var(--pine);
}

.legal-content p,
.legal-content li {
  margin-bottom: 1rem;
  color: var(--pine-light);
  line-height: 1.7;
}

.legal-content ul {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.legal-content a {
  color: var(--berry);
  text-decoration: underline;
}

/* ── Responsive ── */

@media (max-width: 900px) {
  .story-grid,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .values-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .products-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .main-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--arctic);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.25rem;
    border-bottom: 1px solid rgba(27, 58, 47, 0.1);
    box-shadow: 0 8px 24px var(--shadow);
  }

  .main-nav.is-open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .header-inner {
    position: relative;
  }

  .hero {
    min-height: 75vh;
  }

  .section {
    padding: 4rem 1.5rem;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .cookie-inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .product-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-add {
    text-align: center;
  }
}
