/* ====================================================
   BLAZE BURGER — Design tokens
   Palette: charcoal night + ember glow
==================================================== */
:root{
  --ink:        #0A0A0E;   /* page background — dark */
  --surface:    #161622;   /* card surface */
  --surface-2:  #252535;   /* raised surface / inputs */
  --line:       #2A2A3A;   /* hairline borders */
  --text:       #F0F0F5;   /* primary text — light */
  --text-dim:   #A0A0B0;   /* secondary text */
  --text-faint: #606070;   /* tertiary / placeholder */

  --ember-1:    #D4AF37;   /* gold */
  --ember-2:    #B8992E;   /* darker gold */
  --gold:       #D4AF37;   
  --gold-dim:   #B8992E;

  --ember-gradient: linear-gradient(135deg, var(--ember-1) 0%, var(--ember-2) 100%);
  --gold-gradient: linear-gradient(135deg, #FFD15C 0%, var(--gold) 60%, var(--gold-dim) 100%);

  --shadow-glow: 0 0 40px rgba(255, 90, 31, 0.35);
  --shadow-card: 0 8px 24px rgba(0,0,0,0.35);

  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  --font-display: 'Cairo', 'Rubik', sans-serif;
  --font-body: 'Cairo', 'Rubik', sans-serif;
}

* { 
  margin: 0; 
  padding: 0; 
  box-sizing: border-box; 
  -webkit-tap-highlight-color: transparent;
}

button, a, input, select, textarea {
  outline: none;
}

img {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

html, body{
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body{
  direction: rtl;
  max-width: 560px;
  margin: 0 auto;
  position: relative;
  min-height: 100vh;
  padding-bottom: 110px;
}

button{ font-family: inherit; border: none; background: none; cursor: pointer; color: inherit; }
input{ font-family: inherit; }
img{ display:block; max-width:100%; }

/* subtle ambient noise/grain via radial gradients on body */
body::before{
  content:"";
  position: fixed;
  inset: 0;
  background: none;
  pointer-events: none;
  z-index: 0;
}

/* ====================================================
   HEADER
==================================================== */
/* ====================================================
   HEADER & COVER
==================================================== */
.header-cover {
  position: relative;
  width: 100%;
  height: 180px;
}

.header-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.1) 40%, rgba(0,0,0,0.3) 100%);
  pointer-events: none;
}

.header-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.header-top-actions {
  position: absolute;
  top: 16px;
  right: 16px;
  left: 16px;
  display: flex;
  justify-content: space-between;
  z-index: 10;
}

.icon-btn{
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  color: var(--text);
  transition: transform .15s ease, background .15s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.icon-btn:active{ transform: scale(0.92); background: rgba(0,0,0,0.05); }
.icon-btn svg{ width: 20px; height: 20px; }

.lang-toggle{
  width: auto;
  padding: 0 16px;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-pill);
}

/* ====================================================
   MAIN CONTENT PANEL
==================================================== */
.main-panel {
  background: var(--ink);
  border-radius: 32px 32px 0 0;
  margin-top: -32px;
  position: relative;
  z-index: 5;
  padding-bottom: 20px;
}

.logo-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0 24px;
}

.action-left, .action-right {
  width: 44px;
  margin-top: 16px;
}

.brand-row{ position: relative; }

.brand-name{
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.brand-sub{
  font-size: 14px;
  color: var(--text-dim);
  font-weight: 500;
  margin-bottom: 10px;
}

/* ====================================================
   LOGO
==================================================== */
.logo-wrap{
  position: relative;
  display: flex;
  justify-content: center;
  margin-top: -48px;
  z-index: 10;
}

.logo-wrap img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--surface);
  background: var(--surface);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

@keyframes emberPulse{
  0%, 100%{ opacity: 0.7; transform: scale(1); }
  50%{ opacity: 1; transform: scale(1.08); }
}

.logo-badge{
  position: relative;
  width: 96px; height: 96px;
  border-radius: 50%;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  box-shadow:
    0 10px 30px rgba(0,0,0,0.5),
    0 0 0 4px var(--ink),
    0 0 0 5px rgba(255,90,31,0.4);
  animation: floatLogo 4s ease-in-out infinite;
}

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

.logo-ring{
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
}
.logo-ring circle{
  fill: none;
  stroke: var(--ember-1);
  stroke-width: 1.5;
  stroke-dasharray: 4 7;
  animation: rotateRing 18s linear infinite;
  transform-origin: center;
  opacity: 0.55;
}
@keyframes rotateRing{
  to{ transform: rotate(360deg); }
}

.logo-inner{
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--ember-gradient);
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 -4px 10px rgba(0,0,0,0.25), inset 0 3px 6px rgba(255,255,255,0.2);
}

.logo-flame{
  width: 34px; height: 34px;
  color: #FFF3E0;
}

/* ====================================================
   SEARCH
==================================================== */
.search-section{
  padding: 22px 20px 6px;
  position: relative;
  z-index: 2;
}

.search-box{
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 13px 18px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.search-box:focus-within{
  border-color: var(--ember-1);
  box-shadow: 0 0 0 3px rgba(255,90,31,0.15);
}

.search-icon{
  width: 19px; height: 19px;
  color: var(--text-faint);
  flex-shrink: 0;
}

.search-box input{
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
}
.search-box input::placeholder{ color: var(--text-faint); }

/* ====================================================
   CATEGORIES
==================================================== */
.categories{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 0 20px 20px;
}

.cat-card{
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: transform .15s ease;
  padding: 0;
  border: 1px solid var(--line);
}
.cat-card:active{ transform: scale(0.96); }

.cat-card-img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cat-card-overlay{
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 30%, transparent 60%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
}

.cat-card-title{
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  text-align: center;
}

/* ====================================================
   VIEW HEADER (PRODUCTS VIEW)
==================================================== */
.view-header{
  display: flex;
  align-items: center;
  padding: 16px 20px;
  position: sticky;
  top: 0;
  background: rgba(10, 10, 14, 0.9);
  backdrop-filter: blur(10px);
  z-index: 20;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}

.back-btn{
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--gold);
  font-size: 15px;
  font-weight: 700;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: opacity .15s;
}
.back-btn:active{ opacity: 0.7; }

.view-title{
  flex: 1;
  text-align: center;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin-left: 20px; /* Offset to center title in RTL */
}

/* ====================================================
   PRODUCTS
==================================================== */
.products{
  padding: 14px 20px 20px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.section-title{
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  margin: 14px 0 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before{
  content: "";
  width: 4px; height: 18px;
  border-radius: 4px;
  background: var(--ember-gradient);
  display: inline-block;
}

.product-card{
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  transition: transform .15s ease, box-shadow .15s ease;
}
.product-card:active{ transform: scale(0.98); box-shadow: 0 2px 8px rgba(0,0,0,0.04); }

.product-img-wrap{
  width: 100%;
  height: 120px;
  border-radius: 0;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--ink);
  position: relative;
  margin-bottom: 0;
}
.product-img-wrap img{
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
}

.product-info{
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
  padding: 12px 10px;
}

.product-name{
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 6px;
  line-height: 1.3;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-desc{
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}

.product-bottom{
  display: flex;
  justify-content: center;
  align-items: center;
}

.product-price{
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  background: var(--surface-2);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}

.product-badge{
  position: absolute;
  top: 4px; right: 4px;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  color: #fff;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.product-badge.hot{ background: var(--ember-gradient); }
.product-badge.new{ background: var(--gold-gradient); color: #1A1311; }


.add-btn{
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--ember-gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 4px 14px rgba(255,90,31,0.4);
  flex-shrink: 0;
  transition: transform .15s ease;
  line-height: 0;
}
.add-btn:active{ transform: scale(0.85); }

/* ====================================================
   EMPTY STATE
==================================================== */
.empty-state{
  text-align: center;
  padding: 60px 20px;
  color: var(--text-faint);
}
.empty-icon{ font-size: 40px; margin-bottom: 12px; opacity: 0.5; }
.empty-state p{ font-size: 14px; font-weight: 600; }

/* ====================================================
   STICKY CART BAR
==================================================== */
.cart-sticky{
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 528px;
  z-index: 50;
  animation: slideUp .3s ease;
}
@keyframes slideUp{
  from{ transform: translateX(-50%) translateY(20px); opacity: 0; }
  to{ transform: translateX(-50%) translateY(0); opacity: 1; }
}

.cart-sticky-inner{
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--ember-gradient);
  border-radius: var(--radius-pill);
  padding: 8px 8px 8px 20px;
  box-shadow: 0 10px 30px rgba(255,90,31,0.4), 0 4px 12px rgba(0,0,0,0.3);
}

.cart-sticky-info{
  display: flex;
  flex-direction: column;
  color: #fff;
}
.cart-sticky-count{ font-size: 14px; font-weight: 800; }
.cart-sticky-label{ font-size: 10px; opacity: 0.85; font-weight: 600; }

.cart-sticky-total{
  flex: 1;
  text-align: center;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 900;
  color: #fff;
}
.cart-sticky-total .currency{ font-size: 12px; font-weight: 700; margin-right: 2px; }

.cart-sticky-btn{
  background: rgba(0,0,0,0.25);
  color: #fff;
  font-weight: 800;
  font-size: 13.5px;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

/* ====================================================
   PRODUCT MODAL
==================================================== */
.modal-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(5,3,2,0.7);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
.modal-backdrop.open{ opacity: 1; visibility: visible; }

.modal-sheet{
  width: 100%;
  max-width: 560px;
  background: var(--ink);
  border-radius: 28px 28px 0 0;
  position: relative;
  max-height: 88vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.25,.8,.3,1);
  border-top: 1px solid var(--line);
}
.modal-backdrop.open .modal-sheet{ transform: translateY(0); }

.modal-close{
  position: absolute;
  top: 16px; left: 16px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
  color: #fff;
}
.modal-close svg{ width: 18px; height: 18px; }

.modal-image-wrap{
  position: relative;
  width: 100%;
  height: 240px;
  overflow: hidden;
  border-radius: 28px 28px 0 0;
  background: var(--surface);
}
.modal-glow{
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(255,90,31,0.3), transparent 70%);
  z-index: 1;
}
.modal-image{
  width: 100%; height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 0;
}

.modal-body{
  padding: 20px 22px 10px;
}

.modal-title{
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 800;
  margin-bottom: 8px;
}

.modal-desc{
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 14px;
}

.modal-price{
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  color: var(--gold);
}

.modal-footer{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px 28px;
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, transparent, var(--ink) 30%);
}

.qty-control{
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
}

.qty-btn{
  width: 26px; height: 26px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
}

.qty-value{
  font-size: 15px;
  font-weight: 800;
  min-width: 18px;
  text-align: center;
}

.add-to-cart-btn{
  flex: 1;
  background: var(--ember-gradient);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  padding: 16px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(255,90,31,0.35);
}
.add-to-cart-btn:active{ transform: scale(0.97); }

/* ====================================================
   TOAST
==================================================== */
.toast{
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 700;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.toast.show{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast::before{
  content: "✓";
  color: var(--gold);
  font-weight: 900;
}

/* ====================================================
   ACCESSIBILITY / MOTION
==================================================== */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

button:focus-visible, input:focus-visible{
  outline: 2px solid var(--ember-1);
  outline-offset: 2px;
}

/* ====================================================
   RESPONSIVE — small phones
==================================================== */
@media (max-width: 360px){
  .brand-name{ font-size: 22px; }
  .logo-badge{ width: 84px; height: 84px; }
  .logo-inner{ width: 56px; height: 56px; }
  .logo-flame{ width: 28px; height: 28px; }
  .product-img-wrap{ width: 76px; height: 76px; }
}
