﻿:root {
  --primary: #00593a;
  --primary-dark: #003a25;
  --primary-light: #e4f2ea;
  --accent: #00843d;
  --accent-dark: #00662f;
  --hero-glow: #0b8a52;
  --shadow: rgba(0, 89, 58, 0.12);
  --heading: var(--primary);
  --accent-text: var(--accent);
  --bg: #f7f8fa;
  --surface: #fff;
  --text: #1f2937;
  --muted: #667085;
  --border: #e5e7eb;
  --radius: 10px;
}

:root[data-palette="msh"] {
  --primary: #1b3d6d;
  --primary-dark: #0e2440;
  --primary-light: #eaf0f8;
  --accent: #c0392b;
  --accent-dark: #9c2c20;
  --hero-glow: #2a5389;
  --shadow: rgba(27, 61, 109, 0.12);
}

:root[data-mode="dark"] {
  color-scheme: dark;
  --bg: #0f1512;
  --surface: #18211c;
  --text: #e6ece8;
  --muted: #9aa8a0;
  --border: #2a3730;
  --primary-light: #1d2b24;
  --heading: #7fd8a8;
  --accent-text: #4cd18a;
  --shadow: rgba(0, 0, 0, 0.45);
}

:root[data-mode="dark"][data-palette="msh"] {
  --bg: #0e141c;
  --surface: #18212d;
  --text: #e6eaf0;
  --muted: #9aa5b5;
  --border: #2a3646;
  --primary-light: #1c2938;
  --heading: #9db8e0;
  --accent-text: #ff7a6b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: "Poppins", "Inter", sans-serif;
}

a {
  color: inherit;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

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

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--heading);
}

.logo-drop {
  font-size: 1.6rem;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-name {
  font-weight: 700;
  font-size: 1.05rem;
}

.logo-sub {
  font-size: 0.78rem;
  color: var(--accent-text);
}

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

.main-nav a {
  text-decoration: none;
  color: var(--heading);
  font-weight: 500;
  font-size: 0.95rem;
}

.main-nav a:hover {
  color: var(--accent-text);
}

.main-nav a.nav-active {
  color: var(--accent-text);
}

.cart-toggle {
  position: relative;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 1.1rem;
  cursor: pointer;
}

.cart-toggle:hover {
  background: var(--primary-dark);
}

.cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hero */
.hero {
  background: radial-gradient(circle at top right, var(--hero-glow) 0%, var(--primary) 45%, var(--primary-dark) 100%);
  color: #fff;
  padding: 96px 0 88px;
}

.hero-inner {
  max-width: 640px;
}

.hero-tag {
  display: inline-block;
  background: rgba(255, 255, 255, 0.12);
  color: #d8efe3;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: 2.6rem;
  line-height: 1.2;
  margin: 0 0 18px;
}

.hero p {
  color: #d8e8df;
  font-size: 1.05rem;
  margin: 0 0 32px;
}

.cta-btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 13px 28px;
  border-radius: 8px;
  transition: background 0.15s ease;
}

.cta-btn:hover {
  background: var(--accent-dark);
}

/* Page header (Produtos / Quem Somos / Contacto) */
.page-header {
  padding: 48px 0 8px;
  text-align: center;
}

.page-header h1 {
  color: var(--heading);
  font-size: 2rem;
  margin-bottom: 6px;
}

/* Quick categories (home) */
.quick-categories {
  padding: 36px 0 0;
}

.category-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.category-link {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--heading);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 10px 18px;
  border-radius: 999px;
  transition: all 0.15s ease;
}

.category-link:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px var(--shadow);
}

/* Company history teaser (home) */
.history {
  padding: 72px 0;
}

.history-inner {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}

.history h2 {
  color: var(--heading);
  font-size: 1.8rem;
  margin: 8px 0 16px;
}

.history p {
  color: var(--muted);
  margin: 0 0 20px;
}

.section-tag {
  display: inline-block;
  color: var(--accent-text);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.link-arrow {
  color: var(--accent-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}

.link-arrow:hover {
  text-decoration: underline;
}

/* Products */
.products {
  padding: 56px 0;
}

.promo-section {
  background: var(--primary-light);
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
  flex-wrap: wrap;
}

.section-header h2 {
  color: var(--heading);
  margin: 4px 0 0;
  font-size: 1.7rem;
}

.products h1 {
  text-align: center;
  color: var(--heading);
  margin-bottom: 8px;
  font-size: 1.9rem;
}

.section-subtitle {
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 36px;
  font-style: italic;
}

.category-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 40px;
}

.filter-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--heading);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-btn:hover {
  border-color: var(--primary);
}

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

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 22px;
}

.product-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.badge {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

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

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

.product-card[hidden] {
  display: none;
}

.product-card:hover {
  box-shadow: 0 8px 24px var(--shadow);
  transform: translateY(-2px);
}

.product-icon {
  font-size: 1.8rem;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  border-radius: 10px;
  margin-bottom: 14px;
}

.product-category {
  font-size: 0.75rem;
  color: var(--accent-text);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.product-card h3 {
  color: var(--heading);
  margin: 6px 0 4px;
  font-size: 1.05rem;
}

.product-card p {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 18px;
  flex-grow: 1;
}

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

.product-price {
  font-weight: 700;
  color: var(--heading);
}

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

.product-price.sale {
  color: var(--accent-text);
}

.add-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.add-btn:hover {
  background: var(--accent-dark);
}

.add-btn:disabled {
  background: #003a25;
  cursor: default;
}

/* About page */
.about-page {
  padding: 40px 0 72px;
}

.about-content {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
  color: var(--muted);
}

.placeholder-note {
  font-style: italic;
  font-size: 0.85rem;
  color: #9aa2ae;
}

/* Contact page */
.contact-page {
  padding: 40px 0 72px;
}

.contact-grid {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  text-align: center;
}

.contact-grid a {
  color: var(--accent-text);
  text-decoration: none;
}

/* Footer */
.site-footer {
  background: var(--primary-dark);
  color: #b5d3c3;
  text-align: center;
  padding: 24px 0;
  font-size: 0.85rem;
}

/* Cart panel */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 38, 24, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 30;
}

.cart-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 380px;
  max-width: 90vw;
  background: var(--surface);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 31;
  display: flex;
  flex-direction: column;
}

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

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

.cart-header h2 {
  margin: 0;
  color: var(--heading);
  font-size: 1.2rem;
}

.cart-header button {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--muted);
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px;
}

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

.cart-item-info {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
}

.cart-item-info span {
  color: var(--muted);
  font-size: 0.8rem;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty-btn {
  color: var(--text);
  width: 26px;
  height: 26px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
}

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

.remove-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  margin-left: 6px;
}

.remove-btn:hover {
  color: var(--accent-text);
}

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

.cart-footer {
  padding: 18px 20px;
  border-top: 1px solid var(--border);
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 1.05rem;
  margin-bottom: 14px;
}

.send-order-btn {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 13px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.send-order-btn:hover {
  background: var(--accent-dark);
}

.cart-note {
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  margin: 10px 0 0;
}

/* Responsive */
@media (max-width: 720px) {
  .main-nav {
    display: none;
  }

  .hero h1 {
    font-size: 2rem;
  }
}

/* Theme buttons */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 1.05rem;
  cursor: pointer;
  line-height: 1;
}

.theme-btn:hover {
  border-color: var(--primary);
}