*{margin:0;padding:0;box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
  /* background-color:#f5f5f5; */
  transition:all .3s ease;
  direction:ltr;
  color:#222;
}

/* Vars for sticky heights (set by JS for accuracy) */
:root { --topbar-h: 40px; --header-h: 88px; }

/* ===== Top bar ===== */
.top-bar{background-color:#2c3e50;color:#fff;font-size: 12px;padding: 3px 0;position:sticky;top:0;z-index:1000}
.top-bar .container{
  max-width:1200px;margin:0 auto;padding:0 20px;
  display:flex;justify-content:space-between;align-items:center;gap:16px
}
.lang-toggle{background:rgba(255,255,255,.2);padding:4px 8px;border-radius:4px}
.lang-link{color:#fff;text-decoration:none}
.lang-link:hover{text-decoration:underline}
.contact-info{display:flex;align-items:center;gap:20px}
.whatsapp-btn{background:#25D366;padding:6px 12px;border-radius:4px;text-decoration:none;color:#fff;display:inline-flex;align-items:center;gap:6px}

/* WhatsApp icon inside the top-bar button */
.whatsapp-btn svg {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: -3px;
  margin-right: 6px; /* for LTR header */
  fill: currentColor;
}


/* ===== Header ===== */
.header{
  background:#fff;
  /* padding:16px 0; */
  box-shadow:0 2px 10px rgba(0,0,0,.06);
  position:sticky;
  top:var(--topbar-h);
  z-index:999;
}
.header.is-stuck{ box-shadow:0 4px 14px rgba(0,0,0,.08); }
.header .container{
  max-width:1200px;margin:0 auto;padding:0 20px;
  display:flex;align-items:center;justify-content:space-between;gap:16px
}
.logo-section{display:flex;align-items:center;gap:12px}
.logo{width:56px;height:56px;border-radius:50%}
.company-info h1{font-size:18px;color:#222;margin-bottom:2px;font-weight:600}
.company-info p{font-size:12px;color:#555}

.view-quote-btn{
  background:#fff;border:2px solid #A01544;color:#A01544;
  padding:10px 18px;border-radius:8px;font-weight:500;
  display:flex;align-items:center;gap:8px;cursor:pointer
}
.view-quote-btn:hover{background:#A01544;color:#fff}

/* ===== Main layout (Sidebar + Products) ===== */
.main-content{
  max-width:1400px;
  margin:0 auto;
  padding:24px 20px 32px;
  display:grid;
  grid-template-columns:280px 1fr;
  gap:24px;
}

/* Sidebar */
.sidebar{
  background:#fff;border-radius:10px;box-shadow:0 2px 10px rgba(0,0,0,.08);
  position:sticky; top:calc(var(--topbar-h) + var(--header-h) + 12px);
  align-self:start; overflow:hidden;
}
.sidebar h3{
  position:sticky; top:0; z-index:1;
  background:#303d4e;color:#fff;padding:14px 16px;margin:0;border-radius:10px 10px 0 0;font-size:15px
}
.category-list{list-style:none; max-height:calc(100vh - 280px); overflow:auto}
.category-item{border-bottom:1px solid #eee}
.category-item:last-child{border-bottom:none}
.category-link{display:block;padding:12px 16px;text-decoration:none;color:#333;transition:all .2s;cursor:pointer}
.category-link:hover,.category-link.active{background:#A01544;color:#fff}
.category-link.all-products{background:#A01544;color:#fff}

/* Sidebar search (under categories) */
.sidebar-search{padding:12px 16px 16px;border-top:1px solid #eee}
.sidebar .search-bar{
  width:100%;padding:10px 12px;border:1px solid #ddd;border-radius:8px;font-size:14px
}
.sidebar .search-bar:focus{outline:none;border-color:#A01544}

/* ===== Products area ===== */
.products-section{
  background:#fff;border-radius:10px;box-shadow:0 2px 10px rgba(0,0,0,.08);
  padding:20px;
}

/* Mobile Category Dropdown - hidden on desktop */
.mobile-category-dropdown{display:none;margin-bottom:16px}
.mobile-category-dropdown select{
  width:100%;padding:12px 14px;border:2px solid #ddd;border-radius:10px;font-size:16px;background:#fff;color:#333
}
.mobile-category-dropdown select:focus{outline:none;border-color:#A01544}

/* Product Grid */
.products-grid{display:grid;gap:22px}
@media (max-width: 479px){
  .products-grid{grid-template-columns:repeat(1, 1fr);}
}
@media (min-width: 480px) and (max-width: 767px){
  .products-grid{grid-template-columns:repeat(2, 1fr);}
}
@media (min-width: 768px) and (max-width: 1199px){
  .products-grid{grid-template-columns:repeat(2, 1fr);}
}
@media (min-width: 1200px){
  .products-grid{grid-template-columns:repeat(3, 1fr);}
}

.product-card{
  border:1px solid #eee;border-radius:10px;overflow:hidden;transition:transform .2s,box-shadow .2s;
  background:#fff
}
.product-card:hover{transform:translateY(-2px);box-shadow:0 6px 18px rgba(0,0,0,.08)}
.product-image{width:100%;height:200px;object-fit:contain;background:#f8f8f8;padding:10px}
.product-info{padding:16px}
.product-name{font-size:16px;font-weight:500;color:#222;margin-bottom:6px;line-height:1.3;height:2.6em;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.product-sku{font-size:12px;color:#555;margin-bottom:8px}
.product-description{font-size:14px;color:#555;margin-bottom:14px;line-height:1.4;height:2.8em;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}

/* Qty & unit */
.quantity-section{display:flex;align-items:center;gap:12px;justify-content:flex-start;margin-bottom:14px;flex-wrap:wrap}
.quantity-controls{display:flex;align-items:center;gap:10px}
.qty-btn{width:34px;height:34px;border:1px solid #ddd;background:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;border-radius:8px;font-size:18px;font-weight:700;line-height:1}
.qty-btn:hover{background:#f5f5f5}
.qty-input{width:48px;height:34px;text-align:center;border:1px solid #ddd;border-radius:8px;padding:0;font-size:16px;line-height:34px;-moz-appearance:textfield}
.qty-input::-webkit-outer-spin-button,.qty-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.unit-select{height:34px;border:1px solid #ddd;border-radius:10px;padding:0 10px;background:#fff;color:#374151}

/* Buttons */
.add-quote-btn{width:100%;background:#A01544;color:#fff;border:none;padding:12px;border-radius:8px;cursor:pointer;font-weight:500;transition:background .2s,font-weight .2s;font-size:14px}
.add-quote-btn:hover{background:#8A123A}
.add-quote-btn.added{background:#28a745}
.add-quote-btn.added:hover{background:#218838}

/* Loading */
.loading{text-align:center;padding:50px;color:#666}

/* ===== Modal ===== */
.modal-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.5);display:none;align-items:center;justify-content:center;z-index:1100}
.modal{background:#fff;border-radius:12px;width:90%;max-width:520px;max-height:90vh;overflow-y:auto}
.modal-header{padding:18px;border-bottom:1px solid #eee;display:flex;justify-content:space-between;align-items:center}
.modal-close{background:none;border:none;font-size:24px;cursor:pointer;color:#666}
.modal-body{padding:18px}

/* Quote modal details */
.quote-stats{background:#f8f9fa;padding:12px;border-radius:10px;margin-bottom:12px;display:flex;justify-content:space-between}
.quote-items{margin:12px 0 18px}
.items-table{border:1px solid #eee;border-radius:10px;overflow:hidden}
.items-row{display:grid;grid-template-columns:1fr auto auto;gap:8px;align-items:center;padding:10px 12px;border-bottom:1px solid #eee}
.items-row:last-child{border-bottom:none}
.items-name{font-size:14px;color:#111}
.items-sku{font-size:12px;color:#6b7280}
.items-qty{font-weight:700}
.muted{color:#6b7280}

.form-group{margin-bottom:12px}
.form-group label{display:block;margin-bottom:6px;font-weight:500;color:#222}
.form-group input,.form-group textarea{width:100%;padding:10px;border:1px solid #ddd;border-radius:8px;font-size:14px}
.form-group textarea{height:80px;resize:vertical}

/* Invalid highlight */
.form-group input:invalid,.form-group textarea:invalid{border-color:#dc2626}

/* Modal actions */
.modal-actions{display:flex;gap:10px;margin-top:16px}
.btn{flex:1;padding:12px;border:none;border-radius:8px;cursor:pointer;font-weight:600}
.btn-email{background:#6c757d;color:#fff}
.btn-whatsapp{background:#25D366;color:#fff}

/* ===== Footer ===== */
.footer{background:#2c3e50;color:#fff;padding:40px 0 20px;margin-top:40px}
.footer .container{
  max-width:1200px;margin:0 auto;padding:0 20px;
  display:grid;grid-template-columns:2fr 1fr 1fr 1fr;gap:40px
}
.footer-section h4{margin-bottom:15px;color:#ecf0f1}
.footer-section ul{list-style:none}
.footer-section ul li{margin-bottom:8px}
.footer-section ul li a{color:#bdc3c7;text-decoration:none}
.footer-section ul li a:hover{color:#fff}
.footer-bottom{border-top:1px solid #34495e;margin-top:30px;padding-top:20px;text-align:center;color:#95a5a6}

/* ===== Responsive ===== */
@media (max-width: 767px) {
  .main-content{grid-template-columns:1fr; padding:16px 15px; gap:16px}
  .sidebar{display:none}
  .products-section{padding:16px}
  .mobile-category-dropdown{display:block}
  .product-image{height:140px;padding:8px}
  .product-info{padding:12px}
  .product-name{font-size:14px;height:2.1em;-webkit-line-clamp:2;margin-bottom:4px}
  .product-sku{font-size:11px;margin-bottom:6px}
  .product-description{font-size:12px;height:2.4em;-webkit-line-clamp:2;margin-bottom:10px}
  .quantity-section{gap:8px;margin-bottom:10px}
  .qty-btn{width:28px;height:28px;font-size:16px}
  .qty-input{width:40px;height:28px;font-size:14px;line-height:28px}
  .unit-select{height:28px;font-size:12px;padding:0 6px}
  .quantity-controls{gap:6px}
  .add-quote-btn{padding:8px;font-size:12px}

  .header .container{padding:0 15px}
  .logo{width:50px;height:50px}
  .company-info h1{font-size:16px}
  .company-info p{font-size:11px}
  .view-quote-btn{padding:8px 14px;font-size:13px}

  .top-bar .container{padding:0 15px;font-size:12px}
  .contact-info{gap:10px}
  .whatsapp-btn{padding:4px 8px;font-size:12px}

  .footer .container{grid-template-columns:1fr; gap:20px; text-align:center}
}

@media (min-width: 768px) {
  .mobile-category-dropdown{display:none !important}
  .sidebar{display:block !important}
}

.whatsapp-btn svg{
  width:18px;height:18px;display:inline-block;vertical-align:-3px;margin-right:6px;fill:currentColor;
}

/* ===== ADDED CUSTOM CSS ===== */

/* Default product grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

/* Product card */
.product-card {
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease;
}
.product-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Product name: always two lines */
.product-name {
  font-size: 15px;
  font-weight: 600;
  margin: 6px 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;       /* force 2 lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 2.6em;           /* reserve space for 2 lines */
}

/* --- Mobile adjustments --- */
@media (max-width: 767px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 per row */
    gap: 12px;
  }
  .product-card {
    padding: 8px;
  }
  .product-name {
    font-size: 14px;
  }
}

/* Quote modal: wrap product names to exactly two lines */
.items-name{
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;          /* show max 2 lines */
  overflow:hidden;
  line-height:1.3;
  max-height: calc(1.3em * 2);   /* keeps height consistent */
  word-break: break-word;
}



