/*
Theme Name: Afia Online
Theme URI: https://afiaonline.com
Author: Afia Online
Description: Custom WooCommerce storefront theme for Afia Online — a professional, blue-themed marketplace layout.
Version: 1.0
Text Domain: afia-online
Requires Plugins: woocommerce
*/

/* ============ RESET & BASE ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #0b5fff;
  --primary-dark: #0a3fb0;
  --primary-light: #e8f0ff;
  --text-dark: #1a1a2e;
  --text-gray: #5c5f66;
  --border: #e5e7eb;
  --bg-light: #f7f9fc;
  --white: #ffffff;
  --success: #16a34a;
  --radius: 10px;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-dark);
  background: var(--white);
  line-height: 1.6;
  font-size: 15px;
}

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

/* ============ TOP BAR ============ */
.top-bar {
  background: var(--text-dark);
  color: #cfd6e6;
  font-size: 13px;
  padding: 6px 0;
}
.top-bar .container { display: flex; justify-content: space-between; align-items: center; }
.top-bar a { color: #cfd6e6; }

/* ============ HEADER ============ */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.site-logo img { max-height: 48px; }
.site-logo .site-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}

.header-search {
  flex: 1;
  max-width: 520px;
  display: flex;
}
.header-search input {
  flex: 1;
  padding: 11px 16px;
  border: 2px solid var(--primary);
  border-right: none;
  border-radius: 6px 0 0 6px;
  font-size: 14px;
  outline: none;
}
.header-search button {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0 20px;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  font-size: 16px;
}
.header-search button:hover { background: var(--primary-dark); }

.header-actions { display: flex; align-items: center; gap: 22px; }
.header-actions a {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 12px;
  color: var(--text-dark);
  gap: 3px;
  font-weight: 500;
}
.header-actions .icon { font-size: 20px; }
.cart-count {
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  border-radius: 50%;
  width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  top: -14px; left: 10px;
}

/* ============ NAV MENU ============ */
.main-nav {
  background: var(--primary);
}
.main-nav .container { display: flex; }
.main-nav ul { display: flex; flex-wrap: wrap; }
.main-nav a {
  display: block;
  color: #fff;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 500;
}
.main-nav a:hover { background: var(--primary-dark); }

/* ============ HERO LAYOUT (main slider + side promo tiles) ============ */
.hero-layout {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 16px;
  padding-top: 20px;
}
.hero-side { display: flex; flex-direction: column; gap: 16px; }
.hero-side-tile {
  position: relative;
  flex: 1;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  background-size: cover;
  background-position: center;
  min-height: 130px;
  display: flex;
  align-items: flex-end;
  transition: transform .2s ease;
}
.hero-side-tile:hover { transform: translateY(-3px); }
.hero-side-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(10,30,80,0.75) 0%, rgba(10,30,80,0.15) 70%);
}
.hero-side-text {
  position: relative;
  z-index: 2;
  padding: 16px;
  color: #fff;
}
.hero-side-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255,255,255,0.2);
  padding: 3px 9px;
  border-radius: 20px;
  margin-bottom: 6px;
}
.hero-side-text strong { display: block; font-size: 17px; font-weight: 800; }

@media (max-width: 900px) {
  .hero-layout { grid-template-columns: 1fr; }
  .hero-side { flex-direction: row; }
}

/* ============ HERO SLIDER ============ */
.hero-slider {
  position: relative;
  height: 420px;
  overflow: hidden;
  background: var(--text-dark);
  border-radius: 14px;
}
.hero-slides { position: relative; width: 100%; height: 100%; }
.hero-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  background: linear-gradient(120deg, var(--primary) 0%, var(--primary-dark) 100%);
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 1s ease, transform 6s ease;
  pointer-events: none;
}
.hero-slide.is-active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}
.hero-slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(10,30,80,0.72) 0%, rgba(10,30,80,0.35) 60%, rgba(10,30,80,0.15) 100%);
}
.hero-slide-inner {
  position: relative;
  z-index: 2;
  color: #fff;
  max-width: 460px;
  padding: 0 40px;
}
.hero-slide-icon { font-size: 44px; margin-bottom: 14px; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.25)); }
.hero-slide-inner h1 {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 14px;
  letter-spacing: -0.5px;
  text-shadow: 0 4px 20px rgba(0,0,0,0.25);
}
.hero-slide-inner p { font-size: 16px; color: #e4ecff; margin-bottom: 26px; }

.btn-primary {
  display: inline-block;
  background: #fff;
  color: var(--primary-dark);
  padding: 14px 30px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.22);
}

.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 26px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background .15s ease;
  line-height: 1;
}
.hero-arrow:hover { background: rgba(255,255,255,0.3); }
.hero-arrow-prev { left: 20px; }
.hero-arrow-next { right: 20px; }

.hero-dots {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 5;
}
.hero-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: all .2s ease;
  padding: 0;
}
.hero-dot.is-active { background: #fff; width: 24px; border-radius: 4px; }

@media (max-width: 768px) {
  .hero-slider { height: 320px; }
  .hero-slide-inner { padding: 0 24px; }
  .hero-slide-inner h1 { font-size: 24px; }
  .hero-arrow { width: 36px; height: 36px; font-size: 20px; }
}

/* ============ SECTION HEADINGS ============ */
.section { padding: 48px 0; }
.section-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-title span.accent {
  width: 5px; height: 22px;
  background: var(--primary);
  display: inline-block;
  margin-right: 10px;
  border-radius: 3px;
  vertical-align: middle;
}
.section-title a.view-all {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
}

/* ============ CATEGORY GRID ============ */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}
.category-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-align: center;
  padding: 26px 10px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 32px rgba(11,95,255,0.14);
  border-color: var(--primary);
}
.category-card .cat-icon {
  font-size: 32px;
  margin-bottom: 12px;
  transition: transform .2s ease;
}
.category-card:hover .cat-icon { transform: scale(1.15); }
.category-card .cat-name { font-size: 13px; font-weight: 700; color: var(--text-dark); letter-spacing: 0.2px; }

/* ============ PRODUCT GRID (WooCommerce overrides) ============ */
ul.products {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 20px;
  list-style: none;
}
ul.products li.product {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
  position: relative;
  display: flex !important;
  flex-direction: column;
  overflow: hidden;
  flex: 0 0 calc(25% - 15px) !important;
  max-width: calc(25% - 15px) !important;
  width: auto !important;
}
@media (max-width: 900px) {
  ul.products li.product { flex-basis: calc(50% - 10px) !important; max-width: calc(50% - 10px) !important; }
}
@media (max-width: 480px) {
  ul.products li.product { flex-basis: 100% !important; max-width: 100% !important; }
}
ul.products li.product:hover {
  box-shadow: 0 20px 40px rgba(11,20,50,0.12);
  transform: translateY(-6px);
  border-color: rgba(11,95,255,0.25);
}
ul.products li.product a:not(.button) {
  display: flex;
  flex-direction: column;
  flex: 1;
}
ul.products li.product img,
ul.products li.product a img {
  width: 100% !important;
  height: auto !important;
  max-width: none !important;
  border-radius: 10px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  margin-bottom: 12px;
  transition: transform .35s ease;
}
ul.products li.product:hover img { transform: scale(1.05); }
ul.products li.product .woocommerce-loop-product__title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-dark);
  line-height: 1.4;
}
ul.products li.product .price {
  color: var(--primary-dark);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.2px;
}
ul.products li.product .price del { color: #9aa0aa; font-weight: 400; font-size: 13px; margin-right: 6px; }
ul.products li.product .button {
  display: block;
  margin-top: auto;
  padding-top: 12px;
  background: var(--primary);
  color: #fff !important;
  text-align: center;
  padding: 11px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  transition: background .2s ease, box-shadow .2s ease;
}
ul.products li.product .button:hover {
  background: var(--primary-dark);
  box-shadow: 0 8px 18px rgba(11,95,255,0.3);
}
ul.products li.product .onsale {
  position: absolute;
  top: 12px; left: 12px;
  background: var(--success);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  min-height: auto;
  z-index: 2;
  box-shadow: 0 4px 10px rgba(22,163,74,0.3);
}

/* ============ SINGLE PRODUCT ============ */
.single-product .summary { padding: 0 10px; }
.single-product .price { color: var(--primary); font-size: 24px; font-weight: 700; }
.single-product .single_add_to_cart_button {
  background: var(--primary) !important;
  border: none;
  padding: 14px 32px !important;
  border-radius: 6px !important;
  font-weight: 600 !important;
}
.single-product .single_add_to_cart_button:hover { background: var(--primary-dark) !important; }

/* ============ PAGE / CART / CHECKOUT ============ */
.page-title { font-size: 26px; font-weight: 800; margin: 30px 0 20px; }
.page-content { padding-bottom: 40px; }
.woocommerce-cart-form table.shop_table,
.woocommerce-checkout table.shop_table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}
.woocommerce-cart-form table.shop_table th,
.woocommerce-cart-form table.shop_table td,
.woocommerce-checkout table.shop_table th,
.woocommerce-checkout table.shop_table td {
  padding: 14px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.woocommerce-cart-form .product-thumbnail img {
  width: 64px;
  border-radius: 8px;
}
.cart-collaterals .cart_totals {
  background: var(--bg-light);
  border-radius: var(--radius);
  padding: 20px;
  max-width: 400px;
  margin-left: auto;
}
.wc-proceed-to-checkout .checkout-button,
input.button, button.button, .woocommerce-cart-form button[name="update_cart"] {
  background: var(--primary);
  color: #fff !important;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}
.wc-proceed-to-checkout .checkout-button:hover,
input.button:hover, button.button:hover { background: var(--primary-dark); }

/* ============ TRUST STRIP ============ */
.trust-strip {
  background: var(--bg-light);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 28px 0;
}
.trust-strip .container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  text-align: center;
}
.trust-item .icon { font-size: 26px; margin-bottom: 8px; }
.trust-item h4 { font-size: 14px; margin-bottom: 4px; }
.trust-item p { font-size: 12px; color: var(--text-gray); }

/* ============ CATEGORY CIRCLES (Jumia-style, real photos) ============ */
.category-circle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 20px;
}
.category-circle { text-align: center; }
.category-circle-image {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin: 0 auto 10px;
  overflow: hidden;
  background: var(--primary-light);
  border: 3px solid var(--white);
  box-shadow: 0 4px 16px rgba(11,95,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s ease, box-shadow .2s ease;
}
.category-circle:hover .category-circle-image {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 10px 24px rgba(11,95,255,0.25);
}
.category-circle-image img { width: 100%; height: 100%; object-fit: cover; }
.category-circle-fallback { font-size: 36px; }
.category-circle-name { font-size: 13px; font-weight: 600; color: var(--text-dark); }

/* ============ DEAL BANDS (Flash Sales / Deals of Day / Top Sellers) — premium, minimal ============ */
.deal-band {
  padding: 36px 0;
  margin: 8px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.deal-band-flash { background: var(--white); }
.deal-band-orange { background: var(--bg-light); }
.deal-band-purple { background: var(--white); }

.deal-band-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.deal-band-header h2 {
  font-size: 21px;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.deal-band-eyebrow {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
}
.deal-band-flash .deal-band-eyebrow { background: #e11d48; }
.deal-band-orange .deal-band-eyebrow { background: #ea580c; }
.deal-band-purple .deal-band-eyebrow { background: #7c3aed; }

.deal-band-link {
  margin-left: auto;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 4px;
  border-bottom: 2px solid transparent;
  transition: border-color .2s ease;
}
.deal-band-link:hover { border-color: var(--primary); }

.deal-countdown {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--text-dark);
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.cd-box { min-width: 20px; text-align: center; }

/* Dense horizontally-scrollable product row used inside deal bands */
.deal-band-products {
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.deal-band-products::-webkit-scrollbar { height: 6px; }
.deal-band-products::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.deal-band-products ul.products {
  flex-wrap: nowrap !important;
}
.deal-band-products ul.products li.product {
  flex: 0 0 190px !important;
  max-width: 190px !important;
  scroll-snap-align: start;
}

@media (max-width: 768px) {
  .category-circle-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 14px; }
  .category-circle-image { width: 74px; height: 74px; }
  .deal-band-products ul.products li.product { flex-basis: 150px !important; max-width: 150px !important; }
}
.newsletter-strip {
  background: linear-gradient(120deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: 40px 0;
  margin-top: 20px;
}
.newsletter-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.newsletter-inner h3 { font-size: 20px; margin-bottom: 6px; }
.newsletter-inner p { color: #dbe6ff; font-size: 13px; }
.newsletter-form { display: flex; gap: 0; min-width: 320px; }
.newsletter-form input {
  flex: 1;
  padding: 13px 16px;
  border: none;
  border-radius: 8px 0 0 8px;
  font-size: 14px;
  outline: none;
}
.newsletter-form button {
  background: var(--text-dark);
  color: #fff;
  border: none;
  padding: 0 24px;
  border-radius: 0 8px 8px 0;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
}
.newsletter-form button:hover { background: #000; }

/* ============ FOOTER ============ */
.site-footer {
  background: var(--text-dark);
  color: #cfd6e6;
  padding: 48px 0 20px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  margin-bottom: 32px;
}
.footer-col h4 { color: #fff; font-size: 15px; margin-bottom: 16px; }
.footer-col ul li { margin-bottom: 10px; font-size: 13px; }
.footer-col ul li a:hover { color: var(--primary-light); }
.social-icons { display: flex; gap: 10px; margin-top: 14px; }
.social-icons a {
  width: 34px; height: 34px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
}
.social-icons a:hover { background: var(--primary); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 18px;
  text-align: center;
  font-size: 12px;
  color: #8b91a3;
}

/* ============ MOBILE ============ */
.mobile-toggle { display: none; background: none; border: none; color: #fff; font-size: 24px; }
@media (max-width: 768px) {
  .site-header .container { justify-content: space-between; }
  .header-search { order: 3; max-width: 100%; width: 100%; margin-top: 10px; }
  .main-nav ul { display: none; flex-direction: column; width: 100%; }
  .main-nav ul.open { display: flex; }
  .mobile-toggle { display: block; }
  .main-nav .container { flex-wrap: wrap; }
  .hero-text h1 { font-size: 26px; }
  .hero-image { display: none; }
}
