/*
Theme Name: Merchant Store Master
Theme URI: https://example.com/merchant-store-master
Author: Merchant Platform
Description: A lightweight, reusable WooCommerce storefront for South African micro-merchants.
Version: 1.0.2
Requires at least: 6.5
Requires PHP: 7.4
Text Domain: merchant-store-master
*/

:root {
  --msm-primary: #4f46e5;
  --msm-primary-dark: #3730a3;
  --msm-heading: #111827;
  --msm-text: #374151;
  --msm-muted: #6b7280;
  --msm-bg: #ffffff;
  --msm-soft: #f5f7fa;
  --msm-border: #e5e7eb;
  --msm-radius: 14px;
  --msm-shadow: 0 12px 30px rgba(17, 24, 39, .08);
  --msm-content: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--msm-text);
  background: var(--msm-bg);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}
img { max-width: 100%; height: auto; }
a { color: var(--msm-primary); text-decoration: none; }
a:hover { color: var(--msm-primary-dark); }
h1, h2, h3, h4, h5, h6 {
  color: var(--msm-heading);
  font-family: Manrope, Inter, system-ui, sans-serif;
  line-height: 1.15;
}
.msm-wrap { width: min(calc(100% - 48px), var(--msm-content)); margin-inline: auto; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--msm-border); backdrop-filter: blur(12px); }
.header-inner { min-height: 76px; display: flex; align-items: center; gap: 28px; }
.site-branding { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.custom-logo { max-height: 46px; width: auto; }
.site-title { color: var(--msm-heading); font: 700 1.15rem Manrope, sans-serif; }
.main-navigation ul { display: flex; align-items: center; gap: 24px; list-style: none; margin: 0; padding: 0; }
.main-navigation a { color: var(--msm-heading); font-weight: 600; }
.header-actions { display: flex; gap: 10px; align-items: center; }
.header-action { display: grid; place-items: center; min-width: 42px; height: 42px; border: 1px solid var(--msm-border); border-radius: 999px; color: var(--msm-heading); }
.cart-count { min-width: 19px; height: 19px; padding: 0 5px; margin-left: -7px; margin-top: -24px; display: grid; place-items: center; color: white; background: var(--msm-primary); border-radius: 99px; font-size: .7rem; }
.menu-toggle { display: none; padding: 10px 12px; background: white; border: 1px solid var(--msm-border); border-radius: 8px; }

.hero { overflow: hidden; padding: clamp(64px, 9vw, 120px) 0; background: linear-gradient(135deg, var(--msm-soft), #fff 60%); }
.hero-grid { display: grid; grid-template-columns: 1.08fr .92fr; align-items: center; gap: clamp(40px, 7vw, 96px); }
.eyebrow { margin: 0 0 12px; color: var(--msm-primary); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: .78rem; }
.hero h1 { max-width: 700px; margin: 0 0 22px; font-size: clamp(2.35rem, 4.4vw, 4.35rem); line-height: 1.06; letter-spacing: -.04em; }
.hero-copy { max-width: 610px; margin: 0 0 30px; font-size: 1.1rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.button, button, input[type=submit], .wp-element-button, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 24px;
  color: #fff; background: var(--msm-primary); border: 0; border-radius: 8px; font-family: Manrope, sans-serif;
  font-weight: 700; cursor: pointer; transition: .2s ease;
}
.button:hover, button:hover, input[type=submit]:hover, .woocommerce a.button:hover, .woocommerce button.button:hover {
  color: #fff; background: var(--msm-primary-dark); transform: translateY(-1px);
}
.button-secondary { color: var(--msm-heading); background: white; border: 1px solid var(--msm-border); }
.button-secondary:hover { color: var(--msm-primary); background: white; border-color: var(--msm-primary); }
.hero-visual { min-height: 420px; display: grid; place-items: center; position: relative; background: white; border-radius: 32px; box-shadow: var(--msm-shadow); }
.hero-visual img { width: 100%; height: 100%; max-height: 520px; object-fit: cover; border-radius: inherit; }
.hero-placeholder { padding: 48px; text-align: center; color: var(--msm-muted); }

.section { padding: clamp(56px, 8vw, 96px) 0; }
.section-soft { background: var(--msm-soft); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 36px; }
.section-heading h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.4rem); }
.benefit-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.benefit-card { padding: 28px; background: white; border: 1px solid var(--msm-border); border-radius: var(--msm-radius); }
.benefit-card h3 { margin-top: 8px; }
.benefit-icon { font-size: 1.7rem; }
.story-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 60px; align-items: center; }
.story-image { min-height: 360px; background: var(--msm-soft); border-radius: 24px; overflow: hidden; }
.story-image img { width: 100%; height: 100%; min-height: 360px; object-fit: cover; }

.site-main { min-height: 55vh; padding: 56px 0 88px; }
.page-header { margin-bottom: 34px; }
.page-header h1 { margin-bottom: 8px; font-size: clamp(2.2rem, 5vw, 4rem); }
.content-card { padding: clamp(24px, 5vw, 48px); border: 1px solid var(--msm-border); border-radius: var(--msm-radius); background: white; }

.woocommerce ul.products { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 24px; }
.woocommerce ul.products::before, .woocommerce ul.products::after { display: none; }
.woocommerce ul.products li.product { width: auto !important; margin: 0 !important; padding: 14px 14px 20px; border: 1px solid var(--msm-border); border-radius: var(--msm-radius); background: white; transition: .2s ease; }
.woocommerce ul.products li.product:hover { transform: translateY(-3px); box-shadow: var(--msm-shadow); }
.woocommerce ul.products li.product img { border-radius: 10px; }
.woocommerce div.product { display: flow-root; }
.woocommerce div.product div.images img { border-radius: var(--msm-radius); }
.woocommerce div.product p.price, .woocommerce div.product span.price { color: var(--msm-primary); font-weight: 800; }
.woocommerce-message, .woocommerce-info { border-top-color: var(--msm-primary); background: var(--msm-soft); }
.woocommerce-checkout .col2-set, .woocommerce-account .woocommerce { display: grid; gap: 28px; }
input, textarea, select { width: 100%; min-height: 46px; padding: 10px 12px; color: var(--msm-text); background: white; border: 1px solid #d1d5db; border-radius: 8px; }
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(79,70,229,.14); border-color: var(--msm-primary); }

.site-footer { padding: 64px 0 24px; color: #d1d5db; background: var(--msm-heading); }
.footer-grid { display: grid; grid-template-columns: 1.3fr repeat(2, .7fr); gap: 40px; }
.site-footer h2, .site-footer h3 { color: white; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: #e5e7eb; }
.site-footer a:hover { color: white; }
.footer-bottom { margin-top: 48px; padding-top: 22px; border-top: 1px solid #374151; font-size: .9rem; }

@media (max-width: 900px) {
  .hero-grid, .story-grid { grid-template-columns: 1fr; }
  .benefit-grid, .woocommerce ul.products { grid-template-columns: repeat(2, 1fr); }
  .menu-toggle {
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    width: 42px;
    min-height: 42px;
    padding: 0;
    color: var(--msm-heading);
    background: white;
    border: 1px solid var(--msm-border);
    border-radius: 8px;
    font-size: 0;
  }
  .menu-toggle::before { content: "☰"; font-size: 1.25rem; line-height: 1; }
  .main-navigation { display: none; position: absolute; inset: 76px 0 auto; padding: 20px 24px; background: white; border-bottom: 1px solid var(--msm-border); }
  .main-navigation.is-open { display: block; }
  .main-navigation ul { flex-direction: column; align-items: stretch; gap: 14px; }
}
@media (max-width: 600px) {
  .msm-wrap { width: min(calc(100% - 32px), var(--msm-content)); }
  .header-inner { min-height: 68px; gap: 10px; }
  .main-navigation { inset-block-start: 68px; }
  .site-title { font-size: 1rem; }
  .header-action.account-link { display: none; }
  .hero { padding: 48px 0; }
  .hero-grid { gap: 36px; }
  .hero-visual { min-height: 190px; border-radius: 24px; }
  .hero-placeholder { padding: 30px 24px; }
  .section { padding: 48px 0; }
  .section-heading { margin-bottom: 24px; }
  .benefit-grid, .woocommerce ul.products, .footer-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: start; flex-direction: column; }
}
