:root {
  --bg: #F2F4FF;
  --text: #707376;
  --heading: #0C152E;
  --blue: #0050E6;
  --footer-bg: #0D1A34;
  --card-bg: #ffffff;
  --border: #E3E6F5;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

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

a { text-decoration: none; color: var(--blue); }

h1, h2, h3, h4 {
  color: var(--heading);
  font-weight: 500;
  margin: 0 0 .5em;
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------- Header ---------------- */

.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
}

.logo img { height: 64px; width: auto; }

.main-nav {
  display: flex;
  gap: 32px;
}

.main-nav a {
  color: var(--heading);
  font-weight: 500;
  font-size: 17px;
}

.main-nav a.active,
.main-nav a:hover { color: var(--blue); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.cart-icon {
  position: relative;
  color: var(--heading);
  display: inline-flex;
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -10px;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--heading);
}

/* ---------------- Hero / page header ---------------- */

.page-hero {
  text-align: center;
  padding: 64px 24px 32px;
}

.page-hero h1 {
  font-size: 42px;
  margin-bottom: 8px;
}

.page-hero p {
  font-size: 18px;
}

/* ---------------- Product grid ---------------- */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px;
  padding: 32px 24px 64px;
  max-width: 1200px;
  margin: 0 auto;
}

.product-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  transition: transform .15s ease, box-shadow .15s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(12, 21, 46, .08);
}

.badge-sale {
  position: absolute;
  top: 16px;
  left: 16px;
  background: var(--heading);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  z-index: 2;
}

.product-card .product-thumb {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f7f7f9;
}

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

.product-card .product-info {
  padding: 16px 4px 4px;
}

.product-card h3 {
  font-size: 19px;
  margin-bottom: 6px;
}

.price {
  font-size: 16px;
}

.price .old {
  text-decoration: line-through;
  color: #a7a9ac;
  margin-right: 8px;
}

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

.btn {
  display: inline-block;
  background: var(--heading);
  color: #fff;
  padding: 12px 28px;
  border-radius: 999px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-family: inherit;
  text-align: center;
}

.btn:hover { background: var(--blue); color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--heading);
  border: 1.5px solid var(--heading);
}

.btn-outline:hover {
  background: var(--heading);
  color: #fff;
}

.btn-block { width: 100%; }

.shop-cta {
  text-align: center;
  padding: 8px 24px 48px;
}

/* ---------------- Product detail ---------------- */

.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  align-items: flex-start;
}

.product-gallery { position: relative; }

.product-gallery .badge-sale { top: 16px; left: 16px; }

.product-gallery-main {
  border-radius: var(--radius);
  overflow: hidden;
  background: #f7f7f9;
  margin-bottom: 12px;
}

.product-gallery-thumbs {
  display: flex;
  gap: 10px;
}

.product-gallery-thumbs img {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
}

.product-gallery-thumbs img.active { border-color: var(--blue); }

.product-summary h1 { font-size: 32px; }

.product-summary .price { font-size: 22px; margin-bottom: 20px; }

.product-summary .desc { margin-bottom: 24px; }

.qty-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.qty-input {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.qty-input button {
  background: none;
  border: none;
  width: 38px;
  height: 42px;
  font-size: 18px;
  cursor: pointer;
  color: var(--heading);
}

.qty-input input {
  width: 44px;
  text-align: center;
  border: none;
  font-size: 16px;
  font-family: inherit;
  -moz-appearance: textfield;
}

.product-meta {
  font-size: 14px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 8px;
}

/* ---------------- Cart & checkout ---------------- */

.cart-page, .checkout-page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.cart-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 32px;
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
}

.cart-table th, .cart-table td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.cart-table th { color: var(--heading); font-weight: 600; font-size: 14px; }

.cart-product {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cart-product img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  background: #f7f7f9;
}

.cart-remove {
  color: #c53030;
  font-size: 13px;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}

.cart-summary {
  max-width: 380px;
  margin-left: auto;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
}

.cart-summary-row.total {
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 16px;
  font-weight: 700;
  color: var(--heading);
  font-size: 18px;
}

.empty-state {
  text-align: center;
  padding: 60px 24px;
}

/* Checkout */

.checkout-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 40px;
  align-items: flex-start;
}

.checkout-form, .order-summary {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 28px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  font-size: 14px;
  color: var(--heading);
  font-weight: 500;
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  background: #fff;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--blue);
}

.payment-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }

.payment-option {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
}

.payment-option.disabled { opacity: .55; cursor: not-allowed; }

.payment-option input { accent-color: var(--blue); }

.payment-option .soon {
  margin-left: auto;
  font-size: 12px;
  background: #f0f0f4;
  padding: 2px 8px;
  border-radius: 999px;
}

.order-summary-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

.alert {
  padding: 14px 16px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 14px;
}

.alert-error { background: #FDEDEE; color: #9B2C2C; }
.alert-success { background: #E9F9EF; color: #1E6B3C; }

/* ---------------- Order success ---------------- */

.order-success {
  max-width: 640px;
  margin: 0 auto;
  padding: 72px 24px;
  text-align: center;
}

.order-success .check {
  font-size: 56px;
  margin-bottom: 16px;
}

/* ---------------- App promo ---------------- */

.app-promo {
  background: #E8ECFF;
  padding: 48px 24px;
  text-align: center;
}

.app-promo-inner { max-width: 500px; margin: 0 auto; }

.app-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  margin: 0 auto 16px;
}

.app-promo p {
  color: var(--heading);
  font-size: 19px;
  font-weight: 500;
  margin-bottom: 20px;
}

.app-badges {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.app-badges img { height: 44px; }

/* ---------------- Footer ---------------- */

.site-footer {
  background: var(--footer-bg);
  color: #B7BDD6;
  padding-top: 56px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
}

.footer-logo { height: 56px; margin-bottom: 12px; }

.footer-col h4 {
  color: #fff;
  font-size: 15px;
  margin-bottom: 14px;
}

.footer-col a {
  display: block;
  color: #B7BDD6;
  padding: 5px 0;
  font-size: 14px;
}

.footer-col a:hover { color: #fff; }

.social-links { display: flex; flex-direction: column; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 20px 24px;
  font-size: 13px;
}

/* ---------------- Static content pages ---------------- */

.content-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

.content-page h1 { font-size: 34px; margin-bottom: 24px; }
.content-page h2 { font-size: 22px; margin-top: 32px; }
.content-page ul { padding-left: 20px; }
.content-page hr { border: none; border-top: 1px solid var(--border); margin: 28px 0; }

.info-box {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

/* ---------------- Contact page ---------------- */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  max-width: 1000px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

/* ---------------- Responsive ---------------- */

@media (max-width: 860px) {
  .product-detail, .checkout-grid, .contact-grid {
    grid-template-columns: 1fr;
  }
  .footer-inner { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: none;
  }
  .main-nav.open { display: flex; }
  .nav-toggle { display: flex; }
  .site-header { position: relative; }
  .page-hero h1 { font-size: 30px; }
  .cart-table thead { display: none; }
  .cart-table, .cart-table tbody, .cart-table tr, .cart-table td { display: block; width: 100%; }
  .cart-table tr { padding: 12px 16px; }
}
