/* =========================================================
   products.css  (FULL + FIXED)
========================================================= */

/* =========================
   Base
========================= */
*{
  box-sizing: border-box;
}

main{
  padding: 50px 8%;
}

/* =========================
   Header Row
========================= */
.product-header{
  background: #f2f2f2;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 6px;
  margin-bottom: 22px;
}

.product-header .menu-icon{
  font-size: 26px;
  cursor: pointer;
  display: none;
}

.product-header-right{
  display: flex;
  align-items: center;
  gap: 10px;
}

.product-header-right span{
  font-size: 14px;
  font-weight: 600;
  color: #111;
}

.product-header-right #sort{
  border: 1px solid #ddd;
  background: #fff;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 8px;
  outline: none;
}

.product-header-right #sort:focus{
  border-color: #000;
}

#productCount{
  font-size: 13px;
  color: #555;
}

/* =========================
   Layout
========================= */
/* مهم: خلي container يبقى grid بدل absolute */
main .container{
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  align-items: start;
}

/* =========================
   Sidebar (Categories + Filters)
========================= */
.aside{
  background: #f2f2f2;
  padding: 18px 16px;
  border-radius: 10px;
  position: sticky;
  top: 110px;
  height: fit-content;
}

/* عنوان Categories + زر Close */
.aside-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.aside h2{
  font-size: 22px;
  font-weight: 500;
  margin: 0;
}

/* زر Close (يتشاف موبايل فقط) */
.aside-close{
  display: none;
  border: 1px solid #ddd;
  background: #fff;
  color: #111;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}

/* categories links */
.shop_categories{
  margin-top: 10px;
  border-bottom: 1px solid #e1e1e1;
  padding-bottom: 12px;
}

.shop_categories a{
  padding: 10px 10px;
  text-decoration: none;
  font-size: 14px;
  color: #777;
  display: block;
  transition: .25s;
  border-radius: 8px;
}

.shop_categories a.active,
.shop_categories a:hover{
  color: #000;
  background: rgba(0,0,0,.04);
}

/* =========================
   Filters UI
========================= */
.filters-box{
  margin-top: 14px;
  padding-top: 14px;
}

.filters-title{
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #111;
}

/* كل مجموعة فلتر */
.filter-group{
  margin-top: 14px;
}

.filter-label{
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #111;
}

/* Price inputs row */
.price-row{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

#minPrice,
#maxPrice,
#ratingFilter{
  width: 100%;
  height: 38px;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px 10px;
  outline: none;
  background: #fff;
  font-size: 13px;
  min-width: 0;
}

#minPrice:focus,
#maxPrice:focus,
#ratingFilter:focus{
  border-color: #000;
}

.filter-btn{
  margin-top: 10px;
  width: 100%;
  height: 40px;
  border-radius: 10px;
  border: none;
  background: #000;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: .2s ease;
}

.filter-btn:hover{
  opacity: .9;
}

.filter-btn.secondary{
  background: #fff;
  color: #111;
  border: 1px solid #d0d0d0;
}

.filter-actions{
  margin-top: 12px;
}

/* Colors */
.color-filter{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.color-chip{
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}

.color-chip.active{
  border-color: #111;
  transform: scale(1.05);
}

/* Sizes */
.size-filter{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.size-chip{
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #ddd;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
  transition: .2s ease;
}

.size-chip.active{
  background: #111;
  color: #fff;
  border-color: #111;
}

/* =========================
   Products Area
========================= */
.products{
  width: 100%;
}

.products .content{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

/* Card */
.product-card{
  transition: transform .2s ease;
}

.card-img{
  position: relative;
  overflow: hidden;
  border-radius: 10px;
}

.card-img img{
  width: 100%;
  display: block;
  transition: transform .8s ease;
}

.card-img:hover img{
  transform: scale(1.07);
}

.addToCart{
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: .2s ease;
}

.addToCart:hover{
  background: #111;
  color: #fff;
}

.card-info{
  padding: 10px 2px;
}

.product-name{
  font-size: 14px;
  font-weight: 500;
  color: #111;
  margin: 0 0 6px;
}

/* Price */
.product-price{
  display: flex;
  align-items: center;
  gap: 8px;
}

.current-price{
  font-size: 14px;
  font-weight: 700;
  color: #111;
}

.old-price{
  font-size: 12px;
  color: #999;
  text-decoration: line-through;
}

/* Badges */
.badge{
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  font-size: 11px;
  color: #fff;
  border-radius: 6px;
  z-index: 5;
}

.badge-sale{ background: #e74c3c; }
.badge-trending{ background: #f39c12; }

/* =========================
   Mobile
========================= */
@media (max-width: 900px){
  main{
    padding: 30px 16px;
  }

  /* container يرجع عمود واحد */
  main .container{
    grid-template-columns: 1fr;
  }

  .product-header .menu-icon{
    display: block;
  }

  .sortBy{
    display: none;
  }

  /* Sidebar drawer */
  .aside{
    position: fixed;
    top: 0;
    left: -110%;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    overflow-y: auto;
    z-index: 9999;
    border-radius: 0;
    transition: .35s ease;
  }

  .aside.open{
    left: 0;
  }

  .aside-close{
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .products .content{
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

/* =========================
   Product Details Page Specific

   /* ====== Mobile Bottom Bar ====== */
.bottom-bar{
  display:none;
}

/* موبايل */
@media (max-width: 820px){

  /* اخفاء منيو الهيدر العلوية */
  #navbar{ display:none; }

  /* تقليل الهيدر */
  .header_top{
    padding-bottom: 10px;
  }

  /* نخفي زر السلة العلوي (اختياري) */
  #cartBtnTop{ display:none; }

  /* نظبط مساحة المحتوى عشان البار اللي تحت */
  body{
    padding-bottom: 78px; /* نفس ارتفاع البار تقريباً */
  }

  .bottom-bar{
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;

    height: 64px;
    padding: 8px 10px;

    background: rgba(255,255,255,.92);
    border: 1px solid rgba(15,23,42,.10);
    border-radius: 18px;
    box-shadow: 0 18px 35px rgba(2,8,23,.14);

    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;

    backdrop-filter: blur(10px);
    z-index: 9998;
  }

  .bb-item{
    position: relative;
    text-decoration: none;
    border: 0;
    background: transparent;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 4px;
    color: #111827;
    font-size: 11px;
    cursor: pointer;
    border-radius: 14px;
  }

  .bb-item ion-icon{
    font-size: 20px;
  }

  .bb-active{
    background: rgba(17,24,39,.08);
    font-weight: 600;
  }

  .bb-cart{
    outline: none;
  }

  .bb-badge{
    position: absolute;
    top: 6px;
    right: 18px;

    min-width: 18px;
    height: 18px;
    padding: 0 5px;

    background: #111827;
    color: #fff;
    font-size: 10px;
    line-height: 18px;
    border-radius: 999px;
    font-style: normal;
  }
}
