/**
 * ez-gan Global Styles
 * Site header, footer, and layout following the design system
 *
 * @package ez-gan
 */

/* ========================================
   CSS Variables (ez-gan design system)
   ======================================== */
:root {
    --ez-primary: #3ECFB2;
    --ez-primary-dark: #2DB89D;
    --ez-primary-light: #E6FFFA;
    --ez-secondary: #FFAB91;
    --ez-secondary-light: #FFE4DC;
    --ez-accent: #FFD93D;
    --ez-accent-light: #FFF8DC;
    --ez-background: #FBF9F7;
    --ez-surface: #FFFFFF;
    --ez-text: #2D3748;
    --ez-text-light: #718096;
    --ez-gray-100: #F7FAFC;
    --ez-gray-200: #EDF2F7;
    --ez-gray-300: #E2E8F0;
    --ez-shadow-sm: 0 2px 10px rgba(0,0,0,0.06);
    --ez-shadow-md: 0 4px 20px rgba(0,0,0,0.08);
    --ez-shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
    --ez-radius-sm: 12px;
    --ez-radius-md: 16px;
    --ez-radius-lg: 24px;
    --ez-radius-full: 50px;
}

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

body {
    font-family: 'Rubik', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--ez-background);
    color: var(--ez-text);
    direction: rtl;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

a {
    color: var(--ez-primary-dark);
    text-decoration: none;
}

a:hover {
    color: var(--ez-primary);
}

/* ========================================
   SITE HEADER
   ======================================== */
.ez-site-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1000;
    padding: 16px 24px;
    background: rgba(251, 249, 247, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(45, 55, 72, 0.05);
    transition: all 0.3s ease;
}

/* WordPress Admin Bar offset */
.admin-bar .ez-site-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar .ez-site-header {
        top: 46px;
    }
}

.ez-site-header.scrolled {
    padding: 12px 24px;
    box-shadow: var(--ez-shadow-sm);
    background: rgba(251, 249, 247, 0.98);
}

.ez-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 24px;
}

/* Logo */
.ez-logo {
    font-size: 28px;
    font-weight: 700;
    color: var(--ez-primary-dark);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.ez-logo span {
    color: var(--ez-text);
}

.ez-logo img,
.ez-logo .custom-logo {
    max-height: 40px;
    width: auto;
}

/* Navigation */
.ez-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1; /* Take remaining space so buttons can push to left */
}

.ez-nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Push buttons to far left in RTL */
.ez-nav > .ez-nav-btn:first-of-type,
.ez-nav > .ez-nav-login {
    margin-inline-start: auto;
}

.ez-nav-menu li {
    margin: 0;
}

.ez-nav-menu a {
    display: block;
    padding: 10px 18px;
    color: var(--ez-text);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-radius: var(--ez-radius-full);
    transition: all 0.2s ease;
}

.ez-nav-menu a:hover,
.ez-nav-menu .current-menu-item a {
    background: var(--ez-primary-light);
    color: var(--ez-primary-dark);
}

/* Login/Personal Area Button */
.ez-nav-login {
    padding: 10px 24px;
    background: var(--ez-primary);
    color: white !important;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--ez-radius-full);
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(62, 207, 178, 0.3);
    margin-right: 8px;
}

.ez-nav-login:hover {
    background: var(--ez-primary-dark);
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(62, 207, 178, 0.4);
}

/* Cart Icon */
.ez-cart-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: var(--ez-primary);
    text-decoration: none;
    border-radius: 50%;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.ez-cart-icon:hover {
    background: var(--ez-primary-light);
    color: var(--ez-primary-dark);
    transform: scale(1.05);
}

.ez-cart-icon svg {
    width: 24px;
    height: 24px;
    transition: all 0.25s ease;
}

.ez-cart-icon.has-items {
    color: var(--ez-primary-dark);
}

.ez-cart-icon.has-items svg {
    stroke-width: 2.5;
}

.ez-cart-count {
    position: absolute;
    top: 2px;
    left: 2px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--ez-secondary);
    color: white;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(255, 171, 145, 0.4);
    animation: cartBadgePop 0.3s ease;
}

@keyframes cartBadgePop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Role-based Navigation Buttons */
.ez-nav-btn {
    padding: 10px 20px;
    color: white !important;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--ez-radius-full);
    transition: all 0.25s ease;
    white-space: nowrap;
}

.ez-nav-btn-user {
    background: var(--ez-primary);
    box-shadow: 0 4px 15px rgba(62, 207, 178, 0.3);
}

.ez-nav-btn-user:hover {
    background: var(--ez-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(62, 207, 178, 0.4);
}

.ez-nav-btn-supplier {
    background: var(--ez-secondary);
    box-shadow: 0 4px 15px rgba(255, 171, 145, 0.3);
}

.ez-nav-btn-supplier:hover {
    background: #FF9A7A;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 171, 145, 0.4);
}

.ez-nav-btn-manager {
    background: var(--ez-accent);
    color: var(--ez-text) !important;
    box-shadow: 0 4px 15px rgba(255, 217, 61, 0.3);
}

.ez-nav-btn-manager:hover {
    background: #F5CC00;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 217, 61, 0.4);
}

/* Mobile Menu Toggle */
.ez-mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
}

.ez-mobile-toggle span {
    width: 24px;
    height: 2px;
    background: var(--ez-text);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.ez-mobile-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.ez-mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.ez-mobile-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ========================================
   MAIN CONTENT AREA
   ======================================== */
.ez-site-main {
    padding-top: 80px; /* Account for fixed header */
    min-height: calc(100vh - 80px);
}

/* Hide WordPress page title on pages with their own headers */
.ezgan-container:has(.kgi-personal-area) > h1,
.ezgan-container:has(.ezgan-manager-dashboard) > h1,
.ezgan-container:has(.ezgan-supplier-dashboard) > h1 {
    display: none;
}

.admin-bar .ez-site-main {
    padding-top: 112px;
}

@media screen and (max-width: 782px) {
    .admin-bar .ez-site-main {
        padding-top: 126px;
    }
}

/* ========================================
   SITE FOOTER
   ======================================== */
.ez-site-footer {
    background: var(--ez-text);
    color: rgba(255, 255, 255, 0.7);
    padding: 60px 24px 40px;
    margin-top: 60px;
}

.ez-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.ez-footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.ez-footer-brand {
    max-width: 300px;
}

.ez-footer-logo {
    font-size: 28px;
    font-weight: 700;
    color: var(--ez-primary);
    margin-bottom: 16px;
}

.ez-footer-logo span {
    color: white;
}

.ez-footer-logo img,
.ez-footer-logo .custom-logo {
    max-height: 40px;
    width: auto;
}

.ez-footer-tagline {
    font-size: 15px;
    line-height: 1.7;
    margin: 0 0 20px;
}

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

.ez-social-link {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.2s ease;
}

.ez-social-link:hover {
    background: var(--ez-primary);
    color: white;
    transform: translateY(-3px);
}

.ez-footer-column h4 {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 20px;
}

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

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

.ez-footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 15px;
    transition: color 0.2s ease;
}

.ez-footer-links a:hover {
    color: var(--ez-primary);
}

.ez-footer-bottom {
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.ez-footer-copyright {
    font-size: 14px;
    margin: 0;
}

.ez-footer-legal {
    display: flex;
    gap: 24px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ez-footer-legal li {
    margin: 0;
}

.ez-footer-legal a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.ez-footer-legal a:hover {
    color: var(--ez-primary);
}

/* ========================================
   RESPONSIVE - TABLET & MOBILE
   ======================================== */
@media (max-width: 1024px) {
    .ez-footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }

    .ez-footer-brand {
        grid-column: 1 / -1;
        max-width: none;
        text-align: center;
    }

    .ez-footer-social {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .ez-nav {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        background: var(--ez-surface);
        flex-direction: column;
        padding: 20px;
        box-shadow: var(--ez-shadow-lg);
        border-radius: 0 0 var(--ez-radius-lg) var(--ez-radius-lg);
    }

    .ez-nav.active {
        display: flex;
    }

    .ez-nav-menu {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }

    .ez-nav-menu li {
        width: 100%;
    }

    .ez-nav-menu a {
        display: block;
        text-align: center;
        padding: 14px 20px;
        border-radius: var(--ez-radius-sm);
    }

    .ez-nav-login,
    .ez-nav-btn {
        width: 100%;
        text-align: center;
        margin-right: 0;
        margin-top: 8px;
    }

    .ez-mobile-toggle {
        display: flex;
    }

    /* Cart icon on mobile - always visible */
    .ez-cart-icon {
        order: -1;
        margin-inline-start: auto;
        margin-inline-end: 8px;
    }

    .ez-footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }

    .ez-footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .ez-footer-legal {
        justify-content: center;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.ez-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.ez-section {
    padding: 60px 24px;
}

.ez-section-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--ez-text);
    margin: 0 0 24px;
}

.ez-card {
    background: var(--ez-surface);
    border-radius: var(--ez-radius-lg);
    box-shadow: var(--ez-shadow-md);
    padding: 24px;
}

/* Button Styles */
.ez-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--ez-radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
}

.ez-btn-primary {
    background: var(--ez-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(62, 207, 178, 0.3);
}

.ez-btn-primary:hover {
    background: var(--ez-primary-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(62, 207, 178, 0.4);
}

.ez-btn-secondary {
    background: var(--ez-surface);
    color: var(--ez-text);
    box-shadow: var(--ez-shadow-md);
}

.ez-btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--ez-shadow-lg);
}
