/* ═══════════════════════════════════════════
   shared.css  –  Carcedes Market
   مشترك بين كل الصفحات
═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;900&display=swap');

/* ─── VARIABLES ─── */
:root {
  --gold:       #C9A400;
  --gold-dark:  #8F7300;
  --bg:         #0a0a0a;
  --bg2:        #111111;
  --bg3:        #161616;
  --text:       #ffffff;
  --text-muted: #888888;
  --border:     #222222;
  --nav-bg:     rgba(10,10,10,0.95);
}

/* ─── الوضع الفاتح ─── */
[data-theme="light"] {
  --bg:         #f1ede4;
  --bg2:        #faf8f3;
  --bg3:        #eae4d6;
  --text:       #2a251d;
  --text-muted: #756c5e;
  --border:     #ddd4c0;
  --nav-bg:     rgba(250,248,243,0.95);
}

html { transition: background-color 0.2s ease; }
body { transition: background-color 0.2s ease, color 0.2s ease; }

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

/* ─── TABLES: سكرول أفقي تلقائي على كل الجداول ─── */
table {
  display: block;
  width: 100%;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}
table thead, table tbody, table tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Cairo', sans-serif;
  overflow-x: hidden;
}

/* ─── NAVBAR (shared) ─── */
nav:not(.bottom-nav), .page-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 60px;
  border-bottom: 1px solid var(--border);
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  transition: background-color 0.2s ease;
}

.nav-logo { display: flex; align-items: center; gap: 12px; cursor: pointer; }
a.nav-logo { text-decoration: none; }
a.nav-logo:hover .logo-text { color: var(--text); }
a.nav-logo:hover .logo-icon { transform: scale(1.05); transition: transform 0.2s; }

.logo-icon {
  width: 44px; height: 44px;
  background: transparent;
  border-radius: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  overflow: hidden;
}

.logo-text { font-size: 22px; font-weight: 900; color: var(--text); }
.logo-text span { color: var(--gold); }

.nav-links { display: flex; gap: 36px; list-style: none; }

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  transition: color 0.2s;
  cursor: pointer;
}
.nav-links a:hover,
.nav-links a.active { color: var(--gold); }

.nav-cta {
  background: var(--gold);
  color: #000;
  border: none;
  padding: 10px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Cairo', sans-serif;
  cursor: pointer;
  transition: background 0.2s;
}
.nav-cta:hover { background: #f0cc00; }

/* ─── SELL NAV BUTTON ─── */
.sell-nav-btn {
  display: none; align-items: center; gap: 8px;
  background: var(--gold); color: #000; border: none;
  padding: 10px 20px; border-radius: 10px;
  font-size: 14px; font-weight: 700;
  font-family: 'Cairo', sans-serif; cursor: pointer;
  transition: all 0.2s; text-decoration: none;
}
.sell-nav-btn:hover { background: #f0cc00; }
.dashboard-link {
  display: none; align-items: center; gap: 8px;
  background: rgba(221,184,0,0.1); border: 1px solid rgba(221,184,0,0.3);
  color: var(--gold); padding: 9px 18px; border-radius: 10px;
  text-decoration: none; font-size: 14px; font-weight: 700; transition: all 0.2s;
}
.dashboard-link:hover { background: rgba(221,184,0,0.2); }

/* ─── BACK BUTTON ─── */
.back-btn {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 9px 18px;
  border-radius: 10px;
  font-family: 'Cairo', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.back-btn:hover { border-color: var(--gold); color: var(--gold); }

/* ─── BADGES ─── */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(221,184,0,0.1);
  border: 1px solid rgba(221,184,0,0.3);
  border-radius: 100px;
  padding: 6px 16px;
  font-size: 13px;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 24px;
}

.badge-dot {
  width: 7px; height: 7px;
  background: var(--gold);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

/* ─── MODAL ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 48px 44px;
  width: 100%;
  max-width: 440px;
  position: relative;
  transform: translateY(30px) scale(0.97);
  transition: transform 0.3s ease;
}
.modal-overlay.active .modal { transform: translateY(0) scale(1); }

.modal-close {
  position: absolute;
  top: 20px; left: 20px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 34px; height: 34px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.modal-close:hover { color: var(--text); border-color: var(--gold); }

.modal-logo {
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
}
.modal-logo-icon {
  width: 44px; height: 44px;
  background: var(--gold);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.modal-logo-text { font-size: 20px; font-weight: 900; }
.modal-logo-text span { color: var(--gold); }

.modal h2 { text-align: center; font-size: 24px; font-weight: 900; margin-bottom: 6px; }
.modal-sub { text-align: center; font-size: 14px; color: var(--text-muted); margin-bottom: 32px; }

.tabs {
  display: flex;
  background: var(--bg3);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 28px;
  gap: 4px;
}
.tab-btn {
  flex: 1; padding: 10px; border: none;
  border-radius: 9px;
  font-family: 'Cairo', sans-serif;
  font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
  background: transparent; color: var(--text-muted);
}
.tab-btn.active { background: var(--gold); color: #000; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 700; color: var(--text-muted); margin-bottom: 8px; }
.form-input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 16px;
  color: var(--text);
  font-family: 'Cairo', sans-serif;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--gold); }
.form-input::placeholder { color: #444; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.btn-submit {
  width: 100%;
  background: var(--gold); color: #000; border: none;
  padding: 15px; border-radius: 14px;
  font-size: 16px; font-weight: 700;
  font-family: 'Cairo', sans-serif;
  cursor: pointer; transition: all 0.2s; margin-top: 8px;
}
.btn-submit:hover { background: #f0cc00; transform: translateY(-1px); }

.modal-footer { text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 20px; }
.modal-footer a { color: var(--gold); text-decoration: none; font-weight: 700; }

.divider {
  display: flex; align-items: center; gap: 12px;
  margin: 22px 0; color: var(--text-muted); font-size: 13px;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.social-btns { display: flex; gap: 10px; }
.social-btn {
  flex: 1;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); padding: 11px; border-radius: 11px;
  font-family: 'Cairo', sans-serif; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.social-btn:hover { border-color: var(--gold); }

/* ─── ANIMATIONS ─── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* ─── UTILITIES ─── */
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  nav:not(.bottom-nav), .page-nav {
    padding: 10px 16px;
    flex-wrap: nowrap;
    gap: 8px;
    display: flex !important;
  }
  .nav-links { display: none; }
  .nav-links.mobile-open {
    display: flex;
    flex-direction: column;
    width: 100%;
    order: 3;
    gap: 4px;
    padding: 8px 0 4px;
    border-top: 1px solid var(--border);
  }
  .nav-links.mobile-open li a {
    display: block;
    padding: 10px 4px;
    font-size: 15px;
    border-bottom: 1px solid var(--border);
  }
  .hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    padding: 8px;
  }
  .hamburger-btn span {
    display: block;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.2s;
  }
  .modal { margin: 16px; padding: 28px 18px; width: calc(100% - 32px); max-width: 100%; }
  .form-row { grid-template-columns: 1fr; }
  .logo-text { font-size: 18px; }
  .logo-icon { width: 34px; height: 34px; font-size: 17px; }
  .nav-cta { padding: 8px 16px; font-size: 13px; }
  .dashboard-link { font-size: 12px; padding: 7px 12px !important; }
  .sell-nav-btn { display: none !important; }
}
.hamburger-btn { display: none; }

@media (max-width: 600px) {
  nav:not(.bottom-nav), .page-nav {
    padding: 12px 14px;
  }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal, .booking-modal-box, .add-modal-box {
    border-radius: 20px 20px 0 0;
    margin: 0;
    width: 100%;
    max-width: 100%;
    padding: 24px 16px 32px;
    max-height: 90vh;
    overflow-y: auto;
  }
  .form-input, .form-select { font-size: 16px !important; } /* prevent zoom on iOS */
  .btn-submit { font-size: 15px; padding: 14px; }
}

/* ─── BOTTOM NAVIGATION (Mobile) ─── */
.bottom-nav {
  display: none;
}

@media (max-width: 900px) {
  /* إخفاء الـ hamburger وإظهار الـ bottom nav */
  .hamburger-btn { display: none !important; }

  /* مساحة أسفل الصفحة عشان المحتوى ميتغطاش */
  body { padding-bottom: 72px; }

  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--bg2);
    border-top: 1px solid var(--border);
    z-index: 500;
    align-items: center;
    justify-content: space-around;
    padding: 0 4px;
    /* safe area for iPhone notch */
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    height: 100%;
    text-decoration: none;
    color: var(--text-muted);
    font-family: 'Cairo', sans-serif;
    font-size: 10px;
    font-weight: 700;
    transition: color 0.2s;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
  }

  .bottom-nav-item .bn-icon {
    font-size: 22px;
    line-height: 1;
    transition: transform 0.2s;
  }

  .bottom-nav-item.active,
  .bottom-nav-item:hover {
    color: var(--gold);
  }

  .bottom-nav-item.active .bn-icon {
    transform: scale(1.15);
  }

  /* زرار "أعلن" في المنتصف مميز */
  .bottom-nav-item.bn-sell {
    background: var(--gold);
    color: #000;
    border-radius: 16px;
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    margin: 0 4px;
    font-size: 9px;
    font-weight: 900;
    box-shadow: 0 4px 16px rgba(221,184,0,0.35);
  }

  .bottom-nav-item.bn-sell .bn-icon {
    font-size: 20px;
  }

  .bottom-nav-item.bn-sell:hover {
    background: var(--gold-dark);
    color: #000;
  }
}

/* ─── SITE FOOTER ─── */
.site-footer {
  margin-top: 48px;
  border-top: 1px solid var(--border);
  background: var(--bg2);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 28px;
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 32px;
}

.footer-col-title {
  font-size: 14px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 14px;
}

.footer-logo {
  font-size: 19px;
  font-weight: 900;
  color: var(--gold);
  margin-bottom: 6px;
}

.footer-tagline {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
}

.footer-contact-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color .15s;
  direction: ltr;
  justify-content: flex-end;
}

.footer-contact-item:hover { color: var(--gold); }

.footer-ic { font-size: 15px; flex-shrink: 0; }

.footer-social-list {
  display: flex;
  gap: 10px;
}

.footer-social-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  text-decoration: none;
  transition: all .15s;
  color: #ffffff;
}

[data-theme="light"] .footer-social-btn {
  color: #2563eb;
}

.footer-social-btn:hover {
  border-color: var(--gold);
  background: rgba(221,184,0,0.08);
  transform: translateY(-2px);
}

.footer-lang-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}

.footer-lang-pill:hover {
  border-color: var(--gold);
  color: var(--text);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
}

@media (max-width: 800px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 32px 20px 24px;
    text-align: center;
  }
  .footer-contact-item { justify-content: center; }
  .footer-social-list { justify-content: center; }
}