/*
Theme Name: The Standard Arena
Theme URI: https://thestandardarena.co.ke
Author: The Standard Arena
Author URI: https://thestandardarena.co.ke
Description: A professional WordPress theme for The Standard Arena - Kenya's premier educational resources marketplace. Features sticky navigation, product categories, payment integration, and responsive design.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: standard-arena
Tags: one-column, custom-menu, featured-images, theme-options, translation-ready
*/

/* ========================================
   CSS Variables & Base Styles
   ======================================== */
:root {
    --primary: #1a7a3e;
    --primary-dark: #145c2e;
    --primary-light: #e8f5ec;
    --orange: #f59e0b;
    --dark: #1a1a2e;
    --text: #1a1a2e;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --bg-light: #f9fafb;
    --white: #ffffff;
    --max-width: 1200px;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    background: var(--white);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

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

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   Header Styles
   ======================================== */
.main-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo-container .logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
}

.logo-container .logo img {
    height: 40px;
    width: auto;
}

.desktop-center {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    justify-content: center;
}

.search-box {
    display: flex;
    align-items: center;
    border: 2px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: #f9fafb;
    max-width: 500px;
    width: 100%;
    transition: border-color 0.2s;
}

.search-box:focus-within {
    border-color: var(--primary);
}

.search-box input {
    border: none;
    outline: none;
    padding: 10px 16px;
    font-size: 14px;
    background: transparent;
    flex: 1;
    color: var(--text);
}

.search-box input::placeholder {
    color: #9ca3af;
}

.search-box button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.search-box button:hover {
    background: var(--primary-dark);
}

.desktop-contact {
    display: flex;
    align-items: center;
    gap: 16px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
}

.mpesa-badge {
    background: #fef3c7;
    color: #92400e;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

/* ========================================
   Navigation
   ======================================== */
.main-nav {
    background: var(--primary);
    padding: 0;
    position: sticky;
    top: 65px;
    z-index: 99;
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.navbar-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.navbar-list::-webkit-scrollbar {
    display: none;
}

.navbar-list > li {
    position: relative;
}

.navbar-list > li > a,
.navbar-list > li > .nav-parent-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 14px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

.navbar-list > li > a:hover,
.navbar-list > li > .nav-parent-btn:hover,
.navbar-list > li:hover > a,
.navbar-list > li:hover > .nav-parent-btn {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

/* Dropdown */
.nav-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 240px;
    background: var(--white);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    padding: 8px 0;
    z-index: 1000;
    list-style: none;
    margin: 0;
}

.navbar-list > li:hover .nav-dropdown {
    display: block;
}

.nav-dropdown li a {
    display: block;
    padding: 9px 20px;
    color: #374151;
    font-size: 13px;
    transition: all 0.15s;
}

.nav-dropdown li a:hover {
    background: #f0fdf4;
    color: var(--primary);
    padding-left: 24px;
}

/* ========================================
   Hero Section
   ======================================== */
.hero-section {
    background: linear-gradient(135deg, #1a7a3e 0%, #145c2e 50%, #0d4020 100%);
    padding: 60px 0;
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.hero-section::after {
    content: "";
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
}

.hero-content h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 28px;
    line-height: 1.6;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--orange);
    color: var(--dark);
    padding: 14px 32px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 15px;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.hero-btn:hover {
    background: #d97706;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

/* ========================================
   Categories Section
   ======================================== */
.categories-section {
    padding: 50px 0;
    background: var(--bg-light);
}

.section-header {
    text-align: center;
    margin-bottom: 36px;
}

.section-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
}

.section-header p {
    color: var(--text-muted);
    font-size: 15px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 12px;
    background: var(--white);
    border-radius: 12px;
    text-align: center;
    transition: all 0.25s;
    border: 1px solid var(--border);
    cursor: pointer;
    text-decoration: none;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(26, 122, 62, 0.12);
    border-color: var(--primary);
}

.category-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: linear-gradient(135deg, #e8f5ec, #d1fae5);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    transition: all 0.25s;
}

.category-card:hover .category-icon {
    background: linear-gradient(135deg, #1a7a3e, #145c2e);
}

.category-card:hover .category-icon i {
    color: #ffffff;
}

.category-icon i {
    font-size: 22px;
    color: var(--primary);
    transition: color 0.25s;
}

.category-title {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    line-height: 1.3;
}

/* ========================================
   Product Sections
   ======================================== */
.product-section {
    padding: 50px 0;
}

.product-section:nth-child(even) {
    background: var(--bg-light);
}

.product-section .section-header {
    text-align: left;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.product-card {
    background: var(--white);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.25s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border-color: var(--primary);
}

.product-header {
    padding: 20px 16px 12px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.product-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 8px;
    background: #f0fdf4;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-icon i {
    color: var(--primary);
    font-size: 16px;
}

.product-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
    text-decoration: none;
}

.product-title:hover {
    color: var(--primary);
}

.product-meta {
    padding: 0 16px 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.product-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    color: var(--text-muted);
    padding: 3px 8px;
    background: #f3f4f6;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.15s;
}

.product-tag:hover {
    background: #e8f5ec;
    color: var(--primary);
}

.product-footer {
    padding: 12px 16px;
    border-top: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.product-price span {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    margin-right: 2px;
}

.product-actions {
    display: flex;
    gap: 6px;
}

.btn-buy-now {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--primary);
    color: white;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
    text-decoration: none;
    cursor: pointer;
    border: none;
}

.btn-buy-now:hover {
    background: var(--primary-dark);
}

.btn-add-cart {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f0fdf4;
    color: var(--primary);
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
    border: 1px solid #bbf7d0;
}

.btn-add-cart:hover {
    background: #dcfce7;
}

/* ========================================
   Footer
   ======================================== */
.site-footer {
    background: var(--dark);
    color: rgba(255, 255, 255, 0.8);
    padding: 50px 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: 40px;
}

.footer-brand .logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.4rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 14px;
    text-decoration: none;
}

.footer-brand p {
    font-size: 13.5px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 20px;
}

.footer-social {
    display: flex;
    gap: 10px;
}

.footer-social a {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.2s;
    font-size: 15px;
}

.footer-social a:hover {
    background: var(--primary);
    color: #ffffff;
}

.footer-heading {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 18px;
    position: relative;
}

.footer-heading::after {
    content: "";
    display: block;
    width: 30px;
    height: 2px;
    background: var(--primary);
    margin-top: 8px;
    border-radius: 2px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links li a {
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.65);
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer-links li a:hover {
    color: #4ade80;
    padding-left: 4px;
}

.footer-contact-info p {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 12px;
}

.footer-contact-info p i {
    color: #4ade80;
    margin-top: 3px;
    min-width: 16px;
}

.newsletter-form {
    display: flex;
    margin-top: 12px;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.newsletter-form input {
    flex: 1;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 13px;
}

.newsletter-form input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.newsletter-form button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 18px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: background 0.2s;
}

.newsletter-form button:hover {
    background: var(--primary-dark);
}

.footer-bottom {
    margin-top: 40px;
    padding: 18px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.45);
}

/* ========================================
   WhatsApp Floating Button
   ======================================== */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
}

.whatsapp-float a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: #25d366;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
    color: white;
    font-size: 28px;
    transition: all 0.3s;
}

.whatsapp-float a:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}

/* ========================================
   Mobile Menu
   ======================================== */
.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
}

.mobile-overlay.active {
    display: block;
}

.mobile-menu {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background: var(--white);
    z-index: 201;
    overflow-y: auto;
    transition: left 0.3s ease;
}

.mobile-menu.active {
    left: 0;
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--primary);
    color: white;
}

.mobile-menu-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.mobile-menu-close {
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    padding: 4px;
}

.mobile-menu-body {
    padding: 12px 0;
}

.mobile-menu-body .mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    transition: background 0.15s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.mobile-menu-body .mobile-nav-link:hover {
    background: #f0fdf4;
    color: var(--primary);
}

.mobile-sub-menu {
    display: none;
    background: #f9fafb;
    padding: 4px 0;
}

.mobile-sub-menu.active {
    display: block;
}

.mobile-sub-menu a {
    display: block;
    padding: 10px 20px 10px 36px;
    font-size: 13px;
    color: #6b7280;
    transition: all 0.15s;
}

.mobile-sub-menu a:hover {
    background: #f0fdf4;
    color: var(--primary);
}

/* ========================================
   Mobile Search
   ======================================== */
.mobile-search {
    display: none;
    padding: 12px 16px;
    background: #f9fafb;
    border-bottom: 1px solid var(--border);
}

.mobile-search.active {
    display: block;
}

.mobile-search .search-box {
    width: 100%;
    max-width: 100%;
}

/* ========================================
   Responsive Breakpoints
   ======================================== */
@media (max-width: 1024px) {
    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .hero-content h1 {
        font-size: 1.6rem;
    }
    .hero-btn {
        padding: 12px 24px;
        font-size: 14px;
    }
    .section-header h2 {
        font-size: 1.4rem;
    }
}

@media (max-width: 640px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Hide/Show helpers */
.d-lg-none {
    display: none;
}

@media (max-width: 1023px) {
    .d-lg-none {
        display: flex;
    }
    .desktop-center,
    .desktop-contact {
        display: none;
    }
    .main-nav {
        display: none;
    }
}

@media (min-width: 1024px) {
    .mobile-menu-btn {
        display: none !important;
    }
    #desktopNav {
        display: block !important;
    }
}

/* ========================================
   Single Product Page
   ======================================== */
.single-product-page {
    padding: 40px 0;
}

.single-product-content {
    max-width: 800px;
    margin: 0 auto;
}

.single-product-content h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 16px;
}

.product-detail-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.product-detail-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 24px;
}

.product-detail-price span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}

.product-description {
    line-height: 1.8;
    color: #374151;
    margin-bottom: 32px;
}

.payment-options {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-top: 24px;
}

.payment-options h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--dark);
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.payment-option:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.payment-option img,
.payment-option .payment-icon {
    height: 28px;
    width: auto;
}

.payment-option span {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

/* ========================================
   Archive Page
   ======================================== */
.archive-header {
    background: linear-gradient(135deg, #1a7a3e 0%, #145c2e 100%);
    padding: 40px 0;
    color: white;
    margin-bottom: 30px;
}

.archive-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.archive-header p {
    opacity: 0.85;
    margin-top: 8px;
}

/* ========================================
   Admin Toggle Switch
   ======================================== */
.sa-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sa-toggle {
    position: relative;
    width: 48px;
    height: 26px;
    background: #ccc;
    border-radius: 13px;
    cursor: pointer;
    transition: background 0.3s;
}

.sa-toggle.active {
    background: var(--primary);
}

.sa-toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.sa-toggle.active::after {
    transform: translateX(22px);
}

.sa-toggle-label {
    font-size: 14px;
    font-weight: 500;
}
