/* =========================================================
   BLOOM — CLEAN FULL SITE CSS (HOME + CATEGORY + ADMIN)
   - Unified product cards across Home + Category
   - Admin navbar responsive on mobile
   - Keeps your original theme (same colors)
========================================================= */

/* ================= THEME VARS ================= */
:root{
  --primary:#7C8F85;
  --dark:#4E5F58;
  --light:#F5F5F2;
  --text:#1f2a26;
  --muted:#6b7c75;

  --border: rgba(0,0,0,.08);
  --shadow: 0 10px 30px rgba(0,0,0,.08);
  --radius: 18px;
}

*{ box-sizing:border-box; }

html,body{ height:100%; }

body{
  margin:0;
  background:var(--light);
  color:var(--text);
  font-family:'Amiri', serif;
}

a{ text-decoration:none; color:inherit; }
img{ max-width:100%; display:block; }

/* ================= LAYOUT ================= */
.container{
  width:90%;
  max-width:1150px;
  margin:20px auto;
}

.hr{
  height:1px;
  background:var(--border);
  margin:22px 0;
}

.section-title{
  font-family:'El Messiri', sans-serif;
  font-weight:900;
  margin:0;
}

.section-sub{
  color:var(--muted);
  margin-top:6px;
}

/* ================= NAVBAR (Site + Admin) ================= */
.nav{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:18px 22px;
  background:#fff;
  border-bottom:1px solid var(--border);
  gap:12px;
  flex-wrap:wrap;
}

.nav .left,
.nav .right{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

.nav .center{
  position:absolute;
  left:50%;
  transform:translateX(-50%);
}

.nav .logo{ max-height:90px; }

/* badge */
.badge{
  display:inline-block;
  padding:10px 12px;
  border-radius:14px;
  background:#f1f1ef;
  border:1px solid var(--border);
  font-family:'El Messiri', sans-serif;
  font-weight:700;
}

/* ================= BUTTONS ================= */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;

  padding:10px 16px;
  border-radius:14px;
  background:#f1f1ef;
  color:var(--text);
  border:1px solid var(--border);

  font-family:'El Messiri', sans-serif;
  font-weight:700;
  cursor:pointer;
  transition:.2s ease;
}

.btn:hover{ background:#e7e7e4; transform:translateY(-1px); }

.btn.primary,
a.btn.primary,
button.btn.primary{
  background:var(--primary);
  color:#fff !important;
  border:2px solid var(--dark);
  font-weight:900;
}

.btn.primary:hover{ background:var(--dark); }

.btn.danger,
a.btn.danger,
button.btn.danger{
  background:#b91c1c;
  color:#fff !important;
  border:2px solid #7f1d1d;
}

.btn.danger:hover{ background:#7f1d1d; }

/* زرّات الكروت (مثل "عرض المزيد") */
.btn2,
a.btn2,
button.btn2{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;

  padding:10px 14px;
  border-radius:14px;
  border:2px solid var(--dark);
  background:var(--primary);
  color:#fff !important;

  font-family:'El Messiri', sans-serif;
  font-weight:900;
  transition:.2s ease;
  line-height:1;
}

.btn2:hover{ background:var(--dark); transform:translateY(-1px); }

/* ================= INPUTS ================= */
.input,
select.input,
textarea.input,
input.input{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:#fff;
  font-family:'El Messiri', sans-serif;
  outline:none;
}

.input:focus{
  border-color: rgba(124,143,133,.55);
  box-shadow: 0 0 0 3px rgba(124,143,133,.15);
}

/* ================= CARDS / TABLES ================= */
.card,
.cardx{
  background:#fff;
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
}

.p{ padding:16px; }
.cardx .pad{ padding:16px; }

.table{
  width:100%;
  border-collapse:separate;
}

.table th{
  font-family:'El Messiri', sans-serif;
  font-weight:900;
  background:#f7f7f4;
  padding:12px;
}

.table td{
  padding:12px;
  border-bottom:1px solid var(--border);
}

.alert{
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--border);
  background:#fff;
}

.alert.danger{ border-color: rgba(185,28,28,.25); background:#fff5f5; }

/* ================= HOME CATALOG SLIDER ================= */
.home-catalog{ position:relative; margin-bottom:30px; }

#homeCatalog{
  display:flex;
  overflow-x:auto;
  overflow-y:hidden;
  scroll-snap-type:x mandatory;
  scroll-behavior:smooth;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
}

#homeCatalog::-webkit-scrollbar{ display:none; }

.home-catalog-item{
  flex:0 0 100%;
  min-width:100%;
  scroll-snap-align:start;
}

.home-catalog-media{
  width:100%;
  aspect-ratio:16/7;
  overflow:hidden;
  border-radius:var(--radius);
  background:var(--light);
}

.home-catalog-media img,
.home-catalog-media video{
  width:100%;
  height:100%;
  object-fit:cover;
}

.home-catalog-arrow{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  width:46px;
  height:46px;
  border-radius:50%;
  border:none;
  background:rgba(255,255,255,.95);
  box-shadow:0 8px 20px rgba(0,0,0,.18);
  cursor:pointer;
  font-size:22px;
  z-index:10;
}
.home-catalog-arrow-prev{ left:20px; }
.home-catalog-arrow-next{ right:20px; }
.home-catalog-arrow:hover{ background:#fff; }

/* ================= CATEGORIES ================= */
.cats{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:30px;
  margin:25px 0;
}

.cats .cat{
  text-align:center;
  max-width:200px;
  display:flex;
  flex-direction:column;
  align-items:center;
}

.cats .pic{
  width:180px;
  height:180px;
  border-radius:50%;
  overflow:hidden;
  background:#fff;
  box-shadow:0 12px 30px rgba(0,0,0,.08);
  margin-bottom:10px;
}

.cats .pic img{
  width:100%;
  height:100%;
  object-fit:cover;
}

.cats .name{
  font-family:'El Messiri', sans-serif;
  font-weight:900;
}

/* ================= PRODUCTS GRID (HOME + CATEGORY) ================= */
.product-grid,
.grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(230px,1fr));
  gap:22px;
  margin-top:30px;
  align-items:stretch; /* مهم لتساوي الطول */
}

/* ================= PRODUCT CARD (HOME) ================= */
.pcard{
  background:#fff;
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
  transition:.25s ease;
  height:100%;
  display:flex;
  flex-direction:column;
}
.pcard:hover{ transform:translateY(-5px); }

.pcard .thumb{
  height:200px;
  overflow:hidden;
  position:relative;
  flex:0 0 auto;
}
.pcard .thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
}

.pcard .body{
  padding:16px;
  flex:1 1 auto;
  display:flex;
  flex-direction:column;
}

.pcard .title{
  margin:10px 0 8px;
  font-family:'El Messiri', sans-serif;
  font-weight:900;
  line-height:1.25;

  /* توحيد سطرين */
  min-height:40px;
  max-height:40px;
  overflow:hidden;
}

.price .now{ font-weight:900; color:var(--dark); }
.price .old{ text-decoration:line-through; color:#999; font-size:14px; }

/* actions pinned bottom */
.pcard .actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  margin-top:auto; /* يثبت أسفل الكرت */
  padding-top:10px;
}

.pcard .actions form{ margin:0; }
.pcard .actions form button{
  appearance:none;
  -webkit-appearance:none;
  background:var(--primary) !important;
  border:2px solid var(--dark) !important;
  color:#fff !important;
  font-weight:900 !important;
  cursor:pointer;
  border-radius:14px;
  padding:10px 14px;
}
.pcard .actions form button:hover{ background:var(--dark) !important; }

/* ================= CATEGORY PRODUCTS (MAKE THEM LOOK LIKE HOME) =================
   إذا صفحة الأقسام لا تستخدم .pcard — نطبّق ستايل كروت الهوم على عناصر grid */
.product-grid > *{
  background:#fff;
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
  transition:.25s ease;

  height:100%;
  display:flex;
  flex-direction:column;
}

.product-grid > *:hover{ transform:translateY(-5px); }

/* رتّب أي محتوى داخل كرت القسم بشكل "صورة ثم عنوان ثم سعر ثم زر" */
.product-grid > * img{
  width:100%;
  height:200px;
  object-fit:cover;
  order:1;
}

/* عناوين/أسماء */
.product-grid > * h1,
.product-grid > * h2,
.product-grid > * h3,
.product-grid > * h4,
.product-grid > * .title,
.product-grid > * .name{
  order:2;
  margin:12px 16px 6px;
  font-family:'El Messiri', sans-serif;
  font-weight:900;
  line-height:1.25;

  min-height:40px;
  max-height:40px;
  overflow:hidden;
}

/* السعر (أكثر من احتمال) */
.product-grid > * .price,
.product-grid > * .now,
.product-grid > * .muted,
.product-grid > * p{
  order:3;
  margin:0 16px 10px;
  font-weight:900;
}

/* زر / form لتحت */
.product-grid > * form,
.product-grid > * .actions,
.product-grid > * a.btn2,
.product-grid > * button{
  order:4;
}

.product-grid > * form{ margin-top:auto; padding:0 16px 16px; }
.product-grid > * form button{
  width:100%;
  border-radius:14px;
  background:var(--primary);
  color:#fff;
  border:2px solid var(--dark);
  font-family:'El Messiri', sans-serif;
  font-weight:900;
  padding:10px 14px;
}
.product-grid > * form button:hover{ background:var(--dark); }

/* ================= FOOTER ================= */
.site-footer{
  background:#fff;
  text-align:center;
  padding:40px 0;
  margin-top:50px;
  border-top:1px solid var(--border);
}

.instagram-link{
  display:inline-block;
  padding:8px 18px;
  border-radius:30px;
  background:var(--primary);
  color:#fff;
  font-family:'El Messiri', sans-serif;
  font-weight:900;
}
.instagram-link:hover{ background:var(--dark); }

.footer-dev{
  margin-top:10px;
  color:var(--muted);
  font-size:14px;
}

/* ================= RESPONSIVE ================= */
@media(max-width:768px){
  /* nav */
  .nav{
    padding:12px 16px;
    gap:10px;
  }
  .nav .center{
    position:static;
    transform:none;
  }
  .nav .logo{ max-height:80px; }

  /* Admin nav buttons: مرتب على الهاتف */
  .nav{
    flex-direction:column;
    align-items:stretch;
  }
  .nav .left,
  .nav .right{
    width:100%;
    justify-content:flex-start;
  }
  .nav .right{
    justify-content:space-between;
  }
  .nav .left a.btn,
  .nav .right a.btn{
    flex:1 1 auto;
    min-width:120px;
    text-align:center;
  }
  .nav .left a.btn.primary{
    flex:1 1 100%;
    min-width:100%;
  }
  .nav .right .badge{
    flex:1 1 auto;
    max-width:65%;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    text-align:center;
  }

  /* 2 منتجات بكل صف (الهوم + الأقسام) */
  .product-grid,
  .grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:12px;
  }

  .pcard .thumb{ height:150px; }
  .product-grid > * img{ height:150px; }

  .pcard .title{
    min-height:34px;
    max-height:34px;
    font-size:13px;
  }
  .product-grid > * h1,
  .product-grid > * h2,
  .product-grid > * h3,
  .product-grid > * h4,
  .product-grid > * .title,
  .product-grid > * .name{
    min-height:34px;
    max-height:34px;
    font-size:13px;
  }

  /* زر السلة في الهوم (ايقونة) */
  .pcard .actions{
    gap:8px;
    flex-wrap:nowrap;
  }
  .pcard .actions .btn2{
    flex:1 1 auto;
    font-size:13px;
    padding:10px;
  }
  .pcard .actions form button{
    width:44px;
    height:44px;
    padding:0;
    border-radius:14px;
    display:flex;
    align-items:center;
    justify-content:center;
  }
  .pcard .actions form button svg{
    width:20px;
    height:20px;
    stroke:#fff;
  }
}
/* ===== CLEAN MOBILE NAV - SMALL + THEME COLORS ===== */
@media (max-width: 768px){

  .nav{
    display:flex !important;
    flex-direction:column !important;
    align-items:stretch !important;
    gap:8px !important;
    padding:10px 12px !important;
  }

  /* الشعار */
  .nav .center{
    position:static !important;
    transform:none !important;
    width:100% !important;
    display:flex !important;
    justify-content:center !important;
    margin-bottom:6px !important;
  }

  .nav .logo{
    max-height:60px !important;
  }

  /* الأزرار */
  .nav .left,
  .nav .right{
    width:100% !important;
    display:grid !important;
    grid-template-columns:repeat(3, 1fr) !important;
    gap:6px !important;
  }

  .nav .btn{
    font-size:13px !important;
    padding:8px 6px !important;
    border-radius:12px !important;
    background:#E8ECE8 !important;       /* لون هادئ */
    color:#4E5F57 !important;            /* لون النص من الثيم */
    border:1px solid #D8DDD8 !important;
    box-shadow:none !important;
  }

  .nav .btn:hover{
    background:#DDE4DE !important;
  }

  /* زر logout */
  .nav .btn.danger{
    background:#F2E4E4 !important;
    color:#7B2C2C !important;
    border:1px solid #E0CACA !important;
  }
}



/* ===== FINAL NAV THEME FIX (ADD ONLY – DO NOT DELETE OLD CSS) ===== */

/* كل أزرار الشريط أخضر ثيم */
.nav .btn{
  background: var(--primary) !important;
  color:#ffffff !important;
  border:2px solid var(--dark) !important;
  box-shadow:none !important;
  font-weight:600 !important;
}

/* تأثير hover */
.nav .btn:hover{
  background: var(--dark) !important;
}

/* زر تسجيل الخروج فقط أحمر */
.nav .btn.danger{
  background:#b91c1c !important;
  border:2px solid #7f1d1d !important;
  color:#fff !important;
}

.nav .btn.danger:hover{
  background:#7f1d1d !important;
}

/* تصغير الأزرار بالموبايل */
@media (max-width:768px){
  .nav .left,
  .nav .right{
    display:grid !important;
    grid-template-columns:repeat(3,1fr) !important;
    gap:6px !important;
  }

  .nav .btn{
    font-size:13px !important;
    padding:7px 6px !important;
    border-radius:12px !important;
  }

  .nav .left .btn.danger{
    grid-column:1 / -1 !important;
  }
}
/* ===== SMALL LANGUAGE BUTTONS ===== */

.nav .right .btn{
  font-size:11px !important;
  padding:4px 8px !important;
  min-width:40px !important;
  height:28px !important;
  border-radius:8px !important;
  background: var(--light) !important;
  color: var(--dark) !important;
  border:1px solid var(--border) !important;
  font-weight:600 !important;
}

/* تأثير hover خفيف */
.nav .right .btn:hover{
  background: var(--primary) !important;
  color:#fff !important;
}


/* ===== MOBILE LANGUAGE BUTTONS FIX ===== */
@media (max-width:768px){

  /* خليهم أقصى اليمين */
  .nav .right{
    display:flex !important;
    justify-content:flex-end !important;
    gap:4px !important;
  }

  .nav .right .btn{
    font-size:10px !important;
    padding:3px 6px !important;
    height:24px !important;
    min-width:32px !important;
    border-radius:6px !important;
  }

}

/* ===== CLEAN PRODUCT GRID (HOME + CATEGORY) ===== */

/* الشبكة العامة */
.grid{
  display:grid !important;
  grid-template-columns:repeat(auto-fit, minmax(260px, 1fr)) !important;
  gap:24px !important;
  align-items:start !important;
}

/* كرت المنتج */
.product-card{
  background:#fff;
  border-radius:18px;
  box-shadow:var(--shadow);
  padding:16px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  height:100% !important;
}

/* صورة المنتج */
.product-card img{
  width:100%;
  height:240px;
  object-fit:cover;
  border-radius:14px;
}

/* اسم المنتج */
.product-card h3{
  font-size:16px;
  margin:12px 0 6px;
  min-height:40px; /* يمنع اختلاف الطول */
}

/* السعر */
.product-card .price{
  font-weight:700;
  margin-bottom:10px;
}

/* الأزرار */
.product-card .actions{
  margin-top:auto;
  display:flex;
  gap:8px;
  justify-content:center;
}

/* ===== موبايل: صفين جنب بعض ===== */
@media (max-width:768px){
  .grid{
    grid-template-columns:repeat(2, 1fr) !important;
    gap:14px !important;
  }

  .product-card img{
    height:180px;
  }

  .product-card h3{
    font-size:14px;
    min-height:34px;
  }
}
/* =======================================================
   FINAL FIX: CATEGORIES 2/COL + HOME PRODUCTS NOT TALL
   (ADD AT VERY END OF app.css)
======================================================= */

/* 1) الأقسام (دوائر) => 2 بالصف على الموبايل */
@media (max-width:768px){
  .cats{
    display:grid !important;
    grid-template-columns:repeat(2, minmax(0,1fr)) !important;
    gap:14px !important;
    justify-items:center !important;
    margin:18px 0 !important;
  }
  .cats .cat{
    width:95% !important;
    max-width:none !important;
  }
  .cats .pic{
    width:130px !important;
    height:130px !important;
    margin-bottom:8px !important;
  }
  .cats .name{
    font-size:14px !important;
    text-align:center !important;
  }
}

/* 2) الهوم: كروت المنتجات (.pcard) قصيرة ومش متمددة */
@media (max-width:768px){

  /* خلي الصورة أقل ارتفاعاً */
  .pcard .thumb{
    height:120px !important;  /* كان 150 عندك */
  }

  /* قللي الحشو */
  .pcard .body{
    padding:10px !important;
  }

  /* ثبتي العنوان على سطرين (حتى ما يطول كرت) */
  .pcard .title{
    font-size:13px !important;
    line-height:1.25 !important;
    margin:6px 0 !important;

    max-height:32px !important;  /* تقريباً سطرين */
    overflow:hidden !important;
  }

  /* خلّي الأزرار أقل ارتفاع */
  .pcard .actions{
    margin-top:8px !important;
    gap:8px !important;
  }

  .pcard .actions .btn2{
    padding:9px 10px !important;
    border-radius:12px !important;
    font-size:13px !important;
  }

  /* زر السلة مربع أصغر */
  .pcard .actions form button{
    width:40px !important;
    height:40px !important;
    border-radius:12px !important;
  }
}
/* ===== HOME PRODUCTS: SHORTER CARDS (MOBILE) ===== */
@media (max-width:768px){

  /* قللي ارتفاع الصورة أكثر */
  .pcard .thumb{
    height:100px !important;  /* كان 120 */
  }

  /* أقلل padding */
  .pcard .body{
    padding:8px !important;
  }

  /* العنوان سطرين فقط */
  .pcard .title{
    font-size:12.5px !important;
    line-height:1.2 !important;
    margin:6px 0 4px !important;
    min-height:30px !important;
    max-height:30px !important;
    overflow:hidden !important;
  }

  /* السعر أصغر */
  .pcard .price{
    font-size:12px !important;
  }

  /* الأزرار أقصر */
  .pcard .actions{
    gap:4px !important;
    padding-top:6px !important;
  }

  .pcard .actions .btn2{
    padding:8px 9px !important;
    font-size:12.5px !important;
    border-radius:12px !important;
  }

  .pcard .actions form button{
    width:36px !important;
    height:36px !important;
    border-radius:12px !important;
  }
}
/* ===== Bottom Bar ===== */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #111;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 0;
  z-index: 999;
  box-shadow: 0 -2px 8px rgba(0,0,0,.2);
}

.bottom-bar a {
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: 0.3s;
}

.bottom-bar a:hover {
  color: #25D366; /* لون واتس خفيف */
}

.bottom-bar svg {
  width: 20px;
  height: 20px;
}

body {
  padding-bottom: 60px; /* عشان ما يغطي المحتوى */
}

@media (max-width: 768px) {
  .cats {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px;
    padding: 0 4px;
  }

  .cats .card {
    width: calc((100% - 12px) / 3) !important;
    max-width: calc((100% - 12px) / 3) !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 4px !important;
    box-sizing: border-box !important;
    overflow: hidden;
  }

  .cats .card img {
    width: 100%;
    height: 55px;
    object-fit: cover;
    display: block;
  }

  .cats .card h3,
  .cats .card .title,
  .cats .card p,
  .cats .card span {
    font-size: 10px !important;
    line-height: 1.2 !important;
    margin: 3px 0 !important;
    word-break: break-word;
  }
}

/* إخفاء أسهم السلايدر نهائياً */
.slider-arrow {
  display: none !important;
}

/* إخفاء كل أنواع الأسهم المحتملة */
.slider-arrow,
.swiper-button-next,
.swiper-button-prev,
.slick-prev,
.slick-next,
.carousel-control-prev,
.carousel-control-next {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}