:root {
    --bg-color: #f8f9fa;
    --surface-color: #ffffff;
    --primary-color: #f39c12; /* Athletic Gold */
    --secondary-color: #1a2b4c; /* Navy Blue */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --danger: #ef4444;
    --success: #10b981;
    --border-color: #f1f5f9;
    --bottom-nav-height: 75px;
    --header-height: 65px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.02);
    --shadow-md: 0 4px 15px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.08);
    --radius-md: 16px;
    --radius-lg: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow: hidden; 
}

/* --- Loader --- */
#splash-screen {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--secondary-color);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s;
}
#splash-screen img {
    width: 220px;
    margin-bottom: 40px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
}
.loader {
    width: 45px; height: 45px;
    border: 4px solid rgba(255,255,255,0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- App Layout --- */
#app-container {
    width: 100vw;
    max-width: 480px;
    margin: 0 auto;
    height: 100vh;
    position: relative;
    background-color: var(--bg-color);
    box-shadow: 0 0 30px rgba(0,0,0,0.05);
}

.app-header {
    position: fixed;
    top: 0; left: 0; right: 0; 
    width: 100%; max-width: 480px; margin: 0 auto;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
    border-bottom: 1px solid rgba(0,0,0,0.03);
}
.app-logo { height: 38px; }
.icon-btn {
    background: var(--bg-color);
    border: none; 
    color: var(--secondary-color);
    font-size: 20px; 
    cursor: pointer; 
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}
.icon-btn:active {
    transform: scale(0.9);
    background: #e2e8f0;
}

/* --- Screens --- */
.screen {
    position: absolute;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-height) - var(--bottom-nav-height));
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 15px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: translateY(20px) scale(0.98);
    background-color: var(--bg-color);
}
.screen.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}
.screen.slide-up {
    transform: translateY(100%);
    top: 0; height: 100vh; z-index: 1500; background: var(--bg-color);
}
.screen.slide-up.active {
    transform: translateY(0);
}

/* --- Home Elements --- */
.hero-banner {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #0d162a 100%);
    border-radius: var(--radius-lg);
    padding: 35px 25px;
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.hero-banner::after {
    content: '';
    position: absolute;
    top: -50%; right: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(243,156,18,0.15) 0%, transparent 60%);
    z-index: 0;
}
.hero-banner h2 { position: relative; z-index: 1; font-size: 30px; font-weight: 900; margin-bottom: 8px; color: var(--primary-color); letter-spacing: -0.5px; }
.hero-banner p { position: relative; z-index: 1; font-size: 15px; color: #cbd5e1; opacity: 0.9; }

.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding: 0 5px; }
.section-header h3 { font-size: 20px; font-weight: 800; color: var(--text-primary); }

/* --- Sidebar Menu --- */
.sidebar {
    position: fixed;
    top: 0; right: -300px;
    width: 280px; height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 2000;
    transition: right 0.4s cubic-bezier(0.175, 0.885, 0.32, 1);
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    overflow-y: auto;
    padding: 30px 20px;
}
.sidebar.open { right: 0; }
.sidebar-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(15, 23, 42, 0.6); z-index: 1999;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: none; opacity: 0; transition: opacity 0.3s ease;
}
.sidebar-overlay.show { display: block; opacity: 1; }
.sidebar-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid var(--border-color);
}
.sidebar-header h2 { color: var(--secondary-color); font-size: 22px; font-weight: 900; }
.sidebar-close { background: var(--bg-color); border: none; width: 35px; height: 35px; border-radius: 50%; color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* Sidebar Categories */
.sidebar-categories { display: flex; flex-direction: column; gap: 12px; }
.sidebar-category-item {
    display: flex; align-items: center; gap: 15px;
    padding: 12px 15px; border-radius: var(--radius-md);
    background: var(--surface-color); cursor: pointer;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}
.sidebar-category-item:active { transform: scale(0.98); border-color: var(--primary-color); }
.sidebar-category-img { width: 40px; height: 40px; object-fit: contain; }
.sidebar-category-text { font-weight: 700; color: var(--text-primary); font-size: 15px; }

.full-width-banner {
    width: 100%;
    border-radius: var(--radius-lg);
    margin: 25px 0;
    box-shadow: var(--shadow-md);
}

/* --- Product Grid & Cards --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding-bottom: 20px;
}
.product-card {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: 12px;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid rgba(0,0,0,0.02);
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.product-card:active {
    transform: scale(0.98);
}
.product-img {
    width: 100%;
    height: 140px;
    flex-shrink: 0;
    object-fit: contain;
    border-radius: var(--radius-md);
    background: #fff;
    margin-bottom: 12px;
    padding: 5px;
}
.product-title {
    font-size: 13px;
    font-weight: 800;
    line-height: 1.5;
    margin-bottom: auto; /* This pushes everything below it down */
    min-height: 45px;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-price {
    color: var(--primary-color);
    font-weight: 900;
    font-size: 17px;
    margin-bottom: 12px;
}
.add-btn {
    background: var(--secondary-color);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 10px;
    font-weight: 800;
    font-family: 'Cairo';
    width: 100%;
    font-size: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(26,43,76,0.2);
}
.add-btn:active {
    background: var(--primary-color);
    transform: scale(0.96);
}

/* --- Bottom Nav (Pill Style) --- */
.bottom-nav {
    position: fixed;
    bottom: 15px; left: 15px; right: 15px;
    max-width: 450px; margin: 0 auto;
    height: var(--bottom-nav-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-radius: 35px;
    z-index: 1000;
    padding: 0 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.4);
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 11px;
    position: relative;
    font-weight: 700;
    height: 100%;
    width: 65px;
    border-radius: 20px;
    transition: all 0.3s ease;
}
.nav-item i { font-size: 22px; margin-bottom: 4px; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.nav-item.active { color: var(--primary-color); }
.nav-item.active i { transform: translateY(-4px) scale(1.1); color: var(--primary-color); }

.cart-badge {
    position: absolute; top: 8px; right: 8px;
    background: var(--danger); color: #fff;
    font-size: 10px; font-weight: 900;
    width: 18px; height: 18px; border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    box-shadow: 0 2px 5px rgba(239, 68, 68, 0.4);
    border: 2px solid #fff;
}

/* --- Cart & Checkout --- */
.page-title h2 { color: var(--text-primary); margin-bottom: 20px; font-weight: 900; font-size: 24px; padding: 0 5px; }
.cart-item {
    display: flex;
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: 12px;
    margin-bottom: 15px;
    align-items: center;
    border: 1px solid rgba(0,0,0,0.02);
    box-shadow: var(--shadow-sm);
}
.cart-item img { width: 70px; height: 70px; object-fit: contain; background: #fff; border-radius: 12px; margin-left: 15px; padding: 5px; border: 1px solid var(--border-color); }
.cart-item-info { flex: 1; }
.cart-item-title { font-size: 14px; font-weight: 800; margin-bottom: 6px; color: var(--text-primary); }
.cart-item-price { color: var(--primary-color); font-weight: 900; font-size: 16px; }
.cart-qty-ctrl { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.qty-btn { background: var(--bg-color); color: var(--text-primary); border: none; width: 32px; height: 32px; border-radius: 8px; font-weight: 900; font-size: 16px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.cart-remove { color: var(--danger); font-size: 20px; margin-right: 15px; cursor: pointer; padding: 10px; background: rgba(239, 68, 68, 0.1); border-radius: 10px; }

.cart-summary {
    background: var(--surface-color);
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-top: 20px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}
.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 15px;
}
.summary-row .price-val { color: var(--primary-color); font-size: 22px; }

/* --- Forms & Buttons --- */
.input-group { position: relative; margin-bottom: 18px; }
.input-group i { position: absolute; right: 18px; top: 17px; color: var(--text-secondary); }
.input-group input, .input-group select {
    width: 100%; padding: 15px 45px 15px 18px;
    background: var(--bg-color); border: 1px solid var(--border-color);
    color: var(--text-primary); border-radius: 14px; font-family: 'Cairo'; font-size: 15px; font-weight: 600;
    transition: all 0.3s ease;
}
.input-group input:focus { outline: none; border-color: var(--primary-color); background: #fff; box-shadow: 0 0 0 4px rgba(243,156,18,0.1); }
.btn-primary { background: var(--primary-color); color: #fff; padding: 16px 20px; border: none; border-radius: 14px; font-weight: 900; font-family: 'Cairo'; font-size: 17px; box-shadow: 0 6px 15px rgba(243,156,18,0.3); transition: all 0.2s ease; cursor: pointer;}
.btn-primary:active { transform: translateY(2px); box-shadow: 0 2px 5px rgba(243,156,18,0.3); }
.btn-secondary { background: var(--surface-color); color: var(--secondary-color); padding: 16px 20px; border: none; border-radius: 14px; font-weight: 900; font-family: 'Cairo'; font-size: 17px; border: 2px solid var(--border-color); cursor: pointer;}
.btn-gps { background: rgba(16, 185, 129, 0.1); color: var(--success); padding: 14px 20px; border: none; border-radius: 12px; font-weight: 800; font-family: 'Cairo'; width: 100%; display: flex; justify-content: center; align-items: center; gap: 10px; margin-bottom: 15px; cursor: pointer;}
.full-width { width: 100%; }

/* --- Search --- */
.search-bar-container { position: relative; margin-bottom: 25px; padding: 0 5px; }
.search-bar-container input { width: 100%; padding: 15px 45px 15px 20px; background: var(--surface-color); border: none; border-radius: 30px; color: var(--text-primary); font-family: 'Cairo'; font-size: 15px; font-weight: 600; box-shadow: var(--shadow-md); transition: all 0.3s ease; }
.search-bar-container input:focus { box-shadow: 0 0 0 3px rgba(243,156,18,0.2); outline: none; }
.search-bar-container i { position: absolute; right: 22px; top: 17px; color: var(--primary-color); font-size: 18px; }

/* --- More / Menu --- */
.profile-header { text-align: center; margin-bottom: 40px; margin-top: 20px; }
.profile-icon { font-size: 70px; color: var(--primary-color); margin-bottom: 15px; filter: drop-shadow(0 4px 6px rgba(243,156,18,0.2)); }
.profile-header h2 { color: var(--text-primary); font-weight: 900; font-size: 24px; }
.profile-menu { list-style: none; padding: 0 5px; }
.profile-menu li { background: var(--surface-color); padding: 18px 20px; margin-bottom: 12px; border-radius: var(--radius-lg); display: flex; align-items: center; gap: 18px; font-size: 16px; font-weight: 800; color: var(--text-primary); box-shadow: var(--shadow-sm); transition: transform 0.2s ease; cursor: pointer; border: 1px solid rgba(0,0,0,0.01); }
.profile-menu li:active { transform: scale(0.98); }
.profile-menu li i { color: var(--secondary-color); background: var(--bg-color); width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 18px; }

/* --- Toasts --- */
.toast {
    position: fixed; top: 30px; left: 50%; transform: translateX(-50%) translateY(-100px);
    background: rgba(16, 185, 129, 0.95); backdrop-filter: blur(10px); color: #fff; padding: 12px 25px; border-radius: 30px;
    font-weight: 800; z-index: 9999; opacity: 0; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.error { background: rgba(239, 68, 68, 0.95); box-shadow: 0 10px 20px rgba(239, 68, 68, 0.3); }

/* --- Product Detail View --- */
.product-header { display: flex; align-items: center; padding: 20px; gap: 15px; background: transparent; position: absolute; top: 0; left: 0; right: 0; z-index: 10; }
.product-header .icon-btn { background: rgba(255,255,255,0.9); backdrop-filter: blur(5px); box-shadow: var(--shadow-sm); }
.detail-img-wrapper { background: #fff; border-radius: 0 0 40px 40px; padding: 80px 20px 40px 20px; text-align: center; margin: 0 0 25px 0; box-shadow: var(--shadow-sm); }
.detail-img { max-height: 280px; object-fit: contain; filter: drop-shadow(0 10px 20px rgba(0,0,0,0.1)); }
.detail-info { padding: 0 20px 120px 20px; }
.detail-info h2 { color: var(--text-primary); margin-bottom: 10px; font-weight: 900; font-size: 22px; line-height: 1.4; }
.detail-price { font-size: 28px; color: var(--primary-color); font-weight: 900; margin: 15px 0; display: inline-block; padding: 5px 15px; background: rgba(243,156,18,0.1); border-radius: 12px; }
.detail-desc { color: var(--text-secondary); line-height: 1.8; font-size: 15px; margin-top: 20px; background: var(--surface-color); padding: 20px; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.fixed-bottom-bar { position: fixed; bottom: 0; left: 0; right: 0; width: 100%; max-width: 480px; margin: 0 auto; background: rgba(255,255,255,0.95); backdrop-filter: blur(10px); padding: 20px; border-top: 1px solid rgba(0,0,0,0.03); box-shadow: 0 -10px 30px rgba(0,0,0,0.05); z-index: 100;}

/* GPS Status */
#gps-status { color: var(--success); font-size: 13px; font-weight: 700; text-align: center; margin-top: 8px; display: none; }
#gps-status.error { color: var(--danger); }

/* --- BMI Calculator --- */
.bmi-card {
    background: var(--surface-color);
    padding: 25px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin: 0 5px;
}
#bmi-result {
    margin-top: 25px;
    padding: 20px;
    border-radius: var(--radius-md);
    text-align: center;
    font-weight: 900;
    display: none;
    font-size: 20px;
    background: var(--bg-color);
    color: var(--primary-color);
}

/* --- About Us --- */
.about-card {
    background: var(--surface-color);
    padding: 25px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin: 0 5px 20px 5px;
    text-align: justify;
    line-height: 1.9;
    color: var(--text-secondary);
    font-size: 15px;
}
.about-card h3 { color: var(--text-primary); margin-bottom: 15px; font-weight: 900; font-size: 20px; }

/* Filter select in Shop */
.shop-filters select {
    width: 100%;
    padding: 15px 20px;
    border-radius: 30px;
    border: none;
    font-family: 'Cairo';
    font-weight: 800;
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 25px;
    background: var(--surface-color);
    box-shadow: var(--shadow-md);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%231a2b4c%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat, repeat;
    background-position: left 20px top 50%, 0 0;
    background-size: .65em auto, 100%;
}
