
/* =======================================================
   GLOBAL RESET
======================================================= */
#onePageStore * {
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
}

/* =======================================================
   CONTAINER
======================================================= */
#onePageStore {
  max-width: 100%;
  margin: auto;
  padding: 70px 12px 60px 12px; /* 🔹 sides gap */
  background: #f9f9f9;
  position: relative;
}

/* =======================================================
   FIXED TOP BAR (SEARCH + PAGE NAME)
======================================================= */
#searchContainer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;               /* 🔹 explicit top bar height */
  background: #2e8b57;        /* 🔹 medium balanced green */
  z-index: 10000;

  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Store Name */
#pageName {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

/* Search Box */
#storeSearch {
  width: 60%;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 2px solid #000; /* 🔹 black border */
  background: #fff;        /* 🔹 white background */
  font-size: 14px;
}
/* =======================================================
   PRODUCT GRID
======================================================= */
.storeView{
  display:grid;
  grid-template-columns: 1fr;
  gap:16px;
  padding:8px 10px;
}

.productCard {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  padding: 14px;

  border: 1px solid #e6e6e6;

  box-shadow: 
  0 4px 10px rgba(0,0,0,0.06),
  0 1px 3px rgba(0,0,0,0.05);

  transition: all 0.25s ease;
}
/* =======================================================
   PRODUCT CARD
======================================================= */
.cartIconWrap {
  position: relative; /* badge relative to icon */
  display: inline-block;
}

#cartBadge {
  position: absolute;
  top: -8px;       /* 🔹 تھوڑا اوپر icon */
  right: -10px;    /* 🔹 تھوڑا right side پر */
  background-color: #ff0000; /* 🔹 red background */
  color: #fff;               /* 🔹 white text */
  font-size: 12px;           /* 🔹 adjust if needed */
  font-weight: 700;
  width: 18px;               /* 🔹 square badge */
  height: 18px;              /* 🔹 square badge */
  border-radius: 50%;        /* 🔹 circle */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2); /* optional shadow for visibility */
}
.productCard:hover {
  transform: translateY(-4px);

  box-shadow:
  0 10px 22px rgba(0,0,0,0.12),
  0 4px 10px rgba(0,0,0,0.08);
}

/* Product Image */
.productCard img.mainImg{
  width:100%;
  height:190px;
  object-fit:cover;
  border-radius:10px;
}

/* Product Title */
.productTitle {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  margin-top:10px;
  margin-bottom:6px;
  line-height: 1.3;
  min-height: 42px; /* 2 lines space */
  height: auto;
  overflow: visible;
  word-break: break-word;
}

/* Product Price */
.productPrice {
  font-size: 15px;
  color: #2196f3;
  font-weight: 700;
  margin-bottom: 8px;
}

/* =======================================================
   BUTTONS
======================================================= */
.btnAdd {
  display: block;
  width: 92%;
  margin: 12px auto 18px auto; /* 🔹 top 12px (gap from gallery), bottom 18px */
  min-height: 48px;
  line-height: 48px;
  border-radius: 10px;
  border: none;
  font-weight: 700;
  font-size: 16px;
  text-align: center;
  cursor: pointer;
  background: #006FFF;
  color: white;
}
.btnAdd:hover {
  background: #e64a19;
}
 
.btnAdd:hover {
  background: #e64a19;
}

.btnOrder {
  width: 100%;
  padding: 12px 0;
  font-size: 17px;
  font-weight: 700;
  border-radius: 12px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  background: #25D366;
  color: white;
}

.btnOrder:hover {
  background: #1da851;
}
#cartFooter .btnOrder {
    width: 90%;          /* تھوڑی کم چوڑائی */
    padding: 12px 0;     /* تھوڑی کم height */
    font-size: 16px;
    margin: auto;
    display: block;
}

/* =======================================================
   BOTTOM NAVIGATION
======================================================= */
#storeBottomMenu {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: white;
  border-top: 1px solid #ddd;
  display: flex;
  justify-content: space-around;
  padding: 10px 0;
  z-index: 9999;
  margin: 0;
  transform: translateY(0);
}

.menuBtn {
  font-size: 14px;
  color: #666;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: 0.2s ease;
}

.menuBtn.active {
  color: #ff5722;
  font-weight: 700;
}

.menuBtn:hover {
  color: #ff5722;
}

.menuBtn i {
  font-size: 20px;
  margin-bottom: 3px;
}

/* =======================================================
   QUANTITY BOX
======================================================= */
.qtyBox {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 6px;
  gap: 6px;
}

.qtyBox button {
  width: 25px;
  height: 25px;
  font-size: 20px;
  border: none;
  cursor: pointer;
  border-radius: 1px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.qtyBox .decQ { background: #dc3545; color: #fff; } /* minus red */
.qtyBox .incQ { background: #2196f3; color: #fff; } /* plus blue */

.qtyBox .showQ {
  width: 25px;
  height: 25px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 600;
  background: #fff;
  border-radius: 1px;
}

/* ==============================
   CART VIEW PROFESSIONAL
============================== */
#cartView {
  padding: 0px;
  box-sizing: border-box;
}

.cartItem {
  display: flex;
  flex-direction: column; /* 🔥 main change */
  position: relative;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid #eee;
  background: #fff;
  border-radius: 12px;
  margin-bottom: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.cartTop {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.cartImg {
  width: 70px;       /* consistent size */
  height: 70px;      /* professional card height */
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #eee;
  flex-shrink: 0;    /* prevent image shrink */
  cursor: default;   /* disable zoom */
  transition: none;  /* disable hover zoom */
}

.cartInfo {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.cartName {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  line-height: 1.4;
  flex: 1; 
  display: -webkit-box;
  -webkit-line-clamp: 2;  
  -webkit-box-orient: vertical;

  overflow: hidden;     
  word-break: break-word; 
}

.cartQty {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cartQty button {
  width: 25px;
  height: 25px;
  border: none;
  border-radius: 2px;
  background: #EC3C28;
  font-size: 18px;
  cursor: pointer;
}

.cartQty span {
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

.cartDelete {
  position: absolute;
  top: 0px;
  right: 12px;
  z-index: 10;
  cursor: pointer;

  display: inline-flex; /* inline-block سے بہتر */
  justify-content: center;
  align-items: center;

  width: 22px;   /* fix hitbox */
  height: 22px;  /* fix hitbox */
  pointer-events: auto; /* ensure only this triggers */
  background: none;
  border: none;
}



/* Cart total styling */
.cartTotal, #cartTotalBox {
  font-size: 20px;
  font-weight: 800;
  text-align: center;
  margin-top: 15px;
  color: #333;
}

/* Cart scrollable items with side gap on mobile */
#cartItems {
  overflow-y: auto;
  padding: 10px 12px 140px 12px;
  height: 100%;
  max-width: 480px;       /* limit width on mobile */
  margin: auto;           /* center cart */
}

/* Fixed cart footer */
#cartFooter {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 100px; 
  background: #fff;
  padding: 18px;
  box-shadow: 0 -3px 12px rgba(0,0,0,0.08);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 480px;       /* same width as cartItems */
  margin: auto;           /* center footer */
}
.cartBottom {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 8px;

  width: 100%;        /* 🔥 IMPORTANT */
  padding-right: 40px; /* delete ke liye space */
}

/* Cart total styling */
.cartTotal, #cartTotalBox {
  font-size: 20px;
  font-weight: 800;
  text-align: center;
  margin-top: 15px;
  color: #333;
}

/* Cart scrollable items */
#cartItems {
  overflow-y: auto;
  padding: 10px 12px 140px 12px;
  height: 100%;
}

/* Fixed cart footer */
#cartFooter {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 55px; 
  background: #fff;
  padding: 15px;
  box-shadow: 0 -3px 12px rgba(0,0,0,0.08);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* =======================================================
   ORDER POPUP
======================================================= */
#orderPopup {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.65);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#orderPopup .popupBox {
  background: white;
  width: 90%;
  max-width: 420px;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

#orderPopup h3 { margin-bottom: 15px; font-size: 18px; color: #333; }

#orderPopup input, #orderPopup textarea {
  width: 100%;
  padding: 10px;
  margin: 6px 0;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 14px;
}

#orderPopup textarea { resize: none; height: 60px; }

/* =======================================================
   ACCOUNT VIEW
======================================================= */
#accountView { background: #f5f6f8; min-height: 100vh; }
.account-wrapper { padding: 20px; }
.account-title { font-size: 26px; font-weight: 600; margin-bottom: 20px; }
.account-menu { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.account-item { display: flex; justify-content: space-between; align-items: center; padding: 24px 16px; cursor: pointer; transition: 0.2s; }
.account-item:not(:last-child){ border-bottom: 1px solid #eee; }
.account-item:active{ background: #f8f8f8; }
.account-item .left{ display:flex; align-items:center; gap:15px; }
.account-item .left i{ font-size:20px !important; color:#ff6a00 !important; display:inline-block !important; opacity:1 !important; }
.account-item span{ font-size:16px; font-weight:500; }
.account-item .right{ font-size:16px; color:#999; }

/* AUTH VIEW */
#authView input, #authView select{
  width:100%;
  padding:12px;
  margin-bottom:10px;
  border-radius:8px;
  border:1px solid #ddd;
}

.authBtn{
  width:100%;
  padding:20px;
  background:#2196f3;
  color:#fff;
  border:none;
  border-radius:8px;
  font-weight:600;
  margin-top:15px;
}

.switchAuth{
  text-align:center;
  margin-top:10px;
  color:#2196f3;
  cursor:pointer;
}

/* =======================================================
   CONTACT POPUP
======================================================= */
#contactPopup {
  position: fixed;
  top:0; left:0;
  width:100%; height:100%;
  background: rgba(0,0,0,0.6);
  display:none;
  justify-content:center;
  align-items:center;
  z-index:9999;
}

#contactPopup > div {
  background:#fff;
  width:90%;
  max-width:350px;
  border-radius:12px;
  padding:20px;
  text-align:center;
}
/* ============================
   PRODUCT GALLERY + ADD TO CART GAP FIX
============================ */
.productGallery {
  display: flex;
  gap: 6px; 
  margin-bottom: 0;  /* force no collapse */
  flex-wrap: wrap;    /* responsive gallery */
}

.productGallery img{
width:30%;
height:110px;
object-fit:cover;
border-radius:8px;
cursor:pointer;
}

.productCard img.mainImg {
  width: 100%;
  height: auto;
  object-fit: cover;
  cursor: default;
  transition: none;
}
/*search box refresh button css*/
#refreshStore{
  color:#fff;
  font-size:18px;
  margin-right:8px;
  cursor:pointer;
}
/* CUSTOMER POPUP */

#customerPopup{
position:fixed;
top:0;
left:0;
width:90%;
height:100%;
background:rgba(0,0,0,0.6);
display:none;
justify-content:center;
align-items:center;
z-index:9999;
}

.customerPopupBox{
width:300px;
max-height:450px;
background:white;
border-radius:10px;
padding:15px;
display:flex;
flex-direction:column;
overflow:hidden;
}

.customerPopupHeader{
display:flex;
justify-content:space-between;
font-weight:700;
margin-bottom:10px;
}

#customerListContainer{
overflow-y:auto;
flex:1;
}

.customerCard{
border:3px solid #eee;
padding:10px;
margin-bottom:10px;
border-radius:8px;
cursor:pointer;
}

.customerCard:hover{
background:#f5f5f5;
}
.customerPopupHeader button{
background:#006FFF;
border:none;
font-size:18px;
font-weight:700;
cursor:pointer;
width:28px;
height:28px;
display:flex;
align-items:center;
justify-content:center;
border-radius:50%;
}

.customerPopupHeader button:hover{
background:#eee;
}

#quickProductPopup{
position:absolute;
top:60px;
right:10px;
left:10px;
background:#fff;
border-radius:10px;
box-shadow:0 6px 18px rgba(0,0,0,0.15);
display:none;
max-height:260px;
overflow-y:auto;
z-index:9999;
}

.quickProductItem{
padding:8px 12px;
border-bottom:1px solid #eee;
cursor:pointer;
}

.quickProductItem:hover{
background:#f6f6f6;
}

.quickName{
font-size:14px;
font-weight:600;
color:#333;
}

.quickPrice{
font-size:13px;
color:#2196f3;
}