/*
Theme Name: Course Seller
Theme URI: https://example.com
Author: Grow With Murtazi
Description: Simple, fully customizable WordPress theme to sell online courses with WhatsApp + JazzCash/Easypaisa manual order flow. Customize everything from Appearance > Customize.
Version: 1.0
Requires PHP: 7.4
Text Domain: course-seller
*/

:root {
  --primary: #16a34a;
  --primary-dark: #0f7a37;
  --dark: #16211a;
  --gray: #6b7280;
  --bg-light: #f7faf8;
  --border: #e5e7eb;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--dark);
  background: #fff;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
}
.site-logo {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
}
.site-logo img { max-height: 44px; }
.main-nav ul {
  list-style: none;
  display: flex;
  gap: 26px;
  margin: 0;
  padding: 0;
}
.main-nav a {
  font-weight: 600;
  font-size: 15px;
}
.main-nav a:hover { color: var(--primary); }
.nav-toggle { display: none; background: none; border: none; font-size: 26px; cursor: pointer; }

@media (max-width: 780px) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 10px 20px 20px;
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; gap: 14px; }
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--bg-light), #fff);
  padding: 70px 20px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(28px, 5vw, 46px);
  font-weight: 900;
  margin: 0 0 16px;
  max-width: 780px;
  margin-left: auto; margin-right: auto;
}
.hero p {
  font-size: 18px;
  color: var(--gray);
  max-width: 620px;
  margin: 0 auto 28px;
}
.btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: 14px 30px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 16px;
  border: none;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { background: var(--primary-dark); transform: translateY(-2px); color: #fff; }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-block { display: block; width: 100%; text-align: center; }

/* ---------- Section headings ---------- */
.section { padding: 60px 20px; }
.section-title {
  font-size: 30px;
  font-weight: 900;
  text-align: center;
  margin: 0 0 8px;
}
.section-subtitle {
  text-align: center;
  color: var(--gray);
  max-width: 560px;
  margin: 0 auto 36px;
}

/* ---------- Course grid ---------- */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 26px;
}
.course-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  transition: box-shadow .2s ease, transform .2s ease;
  display: flex;
  flex-direction: column;
}
.course-card:hover { box-shadow: 0 10px 30px rgba(0,0,0,.08); transform: translateY(-3px); }
.course-card-img { aspect-ratio: 16/9; background: var(--bg-light); overflow: hidden; }
.course-card-img img { width: 100%; height: 100%; object-fit: cover; }
.course-card-body { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex-grow: 1; }
.course-level {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: rgba(22,163,74,.1);
  padding: 3px 10px;
  border-radius: 999px;
  width: fit-content;
}
.course-card-title { font-size: 18px; font-weight: 800; margin: 0; }
.course-meta { font-size: 13px; color: var(--gray); display: flex; gap: 12px; flex-wrap: wrap; }
.course-price-row { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.course-price { font-size: 20px; font-weight: 900; color: var(--primary); }
.course-price-old { font-size: 14px; color: var(--gray); text-decoration: line-through; }
.course-card-footer { padding: 0 18px 18px; margin-top: auto; }

/* ---------- Single course ---------- */
.course-hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 40px;
  padding: 50px 20px;
  align-items: start;
}
@media (max-width: 900px) { .course-hero { grid-template-columns: 1fr; } }
.course-hero-img { border-radius: var(--radius); overflow: hidden; }
.course-badges { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.badge {
  font-size: 13px; font-weight: 700; padding: 5px 12px; border-radius: 999px;
  background: var(--bg-light); color: var(--dark);
}
.course-title { font-size: 32px; font-weight: 900; margin: 0 0 12px; }
.course-desc { color: var(--gray); font-size: 16px; margin-bottom: 24px; }
.buy-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: sticky;
  top: 90px;
}
.buy-box .course-price { font-size: 32px; }
.buy-box .course-price-old { font-size: 18px; }
.payment-methods {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
  font-size: 13px;
  color: var(--gray);
}
.payment-methods strong { color: var(--dark); }
.trust-list { list-style: none; padding: 0; margin: 18px 0 0; font-size: 14px; }
.trust-list li { margin-bottom: 8px; }

/* ---------- Order Modal ---------- */
.order-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  display: none; align-items: center; justify-content: center;
  z-index: 9999; padding: 20px;
}
.order-modal-overlay.open { display: flex; }
.order-modal {
  background: #fff; border-radius: var(--radius); padding: 28px;
  max-width: 420px; width: 100%; position: relative; max-height: 90vh; overflow-y: auto;
}
.order-modal-close {
  position: absolute; top: 12px; right: 14px; background: none; border: none;
  font-size: 22px; cursor: pointer; color: var(--gray);
}
.order-modal h3 { margin: 0 0 6px; font-size: 20px; font-weight: 800; }
.order-modal p.summary { color: var(--gray); font-size: 14px; margin-bottom: 18px; }
.order-modal label { display: block; font-size: 13px; font-weight: 700; margin: 12px 0 6px; }
.order-modal input, .order-modal textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px;
}
.order-modal .pay-info {
  background: var(--bg-light); border-radius: 8px; padding: 12px 14px; margin-top: 18px; font-size: 13px;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--dark); color: #dbe4dd; padding: 40px 20px 24px; margin-top: 60px;
}
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; }
.site-footer a { color: #dbe4dd; }
.footer-bottom { text-align: center; font-size: 13px; color: #8ea391; margin-top: 26px; }

/* WhatsApp floating helper button (footer) */
.wa-fab {
  position: fixed; bottom: 22px; right: 22px; z-index: 9998;
  width: 58px; height: 58px; border-radius: 50%; background: #25D366;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.wa-fab svg { width: 30px; height: 30px; fill: #fff; }

/* ---------- WooCommerce overrides ---------- */
.woocommerce ul.products { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 26px; list-style: none; margin: 0; padding: 0; }
.woocommerce ul.products li.product {
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  padding: 0 !important; margin: 0 !important; transition: box-shadow .2s ease, transform .2s ease;
}
.woocommerce ul.products li.product:hover { box-shadow: 0 10px 30px rgba(0,0,0,.08); transform: translateY(-3px); }
.woocommerce ul.products li.product a img { border-radius: 0; margin: 0 !important; aspect-ratio: 16/9; object-fit: cover; }
.woocommerce ul.products li.product .woocommerce-loop-product__title { padding: 14px 16px 0; font-size: 17px; font-weight: 800; }
.woocommerce ul.products li.product .price { padding: 4px 16px 16px; font-size: 18px; font-weight: 900; color: var(--primary); }
.woocommerce ul.products li.product .price del { color: var(--gray); font-weight: 400; opacity: .7; }
.woocommerce ul.products li.product .price ins { text-decoration: none; }
.woocommerce ul.products li.product .button {
  margin: 0 16px 16px; display: block; text-align: center; background: var(--primary); color: #fff;
  border-radius: 8px; padding: 10px; font-weight: 700; width: calc(100% - 32px);
}
.woocommerce div.product .woocommerce-tabs { margin-top: 30px; }
.woocommerce div.product p.price, .woocommerce div.product span.price { color: var(--primary); font-size: 26px; font-weight: 900; }
.woocommerce div.product form.cart .button,
.woocommerce #respond input#submit,
.woocommerce a.button, .woocommerce button.button, .woocommerce input.button {
  background: var(--primary); color: #fff; border-radius: 999px; padding: 13px 26px; font-weight: 800; border: none;
}
.woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce input.button:hover { background: var(--primary-dark); color: #fff; }
.cs-wa-order-btn { border-radius: 999px !important; font-weight: 800; color: #fff; }
.woocommerce nav.woocommerce-pagination ul { border: none; }
.woocommerce span.onsale {
  background: var(--primary); border-radius: 999px; font-weight: 800; top: 10px; left: 10px; min-height: auto; line-height: normal; padding: 5px 12px;
}
.woocommerce-message, .woocommerce-info { border-top-color: var(--primary) !important; }
.woocommerce-message::before, .woocommerce-info::before { color: var(--primary) !important; }
