/* مطعم شريف - واجهة رئيسية مع أنيميشن مرن RTL */
:root {
  --primary: #c41e3a;
  --primary-dark: #9a1830;
  --accent: #f4a261;
  --dark: #1a1a2e;
  --darker: #16213e;
  --light: #edf2f4;
  --white: #fff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 40px rgba(0,0,0,0.15);
  --font: 'Tajawal', sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--light);
  color: #333;
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ========== Header ========== */
.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1000;
  background: rgba(26, 26, 46, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s;
}

.site-header.hidden {
  transform: translateY(-100%);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--white);
  text-decoration: none;
  letter-spacing: -0.02em;
  transition: color 0.3s, transform 0.3s;
}

.logo:hover {
  color: var(--accent);
  transform: scale(1.02);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.main-nav a {
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: color 0.3s, background 0.3s, transform 0.2s;
}

.main-nav a:hover {
  color: var(--accent);
  background: rgba(255,255,255,0.08);
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: fixed;
    top: 70px;
    right: 0;
    left: 0;
    flex-direction: column;
    background: var(--darker);
    padding: 1rem;
    gap: 0;
    transform: translateY(-120%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s, visibility 0.3s;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  .main-nav.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  .main-nav a {
    display: block;
    padding: 1rem;
    border-radius: var(--radius-sm);
  }
}

/* ========== Hero ========== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, var(--dark) 0%, var(--darker) 50%, #0f3460 100%);
  color: var(--white);
  padding: 6rem 1.5rem 4rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 80%, rgba(196, 30, 58, 0.2) 0%, transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(244, 162, 97, 0.15) 0%, transparent 45%);
  pointer-events: none;
}

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

.hero-badge {
  display: inline-block;
  background: rgba(244, 162, 97, 0.2);
  color: var(--accent);
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1rem;
  animation: fadeInUp 0.8s ease-out, float 4s ease-in-out infinite;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
  animation: fadeInUp 0.8s ease-out 0.15s both;
}

.hero p {
  font-size: 1.2rem;
  opacity: 0.9;
  margin-bottom: 2rem;
  animation: fadeInUp 0.8s ease-out 0.3s both;
}

.hero-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  animation: fadeInUp 0.8s ease-out 0.45s both;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s, background 0.3s;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 4px 20px rgba(196, 30, 58, 0.4);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 30px rgba(196, 30, 58, 0.5);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.5);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-4px);
}

/* ========== Sections ========== */
.section {
  padding: 5rem 0;
  scroll-margin-top: 70px;
}

.section.dark {
  background: var(--dark);
  color: var(--white);
}

.section-title {
  text-align: center;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  text-align: center;
  opacity: 0.85;
  margin-bottom: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* About */
#about .about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  max-width: 1000px;
  margin: 0 auto;
}

#about .about-text h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

#about .about-text p {
  margin-bottom: 1rem;
  opacity: 0.9;
}

#about .about-visual {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: var(--radius);
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  box-shadow: var(--shadow);
  animation: scaleIn 0.8s ease-out;
}

@media (max-width: 768px) {
  #about .about-grid {
    grid-template-columns: 1fr;
  }
}

/* Branches */
.branches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.branch-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.branch-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
  border-color: var(--accent);
}

.branch-card.main {
  border-color: var(--primary);
  background: rgba(196, 30, 58, 0.15);
}

.branch-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.branch-card .city {
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* Contact */
#contact .contact-wrap {
  max-width: 500px;
  margin: 0 auto;
  text-align: center;
}

#contact a {
  color: var(--accent);
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 600;
}

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

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Scroll-triggered reveal */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ========== Menu page ========== */
.page-hero {
  background: linear-gradient(135deg, var(--dark), var(--darker));
  color: var(--white);
  padding: 8rem 1.5rem 4rem;
  text-align: center;
}

.page-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.categories-list {
  padding: 2rem 0;
  min-height: 200px;
}

/* قسم القائمة والطلب يظهر دائماً (بدون انتظار أنيميشن reveal) */
.main-content .categories-list,
.main-content .categories-list .category-block,
.main-content .categories-list .product-card,
.main-content .order-layout .category-block,
.main-content .order-layout .product-card {
  opacity: 1;
  transform: none;
  visibility: visible;
}

.category-block {
  margin-bottom: 3rem;
}

.category-block h2 {
  font-size: 1.6rem;
  color: var(--dark);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--primary);
  display: inline-block;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.product-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.12);
}

.product-card .img-wrap {
  height: 200px;
  background: linear-gradient(135deg, var(--darker), var(--dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: rgba(255,255,255,0.3);
}

.product-card .img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card .body {
  padding: 1.25rem;
}

.product-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.product-card p {
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 0.75rem;
  min-height: 2.8em;
}

.product-card .price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.product-card .price span {
  font-size: 0.85rem;
  font-weight: 500;
  color: #888;
}

/* ========== Order page ========== */
.order-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
  padding: 2rem 0 4rem;
  align-items: start;
}

@media (max-width: 900px) {
  .order-layout {
    grid-template-columns: 1fr;
  }
}

.order-cart {
  position: sticky;
  top: 90px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  border: 2px solid var(--primary);
}

.order-cart h3 {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #eee;
}

.cart-items {
  max-height: 320px;
  overflow-y: auto;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid #eee;
  gap: 0.5rem;
}

.cart-item .name {
  font-weight: 600;
}

.cart-item .qty-price {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cart-item input.qty {
  width: 56px;
  padding: 0.35rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  text-align: center;
  font-size: 1rem;
}

.cart-item .remove-btn {
  background: none;
  border: none;
  color: #c00;
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1.2rem;
  line-height: 1;
}

.cart-total {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px solid #eee;
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
}

.cart-empty {
  padding: 2rem;
  text-align: center;
  color: #888;
}

.order-form {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.order-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.order-form input,
.order-form select,
.order-form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #ddd;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 1rem;
  margin-bottom: 1rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.order-form input:focus,
.order-form select:focus,
.order-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.15);
}

.order-form button[type="submit"] {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
  margin-top: 0.5rem;
}

.add-to-cart {
  margin-top: 0.75rem;
  width: 100%;
  padding: 0.6rem;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
}

.add-to-cart:hover {
  background: var(--primary-dark);
  transform: scale(1.02);
}

/* ========== Page (dynamic) ========== */
.page-content {
  padding: 6rem 0 4rem;
  max-width: 800px;
  margin: 0 auto;
}

.page-content h1 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--dark);
}

.page-content .content-body {
  line-height: 1.8;
}

.page-content .content-body p {
  margin-bottom: 1rem;
}

/* ========== Footer ========== */
.site-footer {
  background: var(--dark);
  color: var(--white);
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

.footer-brand strong {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.footer-brand p,
.footer-links a,
.footer-contact a {
  opacity: 0.85;
  color: inherit;
  text-decoration: none;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.copyright {
  text-align: center;
  opacity: 0.7;
  font-size: 0.9rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* Toast / message */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--dark);
  color: var(--white);
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 9999;
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.success { background: #0d7a4a; }
.toast.error { background: #c41e3a; }

/* زر السلة العائم */
.floating-cart {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(196, 30, 58, 0.45);
  z-index: 999;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.8);
  transition: opacity 0.3s, transform 0.3s, visibility 0.3s, background 0.2s;
}

.floating-cart.visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.floating-cart:hover {
  background: var(--primary-dark);
  color: var(--white);
}

.floating-cart-icon {
  font-size: 1.5rem;
}

.floating-cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--dark);
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

html[dir="rtl"] .floating-cart {
  left: auto;
  right: 1.5rem;
}

html[dir="rtl"] .floating-cart-count {
  right: auto;
  left: -4px;
}

.main-content {
  min-height: 60vh;
}
