/*
Theme Name: AppiPure
Theme URI: https://appipure.com
Author: AppiPure
Author URI: https://appipure.com
Description: Custom high-performance WooCommerce theme for AppiPure supplements. Built for conversion, speed, and SEO.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 8.1
License: Proprietary
Text Domain: appipure

Tags: e-commerce, woocommerce, custom-logo, custom-menu, featured-images
*/

/* ============================================
   DESIGN TOKENS
   ============================================ */

:root {
  /* Brand Colors - Partial refresh: keeping natural/green direction, modernised */
  --ap-green-50: #f0f7f0;
  --ap-green-100: #d4ecd4;
  --ap-green-200: #a8d9a8;
  --ap-green-400: #4caf50;
  --ap-green-600: #2e7d32;
  --ap-green-700: #1b5e20;
  --ap-green-800: #0d3b12;
  --ap-green-900: #071f09;

  /* Warm neutral tones - supplement/wellness feel */
  --ap-sand-50: #faf8f5;
  --ap-sand-100: #f2efe9;
  --ap-sand-200: #e8e3da;
  --ap-sand-300: #d4cdc0;
  --ap-sand-400: #b5ac9c;
  --ap-sand-600: #7a7265;

  /* Trust / accent */
  --ap-gold-400: #c9a84c;
  --ap-gold-600: #9a7b2e;

  /* Functional */
  --ap-white: #ffffff;
  --ap-black: #1a1a18;
  --ap-text: #2c2c2a;
  --ap-text-muted: #6b6b65;
  --ap-text-light: #9c9a92;
  --ap-border: #e5e2db;
  --ap-border-hover: #ccc8be;
  --ap-error: #c62828;
  --ap-success: #2e7d32;
  --ap-info: #1565c0;

  /* Typography */
  --ap-font-display: 'DM Serif Display', Georgia, serif;
  --ap-font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --ap-font-mono: 'JetBrains Mono', monospace;

  /* Sizing */
  --ap-container: 1280px;
  --ap-container-narrow: 960px;
  --ap-radius-sm: 4px;
  --ap-radius-md: 8px;
  --ap-radius-lg: 12px;
  --ap-radius-xl: 16px;
  --ap-radius-pill: 99px;

  /* Spacing scale */
  --ap-space-xs: 4px;
  --ap-space-sm: 8px;
  --ap-space-md: 16px;
  --ap-space-lg: 24px;
  --ap-space-xl: 32px;
  --ap-space-2xl: 48px;
  --ap-space-3xl: 64px;
  --ap-space-4xl: 96px;

  /* Transitions */
  --ap-ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ap-duration: 0.2s;
}

/* ============================================
   RESET & BASE
   ============================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--ap-font-body);
  color: var(--ap-text);
  background-color: var(--ap-sand-50);
  line-height: 1.6;
  overflow-x: hidden;
}

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

a {
  color: var(--ap-green-700);
  text-decoration: none;
  transition: color var(--ap-duration) var(--ap-ease);
}

a:hover {
  color: var(--ap-green-600);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--ap-font-display);
  font-weight: 400;
  line-height: 1.2;
  color: var(--ap-black);
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: 1rem;
  line-height: 1.7;
}

.text-muted { color: var(--ap-text-muted); }
.text-light { color: var(--ap-text-light); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }

/* ============================================
   LAYOUT
   ============================================ */

.ap-container {
  width: 100%;
  max-width: var(--ap-container);
  margin: 0 auto;
  padding: 0 var(--ap-space-lg);
}

.ap-container--narrow {
  max-width: var(--ap-container-narrow);
}

.ap-section {
  padding: var(--ap-space-4xl) 0;
}

.ap-grid {
  display: grid;
  gap: var(--ap-space-lg);
}

/* ============================================
   BUTTONS
   ============================================ */

.ap-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ap-space-sm);
  padding: 14px 28px;
  font-family: var(--ap-font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: none;
  border-radius: var(--ap-radius-md);
  cursor: pointer;
  transition: all var(--ap-duration) var(--ap-ease);
  text-transform: none;
  line-height: 1;
}

.ap-btn--primary {
  background: var(--ap-green-700);
  color: var(--ap-white);
}

.ap-btn--primary:hover {
  background: var(--ap-green-600);
  transform: translateY(-1px);
}

.ap-btn--secondary {
  background: transparent;
  color: var(--ap-green-700);
  border: 1.5px solid var(--ap-green-700);
}

.ap-btn--secondary:hover {
  background: var(--ap-green-50);
}

.ap-btn--ghost {
  background: transparent;
  color: var(--ap-text);
  padding: 10px 16px;
}

.ap-btn--ghost:hover {
  background: var(--ap-sand-100);
}

.ap-btn--sm {
  padding: 10px 20px;
  font-size: 0.8125rem;
}

.ap-btn--lg {
  padding: 18px 36px;
  font-size: 1rem;
}

.ap-btn--full {
  width: 100%;
}

/* ============================================
   HEADER
   ============================================ */

.ap-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ap-border);
}

.ap-header__top-bar {
  background: var(--ap-green-800);
  color: var(--ap-green-100);
  font-size: 0.8125rem;
  text-align: center;
  padding: 6px 0;
  letter-spacing: 0.03em;
}

.ap-header__main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px var(--ap-space-lg);
  max-width: var(--ap-container);
  margin: 0 auto;
}

.ap-header__logo img {
  height: 40px;
  width: auto;
}

.ap-header__nav {
  display: flex;
  align-items: center;
  gap: var(--ap-space-xl);
}

.ap-header__nav a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ap-text);
  position: relative;
}

.ap-header__nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--ap-green-600);
  transition: width var(--ap-duration) var(--ap-ease);
}

.ap-header__nav a:hover::after {
  width: 100%;
}

.ap-header__actions {
  display: flex;
  align-items: center;
  gap: var(--ap-space-md);
}

.ap-header__cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: var(--ap-green-600);
  color: var(--ap-white);
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: 50%;
}

/* Mobile nav */
.ap-header__hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.ap-header__hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ap-text);
  margin: 5px 0;
  transition: all 0.3s;
}

@media (max-width: 768px) {
  .ap-header__nav {
    display: none;
  }
  .ap-header__hamburger {
    display: block;
  }
  .ap-header__nav.is-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--ap-white);
    padding: var(--ap-space-lg);
    border-bottom: 1px solid var(--ap-border);
  }
}

/* ============================================
   HERO SECTION
   ============================================ */

.ap-hero {
  background: linear-gradient(135deg, var(--ap-sand-50) 0%, var(--ap-green-50) 100%);
  padding: var(--ap-space-4xl) 0;
  position: relative;
  overflow: hidden;
}

.ap-hero__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--ap-space-3xl);
  align-items: center;
}

.ap-hero__tag {
  display: inline-block;
  background: var(--ap-green-100);
  color: var(--ap-green-700);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--ap-radius-pill);
  margin-bottom: var(--ap-space-md);
  letter-spacing: 0.03em;
}

.ap-hero__title {
  margin-bottom: var(--ap-space-lg);
  line-height: 1.1;
}

.ap-hero__subtitle {
  font-size: 1.125rem;
  color: var(--ap-text-muted);
  margin-bottom: var(--ap-space-xl);
  max-width: 520px;
}

.ap-hero__ctas {
  display: flex;
  gap: var(--ap-space-md);
  flex-wrap: wrap;
}

.ap-hero__trust {
  display: flex;
  align-items: center;
  gap: var(--ap-space-lg);
  margin-top: var(--ap-space-xl);
  padding-top: var(--ap-space-xl);
  border-top: 1px solid var(--ap-border);
}

.ap-hero__trust-item {
  display: flex;
  align-items: center;
  gap: var(--ap-space-sm);
  font-size: 0.8125rem;
  color: var(--ap-text-muted);
}

@media (max-width: 768px) {
  .ap-hero__inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .ap-hero__subtitle {
    margin-left: auto;
    margin-right: auto;
  }
  .ap-hero__ctas {
    justify-content: center;
  }
  .ap-hero__trust {
    justify-content: center;
    flex-wrap: wrap;
  }
}

/* ============================================
   PRODUCT CARDS
   ============================================ */

.ap-product-card {
  background: var(--ap-white);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius-lg);
  overflow: hidden;
  transition: all 0.3s var(--ap-ease);
  position: relative;
}

.ap-product-card:hover {
  border-color: var(--ap-border-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.ap-product-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  background: var(--ap-green-600);
  color: var(--ap-white);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--ap-radius-sm);
}

.ap-product-card__badge--sale {
  background: var(--ap-error);
}

.ap-product-card__image {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--ap-sand-100);
}

.ap-product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: var(--ap-space-lg);
  transition: transform 0.4s var(--ap-ease);
}

.ap-product-card:hover .ap-product-card__image img {
  transform: scale(1.05);
}

.ap-product-card__body {
  padding: var(--ap-space-md) var(--ap-space-md) var(--ap-space-lg);
}

.ap-product-card__category {
  font-size: 0.75rem;
  color: var(--ap-text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--ap-space-xs);
}

.ap-product-card__title {
  font-family: var(--ap-font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: var(--ap-space-sm);
  color: var(--ap-text);
}

.ap-product-card__title a {
  color: inherit;
}

.ap-product-card__title a:hover {
  color: var(--ap-green-600);
}

.ap-product-card__meta {
  display: flex;
  align-items: center;
  gap: var(--ap-space-sm);
  margin-bottom: var(--ap-space-sm);
}

.ap-product-card__rating {
  color: var(--ap-gold-400);
  font-size: 0.8125rem;
}

.ap-product-card__review-count {
  font-size: 0.75rem;
  color: var(--ap-text-light);
}

.ap-product-card__price {
  display: flex;
  align-items: baseline;
  gap: var(--ap-space-sm);
  margin-bottom: var(--ap-space-md);
}

.ap-product-card__price-current {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ap-text);
}

.ap-product-card__price-original {
  font-size: 0.875rem;
  color: var(--ap-text-light);
  text-decoration: line-through;
}

.ap-product-card__subscribe {
  font-size: 0.75rem;
  color: var(--ap-green-600);
  margin-bottom: var(--ap-space-md);
}

.ap-product-card__actions {
  display: flex;
  gap: var(--ap-space-sm);
}

/* Product grid */
.ap-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--ap-space-lg);
}

/* ============================================
   TRUST BAR
   ============================================ */

.ap-trust-bar {
  background: var(--ap-white);
  border-top: 1px solid var(--ap-border);
  border-bottom: 1px solid var(--ap-border);
  padding: var(--ap-space-xl) 0;
}

.ap-trust-bar__inner {
  display: flex;
  justify-content: center;
  gap: var(--ap-space-3xl);
  flex-wrap: wrap;
}

.ap-trust-bar__item {
  display: flex;
  align-items: center;
  gap: var(--ap-space-md);
  font-size: 0.875rem;
  color: var(--ap-text-muted);
}

.ap-trust-bar__icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ap-green-50);
  color: var(--ap-green-600);
  border-radius: 50%;
  font-size: 1rem;
}

/* ============================================
   CONDITION CARDS (Shop by Condition)
   ============================================ */

.ap-condition-card {
  background: var(--ap-white);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius-lg);
  padding: var(--ap-space-xl);
  transition: all 0.3s var(--ap-ease);
  cursor: pointer;
  text-align: center;
}

.ap-condition-card:hover {
  border-color: var(--ap-green-200);
  background: var(--ap-green-50);
  transform: translateY(-2px);
}

.ap-condition-card__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--ap-space-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ap-green-100);
  color: var(--ap-green-700);
  border-radius: var(--ap-radius-md);
  font-size: 1.25rem;
}

.ap-condition-card__title {
  font-family: var(--ap-font-body);
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: var(--ap-space-xs);
}

.ap-condition-card__count {
  font-size: 0.8125rem;
  color: var(--ap-text-light);
}

/* ============================================
   SUBSCRIBE & SAVE (Product Page)
   ============================================ */

.ap-subscribe-toggle {
  background: var(--ap-green-50);
  border: 1.5px solid var(--ap-green-200);
  border-radius: var(--ap-radius-lg);
  padding: var(--ap-space-lg);
  margin-bottom: var(--ap-space-lg);
}

.ap-subscribe-toggle__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--ap-space-sm);
}

.ap-subscribe-toggle__label {
  font-weight: 500;
  font-size: 0.9375rem;
}

.ap-subscribe-toggle__save {
  background: var(--ap-green-600);
  color: var(--ap-white);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--ap-radius-pill);
}

.ap-subscribe-toggle__frequency {
  display: flex;
  gap: var(--ap-space-sm);
  margin-top: var(--ap-space-md);
}

.ap-subscribe-toggle__freq-btn {
  padding: 8px 16px;
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius-md);
  background: var(--ap-white);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all var(--ap-duration) var(--ap-ease);
}

.ap-subscribe-toggle__freq-btn.is-active {
  border-color: var(--ap-green-600);
  background: var(--ap-green-600);
  color: var(--ap-white);
}

/* ============================================
   FOOTER
   ============================================ */

.ap-footer {
  background: var(--ap-green-900);
  color: var(--ap-green-100);
  padding: var(--ap-space-4xl) 0 var(--ap-space-xl);
}

.ap-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--ap-space-3xl);
  margin-bottom: var(--ap-space-3xl);
}

.ap-footer__brand p {
  font-size: 0.875rem;
  color: var(--ap-green-200);
  line-height: 1.7;
  margin-top: var(--ap-space-md);
  max-width: 320px;
}

.ap-footer__heading {
  font-family: var(--ap-font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ap-sand-400);
  margin-bottom: var(--ap-space-lg);
}

.ap-footer__links {
  list-style: none;
}

.ap-footer__links li {
  margin-bottom: var(--ap-space-sm);
}

.ap-footer__links a {
  font-size: 0.875rem;
  color: var(--ap-green-200);
  transition: color var(--ap-duration);
}

.ap-footer__links a:hover {
  color: var(--ap-white);
}

.ap-footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: var(--ap-space-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--ap-space-md);
}

.ap-footer__copyright {
  font-size: 0.8125rem;
  color: var(--ap-sand-400);
}

.ap-footer__payments {
  display: flex;
  gap: var(--ap-space-md);
  align-items: center;
}

@media (max-width: 768px) {
  .ap-footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--ap-space-xl);
  }
}

@media (max-width: 480px) {
  .ap-footer__grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   WOOCOMMERCE OVERRIDES
   ============================================ */

.woocommerce .quantity .qty {
  width: 60px;
  padding: 10px;
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius-md);
  font-family: var(--ap-font-body);
  font-size: 0.9375rem;
  text-align: center;
}

.woocommerce button.button,
.woocommerce a.button,
.woocommerce input.button {
  background: var(--ap-green-700) !important;
  color: var(--ap-white) !important;
  font-family: var(--ap-font-body) !important;
  font-weight: 500 !important;
  border-radius: var(--ap-radius-md) !important;
  padding: 14px 28px !important;
  border: none !important;
  transition: all var(--ap-duration) var(--ap-ease) !important;
}

.woocommerce button.button:hover,
.woocommerce a.button:hover {
  background: var(--ap-green-600) !important;
  transform: translateY(-1px);
}

.woocommerce button.button.alt,
.woocommerce a.button.alt {
  background: var(--ap-green-700) !important;
}

.woocommerce-message,
.woocommerce-info {
  border-top-color: var(--ap-green-600) !important;
}

.woocommerce-message::before,
.woocommerce-info::before {
  color: var(--ap-green-600) !important;
}

/* Checkout - minimal and clean */
.woocommerce-checkout .woocommerce-input-wrapper input,
.woocommerce-checkout .woocommerce-input-wrapper select,
.woocommerce-checkout .woocommerce-input-wrapper textarea {
  border: 1px solid var(--ap-border) !important;
  border-radius: var(--ap-radius-md) !important;
  padding: 12px 16px !important;
  font-family: var(--ap-font-body) !important;
  font-size: 0.9375rem !important;
  transition: border-color var(--ap-duration) !important;
}

.woocommerce-checkout .woocommerce-input-wrapper input:focus,
.woocommerce-checkout .woocommerce-input-wrapper select:focus {
  border-color: var(--ap-green-600) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1) !important;
}

/* ============================================
   UTILITIES
   ============================================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ap-fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ap-ease), transform 0.6s var(--ap-ease);
}

.ap-fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}
