/*
Theme Name: The Ajrakh Studio Premium All-in-One v5.0
Theme URI: https://theajrakhstudio.shop
Author: The Ajrakh Studio
Author URI: https://theajrakhstudio.shop
Description: Premium standalone WooCommerce theme created exclusively for The Ajrakh Studio.
Version: 5.1.0
Text Domain: tas
*/
:root{--bg:#fffaf6;--ink:#211915;--muted:#74665e;--brand:#8a302d;--gold:#bd8b50;--card:#fff;--line:#eadfd6;--green:#159447;--r:18px;--shadow:0 10px 34px rgba(38,25,18,.08)}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--ink);font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;line-height:1.65}a{text-decoration:none;color:inherit}img{max-width:100%;height:auto;display:block}.container{width:min(1200px,92%);margin:auto}
.topbar{background:#211915;color:#fff;font-size:13px}.topbar .container{display:flex;justify-content:center;gap:32px;padding:7px 0;white-space:nowrap;overflow:auto}
.site-header{position:sticky;top:0;z-index:999;background:rgba(255,250,246,.96);backdrop-filter:blur(12px);border-bottom:1px solid var(--line)}.head{min-height:72px;display:flex;align-items:center;justify-content:space-between;gap:22px}.brand{display:flex;align-items:center;gap:12px}.brand .custom-logo{max-height:48px;width:auto}.brand-title{font-weight:900;letter-spacing:.02em;font-size:20px}.nav ul,.footer-menu ul{list-style:none;margin:0;padding:0}.nav ul{display:flex;gap:22px;align-items:center}.nav a{font-weight:650}.actions{display:flex;gap:9px}.pill{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid var(--line);background:#fff;border-radius:999px;padding:10px 15px;font-weight:750}.count{min-width:22px;height:22px;display:grid;place-items:center;border-radius:50%;background:var(--brand);color:#fff;font-size:12px}
.hero{min-height:650px;background-size:cover;background-position:center;display:grid;align-items:center;position:relative}.hero:before{content:"";position:absolute;inset:0;background:linear-gradient(90deg,rgba(20,10,7,.72) 0%,rgba(20,10,7,.28) 58%,rgba(20,10,7,.08))}.hero-inner{position:relative;color:#fff;max-width:740px;padding:90px 0}.eyebrow{text-transform:uppercase;letter-spacing:.16em;font-size:12px;font-weight:800}.hero h1{font-family:Georgia,serif;font-size:clamp(43px,6vw,78px);line-height:1.02;margin:12px 0 18px}.hero p{font-size:19px;max-width:650px}.btn{display:inline-flex;align-items:center;justify-content:center;border-radius:999px;padding:13px 21px;font-weight:800;border:1px solid transparent;cursor:pointer}.btn-brand{background:var(--brand);color:#fff}.btn-light{background:#fff;color:var(--ink)}.hero-buttons{display:flex;gap:10px;flex-wrap:wrap;margin-top:28px}
.section{padding:72px 0}.soft{background:#f7eee7}.section-head{text-align:center;max-width:760px;margin:0 auto 34px}.section-head h2{font-family:Georgia,serif;font-size:clamp(30px,4vw,48px);line-height:1.1;margin:0 0 10px}.section-head p{color:var(--muted);margin:0}
.catgrid{display:grid;grid-template-columns:repeat(4,1fr);gap:20px}.cat{aspect-ratio:.82;position:relative;border-radius:var(--r);overflow:hidden;background:#ddd;box-shadow:var(--shadow)}.cat img{width:100%;height:100%;object-fit:cover}.cat:after{content:"";position:absolute;inset:40% 0 0;background:linear-gradient(transparent,rgba(0,0,0,.76))}.cat span{position:absolute;left:18px;right:18px;bottom:18px;z-index:2;color:#fff;font-size:22px;font-weight:850}
.values{display:grid;grid-template-columns:repeat(4,1fr);border:1px solid var(--line);border-radius:var(--r);overflow:hidden}.value{background:#fff;padding:23px;text-align:center;border-right:1px solid var(--line)}.value:last-child{border:0}.value strong{display:block;font-size:16px}.value small{color:var(--muted)}
.story{display:grid;grid-template-columns:1.05fr .95fr;gap:52px;align-items:center}.story-copy h2{font-family:Georgia,serif;font-size:44px;line-height:1.1}.story-copy p{color:var(--muted)}.story-box{background:#fff;border:1px solid var(--line);border-radius:var(--r);padding:34px;box-shadow:var(--shadow)}
.page-wrap{width:min(920px,92%);margin:50px auto}.page-wrap h1{font-family:Georgia,serif;font-size:46px}.page-wrap h2{margin-top:34px}.policy{background:#fff;border:1px solid var(--line);border-radius:var(--r);padding:34px}.contact-grid{display:grid;grid-template-columns:1fr 1fr;gap:22px}.contact-card{background:#fff;border:1px solid var(--line);border-radius:var(--r);padding:25px}.contact-card strong{display:block;margin-bottom:4px}.support-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}.support-card{background:#fff;border:1px solid var(--line);border-radius:var(--r);padding:24px}
.woocommerce ul.products{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:20px!important}.woocommerce ul.products li.product{width:auto!important;margin:0!important;background:#fff;border:1px solid var(--line);border-radius:var(--r);overflow:hidden;padding-bottom:16px!important;box-shadow:var(--shadow)}.woocommerce ul.products li.product img{width:100%!important;aspect-ratio:4/5;object-fit:cover;margin:0 0 14px!important}.woocommerce ul.products li.product .woocommerce-loop-product__title,.woocommerce ul.products li.product .price{padding:0 15px!important}.woocommerce ul.products li.product .price{color:var(--brand)!important;font-weight:900!important}.tas-actions{display:flex;gap:8px;padding:11px 15px 0}.tas-actions .button{flex:1;text-align:center;margin:0!important}.woocommerce a.button,.woocommerce button.button,.woocommerce input.button{background:var(--brand)!important;color:#fff!important;border-radius:999px!important}.tas-wa{margin-top:18px;padding:15px;border:1px solid #b9dfc3;background:#edfff1;border-radius:15px}.tas-wa .button{width:100%!important;background:var(--green)!important;padding:14px!important;font-size:16px!important}.woocommerce-message,.woocommerce-info{border-top-color:var(--brand)!important}
.site-footer{background:#211915;color:#f8f1eb;margin-top:60px;padding:55px 0 25px}.footer-grid{display:grid;grid-template-columns:1.4fr 1fr 1fr 1fr;gap:28px}.site-footer h3{margin-top:0}.site-footer p,.site-footer li{color:#d5c7bd}.footer-menu li{margin:6px 0}.copyright{border-top:1px solid rgba(255,255,255,.12);margin-top:30px;padding-top:20px;color:#bbaaa0;font-size:13px}
@media(max-width:900px){.nav{display:none}.hero{min-height:560px}.catgrid,.woocommerce ul.products{grid-template-columns:repeat(2,1fr)!important}.values{grid-template-columns:1fr 1fr}.value:nth-child(2){border-right:0}.story,.contact-grid{grid-template-columns:1fr}.support-grid{grid-template-columns:1fr 1fr}.footer-grid{grid-template-columns:1fr 1fr}}
@media(max-width:560px){.topbar .container{justify-content:flex-start}.head{min-height:64px}.brand-title{font-size:16px}.actions .label{display:none}.hero{min-height:520px}.hero-inner{padding:70px 0}.hero p{font-size:16px}.section{padding:52px 0}.values,.support-grid,.footer-grid{grid-template-columns:1fr}.value{border-right:0;border-bottom:1px solid var(--line)}.page-wrap h1{font-size:38px}.policy{padding:22px}.tas-actions{flex-direction:column}}

/* Customizer direct-edit helpers */
.tas-setting-pencil{display:none}.customize-partial-edit-shortcut button{z-index:10001!important}
.tas-product-edit-pencil{display:none}
body.customize-partial-edit-shortcuts-shown .tas-setting-pencil,
body.customize-partial-edit-shortcuts-shown .tas-product-edit-pencil{display:grid!important}
.tas-setting-pencil,.tas-product-edit-pencil{position:absolute!important;z-index:10010!important;width:32px!important;height:32px!important;min-width:32px!important;border-radius:50%!important;border:2px solid #fff!important;background:#0073aa!important;color:#fff!important;place-items:center!important;font-size:18px!important;line-height:1!important;padding:0!important;box-shadow:0 2px 8px rgba(0,0,0,.28)!important;cursor:pointer!important}
.hero .tas-hero-image-pencil{right:22px!important;top:22px!important;left:auto!important}.cat .tas-cat-image-pencil{right:10px!important;top:10px!important;left:auto!important}
.woocommerce ul.products li.product{position:relative}.woocommerce ul.products li.product .tas-product-edit-pencil{right:10px!important;top:10px!important;left:auto!important;text-decoration:none!important}


/* Elementor-ready homepage */
.tas-elementor-home .elementor-section.elementor-section-boxed > .elementor-container{max-width:1180px}
body.elementor-page .page-wrap{max-width:none;padding:0}
body.elementor-page .page-wrap article>h1{display:none}
.elementor-widget-shortcode .woocommerce ul.products{margin-bottom:0}


/* ===== PREMIUM HEADER + MOBILE EXPERIENCE v4 ===== */
:root{--tas-wine:#6f171b;--tas-deep:#301416;--tas-cream:#fbf5eb;--tas-gold:#b88a52;--tas-ink:#201617;--tas-line:#eadfd0}
.tas-container{width:min(1240px,calc(100% - 40px));margin:auto}
.tas-promo{background:var(--tas-deep);color:#fff;font-size:12px;letter-spacing:.04em}
.tas-promo-inner{height:31px;display:flex;align-items:center;justify-content:center;gap:48px}
.tas-header{position:relative;background:#fff;border-bottom:1px solid var(--tas-line);z-index:999}
.tas-desktop-head{height:84px;display:grid;grid-template-columns:270px 1fr 130px;align-items:center}
.tas-brand,.tas-mobile-brand{text-decoration:none;color:var(--tas-ink);display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1}
.tas-brand-word{font-family:Georgia,'Times New Roman',serif;font-size:26px;letter-spacing:.01em}
.tas-brand small,.tas-mobile-brand small{font-size:8px;letter-spacing:.23em;margin-top:7px;color:#754f43}
.tas-brand .custom-logo{max-height:58px;width:auto}
.tas-desktop-nav ul{list-style:none;margin:0;padding:0;display:flex;justify-content:center;gap:29px;align-items:center}
.tas-desktop-nav a{text-decoration:none;color:var(--tas-ink);font-weight:600;font-size:14px;letter-spacing:.02em}
.tas-desktop-nav a:hover{color:var(--tas-wine)}
.tas-head-actions{display:flex;justify-content:flex-end;gap:20px;align-items:center}
.tas-icon-link,.tas-cart-link{position:relative;display:grid;place-items:center;color:var(--tas-ink);text-decoration:none}
.tas-header svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.tas-cart-count{position:absolute;right:-9px;top:-9px;background:var(--tas-wine);color:#fff;min-width:18px;height:18px;border-radius:50%;font-size:10px;display:grid;place-items:center;font-weight:700}
.tas-mobile-head,.tas-mobile-search,.tas-mobile-drawer,.tas-drawer-overlay{display:none}

/* Homepage polish */
.home .elementor-widget-heading h1,.home .elementor-widget-heading h2{font-family:Georgia,'Times New Roman',serif;color:var(--tas-ink)}
.home .elementor-widget-shortcode ul.products{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:24px;margin:0!important}
.home .elementor-widget-shortcode ul.products:before,.home .elementor-widget-shortcode ul.products:after{display:none!important}
.home .elementor-widget-shortcode ul.products li.product{width:auto!important;margin:0!important;background:#fff;border-radius:14px;overflow:hidden;border:1px solid #eee5da;padding:0 0 16px!important;box-shadow:0 7px 25px rgba(50,20,20,.05)}
.home ul.products li.product a img{margin:0 0 12px!important;aspect-ratio:3/4;object-fit:cover;width:100%}
.home ul.products li.product .woocommerce-loop-product__title{font-size:14px!important;line-height:1.45;padding:0 14px!important;color:var(--tas-ink)}
.home ul.products li.product .price{padding:0 14px;color:var(--tas-wine)!important;font-weight:700!important}
.home ul.products li.product .button{margin:8px 14px 0!important;background:var(--tas-wine)!important;color:#fff!important;border-radius:8px!important;text-align:center!important;display:block!important}
.home .product-category img{aspect-ratio:1/1;object-fit:cover!important}

@media(max-width:767px){
 body{padding-bottom:68px}
 .tas-promo-inner{width:100%;height:28px;justify-content:center;gap:0;font-size:10px;font-weight:600}
 .tas-promo-inner span{display:none}.tas-promo-inner span:nth-child(2){display:block}
 .tas-desktop-head{display:none}
 .tas-mobile-head{height:66px;display:grid;grid-template-columns:48px 1fr 80px;align-items:center;padding:0 12px;background:#fff;position:relative}
 .tas-menu-toggle,.tas-mobile-search-toggle{border:0;background:transparent;padding:10px;color:var(--tas-ink);display:grid;place-items:center}
 .tas-mobile-brand span{font-family:Georgia,'Times New Roman',serif;font-size:20px;white-space:nowrap;font-weight:600}
 .tas-mobile-brand small{font-size:6px;margin-top:5px}
 .tas-mobile-brand .custom-logo{max-height:48px;width:auto;max-width:180px}
 .tas-mobile-actions{display:flex;align-items:center;justify-content:flex-end;gap:4px}
 .tas-mobile-search{background:#fff;padding:8px 12px 12px;border-top:1px solid var(--tas-line)}
 .tas-mobile-search.is-open{display:block}
 .tas-mobile-search form{height:42px;border:1px solid #d9cbbd;border-radius:999px;display:flex;overflow:hidden;background:#fff}
 .tas-mobile-search input{flex:1;border:0!important;outline:0;padding:0 15px;font-size:13px;background:transparent}
 .tas-mobile-search button{width:46px;border:0;background:var(--tas-wine);color:#fff;display:grid;place-items:center}
 .tas-mobile-drawer{display:block;position:fixed;inset:0 auto 0 0;width:min(86vw,360px);background:#fff;z-index:10002;transform:translateX(-105%);transition:.28s ease;box-shadow:20px 0 50px rgba(0,0,0,.18);padding:0 20px 25px;overflow:auto}
 .tas-drawer-top{height:76px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--tas-line);font-family:Georgia,'Times New Roman',serif;font-size:18px}
 .tas-menu-close{font-size:34px;border:0;background:none;font-weight:300;line-height:1}
 .tas-mobile-drawer ul{list-style:none;padding:10px 0;margin:0}.tas-mobile-drawer li{border-bottom:1px solid #f0e8df}.tas-mobile-drawer a{display:block;padding:15px 3px;color:var(--tas-ink);text-decoration:none;font-weight:600}
 .tas-drawer-wa{margin-top:20px!important;background:#25D366;color:#fff!important;text-align:center;border-radius:9px;padding:14px!important}
 .tas-drawer-overlay{display:block;position:fixed;inset:0;background:rgba(20,10,10,.42);z-index:10001;opacity:0;visibility:hidden;transition:.25s}
 body.tas-menu-open{overflow:hidden} body.tas-menu-open .tas-mobile-drawer{transform:translateX(0)} body.tas-menu-open .tas-drawer-overlay{opacity:1;visibility:visible}
 .home .elementor-widget-shortcode ul.products{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 .home .elementor-widget-shortcode ul.products li.product{border-radius:10px;padding-bottom:11px!important}
 .home ul.products li.product .woocommerce-loop-product__title{font-size:12px!important;padding:0 9px!important;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:35px}
 .home ul.products li.product .price{font-size:13px!important;padding:0 9px!important}
 .home ul.products li.product .button{font-size:11px!important;margin:7px 9px 0!important;padding:10px 7px!important}
 .elementor-section.elementor-section-boxed>.elementor-container{max-width:100%!important}
}


/* ===== v4.2 DROPDOWN SUBMENU FIX ===== */
/* Desktop: keep only top-level menu inline; child menus become real dropdowns */
.tas-desktop-nav > ul,
.tas-desktop-nav .menu{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  justify-content:center;
  gap:29px;
  align-items:center;
}
.tas-desktop-nav .menu > li{
  position:relative;
}
.tas-desktop-nav .menu > li > a{
  display:flex;
  align-items:center;
  gap:6px;
  padding:30px 0;
}
.tas-desktop-nav .menu-item-has-children > a::after{
  content:"";
  width:7px;
  height:7px;
  border-right:1.7px solid currentColor;
  border-bottom:1.7px solid currentColor;
  transform:rotate(45deg) translateY(-2px);
  transform-origin:center;
  margin-left:3px;
  transition:transform .2s ease;
}
.tas-desktop-nav .sub-menu{
  position:absolute;
  left:50%;
  top:calc(100% - 8px);
  transform:translate(-50%,10px);
  min-width:220px;
  display:block!important;
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  background:#fff;
  border:1px solid var(--tas-line);
  border-radius:12px;
  padding:8px!important;
  margin:0!important;
  box-shadow:0 16px 40px rgba(40,20,20,.14);
  z-index:10010;
  transition:opacity .18s ease,transform .18s ease,visibility .18s ease;
}
.tas-desktop-nav .sub-menu li{
  display:block;
  width:100%;
  position:relative;
}
.tas-desktop-nav .sub-menu a{
  display:block;
  width:100%;
  padding:11px 13px;
  border-radius:8px;
  white-space:nowrap;
  font-size:13px;
  font-weight:600;
}
.tas-desktop-nav .sub-menu a:hover{
  background:#fbf4ed;
  color:var(--tas-wine);
}
.tas-desktop-nav li.menu-item-has-children:hover > .sub-menu,
.tas-desktop-nav li.menu-item-has-children:focus-within > .sub-menu{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
  transform:translate(-50%,0);
}
.tas-desktop-nav li.menu-item-has-children:hover > a::after,
.tas-desktop-nav li.menu-item-has-children:focus-within > a::after{
  transform:rotate(225deg) translate(-1px,-1px);
}

/* 2nd-level desktop submenu opens to the right */
.tas-desktop-nav .sub-menu .sub-menu{
  left:100%;
  top:-8px;
  transform:translate(10px,0);
}
.tas-desktop-nav .sub-menu li.menu-item-has-children:hover > .sub-menu,
.tas-desktop-nav .sub-menu li.menu-item-has-children:focus-within > .sub-menu{
  transform:translate(0,0);
}

/* Mobile: submenu is collapsed with a visible arrow button */
@media(max-width:767px){
  .tas-mobile-drawer li.menu-item-has-children{
    position:relative;
  }
  .tas-mobile-drawer li.menu-item-has-children > a{
    padding-right:50px;
  }
  .tas-submenu-toggle{
    position:absolute;
    right:0;
    top:7px;
    width:42px;
    height:42px;
    border:0;
    background:transparent;
    display:grid;
    place-items:center;
    cursor:pointer;
    color:var(--tas-ink);
  }
  .tas-submenu-toggle::before{
    content:"";
    width:8px;
    height:8px;
    border-right:2px solid currentColor;
    border-bottom:2px solid currentColor;
    transform:rotate(45deg) translate(-1px,-1px);
    transition:transform .2s ease;
  }
  .tas-mobile-drawer li.submenu-open > .tas-submenu-toggle::before{
    transform:rotate(225deg) translate(-1px,-1px);
  }
  .tas-mobile-drawer .sub-menu{
    display:none;
    margin:0 0 8px 10px!important;
    padding:0 0 0 12px!important;
    border-left:1px solid #eadfd0;
  }
  .tas-mobile-drawer li.submenu-open > .sub-menu{
    display:block;
  }
  .tas-mobile-drawer .sub-menu li{
    border-bottom:0;
  }
  .tas-mobile-drawer .sub-menu a{
    padding:10px 3px;
    font-size:13px;
    font-weight:550;
  }
}


/* ===== v4.3 WOOCOMMERCE CATEGORY / SHOP POLISH ===== */

/* Remove excessive vertical gap between archive/category header and product grid */
.woocommerce.archive .site-main,
.post-type-archive-product .site-main,
.tax-product_cat .site-main,
.tax-product_tag .site-main{
  padding-top:0!important;
}

.woocommerce.archive .woocommerce-products-header,
.post-type-archive-product .woocommerce-products-header,
.tax-product_cat .woocommerce-products-header,
.tax-product_tag .woocommerce-products-header{
  margin:0 0 18px!important;
  padding:24px 0 0!important;
  min-height:0!important;
}

.woocommerce.archive .woocommerce-products-header__title,
.post-type-archive-product .woocommerce-products-header__title,
.tax-product_cat .woocommerce-products-header__title,
.tax-product_tag .woocommerce-products-header__title{
  margin:0 0 8px!important;
  padding:0!important;
  line-height:1.2;
}

.woocommerce.archive .term-description,
.post-type-archive-product .term-description,
.tax-product_cat .term-description,
.tax-product_tag .term-description{
  margin:0 0 14px!important;
  padding:0!important;
}
.woocommerce.archive .term-description:empty,
.post-type-archive-product .term-description:empty,
.tax-product_cat .term-description:empty,
.tax-product_tag .term-description:empty{
  display:none!important;
  margin:0!important;
  padding:0!important;
}

/* Pull sorting/result count and product loop closer to archive title */
.woocommerce.archive .woocommerce-result-count,
.woocommerce.archive .woocommerce-ordering,
.post-type-archive-product .woocommerce-result-count,
.post-type-archive-product .woocommerce-ordering,
.tax-product_cat .woocommerce-result-count,
.tax-product_cat .woocommerce-ordering{
  margin-top:0!important;
  margin-bottom:16px!important;
}

.woocommerce.archive ul.products,
.post-type-archive-product ul.products,
.tax-product_cat ul.products,
.tax-product_tag ul.products{
  margin-top:0!important;
  padding-top:0!important;
}

/* Prevent stray empty blocks from creating large gaps on Woo archives */
.woocommerce.archive main > p:empty,
.woocommerce.archive main > div:empty,
.post-type-archive-product main > p:empty,
.post-type-archive-product main > div:empty,
.tax-product_cat main > p:empty,
.tax-product_cat main > div:empty{
  display:none!important;
}

/* Consistent product grid spacing */
.woocommerce ul.products{
  column-gap:18px;
  row-gap:26px;
}
.woocommerce ul.products li.product{
  margin-bottom:0!important;
}

/* Cleaner product card rhythm without changing theme look */
.woocommerce ul.products li.product .woocommerce-loop-product__title{
  margin-top:9px!important;
  margin-bottom:5px!important;
  line-height:1.35;
}
.woocommerce ul.products li.product .price{
  margin-top:0!important;
  margin-bottom:0!important;
}

/* Hide accidental empty notices / wrappers */
.woocommerce .woocommerce-notices-wrapper:empty,
.woocommerce .woocommerce-info:empty,
.woocommerce .woocommerce-message:empty{
  display:none!important;
  margin:0!important;
  padding:0!important;
}

/* Mobile: keep archive heading compact */
@media(max-width:767px){
  .woocommerce.archive .woocommerce-products-header,
  .post-type-archive-product .woocommerce-products-header,
  .tax-product_cat .woocommerce-products-header,
  .tax-product_tag .woocommerce-products-header{
    padding-top:14px!important;
    margin-bottom:12px!important;
  }
  .woocommerce.archive .woocommerce-products-header__title,
  .post-type-archive-product .woocommerce-products-header__title,
  .tax-product_cat .woocommerce-products-header__title,
  .tax-product_tag .woocommerce-products-header__title{
    font-size:28px;
    margin-bottom:6px!important;
  }
  .woocommerce.archive .woocommerce-result-count,
  .woocommerce.archive .woocommerce-ordering,
  .post-type-archive-product .woocommerce-result-count,
  .post-type-archive-product .woocommerce-ordering,
  .tax-product_cat .woocommerce-result-count,
  .tax-product_cat .woocommerce-ordering{
    margin-bottom:10px!important;
  }
}

/* Tiny polish: avoid horizontal overflow from nested menus/product grids */
html,body{overflow-x:hidden}
.woocommerce .products,
.tas-desktop-nav .sub-menu{
  max-width:100%;
}


/* ===== v4.4 MOBILE SHOP/CATEGORY GRID ALIGNMENT FIX ===== */
/* WooCommerce's first/last/clear float classes were leaving the first left cell blank.
   Force a true CSS grid on shop/category archives so every product starts from column 1. */
@media(max-width:767px){
  body.woocommerce-shop ul.products,
  body.post-type-archive-product ul.products,
  body.tax-product_cat ul.products,
  body.tax-product_tag ul.products,
  body.woocommerce.archive ul.products{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:12px!important;
    width:100%!important;
    margin:0!important;
    padding:0!important;
    clear:both!important;
  }

  body.woocommerce-shop ul.products::before,
  body.woocommerce-shop ul.products::after,
  body.post-type-archive-product ul.products::before,
  body.post-type-archive-product ul.products::after,
  body.tax-product_cat ul.products::before,
  body.tax-product_cat ul.products::after,
  body.tax-product_tag ul.products::before,
  body.tax-product_tag ul.products::after,
  body.woocommerce.archive ul.products::before,
  body.woocommerce.archive ul.products::after{
    display:none!important;
    content:none!important;
  }

  body.woocommerce-shop ul.products li.product,
  body.post-type-archive-product ul.products li.product,
  body.tax-product_cat ul.products li.product,
  body.tax-product_tag ul.products li.product,
  body.woocommerce.archive ul.products li.product,
  body.woocommerce.archive ul.products li.product.first,
  body.woocommerce.archive ul.products li.product.last{
    float:none!important;
    clear:none!important;
    width:auto!important;
    max-width:none!important;
    min-width:0!important;
    margin:0!important;
    grid-column:auto!important;
    grid-row:auto!important;
  }

  /* Product cards keep equal width and do not push neighbouring cards */
  body.woocommerce.archive ul.products li.product img{
    width:100%!important;
    height:auto!important;
    display:block!important;
  }

  /* Compact archive header: no oversized blank space before controls/products */
  body.woocommerce.archive .woocommerce-products-header,
  body.post-type-archive-product .woocommerce-products-header,
  body.tax-product_cat .woocommerce-products-header{
    padding:10px 0 0!important;
    margin:0 0 10px!important;
  }

  body.woocommerce.archive .woocommerce-products-header__title,
  body.post-type-archive-product .woocommerce-products-header__title,
  body.tax-product_cat .woocommerce-products-header__title{
    margin:0 0 10px!important;
    padding:0!important;
  }

  /* Result count + sorting on one clean row where space allows */
  body.woocommerce.archive .woocommerce-result-count{
    margin:0 0 12px!important;
    line-height:38px!important;
  }
  body.woocommerce.archive .woocommerce-ordering{
    margin:0 0 12px!important;
  }
  body.woocommerce.archive .woocommerce-ordering select{
    max-width:100%!important;
  }
}

/* Desktop/tablet archive grid cleanup too */
body.woocommerce.archive ul.products li.product.first,
body.woocommerce.archive ul.products li.product.last{
  clear:none!important;
}


/* ===== v4.5 FIRST PRODUCT BLANK-CELL FIX =====
   Some WooCommerce/theme styles were forcing the first product into column 2.
   This explicitly anchors the first visible product in column 1 and removes
   legacy float/clear/grid offsets. */
@media(max-width:767px){

  body.woocommerce-shop ul.products,
  body.post-type-archive-product ul.products,
  body.tax-product_cat ul.products,
  body.tax-product_tag ul.products,
  body.woocommerce.archive ul.products{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
    grid-auto-flow:row!important;
    grid-auto-columns:auto!important;
    gap:12px!important;
  }

  body.woocommerce-shop ul.products > li.product,
  body.post-type-archive-product ul.products > li.product,
  body.tax-product_cat ul.products > li.product,
  body.tax-product_tag ul.products > li.product,
  body.woocommerce.archive ul.products > li.product{
    position:relative!important;
    float:none!important;
    clear:none!important;
    left:auto!important;
    right:auto!important;
    transform:none!important;
    margin:0!important;
    width:auto!important;
    max-width:none!important;
    grid-column:auto!important;
    grid-row:auto!important;
  }

  /* Hard reset for first visible product */
  body.woocommerce-shop ul.products > li.product:first-of-type,
  body.post-type-archive-product ul.products > li.product:first-of-type,
  body.tax-product_cat ul.products > li.product:first-of-type,
  body.tax-product_tag ul.products > li.product:first-of-type,
  body.woocommerce.archive ul.products > li.product:first-of-type{
    grid-column:1!important;
    grid-row:1!important;
    margin-left:0!important;
  }

  /* Second product must sit next to first, not force a new row */
  body.woocommerce-shop ul.products > li.product:nth-of-type(2),
  body.post-type-archive-product ul.products > li.product:nth-of-type(2),
  body.tax-product_cat ul.products > li.product:nth-of-type(2),
  body.tax-product_tag ul.products > li.product:nth-of-type(2),
  body.woocommerce.archive ul.products > li.product:nth-of-type(2){
    grid-column:2!important;
    grid-row:1!important;
  }

  /* From third onward let CSS Grid place naturally */
  body.woocommerce.archive ul.products > li.product:nth-of-type(n+3){
    grid-column:auto!important;
    grid-row:auto!important;
  }

  /* Kill WooCommerce legacy clearfix spacers */
  body.woocommerce.archive ul.products .woocommerce-loop-product__link::before,
  body.woocommerce.archive ul.products .woocommerce-loop-product__link::after,
  body.woocommerce.archive ul.products li.product::before,
  body.woocommerce.archive ul.products li.product::after{
    float:none!important;
    clear:none!important;
  }
}

/* Remove any invisible first placeholder injected before products */
body.woocommerce.archive ul.products > li.product[style*="visibility: hidden"],
body.woocommerce.archive ul.products > li.product[style*="display: none"]{
  display:none!important;
}
