/* Reset & Base */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { transition: background 0.3s ease; overflow-x: hidden; min-height: 100vh; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; background-color: #fdf2f2; } 

main { flex: 1; width: 100%; margin: 0; padding: 0; }

/* Navbar */
.navbar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 12px 5%; 
    background: #006837; /* اللون الأخضر الغامق من الصورة */
    position: sticky; 
    top: 0; 
    z-index: 1000; 
    width: 100%; 
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.logo-section { 
    display: flex; 
    align-items: center; 
    gap: 12px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}
.site-logo, .site-logo-placeholder { 
    width: 42px; 
    height: 42px; 
    border-radius: 12px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    background: white; 
    color: var(--btn-color);
    font-size: 1.3rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.system-name { 
    font-size: 1.5rem; 
    font-weight: 900; 
    color: white;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

/* Nav Links & Mobile Menu */
.nav-links { display: flex; gap: 8px; align-items: center; }
.nav-links a { 
    font-weight: 700; 
    font-size: 0.95rem; 
    color: white; 
    padding: 10px 18px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.nav-links a i { font-size: 1.2rem; }
.nav-links a:hover { 
    color: white; 
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.menu-toggle { display: none; font-size: 1.6rem; cursor: pointer; color: white; }

@media (max-width: 992px) {
    .menu-toggle { display: block; z-index: 1001; }
    .nav-links { 
        position: fixed; top: 0; right: -100%; width: 80%; height: 100vh; 
        background: white; flex-direction: column; justify-content: center; 
        transition: 0.4s cubic-bezier(0.77, 0, 0.175, 1); z-index: 1000; gap: 25px; 
        box-shadow: -15px 0 40px rgba(0,0,0,0.15);
        border-radius: 40px 0 0 40px;
        padding: 50px;
    }
    .nav-links.active { right: 0; }
    .nav-links a { 
        font-size: 1.3rem; 
        color: #333; 
        width: 100%;
        justify-content: flex-start;
        padding: 15px 25px;
        background: #f8f9fa;
    }
    .nav-links a:hover {
        background: var(--btn-color);
        color: white;
    }
}

/* Login Button in Nav */
.login-btn { 
    background: white !important; 
    color: var(--btn-color) !important; 
    border-radius: 50px !important; 
    padding: 10px 28px !important; 
    font-weight: 800 !important;
    box-shadow: 0 6px 15px rgba(0,0,0,0.1) !important;
    margin-left: 10px;
}
.login-btn:hover {
    transform: scale(1.05) translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15) !important;
}

/* Hero Premium V2 (Matching User Image) */
.hero-premium-v2 {
    position: relative;
    padding: 60px 5% 120px;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-size: cover !important;
    text-align: center;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content-v2 {
    width: 100%;
    max-width: 1000px;
    z-index: 2;
}

.hero-search-bar {
    background: white;
    padding: 8px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    max-width: 950px;
    margin: 40px auto 0;
    gap: 5px;
}

.search-divider {
    width: 1px;
    height: 35px;
    background: #ddd;
}

@media (max-width: 850px) {
    .hero-premium-v2 {
        padding: 40px 5% 80px;
        min-height: 300px;
    }
    .hero-search-bar {
        flex-direction: column;
        border-radius: 20px;
        padding: 15px;
        gap: 10px;
    }
    .search-divider {
        display: none;
    }
    .hero-search-bar div {
        width: 100%;
        border-bottom: 1px solid #eee;
        padding: 10px 0 !important;
    }
    .hero-search-bar button {
        width: 100%;
        margin-left: 0 !important;
    }
}

/* Review & Stats */
.review-box { 
    margin: 30px 4%; 
    padding: 45px 20px; 
    border-radius: 30px; 
    background: #ffffff; 
    text-align: center; 
    box-shadow: 0 15px 45px rgba(0,0,0,0.06); 
    border: 1px solid #fff5f6;
}
.stars { 
    font-size: 1.5rem; 
    color: #f1c40f; 
    margin-bottom: 25px; 
    display: flex;
    justify-content: center;
    gap: 5px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.stat-item h3 { 
    font-size: 3.5rem; 
    font-weight: 900; 
    color: var(--btn-color); 
    margin-bottom: 5px;
    letter-spacing: -2px;
    line-height: 1;
}
.stat-item p { 
    font-size: 0.95rem; 
    font-weight: 700; 
    color: #636e72;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* About Section Premium Styles */
.about-section { 
    padding: 60px 5%; 
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
}
.about-container { 
    display: grid; 
    grid-template-columns: 1.2fr 1fr; 
    gap: 50px; 
    align-items: center; 
}
.about-badge { 
    background: rgba(255, 71, 87, 0.1); 
    color: var(--btn-color); 
    padding: 8px 20px; 
    border-radius: 50px; 
    font-size: 0.85rem; 
    font-weight: 800; 
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    animation: fadeInDown 0.8s ease backwards;
}

.about-content h2 { 
    font-size: clamp(2rem, 5vw, 2.8rem); 
    margin: 20px 0; 
    line-height: 1.1; 
    color: #1a1a1a;
    font-weight: 800;
    animation: fadeInLeft 0.8s ease 0.2s backwards;
}

.about-content p { 
    color: #555; 
    line-height: 1.7; 
    margin-bottom: 35px; 
    font-size: 1.1rem;
    animation: fadeInLeft 0.8s ease 0.4s backwards;
}

.feature-item { 
    background: #fdfdfd;
    padding: 20px;
    border-radius: 20px;
    border: 1px solid #f0f0f0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    transform: translateY(30px);
}

.feature-item.reveal {
    opacity: 1;
    transform: translateY(0);
}

.feature-item:nth-child(1) { transition-delay: 0.6s; }
.feature-item:nth-child(2) { transition-delay: 0.8s; }

.feature-item:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--btn-color);
    box-shadow: 0 15px 30px rgba(255, 71, 87, 0.1);
    background: #fff;
}

.feature-icon i {
    animation: pulseIcon 2s infinite;
}

@keyframes pulseIcon {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
.feature-icon { 
    width: 45px; 
    height: 45px; 
    background: var(--btn-color); 
    border-radius: 12px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: white; 
    font-size: 1.1rem; 
    margin-bottom: 15px;
}
.feature-item h4 { font-size: 1rem; color: #1a1a1a; margin-bottom: 8px; font-weight: 700; }
.feature-item p { font-size: 0.85rem; margin: 0; color: #777; line-height: 1.4; }

.about-image-wrapper { position: relative; padding: 20px; }
.about-main-img { 
    border-radius: 40px; 
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
    width: 100%;
    transform: rotate(-2deg);
    transition: 0.5s;
}
.about-image-wrapper:hover .about-main-img {
    transform: rotate(0deg) scale(1.02);
}
.experience-tag {
    position: absolute;
    top: 0;
    right: 0;
    background: #2d3436;
    color: white;
    padding: 25px;
    border-radius: 25px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    animation: float 4s ease-in-out infinite;
    z-index: 1;
}
.experience-tag strong { font-size: 2rem; display: block; line-height: 1; }
.experience-tag span { font-size: 0.8rem; font-weight: 600; opacity: 0.8; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@media (max-width: 992px) {
    .about-section { padding: 40px 5%; }
    .about-container { grid-template-columns: 1fr; gap: 60px; text-align: center; }
    .about-features { grid-template-columns: 1fr; }
    .feature-item { text-align: left; }
    .feature-icon { margin-left: 0; }
    .experience-tag { right: 10%; top: -20px; }
}

/* Categories Marquee (Right to Left) */
.categories-scroll-wrapper { 
    padding: 25px 0; 
    background: #fff; 
    width: 100%; 
    overflow: hidden;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}
.categories-scroll-track { 
    display: flex; 
    gap: 20px; 
    animation: scrollLeft 20s linear infinite; 
    width: max-content;
}
@keyframes scrollLeft {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.cat-card { 
    min-width: 100px; 
    text-align: center;
    padding: 10px;
}
.cat-card img { 
    width: 75px; 
    height: 75px; 
    border-radius: 50%; 
    margin-bottom: 8px;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border: 2px solid #fff;
}
.cat-card span { font-weight: 700; font-size: 0.8rem; color: #333; display: block; }

/* Shop Grid (2 Columns on Mobile) */
.shops-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 12px; 
    padding: 15px 4%; 
}
@media (min-width: 768px) { 
    .shops-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 25px; } 
}

/* Card Styling & Animation */
.shop-card { 
    background: white; 
    border-radius: 4px; /* زوايا حادة وأكثر تربيعاً */
    overflow: hidden; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    animation: fadeInUp 0.6s ease backwards;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    border: 1px solid #eee;
    position: relative;
}

.shop-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-color: var(--btn-color);
}

.shop-image { 
    aspect-ratio: 1 / 1; 
    width: 100%; 
    height: auto; 
    position: relative; 
    overflow: hidden;
    background: #fdfdfd;
}

/* تحسين شكل ونظام ظهور العروض */
.offer-badge {
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%) scale(0.5); /* تبدأ من المنتصف وصغيرة */
    background: rgba(255, 71, 87, 0.95); /* لون مميز وشفافية بسيطة */
    color: white; 
    padding: 15px 25px; 
    border-radius: 50px; /* شكل بيضاوي أنيق */
    font-size: 1.2rem; 
    font-weight: 900; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    z-index: 2;
    opacity: 0; 
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55); /* حركة ارتدادية جذابة */
    pointer-events: none;
    border: 2px solid white;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.shop-card:hover .offer-badge {
    opacity: 1; 
    transform: translate(-50%, -50%) scale(1); /* تظهر في المنتصف بحجمها الطبيعي */
}

/* إضافة تأثير غباش خفيف خلف العرض */
.shop-card:hover .shop-image img {
    transform: scale(1.1);
    filter: brightness(0.7) blur(2px); /* تعتيم الصورة قليلاً ليبرز العرض في المنتصف */
}

.shop-image img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    transition: transform 0.5s ease;
}

.shop-card:hover .shop-image img {
    transform: scale(1.08);
}

.shop-info { 
    padding: 10px; /* تقليل المسافة لجعل الشكل العام مربع أكثر */
    background: white;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.shop-info h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 4px; color: #222; }
.shop-info .rating-price { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.shop-info .cat-badge { font-size: 0.65rem; color: #888; background: #f5f5f5; padding: 2px 6px; border-radius: 3px; }

/* VIP & Category Sections */
.vip-section {
    padding: 60px 5%;
    background: linear-gradient(135deg, #fffcf0 0%, #fff 100%);
}

.vip-scroll-container {
    display: flex;
    gap: 30px;
    overflow-x: auto;
    padding: 20px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.vip-scroll-container::-webkit-scrollbar {
    display: none;
}

.vip-card {
    min-width: 300px;
    background: white;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(184, 134, 11, 0.15);
    border: 2px solid #ffd700;
    transition: 0.4s;
    position: relative;
}

.vip-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 45px rgba(184, 134, 11, 0.25);
}

.vip-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: linear-gradient(45deg, #ffd700, #ffae00);
    color: white;
    padding: 5px 15px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 1;
}

.cat-shops-scroll {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 20px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.cat-shops-scroll::-webkit-scrollbar {
    display: none;
}

.horizontal-shop-card {
    min-width: 260px;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: 0.3s;
}

.horizontal-shop-card:hover {
    transform: scale(1.03);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* Modal Styling */
#orderModal {
    backdrop-filter: blur(5px);
}

.card-3d {
    transition: 0.3s;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.admin-tabs-wrapper {
    overflow-x: auto;
    white-space: nowrap;
    background: #eee;
    padding: 5px;
    border-radius: 15px;
    margin-bottom: 30px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.admin-tabs-wrapper::-webkit-scrollbar {
    display: none;
}

.admin-tab-item {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: 0.3s;
    color: #636e72;
}

.admin-tab-item.active {
    background: white;
    color: var(--btn-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.admin-card {
    background: white;
    padding: 30px;
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    width: 100%;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        text-align: center;
    }
    .admin-card {
        padding: 20px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Footer Improvements */
.footer { background: #2d3436; color: white; padding: 40px 4% 20px; width: 100%; margin-top: 20px; }
.footer-container { display: flex; flex-direction: column; gap: 30px; }
@media (min-width: 768px) { .footer-container { flex-direction: row; justify-content: space-between; text-align: left; } }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); margin-top: 25px; padding-top: 15px; text-align: center; font-size: 0.8rem; }

/* Language Switch */
.switch {
  --input-focus: #2d8cf0;
  --font-color: #323232;
  --font-color-sub: #666;
  --bg-color: #fff;
  --bg-color-alt: #666;
  --main-color: #323232;
  position: relative;
  display: flex;
  flex-direction: row; /* Changed to row for side-by-side labels */
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: auto;
  height: 40px;
  margin: 2px;
  color: white;
  font-weight: 700;
  font-size: 0.8rem;
}

.switch-container {
  position: relative;
  width: 50px;
  height: 25px;
}

.toggle {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  box-sizing: border-box;
  border-radius: 5px;
  border: 2px solid var(--main-color);
  box-shadow: 2px 2px var(--main-color);
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-color);
  transition: 0.3s;
}

.slider:before {
  box-sizing: border-box;
  position: absolute;
  content: "";
  height: 17px;
  width: 17px;
  border: 2px solid var(--main-color);
  border-radius: 5px;
  left: 2px;
  bottom: 2px;
  background-color: var(--bg-color);
  box-shadow: 0 2px 0 var(--main-color);
  transition: 0.3s;
}

.toggle:checked + .slider {
  background-color: var(--input-focus);
}

.toggle:checked + .slider:before {
  transform: translateX(24px);
}

.lang-label {
  cursor: pointer;
  user-select: none;
}

.lang-label.active {
  color: #ffd700;
  text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

/* RTL Adjustments */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .nav-links {
    flex-direction: row-reverse;
}

[dir="rtl"] .logo-section {
    flex-direction: row-reverse;
}

[dir="rtl"] .nav-links a {
    flex-direction: row-reverse;
}

[dir="rtl"] .login-btn {
    margin-right: 10px;
    margin-left: 0;
}

[dir="rtl"] .switch {
    margin-right: 15px;
}

@media (max-width: 992px) {
    .lang-switch-item {
        order: -1;
        margin-bottom: 20px;
        display: flex;
        justify-content: center;
        width: 100%;
    }
}

/* Product Image Gallery Enhancements */
.p-card {
    overflow: hidden;
    position: relative;
}

.p-card .p-image {
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.p-card:hover .p-image {
    transform: scale(1.1) rotate(2deg);
}

/* Smooth pulse animation for image count badge */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.image-count-badge {
    animation: pulse 2s infinite;
}

/* Shimmer loading effect */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Smooth transitions for all interactive elements */
button, a, input, select, textarea {
    transition: all 0.3s ease;
}

/* Enhanced hover effects for buttons */
.view-btn, .order-btn, .login-btn {
    position: relative;
    overflow: hidden;
}

.view-btn::before, .order-btn::before, .login-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.view-btn:hover::before, .order-btn:hover::before, .login-btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Fade in from bottom animation */
@keyframes fadeInBottom {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.p-card, .shop-card {
    animation: fadeInBottom 0.6s ease backwards;
}

/* Stagger animation for grid items */
.p-card:nth-child(1) { animation-delay: 0.1s; }
.p-card:nth-child(2) { animation-delay: 0.2s; }
.p-card:nth-child(3) { animation-delay: 0.3s; }
.p-card:nth-child(4) { animation-delay: 0.4s; }
.p-card:nth-child(5) { animation-delay: 0.5s; }
.p-card:nth-child(6) { animation-delay: 0.6s; }
.p-card:nth-child(n+7) { animation-delay: 0.7s; }

/* Smooth zoom on click */
.p-card:active, .shop-card:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* Price animation */
@keyframes priceGlow {
    0%, 100% {
        text-shadow: 0 0 5px rgba(255, 71, 87, 0.2);
    }
    50% {
        text-shadow: 0 0 15px rgba(255, 71, 87, 0.5);
    }
}

.p-price, .lightbox-price {
    animation: priceGlow 2s ease-in-out infinite;
}

/* Bounce animation for new badges */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.offer-badge, .vip-badge {
    animation: bounce 2s ease infinite;
}

