:root {
  --color-primary: #0b6e8f;
  --color-primary-dark: #085168;
  --color-primary-light: #12a6d1;
  --color-teal: #0e9488;
  --color-accent: #f5a623;
  --color-bg: #f4f8fa;
  --color-surface: #ffffff;
  --color-text: #1e2a30;
  --color-text-muted: #5c6b73;
  --color-border: #dbe6ea;
  --color-success: #1f9d55;
  --color-danger: #d8412f;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(11, 110, 143, 0.08);
  --shadow-lg: 0 10px 30px rgba(11, 110, 143, 0.14);
  --max-width: 1200px;
  --font-body: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

h1, h2, h3, h4 {
  line-height: 1.25;
  margin: 0 0 0.5em;
}

p {
  margin: 0 0 1em;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 20px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand img {
  height: 44px;
  width: auto;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.main-nav a {
  font-weight: 600;
  color: var(--color-text);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

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

.cart-link {
  position: relative;
}

.cart-badge {
  position: absolute;
  top: -8px;
  right: -14px;
  background: var(--color-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 26px;
  color: var(--color-primary);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-primary-dark);
  color: #dceef4;
  margin-top: 60px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 46px 20px 24px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
}

.footer-inner h4 {
  color: #fff;
  margin-bottom: 14px;
}

.footer-inner a {
  display: block;
  color: #b9d9e4;
  margin-bottom: 8px;
  transition: color 0.15s;
}

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

.footer-brand p {
  color: #b9d9e4;
  max-width: 340px;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  text-align: center;
  padding: 16px 20px;
  font-size: 13px;
  color: #9fc4d1;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius);
  border: none;
  font-weight: 600;
  font-size: 15px;
  transition: transform 0.1s, box-shadow 0.15s, background 0.15s;
}

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

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

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

.btn-accent:hover {
  background: #d98d0d;
}

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

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

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

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

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(120deg, var(--color-primary-dark), var(--color-primary) 60%, var(--color-teal));
  color: #fff;
  padding: 70px 20px;
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}

.hero h1 {
  font-size: 2.6rem;
  margin-bottom: 0.4em;
}

.hero p {
  font-size: 1.1rem;
  color: #e2f3f8;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.hero-art {
  display: flex;
  justify-content: center;
}

.hero-art svg {
  width: 100%;
  max-width: 420px;
}

/* ---------- Section ---------- */
.section {
  padding: 56px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 8px;
}

.section-subtitle {
  text-align: center;
  color: var(--color-text-muted);
  max-width: 560px;
  margin: 0 auto 36px;
}

/* ---------- Categories ---------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.category-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 26px 20px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
  border: 1px solid var(--color-border);
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.category-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  color: var(--color-primary);
}

.category-card h3 {
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.category-card p {
  color: var(--color-text-muted);
  font-size: 0.88rem;
  margin: 0;
}

/* ---------- Product grid & cards ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.product-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s, box-shadow 0.15s;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

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

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

.product-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--color-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
}

.product-body {
  padding: 14px 16px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-brand {
  font-size: 12px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.product-name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.product-rating {
  font-size: 13px;
  color: var(--color-accent);
  margin-bottom: 8px;
}

.product-rating span {
  color: var(--color-text-muted);
  margin-left: 4px;
}

.product-price {
  margin-top: auto;
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}

.price-current {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary-dark);
}

.price-original {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  text-decoration: line-through;
}

/* ---------- Filters / toolbar ---------- */
.shop-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 26px;
}

.shop-toolbar .filter-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.form-input, .form-select, .form-textarea {
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--color-text);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(11,110,143,0.15);
}

.search-input {
  min-width: 220px;
}

.page-heading {
  padding: 36px 0 10px;
}

.page-heading h1 {
  margin-bottom: 4px;
}

.page-heading p {
  color: var(--color-text-muted);
}

.breadcrumb {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 10px;
}

.breadcrumb a {
  color: var(--color-primary);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-muted);
}

/* ---------- Product Detail ---------- */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px;
  padding: 36px 0 60px;
}

.gallery-main {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
  aspect-ratio: 1/1;
  background: #eef4f6;
  margin-bottom: 12px;
}

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

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

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

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

.detail-brand {
  color: var(--color-primary);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-title {
  font-size: 1.8rem;
  margin: 6px 0 10px;
}

.detail-price {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 16px 0;
}

.detail-price .price-current {
  font-size: 1.8rem;
}

.detail-desc {
  color: var(--color-text-muted);
  margin-bottom: 18px;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 22px;
}

.spec-table th, .spec-table td {
  text-align: left;
  padding: 9px 4px;
  border-bottom: 1px solid var(--color-border);
  font-size: 14px;
}

.spec-table th {
  width: 40%;
  color: var(--color-text-muted);
  font-weight: 600;
  text-transform: capitalize;
}

.qty-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.qty-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-border);
  background: #fff;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-primary);
}

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

.qty-value {
  width: 46px;
  text-align: center;
  font-weight: 700;
  font-size: 16px;
}

.detail-actions {
  display: flex;
  gap: 14px;
}

/* ---------- Cart page ---------- */
.cart-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
  padding: 30px 0 60px;
  align-items: start;
}

.cart-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.cart-table th {
  text-align: left;
  background: #eef6f8;
  padding: 12px 16px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
}

.cart-table td {
  padding: 14px 16px;
  border-top: 1px solid var(--color-border);
  vertical-align: middle;
}

.cart-item-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cart-item-info img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--color-border);
}

.cart-qty-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.remove-link {
  color: var(--color-danger);
  font-size: 13px;
  font-weight: 600;
}

.summary-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 15px;
}

.summary-row.total {
  font-weight: 700;
  font-size: 1.2rem;
  border-top: 1px solid var(--color-border);
  padding-top: 14px;
  margin-top: 8px;
}

/* ---------- Forms / auth pages ---------- */
.auth-wrapper {
  max-width: 440px;
  margin: 50px auto 80px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 34px 30px;
  box-shadow: var(--shadow);
}

.auth-wrapper h1 {
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.auth-wrapper .auth-sub {
  color: var(--color-text-muted);
  margin-bottom: 24px;
  font-size: 14px;
}

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

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}

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

.form-message {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}

.form-message.visible {
  display: block;
}

.form-message.success {
  background: #e5f7ec;
  color: var(--color-success);
  border: 1px solid #b8e6c9;
}

.form-message.error {
  background: #fbeae7;
  color: var(--color-danger);
  border: 1px solid #f3c3ba;
}

.auth-links {
  margin-top: 18px;
  font-size: 14px;
  text-align: center;
  color: var(--color-text-muted);
}

.auth-links a {
  color: var(--color-primary);
  font-weight: 600;
}

.checkout-note {
  background: #eef6f8;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13.5px;
  color: var(--color-text-muted);
  margin-bottom: 20px;
}

/* ---------- Profile ---------- */
.profile-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.profile-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 15px;
}

.profile-row:last-child {
  border-bottom: none;
}

.profile-row span:first-child {
  color: var(--color-text-muted);
}

/* ---------- 404 ---------- */
.not-found {
  text-align: center;
  padding: 100px 20px;
}

.not-found h1 {
  font-size: 5rem;
  color: var(--color-primary);
  margin-bottom: 0;
}

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero p { margin: 0 auto; }
  .hero-actions { justify-content: center; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .product-detail { grid-template-columns: 1fr; }
  .cart-layout { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface);
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow);
    display: none;
    gap: 14px;
  }

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

  .nav-toggle {
    display: block;
  }

  .category-grid { grid-template-columns: 1fr 1fr; }
  .product-grid { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 2rem; }
  .footer-inner { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .shop-toolbar { flex-direction: column; align-items: stretch; }
  .cart-table thead { display: none; }
  .cart-table, .cart-table tbody, .cart-table tr, .cart-table td {
    display: block;
    width: 100%;
  }
  .cart-table tr {
    padding: 10px 0;
  }
  .cart-table td {
    border-top: none;
    padding: 6px 16px;
  }
}

@media (max-width: 420px) {
  .category-grid { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: 1fr; }
}
