/* =========================================================
   AlMatbkh Luxury Sidebar — sidebar.css
   Designed to match AlMatbkh warm Arabic culinary aesthetic
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Noto+Kufi+Arabic:wght@300;400;500;600;700&display=swap');

/* ─── CSS Variables ─────────────────────────────────────── */
:root {
  --am-primary:       #E8813A;
  --am-primary-dark:  #C8601F;
  --am-primary-light: #F5A96A;
  --am-bg:            #1A0F08;
  --am-bg-card:       #231509;
  --am-bg-hover:      #2E1A0C;
  --am-text:          #F5EDE4;
  --am-text-muted:    #B89880;
  --am-text-dim:      #7A5C45;
  --am-border:        rgba(232,129,58,0.15);
  --am-glow:          rgba(232,129,58,0.25);
  --am-sidebar-w:     320px;
  --am-radius:        14px;
  --am-font:          'Noto Kufi Arabic', 'Segoe UI', sans-serif;
  --am-transition:    cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Overlay ────────────────────────────────────────────── */
.almatbkh-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 5, 2, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--am-transition),
              visibility 0.35s var(--am-transition);
}

.almatbkh-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

/* ─── Sidebar Shell ──────────────────────────────────────── */
.almatbkh-sidebar {
  position: fixed;
      overflow-y: auto;
    max-height: 100vh;
  top: 0;
  right: 0;
  height: 100%;
  width: var(--am-sidebar-w);
  max-width: 90vw;
  background: var(--am-bg);
  background-image:
    radial-gradient(ellipse 60% 40% at 80% 10%, rgba(232,129,58,0.10) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 20% 90%, rgba(200,96,31,0.08) 0%, transparent 60%);
  border-left: 1px solid var(--am-border);
  box-shadow:
    -8px 0 60px rgba(0,0,0,0.6),
    -1px 0 0 rgba(232,129,58,0.08);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  direction: rtl;
  transform: translateX(100%);
  transition: transform 0.40s var(--am-transition);
  overflow: hidden;
}

.almatbkh-sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg,
    transparent 0%,
    var(--am-primary) 30%,
    var(--am-primary-light) 50%,
    var(--am-primary) 70%,
    transparent 100%
  );
  opacity: 0.7;
}

.almatbkh-sidebar.is-open {
  transform: translateX(0);
}

/* ─── Sidebar Header ─────────────────────────────────────── */
.almatbkh-sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 18px;
  flex-shrink: 0;
}

.almatbkh-sidebar__logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.almatbkh-sidebar__logo-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(232,129,58,0.4));
}

.almatbkh-sidebar__logo-icon svg {
  width: 100%;
  height: 100%;
}

.almatbkh-sidebar__logo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.almatbkh-sidebar__logo-title {
  font-size: 20px;
  color: var(--am-text);
  letter-spacing: -0.3px;
  line-height: 1;
}

.almatbkh-sidebar__logo-sub {
  font-size: 11px;
  color: var(--am-primary-light);
  letter-spacing: 0.5px;
  opacity: 0.85;
}

.almatbkh-sidebar__close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  padding: 0px !important;
  border: 1px solid var(--am-border);
  background: var(--am-bg-card);
  color: var(--am-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s,
    border-color 0.2s,
    transform 0.2s;
  flex-shrink: 0;
}

.almatbkh-sidebar__close svg {
  width: 16px;
  height: 16px;
}

.almatbkh-sidebar__close:hover {
  background: var(--am-primary);
  border-color: var(--am-primary);
  color: white;
  transform: rotate(90deg);
}

/* ─── Divider ────────────────────────────────────────────── */
.almatbkh-sidebar__divider {
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--am-border) 30%,
    var(--am-border) 70%,
    transparent 100%
  );
  margin: 2px 16px;
  flex-shrink: 0;
}

/* ─── Sections ───────────────────────────────────────────── */
.almatbkh-sidebar__section {
  padding: 12px 12px 8px;
  flex-shrink: 0;
}

/* ─── Nav Links ──────────────────────────────────────────── */
.almatbkh-sidebar__nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.almatbkh-sidebar__nav-item {
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.3s var(--am-transition),
              transform 0.3s var(--am-transition);
}

.almatbkh-sidebar.is-open .almatbkh-sidebar__nav-item:nth-child(1) { opacity:1; transform:translateX(0); transition-delay: 0.05s; }
.almatbkh-sidebar.is-open .almatbkh-sidebar__nav-item:nth-child(2) { opacity:1; transform:translateX(0); transition-delay: 0.10s; }
.almatbkh-sidebar.is-open .almatbkh-sidebar__nav-item:nth-child(3) { opacity:1; transform:translateX(0); transition-delay: 0.15s; }
.almatbkh-sidebar.is-open .almatbkh-sidebar__nav-item:nth-child(4) { opacity:1; transform:translateX(0); transition-delay: 0.20s; }
.almatbkh-sidebar.is-open .almatbkh-sidebar__nav-item:nth-child(5) { opacity:1; transform:translateX(0); transition-delay: 0.25s; }

.almatbkh-sidebar__nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--am-text-muted);
  font-size: 14px;

  transition:
    background 0.2s,
    color 0.2s,
    padding-right 0.2s;
  position: relative;
  overflow: hidden;
}

.almatbkh-sidebar__nav-link::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(232,129,58,0.12) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.2s;
  border-radius: inherit;
}

.almatbkh-sidebar__nav-link:hover {
  background: var(--am-bg-hover);
  color: var(--am-text);
  padding-right: 18px;
}

.almatbkh-sidebar__nav-link:hover::before {
  opacity: 1;
}

.almatbkh-sidebar__nav-link--active {
  background: linear-gradient(135deg, rgba(232,129,58,0.18) 0%, rgba(200,96,31,0.08) 100%);
  color: var(--am-primary-light);
  border: 1px solid rgba(232,129,58,0.2);
}

.almatbkh-sidebar__nav-link--active::before {
  opacity: 1;
}

.almatbkh-sidebar__nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: inherit;
  opacity: 0.85;
}

.almatbkh-sidebar__nav-icon svg {
  width: 100%;
  height: 100%;
}

.almatbkh-sidebar__nav-text {
  flex: 1;
  line-height: 1;
}

/* ─── Section Title ──────────────────────────────────────── */
.almatbkh-sidebar__section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--am-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0 6px 10px;
  opacity: 0.9;
}

.almatbkh-sidebar__section-title svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ─── Categories ─────────────────────────────────────────── */
.almatbkh-sidebar__categories {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--am-primary-dark) transparent;
}

.almatbkh-sidebar__categories::-webkit-scrollbar {
  width: 3px;
}

.almatbkh-sidebar__categories::-webkit-scrollbar-track {
  background: transparent;
}

.almatbkh-sidebar__categories::-webkit-scrollbar-thumb {
  background: var(--am-primary-dark);
  border-radius: 2px;
}

.almatbkh-sidebar__cat-item {
  opacity: 0;
  transform: translateX(12px);
  transition: opacity 0.3s var(--am-transition),
              transform 0.3s var(--am-transition);
}

.almatbkh-sidebar.is-open .almatbkh-sidebar__cat-item {
  opacity: 1;
  transform: translateX(0);
  transition-delay: var(--delay, 0.1s);
}

.almatbkh-sidebar__cat-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--am-text-muted);
  font-size: 13px;
  transition:
    background 0.2s,
    color 0.2s,
    padding-right 0.2s;
}

.almatbkh-sidebar__cat-link:hover {
  background: var(--am-bg-hover);
  color: var(--am-text);
  padding-right: 18px;
}

.almatbkh-sidebar__cat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--am-text-dim);
  flex-shrink: 0;
  transition: background 0.2s, transform 0.2s;
}

.almatbkh-sidebar__cat-link:hover .almatbkh-sidebar__cat-dot {
  background: var(--am-primary);
  transform: scale(1.4);
}

.almatbkh-sidebar__cat-name {
  flex: 1;
  line-height: 1;
}

.almatbkh-sidebar__cat-count {
  font-size: 11px;

  color: var(--am-text-dim);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--am-border);
  border-radius: 20px;
  padding: 1px 7px;
  line-height: 1.6;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.almatbkh-sidebar__cat-link:hover .almatbkh-sidebar__cat-count {
  color: var(--am-primary-light);
  background: rgba(232,129,58,0.1);
  border-color: rgba(232,129,58,0.3);
}

/* ─── CTA Button ─────────────────────────────────────────── */
.almatbkh-sidebar__cta {
  padding: 12px 20px 8px;
  flex-shrink: 0;
}

.almatbkh-sidebar__cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 20px;
  border-radius: var(--am-radius);
  background: linear-gradient(135deg, var(--am-primary) 0%, var(--am-primary-dark) 100%);
  color: white;
  font-family: var(--am-font);
  font-size: 14px;

  text-decoration: none;
  letter-spacing: 0.3px;
  transition:
    transform 0.2s,
    box-shadow 0.2s,
    filter 0.2s;
  box-shadow: 0 4px 20px rgba(232,129,58,0.3);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s, box-shadow 0.2s, filter 0.2s;
}

.almatbkh-sidebar.is-open .almatbkh-sidebar__cta-btn {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.3s;
}

.almatbkh-sidebar__cta-btn svg {
  width: 18px;
  height: 18px;
}

.almatbkh-sidebar__cta-btn:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 30px rgba(232,129,58,0.45);
  transform: translateY(-1px);
}

/* ─── Sidebar Footer ─────────────────────────────────────── */
.almatbkh-sidebar__footer {
  margin-top: auto;
  padding: 14px 20px 20px;
  text-align: center;
  font-size: 11px;
  color: var(--am-text-dim);
  letter-spacing: 0.3px;
  flex-shrink: 0;
  border-top: 1px solid var(--am-border);
}

/* ─── Toggle Button ──────────────────────────────────────── */
.almatbkh-toggle {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: linear-gradient(135deg, var(--am-primary) 0%, var(--am-primary-dark) 100%);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(232,129,58,0.35);
  transition: transform 0.2s, box-shadow 0.2s;
  vertical-align: middle;
}

.almatbkh-toggle:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 20px rgba(232,129,58,0.5);
}

.almatbkh-toggle__bar {
  display: block;
  width: 20px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: transform 0.3s var(--am-transition),
              opacity 0.3s,
              width 0.3s;
  transform-origin: center;
}

.almatbkh-toggle__bar--mid {
  width: 14px;
  align-self: flex-start;
}

.almatbkh-toggle[aria-expanded="true"] .almatbkh-toggle__bar--top {
  transform: translateY(7px) rotate(45deg);
}

.almatbkh-toggle[aria-expanded="true"] .almatbkh-toggle__bar--mid {
  opacity: 0;
  transform: scaleX(0);
}

.almatbkh-toggle[aria-expanded="true"] .almatbkh-toggle__bar--bot {
  transform: translateY(-7px) rotate(-45deg);
  width: 20px;
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 480px) {
  :root {
    --am-sidebar-w: 290px;
  }
}

/* ─── [lovable_header_icon] wrapper inside sidebar ─────── */
.almatbkh-sidebar__icon-widget {
  padding: 10px 20px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.almatbkh-sidebar.is-open .almatbkh-sidebar__icon-widget {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.05s;
}
.almatbkh-sidebar__section-label {
  display: flex;
  gap: 8px;
}
.almatbkh-sidebar__section-label svg {
  width: 20px;
  color: white;
}
.almatbkh-sidebar__section-label span {
  color: white;
}