:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --primary: #0c1f4c;
  --secondary: #1f3a7a;
  --accent: #f9c74f;
  --muted: #6b7280;
  --surface: #ffffff;
  --header-primary: #0c1f4c;
  --header-secondary: #1f3a7a;
  --ad-bg: #ffffff;
  --ad-text: #0c1f4c;
  --site-font: "Segoe UI";
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", "Inter", sans-serif;
}

body {
  background: var(--bg);
  color: var(--primary);
}

header {
  background: linear-gradient(120deg, var(--header-primary), var(--header-secondary));
  color: #fff;
  padding: 2.5rem 6vw;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

nav .logo {
  font-family: var(--site-font), "Segoe UI", "Inter", sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 2px;
}

nav a {
  color: #fff;
  margin-left: 1.5rem;
  text-decoration: none;
  font-weight: 500;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  align-items: center;
}

.hero h1 {
  font-size: 2.8rem;
  margin-bottom: 1rem;
}

.hero p {
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
}

.hero .cta {
  margin-top: 1.5rem;
  display: inline-block;
  background: var(--accent);
  color: var(--primary);
  padding: 0.8rem 1.8rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow);
}

main {
  padding: 3rem 6vw 5rem;
}

.section-title {
  font-size: 1.6rem;
  margin-bottom: 1.5rem;
}

.market-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
}

.card {
  background: var(--ad-bg);
  color: var(--ad-text);
  width: 3cm;
  height: 6cm;
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card img {
  width: 3cm;
  height: 3cm;
  object-fit: cover;
}

.card-content {
  height: 3cm;
  padding: 0.35rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.card-content h3 {
  font-size: 0.72rem;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-content p {
  color: var(--ad-text);
  font-size: 0.52rem;
  line-height: 1.2;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.card-content .price {
  font-weight: 700;
  font-size: 0.6rem;
}

.card-content a {
  text-decoration: none;
  color: var(--secondary);
  font-weight: 600;
  font-size: 0.56rem;
}

.cart-add button {
  margin-top: 1rem;
  padding: 0.7rem 1.4rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-weight: 600;
}

.cart-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 2rem;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-item {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 2fr 1fr auto;
  gap: 1.5rem;
  align-items: center;
}

.cart-actions form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.cart-actions input {
  width: 70px;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.cart-actions button {
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: none;
  background: var(--secondary);
  color: #fff;
}

.cart-actions .text-button {
  background: transparent;
  color: var(--secondary);
  border: 1px solid rgba(31, 58, 122, 0.2);
}

.cart-line-total {
  font-weight: 700;
}

.cart-summary,
.checkout-summary {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-top: 0.75rem;
  font-weight: 600;
}

.summary-row.total {
  font-size: 1.1rem;
  margin-top: 1rem;
}

.auth-container {
  max-width: 420px;
  margin: 3rem auto;
  background: var(--surface);
  padding: 2.5rem;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.auth-container form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-container input {
  padding: 0.8rem 1rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.auth-container button {
  padding: 0.8rem 1rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-weight: 600;
}

.flash {
  margin: 1rem 0;
  color: #b91c1c;
  font-weight: 600;
}

.product-detail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 2rem;
}

.product-gallery {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.product-image-frame {
  width: 6cm;
  height: 6cm;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.1);
}

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

.gallery-controls {
  display: flex;
  gap: 0.8rem;
}

.gallery-controls button {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: none;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
}

.checkout-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 2rem;
}

.checkout-form {
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 2rem;
}

.order-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.order-form input {
  padding: 0.8rem 1rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.order-form button {
  padding: 0.8rem 1rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-weight: 600;
}

.checkout-summary ul {
  list-style: none;
  margin-top: 1rem;
}

.checkout-summary li {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid #f1f5f9;
}

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

.paypal-box {
  margin-top: 1rem;
}

footer {
  background: #0f172a;
  color: #fff;
  text-align: center;
  padding: 2rem;
}

.badge {
  background: rgba(15, 23, 42, 0.08);
  color: var(--primary);
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.dashboard-card {
  background: var(--ad-bg);
  color: var(--ad-text);
  padding: 1.5rem;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.dashboard-card h4 {
  margin-bottom: 0.5rem;
}

.dashboard-card span {
  font-size: 1.5rem;
  font-weight: 700;
}

@media (max-width: 768px) {
  header {
    padding: 2rem 5vw;
  }

  main {
    padding: 2rem 5vw 4rem;
  }

  .cart-grid,
  .checkout-grid {
    grid-template-columns: 1fr;
  }

  .cart-item {
    grid-template-columns: 1fr;
  }
}
