/*
Theme Name: QUICKMALL.PK
Theme URI: https://quickmall.pk/
Author: OpenAI for QUICKMALL.PK
Description: Custom WooCommerce marketplace theme for QUICKMALL.PK with a black, yellow and white visual system, responsive marketplace homepage, product grids and WooCommerce support.
Version: 1.3.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: quickmall-pk
Tags: e-commerce, woocommerce, responsive-layout, custom-logo, custom-menu
*/

:root{
  --qm-yellow:#f4c400;
  --qm-yellow-dark:#d8ad00;
  --qm-black:#050505;
  --qm-charcoal:#171717;
  --qm-white:#ffffff;
  --qm-bg:#f6f6f6;
  --qm-text:#111111;
  --qm-muted:#6b7280;
  --qm-border:#e8e8e8;
  --qm-radius:18px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;font-family:Arial,Helvetica,sans-serif;background:var(--qm-bg);color:var(--qm-text)}
a{color:inherit;text-decoration:none}
img{max-width:100%;height:auto}
.qm-container{width:min(1200px,calc(100% - 32px));margin:auto}
.qm-topbar{background:var(--qm-black);color:#eee;font-size:12px;padding:9px 0}
.qm-topbar-inner{display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap}
.qm-header{background:#fff;position:sticky;top:0;z-index:90;box-shadow:0 6px 20px rgba(0,0,0,.06)}
.qm-header-main{min-height:82px;display:grid;grid-template-columns:220px 1fr auto;gap:22px;align-items:center}
.qm-logo img{display:block;max-width:210px;max-height:58px;object-fit:contain}
.qm-text-logo{font-size:26px;font-weight:900}.qm-text-logo span{color:var(--qm-yellow)}
.qm-search{display:flex;border:2px solid var(--qm-yellow);border-radius:12px;overflow:hidden}
.qm-search input{width:100%;border:0;outline:0;padding:13px 15px}
.qm-search button{border:0;background:var(--qm-yellow);color:#050505;font-weight:800;padding:0 22px;cursor:pointer}
.qm-actions{display:flex;gap:10px;align-items:center}
.qm-action{background:#f6f6f6;padding:11px 12px;border-radius:11px;font-size:12px;font-weight:700}
.qm-nav{border-top:1px solid var(--qm-border);background:#fff}
.qm-menu{display:flex;gap:6px;align-items:center;min-height:48px;overflow:auto;list-style:none;margin:0;padding:0}
.qm-menu li a{display:block;white-space:nowrap;padding:9px 12px;border-radius:9px;font-size:13px;font-weight:700}
.qm-menu li a:hover{background:#fff5bd}
.qm-hero{margin:22px auto 0;background:linear-gradient(120deg,#050505,#181818 62%,#262626);border-radius:24px;padding:42px;color:#fff;display:grid;grid-template-columns:1.1fr .9fr;gap:28px;align-items:center;overflow:hidden;position:relative}
.qm-hero:after{content:"";position:absolute;width:330px;height:330px;background:var(--qm-yellow);opacity:.14;border-radius:50%;right:-120px;bottom:-150px}
.qm-pill{display:inline-block;background:var(--qm-yellow);color:#050505;padding:8px 12px;border-radius:999px;font-size:11px;font-weight:900;letter-spacing:.4px}
.qm-hero h1{font-size:46px;line-height:1.05;letter-spacing:-1.5px;margin:16px 0 12px;max-width:720px}
.qm-hero p{color:#ddd;line-height:1.7;font-size:14px;max-width:650px}
.qm-buttons{display:flex;gap:10px;flex-wrap:wrap;margin-top:20px}
.qm-btn{display:inline-flex;padding:12px 17px;border-radius:11px;font-size:13px;font-weight:800}
.qm-btn-yellow{background:var(--qm-yellow);color:#050505}.qm-btn-white{background:#fff;color:#050505}
.qm-showcase{display:grid;grid-template-columns:1fr 1fr;gap:12px;position:relative;z-index:2}
.qm-card{border-radius:18px;padding:20px;min-height:136px;display:flex;flex-direction:column;justify-content:flex-end}
.qm-card.large{grid-row:span 2;min-height:284px;background:#fff;color:#111}
.qm-card.yellow{background:var(--qm-yellow);color:#050505}.qm-card.light{background:#efefef;color:#111}
.qm-card strong{font-size:19px}.qm-card small{font-size:10px;font-weight:900;letter-spacing:.5px}
.qm-trust{margin-top:14px;background:#fff;border:1px solid var(--qm-border);border-radius:16px;padding:15px 18px;display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
.qm-trust-item{font-size:12px}.qm-trust-item b{display:block;margin-bottom:3px}.qm-trust-item span{color:var(--qm-muted);font-size:10px}
.qm-section{padding:30px 0 0}.qm-head{display:flex;justify-content:space-between;align-items:end;gap:12px;margin-bottom:14px}.qm-head h2{margin:0;font-size:24px}.qm-head p{margin:5px 0 0;color:var(--qm-muted);font-size:12px}
.qm-cats{display:grid;grid-template-columns:repeat(8,1fr);gap:12px}.qm-cat{background:#fff;border:1px solid var(--qm-border);border-radius:15px;padding:15px 8px;text-align:center}.qm-cat-icon{width:58px;height:58px;border-radius:18px;background:#fff5bd;display:grid;place-items:center;margin:0 auto 9px;font-size:25px}.qm-cat b{font-size:11px}
.qm-products ul.products{display:grid!important;grid-template-columns:repeat(5,1fr);gap:14px;margin:0!important}
.woocommerce ul.products li.product,.qm-products ul.products li.product{width:auto!important;margin:0!important;background:#fff;border:1px solid var(--qm-border);border-radius:15px;overflow:hidden;padding-bottom:12px;transition:.2s}
.woocommerce ul.products li.product:hover{transform:translateY(-3px);box-shadow:0 12px 25px rgba(0,0,0,.08)}
.woocommerce ul.products li.product a img{margin:0!important;aspect-ratio:1/1;object-fit:cover;background:#eee}
.woocommerce ul.products li.product .woocommerce-loop-product__title{font-size:13px!important;line-height:1.45;padding:11px 12px 3px!important;min-height:54px;color:#222}
.woocommerce ul.products li.product .price{padding:0 12px;color:#111!important;font-size:16px!important;font-weight:900!important}
.woocommerce span.onsale{background:#050505!important;color:var(--qm-yellow)!important;min-height:auto!important;line-height:1!important;padding:7px 9px!important;border-radius:8px!important;margin:8px!important}
.woocommerce a.button,.woocommerce button.button,.woocommerce input.button,.woocommerce #respond input#submit{background:var(--qm-yellow)!important;color:#050505!important;border-radius:10px!important;font-weight:800!important}
.qm-banner{margin-top:28px;background:linear-gradient(110deg,#050505,#1a1a1a);border-radius:20px;color:#fff;padding:28px;display:grid;grid-template-columns:1.2fr 1fr;gap:18px;align-items:center}.qm-banner h2{font-size:28px;margin:5px 0}.qm-coupon{background:#fff;color:#111;border-radius:13px;padding:15px 18px;display:flex;justify-content:space-between;align-items:center}.qm-coupon code{background:#fff3af;padding:8px 11px;border-radius:8px;font-weight:900}
.qm-content{background:#fff;border-radius:18px;padding:24px;margin-top:24px}
.woocommerce div.product{background:#fff;border-radius:18px;padding:22px}.woocommerce div.product p.price,.woocommerce div.product span.price{color:#111!important;font-weight:900}.woocommerce-message,.woocommerce-info{border-top-color:var(--qm-yellow)!important}.woocommerce-message::before,.woocommerce-info::before{color:#b28e00!important}
.qm-footer{margin-top:44px;background:#050505;color:#bbb;padding:38px 0 22px}.qm-footer-grid{display:grid;grid-template-columns:1.4fr repeat(3,1fr);gap:28px}.qm-footer h4{color:#fff;margin:0 0 12px}.qm-footer a,.qm-footer p{font-size:11px;line-height:1.8;color:#bbb}.qm-bottom{border-top:1px solid #232323;margin-top:24px;padding-top:17px;font-size:10px;display:flex;justify-content:space-between;gap:14px;flex-wrap:wrap}
@media(max-width:1024px){.qm-header-main{grid-template-columns:200px 1fr}.qm-actions{display:none}.qm-cats{grid-template-columns:repeat(4,1fr)}.qm-products ul.products{grid-template-columns:repeat(4,1fr)!important}}
@media(max-width:760px){.qm-header-main{grid-template-columns:1fr;gap:10px;padding:13px 0}.qm-logo img{max-width:185px}.qm-nav{display:none}.qm-hero{grid-template-columns:1fr;padding:28px}.qm-hero h1{font-size:34px}.qm-showcase{grid-template-columns:1fr 1fr}.qm-card.large{grid-column:1/-1;grid-row:auto;min-height:150px}.qm-trust{grid-template-columns:1fr 1fr}.qm-products ul.products{grid-template-columns:repeat(2,1fr)!important}.qm-banner{grid-template-columns:1fr}.qm-footer-grid{grid-template-columns:1fr 1fr}}
@media(max-width:480px){.qm-container{width:min(100% - 22px,1200px)}.qm-hero h1{font-size:30px}.qm-showcase{grid-template-columns:1fr}.qm-card.large{grid-column:auto}.qm-footer-grid{grid-template-columns:1fr}}


/* === QUICKMALL.PK v1.1 WooCommerce Grid & Card Fixes === */

/* Keep WooCommerce archive/shop content aligned with the site */
body.woocommerce-page main,
body.post-type-archive-product main,
body.tax-product_cat main,
body.tax-product_tag main {
  width:min(1200px,calc(100% - 32px));
  margin:26px auto 0;
}

/* Archive heading + result/sort bar */
.woocommerce-products-header{
  margin-bottom:18px;
}
.woocommerce-products-header__title.page-title{
  font-size:30px;
  line-height:1.15;
  margin:0 0 14px;
  font-weight:900;
  letter-spacing:-.6px;
}
.woocommerce .woocommerce-result-count{
  float:none!important;
  margin:0!important;
  color:var(--qm-muted);
  font-size:12px;
}
.woocommerce .woocommerce-ordering{
  float:none!important;
  margin:0!important;
}
.woocommerce .woocommerce-ordering select{
  min-width:190px;
  border:1px solid var(--qm-border);
  border-radius:10px;
  background:#fff;
  padding:10px 12px;
  font-size:12px;
  outline:none;
}
body.post-type-archive-product .woocommerce-notices-wrapper + .woocommerce-result-count,
body.tax-product_cat .woocommerce-notices-wrapper + .woocommerce-result-count{
  margin-bottom:10px!important;
}

/* Make archive toolbar neat */
.woocommerce:has(.woocommerce-result-count):has(.woocommerce-ordering){
  position:relative;
}
.woocommerce .woocommerce-result-count,
.woocommerce .woocommerce-ordering{
  display:inline-flex;
  align-items:center;
}
.woocommerce .woocommerce-ordering{
  float:right!important;
}

/* Reset legacy WooCommerce float/clear styles before using CSS Grid */
.woocommerce ul.products,
.woocommerce-page ul.products,
.qm-products ul.products{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:18px!important;
  width:100%!important;
  margin:18px 0 0!important;
  padding:0!important;
  list-style:none!important;
}
.woocommerce ul.products::before,
.woocommerce ul.products::after,
.woocommerce-page ul.products::before,
.woocommerce-page ul.products::after{
  display:none!important;
  content:none!important;
}
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product,
.qm-products ul.products li.product{
  float:none!important;
  clear:none!important;
  width:100%!important;
  margin:0!important;
  padding:0 0 14px!important;
  min-width:0!important;
  background:#fff!important;
  border:1px solid var(--qm-border)!important;
  border-radius:16px!important;
  overflow:hidden!important;
  box-shadow:0 2px 10px rgba(0,0,0,.035);
  transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease;
  display:flex!important;
  flex-direction:column!important;
  position:relative!important;
}
.woocommerce ul.products li.product.first,
.woocommerce ul.products li.product.last{
  clear:none!important;
  margin-left:0!important;
  margin-right:0!important;
}
.woocommerce ul.products li.product:hover{
  transform:translateY(-4px);
  box-shadow:0 14px 32px rgba(0,0,0,.09);
  border-color:#dedede!important;
}
.woocommerce ul.products li.product > a.woocommerce-LoopProduct-link{
  display:flex!important;
  flex-direction:column!important;
  flex:1 1 auto!important;
}
.woocommerce ul.products li.product a img{
  width:100%!important;
  height:auto!important;
  aspect-ratio:1/1!important;
  object-fit:cover!important;
  margin:0!important;
  background:#f3f3f3!important;
  border-radius:0!important;
}
.woocommerce ul.products li.product .woocommerce-loop-product__title{
  font-size:13px!important;
  line-height:1.45!important;
  font-weight:700!important;
  color:#171717!important;
  padding:12px 13px 5px!important;
  margin:0!important;
  min-height:56px!important;
  max-height:56px!important;
  overflow:hidden!important;
}
.woocommerce ul.products li.product .price{
  display:block!important;
  padding:0 13px!important;
  margin:2px 0 0!important;
  color:#050505!important;
  font-size:17px!important;
  font-weight:900!important;
  line-height:1.3!important;
}
.woocommerce ul.products li.product .price del{
  color:#999!important;
  font-size:11px!important;
  font-weight:500!important;
}
.woocommerce ul.products li.product .price ins{
  text-decoration:none!important;
}
.woocommerce ul.products li.product .star-rating{
  margin:8px 13px 0!important;
  font-size:11px!important;
}
.woocommerce ul.products li.product .button{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:calc(100% - 26px)!important;
  min-height:40px!important;
  margin:12px 13px 0!important;
  padding:10px 12px!important;
  border-radius:10px!important;
  background:var(--qm-yellow)!important;
  color:#050505!important;
  font-size:12px!important;
  line-height:1.2!important;
  font-weight:900!important;
  text-align:center!important;
  box-shadow:none!important;
  transition:background .2s ease,transform .2s ease!important;
}
.woocommerce ul.products li.product .button:hover{
  background:var(--qm-yellow-dark)!important;
  transform:translateY(-1px);
}
.woocommerce ul.products li.product .added_to_cart{
  margin:8px 13px 0!important;
  font-size:11px!important;
  font-weight:800!important;
  color:#111!important;
}

/* Sale badge */
.woocommerce span.onsale{
  top:10px!important;
  left:10px!important;
  right:auto!important;
  margin:0!important;
  min-width:auto!important;
  min-height:auto!important;
  padding:7px 9px!important;
  border-radius:8px!important;
  background:#050505!important;
  color:var(--qm-yellow)!important;
  font-size:10px!important;
  line-height:1!important;
  font-weight:900!important;
  z-index:3!important;
}

/* Home product sections: five columns without the mysterious empty first slot */
.home .qm-products ul.products{
  grid-template-columns:repeat(5,minmax(0,1fr))!important;
}
.home .qm-products ul.products li.product{
  grid-column:auto!important;
  grid-row:auto!important;
}
.home .qm-products ul.products li.product:nth-child(n){
  margin:0!important;
}

/* Home section polish */
.qm-products{
  overflow:visible;
}
.qm-products .qm-head{
  margin-bottom:14px;
}
.qm-products .qm-head > a{
  font-size:12px;
  font-weight:800;
  color:#111;
  background:#fff3ad;
  padding:8px 11px;
  border-radius:9px;
}

/* Empty catalogue state shouldn't leave weird whitespace */
.woocommerce ul.products:empty{
  display:none!important;
}

@media(max-width:1100px){
  .woocommerce ul.products,
  .woocommerce-page ul.products,
  .qm-products ul.products,
  .home .qm-products ul.products{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
}
@media(max-width:760px){
  body.woocommerce-page main,
  body.post-type-archive-product main,
  body.tax-product_cat main,
  body.tax-product_tag main{
    width:min(100% - 22px,1200px);
    margin-top:18px;
  }
  .woocommerce-products-header__title.page-title{
    font-size:24px;
  }
  .woocommerce .woocommerce-result-count,
  .woocommerce .woocommerce-ordering{
    float:none!important;
    display:flex!important;
    width:100%;
  }
  .woocommerce .woocommerce-ordering{
    margin-top:10px!important;
  }
  .woocommerce .woocommerce-ordering select{
    width:100%;
  }
  .woocommerce ul.products,
  .woocommerce-page ul.products,
  .qm-products ul.products,
  .home .qm-products ul.products{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:10px!important;
  }
  .woocommerce ul.products li.product .woocommerce-loop-product__title{
    font-size:12px!important;
    min-height:52px!important;
    max-height:52px!important;
    padding:10px 10px 4px!important;
  }
  .woocommerce ul.products li.product .price{
    padding:0 10px!important;
    font-size:15px!important;
  }
  .woocommerce ul.products li.product .button{
    width:calc(100% - 20px)!important;
    margin:10px 10px 0!important;
    min-height:38px!important;
    font-size:11px!important;
  }
}


/* === QUICKMALL.PK v1.2 Stock Status Styling === */
.woocommerce ul.products li.product.outofstock{
  opacity:.82;
}
.woocommerce ul.products li.product.outofstock::after{
  content:"OUT OF STOCK";
  position:absolute;
  top:10px;
  right:10px;
  z-index:4;
  background:#111;
  color:#fff;
  padding:6px 8px;
  border-radius:7px;
  font-size:9px;
  font-weight:900;
  letter-spacing:.4px;
}
.woocommerce ul.products li.product .qm-outofstock-button,
.woocommerce ul.products li.product.outofstock .button{
  background:#e9e9e9!important;
  color:#666!important;
  cursor:not-allowed!important;
  border:1px solid #dedede!important;
}
.woocommerce ul.products li.product .qm-outofstock-button:hover,
.woocommerce ul.products li.product.outofstock .button:hover{
  background:#e9e9e9!important;
  color:#666!important;
  transform:none!important;
}


/* === QUICKMALL.PK v1.3 stronger unavailable-product styling === */
.woocommerce ul.products li.product .qm-outofstock-button,
.woocommerce ul.products li.product .button.qm-outofstock-button{
  background:#efefef!important;
  color:#666!important;
  border:1px solid #ddd!important;
  pointer-events:none!important;
  cursor:not-allowed!important;
}
.woocommerce ul.products li.product .qm-outofstock-button:hover,
.woocommerce ul.products li.product .button.qm-outofstock-button:hover{
  background:#efefef!important;
  color:#666!important;
  transform:none!important;
}
