/* ===== CSS Variables ===== */
:root {
  --background: #F7F6F2;
  --foreground: #100C0B;
  --card: #ffffff;
  --card-foreground: #100C0B;
  --muted: #eeedea;
  --muted-foreground: #5F5350;
  --primary: #100C0B;
  --primary-foreground: #F7F6F2;
  --border: #e5e3dd;
  --radius: 0.5rem;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-tagline: 'Montserrat', 'Inter', sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

/* ===== Container ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(247, 246, 242, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 9rem;
}

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

.logo-image {
  height: 7.5rem;
  width: auto;
}

.nav {
  display: flex;
  gap: 2rem;
}

.nav-link {
  font-family: var(--font-tagline);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--muted-foreground);
  letter-spacing: 0.03em;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--foreground);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cart-button {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--foreground);
}

.cart-count {
  position: absolute;
  top: 0;
  right: 0;
  background-color: var(--primary);
  color: var(--primary-foreground);
  font-size: 0.625rem;
  font-weight: 600;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-menu-button {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--foreground);
}

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

.hero-bg {
  position: absolute;
  inset: 0;
}

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

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(247, 246, 242, 0.85), rgba(247, 246, 242, 0.92));
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: var(--foreground);
  max-width: 640px;
  padding: 0 1.5rem;
}

.hero-tagline {
  font-family: var(--font-tagline);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  color: var(--muted-foreground);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 4.5rem;
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.hero-description {
  font-size: 1.25rem;
  line-height: 1.7;
  color: var(--muted-foreground);
  margin-bottom: 2rem;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  padding: 0.625rem 1.25rem;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-lg {
  padding: 0.875rem 2rem;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

/* ===== Sections ===== */
.section {
  padding: 5rem 0;
}

.section-muted {
  background-color: var(--muted);
}

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 3rem;
}

.section-label {
  display: inline-block;
  font-family: var(--font-tagline);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 400;
  letter-spacing: -0.025em;
  margin-bottom: 1rem;
}

.section-description {
  font-size: 1.0625rem;
  color: var(--muted-foreground);
  line-height: 1.7;
}

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

.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.product-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.product-image-wrapper {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background-color: var(--muted);
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.product-card:hover .product-image {
  transform: scale(1.03);
}

.product-info {
  padding: 1.25rem;
}

.product-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.product-name {
  font-size: 1.125rem;
  font-weight: 600;
}

.product-color {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  border: 2px solid var(--border);
}

.product-details {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  margin-bottom: 0.75rem;
}

.product-price {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.product-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.size-select {
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--background);
  color: var(--foreground);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

.size-select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn-add-to-cart {
  width: 100%;
}

/* ===== About ===== */
.about-layout {
  max-width: 720px;
  margin: 0 auto;
}

.about-content .section-label {
  display: block;
  margin-bottom: 0.75rem;
}

.about-content .section-title {
  margin-bottom: 1.5rem;
}

.about-text p {
  color: var(--muted-foreground);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 1.25rem;
}

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

/* ===== Size Guide ===== */
.size-guide-methods {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem;
  max-width: 900px;
  margin: 0 auto 3rem;
}

.size-method {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.size-method-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 400;
  margin-bottom: 1.5rem;
  text-align: center;
}

.size-method-illustration {
  margin-bottom: 2rem;
}

.size-svg {
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  display: block;
}

.size-method-steps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.size-step {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.step-number {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background-color: var(--primary);
  color: var(--primary-foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
}

.step-text {
  font-size: 0.9375rem;
  color: var(--muted-foreground);
}

/* Size Table */
.size-table-wrapper {
  max-width: 480px;
  margin: 0 auto;
}

.size-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.size-table th {
  font-family: var(--font-tagline);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--border);
}

.size-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--foreground);
}

.size-table tbody tr:hover {
  background-color: var(--muted);
}

/* ===== Footer ===== */
.footer {
  background-color: var(--foreground);
  color: var(--background);
  padding: 3rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-logo {
  margin-bottom: 1rem;
}

.footer-logo-image {
  height: 3rem;
  width: auto;
  filter: invert(1);
  mix-blend-mode: screen;
}

.footer-about {
  font-size: 0.875rem;
  color: rgba(247, 246, 242, 0.7);
  line-height: 1.7;
}

.footer-heading {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.footer-link {
  display: block;
  font-size: 0.875rem;
  color: rgba(247, 246, 242, 0.7);
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--background);
}

.footer-text {
  font-size: 0.875rem;
  color: rgba(247, 246, 242, 0.7);
}

.footer-bottom {
  border-top: 1px solid rgba(247, 246, 242, 0.15);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.8125rem;
  color: rgba(247, 246, 242, 0.5);
}

/* ===== Cart Sidebar ===== */
.cart-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

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

.cart-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 400px;
  max-width: 90vw;
  background-color: var(--card);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.cart-sidebar.active {
  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 {
  font-size: 1.125rem;
  font-weight: 600;
}

.cart-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--foreground);
}

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

.cart-empty {
  text-align: center;
  color: var(--muted-foreground);
  padding: 2rem 0;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.cart-item-info {
  flex: 1;
}

.cart-item-name {
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 0.25rem;
}

.cart-item-size {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

.cart-item-price {
  font-weight: 600;
  margin-right: 1rem;
}

.cart-item-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  text-decoration: underline;
}

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

.cart-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  font-size: 1.0625rem;
  margin-bottom: 1rem;
}

/* ===== Checkout ===== */
.checkout-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 2rem 1rem;
}

.checkout-overlay.active {
  display: flex;
}

.checkout-panel {
  background: var(--card);
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  margin: auto;
  position: relative;
}

.checkout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid var(--border);
}

.checkout-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 400;
}

.checkout-body {
  padding: 1.75rem;
}

.checkout-section {
  margin-bottom: 2rem;
}

.checkout-section:last-child {
  margin-bottom: 0;
}

.checkout-section-title {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* Checkout order items */
.checkout-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.625rem 0;
}

.checkout-item-name {
  font-weight: 500;
  font-size: 0.9375rem;
}

.checkout-item-detail {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

.checkout-item-price {
  font-weight: 600;
  font-size: 0.9375rem;
}

.checkout-total {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 1.0625rem;
  padding-top: 0.75rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border);
}

/* Form styles */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.form-group {
  margin-bottom: 0.875rem;
}

.form-group-wide {
  grid-column: span 1;
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted-foreground);
  margin-bottom: 0.375rem;
}

.form-input {
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--background);
  color: var(--foreground);
  transition: border-color 0.2s;
}

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

.form-textarea {
  resize: vertical;
  min-height: 3rem;
}

.checkout-submit {
  margin-top: 0.5rem;
}

.checkout-note {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  text-align: center;
  margin-top: 0.75rem;
}

/* Confirmation */
.checkout-confirmation {
  padding: 3rem 1.75rem;
  text-align: center;
}

.confirmation-icon {
  margin-bottom: 1.5rem;
}

.confirmation-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
}

.confirmation-text {
  font-size: 0.9375rem;
  color: var(--muted-foreground);
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav {
    display: none;
    position: absolute;
    top: 4rem;
    left: 0;
    right: 0;
    background-color: rgba(247, 246, 242, 0.98);
    backdrop-filter: blur(10px);
    flex-direction: column;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    gap: 0;
  }

  .nav.active {
    display: flex;
  }

  .nav-link {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 1rem;
  }

  .nav-link:last-child {
    border-bottom: none;
  }

  .mobile-menu-button {
    display: block;
  }

  .hero {
    height: 60vh;
    min-height: 400px;
  }

  .hero-title {
    font-size: 2.25rem;
  }

  .hero-description {
    font-size: 1rem;
  }

  .section {
    padding: 3rem 0;
  }

  .section-title {
    font-size: 1.75rem;
  }

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

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .size-guide-methods {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) and (min-width: 769px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
