/* ملف style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', sans-serif;
}

body {
    background: linear-gradient(135deg, #7CB342, #11998e);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.app-container {
    width: 100%;
    max-width: 414px;
    height: 100vh;
    height: 100dvh;
    max-height: 896px;
    background: url('https://images.unsplash.com/photo-1604719312566-8fa246131c11?q=80&w=1000&auto=format&fit=crop') center/cover;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

@media (min-width: 415px) {
    .app-container {
        border-radius: 10px;
    }
}

.page {
    display: none;
    height: 100%;
    width: 100%;
    position: absolute;
    top: 0; 
    left: 0;
    background-color: transparent;
}

.page.active {
    display: flex;
    flex-direction: column;
}

.sticky-top {
    flex-shrink: 0;
    z-index: 50;
    width: 100%;
}

.main-content { 
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 20px 20px;
}

.bottom-nav {
    flex-shrink: 0;
    margin-top: auto;
    width: 100%;
    height: 70px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-radius: 20px 20px 0 0;
    z-index: 100;
}

:root {
    --primary-color: #7CB342;
    --text-dark: #111;
    --text-gray: #555;
    --bg-glass: rgba(255, 255, 255, 0.4);
    --border-glass: rgba(255, 255, 255, 0.5);
    --white: #ffffff;
}

.glass-page {
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.glass-element {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

.login-header {
    display: flex;
    align-items: center;
    color: var(--text-dark);
    font-weight: 500;
}
.login-header .close-btn { margin-left: 5px; color: #ff3b30; cursor: pointer; }
.login-logo {
    text-align: center;
    margin: 60px 0;
}

.logo-circle, .logo-circle-small {
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
}
.logo-circle {
    width: 120px;
    height: 120px;
    margin: 0 auto;
    font-size: 50px;
    box-shadow: 0 10px 20px rgba(124, 179, 66, 0.4);
}
.logo-circle-small {
    width: 45px;
    height: 45px;
    font-size: 20px;
}

.login-logo h2 {
    color: var(--text-dark);
    margin-top: 15px;
    font-size: 2rem;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
}
.btn-google {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    color: #444;
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}
.btn-google i { color: #DB4437; font-size: 1.3rem; }
.btn-guest {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    color: var(--white);
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}
.contact-us {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-dark);
    font-weight: bold;
}
.header-icons {
    display: flex;
    gap: 15px;
    font-size: 1.2rem;
    color: var(--text-dark);
}
.cart-icon { position: relative; cursor: pointer; }
.cart-icon .badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff3b30;
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 50%;
}

.page-title {
    font-size: 1.5rem;
    margin: 10px 0;
    color: var(--text-dark);
    text-shadow: 1px 1px 2px rgba(255,255,255,0.5);
}
.search-bar {
    display: flex;
    align-items: center;
    border-radius: 12px;
    padding: 12px 15px;
}
.search-bar i { color: var(--text-dark); margin-left: 10px; }
.search-bar input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 1rem;
    color: var(--text-dark);
}
.search-bar input::placeholder { color: var(--text-gray); }

/* البنرات */
.banner {
    position: relative;
    width: 100%;
    height: 150px;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.banner-slide {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(0.95) rotateX(10deg);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.banner-slide.active {
    opacity: 1;
    transform: scale(1) rotateX(0deg);
}

/* العروض */
.offers-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    overflow: hidden;
}
.offer-slot {
    width: 100%;
    height: 130px;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    position: relative;
}
.offer-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0; left: 0;
}
@keyframes slideOutRight { 0% { transform: translateX(0); opacity: 1; } 100% { transform: translateX(100%); opacity: 0; } }
@keyframes slideOutLeft { 0% { transform: translateX(0); opacity: 1; } 100% { transform: translateX(-100%); opacity: 0; } }
@keyframes slideInLeft { 0% { transform: translateX(-100%); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } }
@keyframes slideInRight { 0% { transform: translateX(100%); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } }

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.section-header h3 { color: var(--text-dark); font-size: 1.2rem; }
.section-header .more { color: var(--primary-color); font-size: 0.9rem; cursor: pointer; font-weight: bold;}
.mt-20 { margin-top: 20px; }

/* الأقسام */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.category-card {
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: linear-gradient(145deg, rgba(255,255,255,0.4), rgba(255,255,255,0.1));
    border-radius: 15px;
    padding: 10px 5px;
    box-shadow:  5px 5px 15px rgba(0,0,0,0.1), 
                -5px -5px 15px rgba(255,255,255,0.5);
    border: 1px solid rgba(255,255,255,0.6);
    transform-style: preserve-3d;
}
.category-card:hover { 
    transform: translateY(-8px) scale(1.05) rotateX(10deg); 
    box-shadow:  8px 12px 20px rgba(0,0,0,0.15), 
                -5px -5px 15px rgba(255,255,255,0.6);
}
.category-card img {
    width: 85%;
    height: 70px;
    object-fit: cover;
    border-radius: 12px;
    margin: 0 auto;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border: 2px solid rgba(255,255,255,0.8);
    transition: transform 0.3s;
}
.category-card:hover img {
    transform: translateZ(20px);
}
.category-card span {
    font-size: 0.85rem;
    color: var(--text-dark);
    font-weight: 800;
    display: block;
    margin-top: 8px;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}
.product-card {
    border-radius: 16px;
    text-align: center;
    position: relative;
    transition: transform 0.3s ease;
    cursor: pointer;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.product-card:hover {
    transform: translateY(-3px);
}
.product-info {
    padding: 10px;
    text-align: center;
}
.product-card .price {
    font-weight: bold;
    color: var(--primary-color);
    display: block;
    font-size: 1.1rem;
    margin-bottom: 5px;
}
.product-card .old-price {
    text-decoration: line-through;
    color: #999;
    font-size: 0.85rem;
    display: block;
}
.product-card h4 {
    font-size: 0.9rem;
    color: var(--text-dark);
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.btn-add {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px;
    width: 100%;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}
.btn-add.disabled { background: #999; cursor: not-allowed; }

.nav-item {
    text-align: center;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    opacity: 0.7;
    transition: opacity 0.3s;
}
.nav-item.active { 
    color: var(--primary-color); 
    opacity: 1;
    font-weight: bold;
}
.nav-item i { font-size: 1.2rem; }

/* السلة */
.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-radius: 0 0 20px 20px;
}
.cart-header h2 { font-size: 1.2rem; color: var(--text-dark); }
.cart-header i { cursor: pointer; color: var(--text-dark); font-size: 1.2rem;}
.cart-header .cart-count { color: var(--text-dark); font-size: 0.9rem; }
.cart-content { padding: 20px; display: flex; flex-direction: column; gap: 15px;}
.cart-item {
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    position: relative;
}
.cart-item img {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    object-fit: cover;
}
.item-details { flex: 1; }
.item-details h4 { font-size: 0.95rem; color: var(--text-dark); margin-bottom: 5px;}
.item-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}
.item-price-row .price { font-weight: bold; color: var(--primary-color); }
.item-price-row .old-price { text-decoration: line-through; color: #999; font-size: 0.8rem; margin-right: 5px; }
.quantity-control {
    display: flex;
    align-items: center;
    gap: 15px;
}
.qty-btn {
    border: 1px solid var(--text-dark);
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-dark);
    cursor: pointer;
}
.delete-item {
    position: absolute;
    top: 15px;
    left: 15px;
    color: #ff3b30;
    cursor: pointer;
}
.item-total {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-dark);
    text-align: left;
}
.item-total span { color: var(--primary-color); font-weight: bold; }

.cart-summary, .checkout-form {
    position: absolute;
    bottom: 70px;
    width: 100%;
    padding: 20px;
    border-radius: 20px 20px 0 0;
    z-index: 50;
}
.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    color: var(--text-dark);
    font-size: 0.9rem;
    font-weight: 500;
}
.total-row {
    font-weight: bold;
    font-size: 1.1rem;
    margin-top: 10px;
    margin-bottom: 15px;
    border-top: 1px solid rgba(0,0,0,0.1);
    padding-top: 10px;
}
.green-text { color: var(--primary-color); }
.btn-primary {
    width: 100%;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 10px rgba(124, 179, 66, 0.4);
}

.checkout-form h3 {
    margin-bottom: 15px;
    color: var(--text-dark);
    text-align: center;
}
.checkout-input {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border-radius: 10px;
    font-size: 1rem;
    outline: none;
    color: var(--text-dark);
}
.checkout-input::placeholder { color: rgba(0,0,0,0.6); }

/* Modal Styles */
.modal-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 200;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}
.modal-content {
    width: 90%;
    border-radius: 20px;
    padding: 20px;
    position: relative;
    text-align: center;
}
.modal-close {
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 1.5rem;
    color: #ff3b30;
    cursor: pointer;
    z-index: 10;
}
.modal-images {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    justify-content: center;
}
.modal-images img {
    width: 48%;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
}
.modal-content h2 { color: var(--text-dark); font-size: 1.3rem; margin-bottom: 5px; }
.modal-price { color: var(--primary-color); font-weight: bold; font-size: 1.2rem; display: inline-block; margin-bottom: 10px;}
.modal-old-price { text-decoration: line-through; color: #999; font-size: 0.9rem; display: inline-block; margin-right: 10px;}
.modal-desc { color: var(--text-dark); font-size: 0.9rem; margin-bottom: 20px; line-height: 1.5; }

.icons-top {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    z-index: 10;
}
.icons-top i {
    font-size: 1.2rem;
    color: var(--text-dark);
    cursor: pointer;
    background: rgba(255,255,255,0.7);
    border-radius: 50%;
    padding: 5px;
    transition: all 0.3s;
}
.favorite-active {
    color: #ff3b30 !important;
    font-weight: 900 !important;
}
.custom-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) perspective(600px) rotateX(-90deg);
    transform-origin: top center;
    background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.7));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-dark);
    padding: 15px 25px;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2), 0 5px 15px rgba(0,0,0,0.1);
    z-index: 9999;
    font-weight: bold;
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255,255,255,0.5);
    white-space: nowrap;
}
.custom-notification i {
    color: var(--primary-color);
    font-size: 1.3rem;
}
.custom-notification.show {
    opacity: 1;
    transform: translateX(-50%) perspective(600px) rotateX(0deg);
}
