/*
 Theme Name:   P4H Namibia – Astra Child
 Theme URI:    https://p4hnam.com
 Description:  P4H Namibia child theme for Astra – Plant for Hire marketplace
 Author:       P4H Namibia
 Author URI:   https://p4hnam.com
 Template:     astra
 Version:      1.0.0
 Text Domain:  p4h-astra-child
*/

/* ============================================================
   BRAND TOKENS
   ============================================================ */
:root {
  --p4h-navy:       #0d1b2a;
  --p4h-navy-mid:   #1a2e44;
  --p4h-navy-light: #1e3a5f;
  --p4h-gold:       #d4a017;
  --p4h-gold-light: #f0c040;
  --p4h-white:      #ffffff;
  --p4h-offwhite:   #f4f6f9;
  --p4h-gray:       #6b7280;
  --p4h-dark-text:  #1f2937;
  --p4h-card-bg:    #ffffff;
  --p4h-radius:     10px;
  --p4h-shadow:     0 4px 18px rgba(0,0,0,0.10);
}

/* ============================================================
   GLOBAL RESET / BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  background: var(--p4h-offwhite);
  color: var(--p4h-dark-text);
  margin: 0;
}

a { color: var(--p4h-gold); text-decoration: none; }
a:hover { color: var(--p4h-gold-light); text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* ============================================================
   ASTRA HEADER OVERRIDE  (v2 — precise selectors from live HTML)
   ============================================================ */

/* Background: Astra inline CSS sets these — must override all of them */
#masthead,
#ast-desktop-header .main-header-bar-wrap,
#ast-desktop-header .ast-main-header-wrap,
#ast-mobile-header .main-header-bar-wrap,
#ast-mobile-header .ast-main-header-wrap,
.ast-desktop-header-content,
.ast-mobile-header-wrap .ast-mobile-header-content,
.ast-primary-header-bar,
.ast-primary-header-bar .site-primary-header-wrap,
.main-header-bar {
  background: var(--p4h-navy) !important;
  background-color: var(--p4h-navy) !important;
}
#masthead {
  border-bottom: 3px solid var(--p4h-gold) !important;
}

/* Logo image sizing */
.custom-logo,
.site-logo-img,
.ast-site-identity img { max-height: 52px; width: auto; }

/* Site title — visible on dark background */
.ast-site-title-wrap,
.site-branding.ast-site-identity { display: block !important; }

.ast-site-title-wrap .site-title a,
.site-branding .site-title a {
  color: var(--p4h-white) !important;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 0.03em;
  text-decoration: none !important;
}
.ast-site-title-wrap .site-title a:hover,
.site-branding .site-title a:hover { color: var(--p4h-gold) !important; }

/* Tagline */
.ast-site-title-wrap .ast-site-tagline,
.site-branding .ast-site-tagline,
.site-description {
  color: var(--p4h-gold) !important;
  font-size: 0.72rem;
  opacity: 0.9;
}

/* Primary nav — desktop: #primary-site-navigation-desktop */
#primary-site-navigation-desktop .menu-item > a,
#primary-site-navigation-desktop a,
.ast-primary-menu-area .menu-item > a {
  color: var(--p4h-white) !important;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 6px 13px;
  border-radius: 6px;
  transition: background 0.18s, color 0.18s;
}
#primary-site-navigation-desktop .menu-item > a:hover,
#primary-site-navigation-desktop .menu-item:hover > a,
.ast-primary-menu-area .menu-item > a:hover {
  color: var(--p4h-gold) !important;
  background: rgba(212,160,23,0.14) !important;
  text-decoration: none;
}
/* Active / current page link */
#primary-site-navigation-desktop .current-menu-item > a,
#primary-site-navigation-desktop .current-page-ancestor > a,
.ast-primary-menu-area .current-menu-item > a {
  color: var(--p4h-gold) !important;
  background: rgba(212,160,23,0.16) !important;
}

/* Mobile nav toggle icon */
.ast-button-wrap .menu-toggle,
.ast-mobile-menu-trigger-minimal,
.mobile-menu-toggle { color: var(--p4h-white) !important; }

/* Header CTA buttons */
.p4h-btn-login,
.p4h-btn-register {
  display: inline-block;
  padding: 8px 22px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.92rem;
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none !important;
}
.p4h-btn-login {
  color: var(--p4h-white) !important;
  border: 1.5px solid var(--p4h-white);
  background: transparent;
}
.p4h-btn-login:hover { background: rgba(255,255,255,0.10); }
.p4h-btn-register,
.ast-custom-button,
.button.ast-button {
  background: var(--p4h-gold) !important;
  color: var(--p4h-navy) !important;
  border: none;
  font-weight: 700;
}
.p4h-btn-register:hover,
.ast-custom-button:hover { background: var(--p4h-gold-light) !important; }

/* ============================================================
   HERO SECTION
   ============================================================ */
.p4h-hero {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url('images/hero_excavator_sunset_20251206_173016.png') center center / cover no-repeat;
  text-align: center;
  overflow: hidden;
}
.p4h-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(13,27,42,0.82) 0%, rgba(13,27,42,0.55) 100%);
}
.p4h-hero-inner {
  position: relative;
  z-index: 2;
  padding: 60px 24px;
  max-width: 860px;
  margin: 0 auto;
}
.p4h-hero h1 {
  color: var(--p4h-white);
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.18;
  margin: 0 0 16px;
}
.p4h-hero p {
  color: rgba(255,255,255,0.88);
  font-size: 1.15rem;
  margin: 0 0 32px;
}

/* Search bar */
.p4h-search-bar {
  display: flex;
  gap: 8px;
  background: #fff;
  border-radius: 9px;
  padding: 8px 10px;
  max-width: 540px;
  margin: 0 auto;
  box-shadow: 0 6px 24px rgba(0,0,0,0.20);
  flex-wrap: wrap;
  align-items: center;
}
.p4h-search-bar input[type="text"],
.p4h-search-bar select {
  flex: 1 1 130px;
  border: 1.5px solid #e5e7eb;
  border-radius: 6px;
  padding: 8px 11px;
  font-size: 0.88rem;
  outline: none;
  min-width: 100px;
  height: 38px;
}
.p4h-search-bar input:focus,
.p4h-search-bar select:focus { border-color: var(--p4h-gold); }

.p4h-search-bar button,
.p4h-btn-search {
  background: var(--p4h-navy);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 20px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  white-space: nowrap;
  transition: background 0.2s;
}
.p4h-search-bar button:hover { background: var(--p4h-gold); color: var(--p4h-navy); }

/* ============================================================
   SECTION WRAPPERS
   ============================================================ */
.p4h-section {
  padding: 72px 24px;
}
.p4h-section-alt { background: #fff; }
.p4h-section-dark {
  background: var(--p4h-navy);
  color: var(--p4h-white);
}

.p4h-section-header {
  text-align: center;
  margin-bottom: 48px;
}
.p4h-section-header h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 800;
  color: var(--p4h-navy);
  margin: 0 0 10px;
}
.p4h-section-dark .p4h-section-header h2 { color: var(--p4h-white); }
.p4h-section-header p {
  color: var(--p4h-gray);
  font-size: 1.05rem;
  margin: 0;
}
.p4h-section-dark .p4h-section-header p { color: rgba(255,255,255,0.72); }

.p4h-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* ============================================================
   EQUIPMENT CATEGORY CARDS
   ============================================================ */
.p4h-categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 22px;
}
.p4h-cat-card {
  background: var(--p4h-card-bg);
  border-radius: var(--p4h-radius);
  box-shadow: var(--p4h-shadow);
  padding: 28px 18px 22px;
  text-align: center;
  transition: transform 0.22s, box-shadow 0.22s;
  cursor: pointer;
  border: 2px solid transparent;
}
.p4h-cat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  border-color: var(--p4h-gold);
}
.p4h-cat-icon {
  font-size: 2.6rem;
  margin-bottom: 12px;
  display: block;
}
.p4h-cat-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--p4h-navy);
  margin: 0 0 5px;
}
.p4h-cat-card span {
  font-size: 0.82rem;
  color: var(--p4h-gray);
}

/* ============================================================
   LISTING CARDS
   ============================================================ */
.p4h-listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 26px;
}
.p4h-listing-card {
  background: var(--p4h-card-bg);
  border-radius: var(--p4h-radius);
  box-shadow: var(--p4h-shadow);
  overflow: hidden;
  transition: transform 0.22s, box-shadow 0.22s;
}
.p4h-listing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.14);
}
.p4h-listing-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}
.p4h-listing-body { padding: 18px; }
.p4h-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.p4h-badge-hire { background: var(--p4h-navy); color: #fff; }
.p4h-badge-sale { background: var(--p4h-gold); color: var(--p4h-navy); }

.p4h-listing-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--p4h-navy);
  margin: 0 0 8px;
}
.p4h-listing-location {
  color: var(--p4h-gray);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 10px;
}
.p4h-listing-price {
  color: var(--p4h-gold);
  font-weight: 700;
  font-size: 1rem;
}

.p4h-btn-view-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--p4h-navy);
  color: #fff !important;
  padding: 12px 30px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.97rem;
  margin-top: 38px;
  transition: background 0.2s;
  text-decoration: none !important;
}
.p4h-btn-view-all:hover { background: var(--p4h-gold); color: var(--p4h-navy) !important; }

/* ============================================================
   CTA BANNER
   ============================================================ */
.p4h-cta-banner {
  background: var(--p4h-navy);
  text-align: center;
  padding: 72px 24px;
}
.p4h-cta-banner h2 {
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
  margin: 0 0 12px;
}
.p4h-cta-banner p {
  color: rgba(255,255,255,0.76);
  font-size: 1.05rem;
  margin: 0 0 28px;
}
.p4h-btn-cta {
  background: var(--p4h-gold);
  color: var(--p4h-navy) !important;
  padding: 14px 36px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 1.05rem;
  display: inline-block;
  text-decoration: none !important;
  transition: background 0.2s, transform 0.15s;
}
.p4h-btn-cta:hover { background: var(--p4h-gold-light); transform: scale(1.03); }

/* ============================================================
   ABOUT SECTION
   ============================================================ */
.p4h-about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.p4h-about-text h2 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--p4h-navy);
  margin: 0 0 18px;
}
.p4h-about-text p {
  color: var(--p4h-gray);
  line-height: 1.75;
  margin: 0 0 22px;
}
.p4h-about-images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.p4h-about-images img {
  border-radius: 10px;
  width: 100%;
  height: 160px;
  object-fit: cover;
}
.p4h-about-images img:first-child {
  grid-column: 1 / -1;
  height: 200px;
}

/* ============================================================
   PRICING CARDS
   ============================================================ */
.p4h-pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
  align-items: start;
}
.p4h-price-card {
  background: var(--p4h-card-bg);
  border-radius: var(--p4h-radius);
  box-shadow: var(--p4h-shadow);
  padding: 36px 28px 30px;
  border: 2px solid transparent;
  position: relative;
}
.p4h-price-card.featured {
  border-color: var(--p4h-gold);
  transform: scale(1.03);
}
.p4h-price-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--p4h-gold);
  color: var(--p4h-navy);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 18px;
  border-radius: 20px;
  letter-spacing: 0.07em;
}
.p4h-price-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--p4h-navy);
  margin: 0 0 6px;
}
.p4h-price-amount {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--p4h-gold);
  margin: 14px 0 4px;
}
.p4h-price-amount span {
  font-size: 1rem;
  color: var(--p4h-gray);
  font-weight: 400;
}
.p4h-price-desc {
  color: var(--p4h-gray);
  font-size: 0.88rem;
  margin: 0 0 22px;
}
.p4h-price-features {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
}
.p4h-price-features li {
  padding: 7px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.92rem;
  color: var(--p4h-dark-text);
  display: flex;
  align-items: center;
  gap: 9px;
}
.p4h-price-features li::before {
  content: '✓';
  color: #16a34a;
  font-weight: 700;
  font-size: 0.9rem;
}
.p4h-price-features li.disabled {
  color: #aaa;
  text-decoration: line-through;
}
.p4h-price-features li.disabled::before { content: '×'; color: #d1d5db; }

.p4h-btn-plan {
  display: block;
  text-align: center;
  padding: 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.97rem;
  border: 2px solid var(--p4h-navy);
  color: var(--p4h-navy);
  transition: all 0.2s;
  text-decoration: none !important;
  cursor: pointer;
  background: transparent;
  width: 100%;
}
.p4h-btn-plan:hover,
.p4h-price-card.featured .p4h-btn-plan {
  background: var(--p4h-navy);
  color: #fff !important;
}

/* ============================================================
   CONTACT SECTION
   ============================================================ */
.p4h-contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.p4h-contact-info h2 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--p4h-navy);
  margin: 0 0 16px;
}
.p4h-contact-info p { color: var(--p4h-gray); line-height: 1.7; }
.p4h-contact-detail {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 18px 0;
}
.p4h-contact-detail .icon {
  background: var(--p4h-navy);
  color: var(--p4h-gold);
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
}
.p4h-contact-detail .text strong { display: block; color: var(--p4h-navy); }
.p4h-contact-detail .text span { color: var(--p4h-gray); font-size: 0.93rem; }

/* Contact form */
.p4h-contact-form input,
.p4h-contact-form select,
.p4h-contact-form textarea {
  width: 100%;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.95rem;
  margin-bottom: 14px;
  background: #fff;
  font-family: inherit;
  transition: border-color 0.2s;
}
.p4h-contact-form input:focus,
.p4h-contact-form textarea:focus { border-color: var(--p4h-gold); outline: none; }
.p4h-contact-form textarea { min-height: 120px; resize: vertical; }
.p4h-contact-form button {
  background: var(--p4h-navy);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 13px 32px;
  font-size: 0.97rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  width: 100%;
}
.p4h-contact-form button:hover { background: var(--p4h-gold); color: var(--p4h-navy); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer,
.p4h-footer {
  background: var(--p4h-navy) !important;
  color: rgba(255,255,255,0.80);
  padding: 56px 24px 24px;
}
.p4h-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto 40px;
}
.p4h-footer-brand p {
  font-size: 0.9rem;
  line-height: 1.65;
  color: rgba(255,255,255,0.65);
  margin: 10px 0 16px;
}
.p4h-footer-brand .logo-text {
  color: #fff;
  font-size: 1.3rem;
  font-weight: 800;
}
.p4h-footer-brand .logo-text span { color: var(--p4h-gold); }
.p4h-footer-contact-item {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.72);
  margin-bottom: 7px;
}
.p4h-footer-col h4 {
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 16px;
}
.p4h-footer-col ul {
  list-style: none;
  padding: 0; margin: 0;
}
.p4h-footer-col ul li { margin-bottom: 9px; }
.p4h-footer-col ul li a {
  color: rgba(255,255,255,0.65);
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.2s;
}
.p4h-footer-col ul li a:hover { color: var(--p4h-gold); }
.p4h-footer-bottom {
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 22px;
  font-size: 0.84rem;
  color: rgba(255,255,255,0.45);
  max-width: 1200px;
  margin: 0 auto;
}

/* ============================================================
   WP ASTRA OVERRIDES
   ============================================================ */
.ast-container { max-width: 1200px !important; }
.entry-content { font-size: 1rem; line-height: 1.8; }
.wp-block-button__link,
.woocommerce a.button,
.woocommerce button.button {
  background: var(--p4h-navy) !important;
  color: #fff !important;
  border-radius: 8px !important;
  font-weight: 700 !important;
  padding: 11px 26px !important;
}
.wp-block-button__link:hover,
.woocommerce a.button:hover { background: var(--p4h-gold) !important; color: var(--p4h-navy) !important; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .p4h-about-grid,
  .p4h-contact-grid,
  .p4h-footer-grid { grid-template-columns: 1fr; }
  .p4h-footer-grid { grid-template-columns: 1fr 1fr; }
  .p4h-price-card.featured { transform: scale(1); }
}
@media (max-width: 600px) {
  .p4h-hero h1 { font-size: 1.8rem; }
  .p4h-footer-grid { grid-template-columns: 1fr; }
  .p4h-search-bar { flex-direction: column; }
}
