/* ================
   Waroeng Store UI - Premium CSS
   RTL + Responsive + Glass Cards
   ================= */

:root{
  --bg-0:#071a24;
  --bg-1:#0a2c3a;
  --bg-2:#0d3b4b;

  --card:#0b2632cc;             /* glass */
  --card-2:#0b2632e6;
  --stroke:rgba(255,255,255,.10);

  --text:#eaf6ff;
  --muted:rgba(234,246,255,.68);

  --accent:#2ee6c7;
  --accent-2:#00b7ff;

  --danger:#ff4d5e;
  --success:#38d07f;
  --warning:#ffd36b;

  --shadow: 0 18px 50px rgba(0,0,0,.35);
  --shadow-soft: 0 10px 30px rgba(0,0,0,.25);

  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;

  --gap: 18px;
  --max: 1200px;

  --blur: 14px;
  --ring: 0 0 0 3px rgba(46,230,199,.18);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: system-ui, -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;
  direction: rtl;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 80% 10%, rgba(0,183,255,.18), transparent 60%),
    radial-gradient(900px 500px at 20% 15%, rgba(46,230,199,.16), transparent 55%),
    linear-gradient(180deg, var(--bg-2), var(--bg-1) 35%, var(--bg-0));
  overflow-x:hidden;
}

/* Container */
.container{
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px 18px 36px;
}

/* ===== Top Bar ===== */
.topbar{
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  background: linear-gradient(180deg, rgba(10,44,58,.88), rgba(10,44,58,.60));
  border-bottom: 1px solid var(--stroke);
}

.topbar__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 14px 18px;
  max-width: var(--max);
  margin: 0 auto;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight: 800;
  letter-spacing:.2px;
}
.brand__logo{
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background:
    radial-gradient(circle at 30% 30%, rgba(46,230,199,.95), rgba(0,183,255,.70) 55%, rgba(0,0,0,0) 70%),
    linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,0));
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255,255,255,.18);
}

.search{
  flex:1;
  display:flex;
  align-items:center;
  max-width: 520px;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
}
.search input{
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}
.search input::placeholder{ color: rgba(234,246,255,.55); }

.icon-btn{
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  display:grid;
  place-items:center;
  cursor:pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.icon-btn:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.18);
}
.icon-btn:active{ transform: translateY(0); }

/* ===== Section Title ===== */
.section-title{
  margin: 18px 0 10px;
  font-size: 18px;
  font-weight: 900;
  color: rgba(234,246,255,.92);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}
.section-title small{
  font-weight: 600;
  color: var(--muted);
}

/* ===== Product Grid ===== */
.grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
  margin-top: 14px;
}

/* Responsive */
@media (max-width: 1100px){
  .grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px){
  .topbar__inner{ flex-wrap:wrap; }
  .search{ order: 3; width: 100%; max-width: none; }
  .grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 460px){
  .grid{ grid-template-columns: 1fr; }
}

/* ===== Product Card ===== */
.card{
  position: relative;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--card), rgba(11,38,50,.55));
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: var(--shadow);
  overflow:hidden;
  transform: translateZ(0);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.card:hover{
  transform: translateY(-4px);
  border-color: rgba(46,230,199,.35);
  box-shadow: 0 26px 70px rgba(0,0,0,.42);
}

.card::before{
  content:"";
  position:absolute; inset:-1px;
  background:
    radial-gradient(600px 200px at 70% 0%, rgba(0,183,255,.14), transparent 55%),
    radial-gradient(400px 200px at 20% 15%, rgba(46,230,199,.12), transparent 55%);
  pointer-events:none;
}

.card__media{
  position: relative;
  padding: 16px 16px 6px;
}
.card__img{
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.08);
  overflow:hidden;
  display:grid;
  place-items:center;
}
.card__img img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display:block;
  filter: saturate(1.05) contrast(1.03);
}

.card__body{
  padding: 10px 16px 16px;
}

.card__title{
  margin: 6px 0 10px;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 900;
  color: rgba(234,246,255,.95);
  display:-webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow:hidden;
}

/* Price Row */
.price{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap: 10px;
  margin: 6px 0 12px;
}
.price__now{
  font-size: 18px;
  font-weight: 1000;
  color: var(--text);
}
.price__old{
  font-size: 13px;
  color: rgba(234,246,255,.55);
  text-decoration: line-through;
}
.price__save{
  font-size: 12px;
  font-weight: 800;
  color: rgba(46,230,199,.95);
}

/* Actions */
.actions{
  display:flex;
  gap: 10px;
  align-items:center;
}
.btn{
  appearance:none;
  border:0;
  cursor:pointer;
  border-radius: 14px;
  padding: 12px 12px;
  font-weight: 900;
  color: #071a24;
  background: linear-gradient(135deg, var(--accent), rgba(0,183,255,.95));
  box-shadow: 0 12px 28px rgba(0,183,255,.18);
  flex: 1;
  transition: transform .18s ease, filter .18s ease;
}
.btn:hover{ transform: translateY(-1px); filter: brightness(1.03); }
.btn:active{ transform: translateY(0); }
.btn:focus{ outline: none; box-shadow: var(--shadow-soft), var(--ring); }

.btn--ghost{
  width: 46px;
  min-width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(234,246,255,.92);
  display:grid;
  place-items:center;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.btn--ghost:hover{
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.20);
  transform: translateY(-1px);
}

/* ===== Badges ===== */
.badge{
  position:absolute;
  top: 14px;
  inset-inline-start: 14px; /* RTL aware */
  display:inline-flex;
  align-items:center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
}
.badge--hot{
  background: rgba(255,77,94,.16);
  border-color: rgba(255,77,94,.30);
  color: rgba(255,220,224,.98);
}
.badge--rate{
  background: rgba(255,211,107,.16);
  border-color: rgba(255,211,107,.28);
  color: rgba(255,241,210,.98);
}
.badge__dot{
  width: 10px; height: 10px;
  border-radius: 999px;
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(255,211,107,.16);
}

/* ===== Mini Meta (icons row) ===== */
.meta{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}
.meta .pill{
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
}

/* ===== Floating WhatsApp ===== */
.fab{
  position: fixed;
  bottom: 18px;
  inset-inline-end: 18px;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(135deg, #35d07f, #1bbf6a);
  display:grid;
  place-items:center;
  color: #062012;
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: 0 22px 60px rgba(0,0,0,.35);
  cursor:pointer;
  transition: transform .18s ease, filter .18s ease;
}
.fab:hover{ transform: translateY(-2px); filter: brightness(1.02); }

/* ===== Skeleton (loading) optional ===== */
.skeleton{
  background: linear-gradient(90deg,
    rgba(255,255,255,.04),
    rgba(255,255,255,.08),
    rgba(255,255,255,.04)
  );
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
}
@keyframes shimmer{
  0%{ background-position: 200% 0; }
  100%{ background-position: -200% 0; }
}