/*
Theme Name: Apex Market
Version: 1.0.4
Description: Lekki motyw sklepu WooCommerce z nawigacją katalogową.
Text Domain: apex-market
*/
*{box-sizing:border-box}body{margin:0;background:#f6f5f2;color:#292724;font:16px/1.5 system-ui,sans-serif}a{color:inherit;text-decoration:none}a:hover{color:#927044}img{max-width:100%;height:auto}button,input,select{font:inherit}button,.button,input[type=submit]{cursor:pointer} .ap-wrap{max-width:1440px;margin:auto;padding:0 24px}.ap-header{background:white;border-bottom:1px solid #e6e2db;position:relative;z-index:10}.ap-top{display:flex;align-items:center;gap:24px;padding:20px 0}.ap-logo{font-size:24px;font-weight:750;letter-spacing:2px;white-space:nowrap}.ap-search{display:flex;flex:1;position:relative;border:1px solid #bcb7af;border-radius:6px}.ap-search input{min-width:0;flex:1;border:0;padding:12px;background:transparent}.ap-search select{max-width:180px;border:0;border-left:1px solid #ddd;background:white}.ap-search button,.ap-btn{background:#806344;color:white;border:0;padding:12px 18px;border-radius:4px}.ap-actions{display:flex;gap:16px;white-space:nowrap}.ap-nav{display:flex;gap:24px;align-items:center;padding:0 0 14px;flex-wrap:wrap}.ap-nav details{position:relative}.ap-nav summary{cursor:pointer;font-weight:700}.ap-menu{position:absolute;background:white;box-shadow:0 8px 30px #0002;width:320px;max-height:70vh;overflow:auto;padding:16px;z-index:20}.ap-cats{list-style:none;padding:0;margin:0}.ap-cats li{padding:5px 0}.ap-cats ul{list-style:none;padding-left:16px}.ap-cats a{display:block}.ap-layout{display:grid;grid-template-columns:245px minmax(0,1fr);gap:24px;margin:24px auto}.ap-side,.ap-main{background:white;border:1px solid #e8e4dd;border-radius:8px;padding:20px;min-width:0}.ap-side h3{font-size:17px;margin:0 0 12px}.ap-side hr{border:0;border-top:1px solid #ddd;margin:20px 0}.ap-filter label{display:block;margin:8px 0}.ap-filter input[type=number],.ap-filter select{width:100%;padding:8px;border:1px solid #ccc;border-radius:4px}.ap-filter button{width:100%;margin-top:12px}.ap-main h1{font-size:28px}.woocommerce ul.products{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}.woocommerce ul.products:before,.woocommerce ul.products:after{display:none}.woocommerce ul.products li.product{width:auto!important;float:none!important;margin:0!important;padding:12px;border:1px solid #e8e4dd;border-radius:8px;display:flex;flex-direction:column}.woocommerce ul.products li.product img{aspect-ratio:1;object-fit:contain}.woocommerce ul.products li.product .button{margin-top:auto;text-align:center}.woocommerce ul.products li.product .price{color:#292724;font-size:18px;font-weight:700}.woocommerce a.button,.woocommerce button.button,.woocommerce button.button.alt,.woocommerce a.button.alt{background:#806344;color:white}.ap-footer{padding:30px 0;border-top:1px solid #ddd;background:white}.ap-suggestions{position:absolute;top:100%;left:0;right:0;background:white;box-shadow:0 8px 20px #0002;z-index:30}.ap-suggestions a{display:flex;align-items:center;gap:12px;padding:10px;border-bottom:1px solid #eee}.ap-suggestions img{width:48px;height:48px;object-fit:contain}.ap-suggestions span{margin-left:auto}.ap-mobile{display:none}.ap-content{margin:24px auto;background:white;padding:24px;border-radius:8px}.ap-active{padding:8px 0;display:flex;gap:8px;flex-wrap:wrap}.ap-active a{background:#eee;padding:5px 10px;border-radius:20px}.ap-side-toggle{display:none}@media(max-width:1000px){.woocommerce ul.products{grid-template-columns:repeat(3,minmax(0,1fr))}.ap-top{flex-wrap:wrap}.ap-search{order:3;flex-basis:100%}.ap-actions{margin-left:auto}}@media(max-width:700px){.ap-wrap{padding:0 12px}.ap-top{gap:12px;padding:12px 0}.ap-logo{font-size:19px}.ap-search select{display:none}.ap-nav{gap:12px;font-size:14px}.ap-layout{display:block;margin:12px auto}.ap-side{display:none;margin-bottom:12px}.ap-side.is-open{display:block}.ap-side-toggle{display:block;margin-bottom:10px}.ap-main{padding:12px}.woocommerce ul.products{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.woocommerce ul.products li.product{padding:8px}.ap-mobile{display:flex;position:fixed;bottom:0;left:0;right:0;background:white;border-top:1px solid #ddd;justify-content:space-around;padding:12px 4px;z-index:50;font-size:12px}body{padding-bottom:55px}.ap-actions{font-size:13px}.ap-main h1{font-size:23px}}

/* Storefront layout isolation from legacy builder styles. */
body .ap-layout{display:grid!important;grid-template-columns:245px minmax(0,1fr);gap:24px;align-items:start;width:100%;}
body .ap-layout>.ap-side{display:block;grid-column:1;min-width:0;}
body .ap-layout>.ap-main{grid-column:2;min-width:0;}
body .ap-cats,body .ap-cats ul{list-style:none!important;margin:0!important;padding:0!important;}
body .ap-cats ul{padding-left:12px!important;}
body .ap-cats li{list-style:none!important;margin:0!important;padding:7px 0!important;border-bottom:1px solid #eee;}
body .ap-cats details summary{font-size:12px;color:#806344;cursor:pointer;}
body .ap-nav>details:not([open])>.ap-menu{display:none!important;}
body .ap-nav>ul{list-style:none;margin:0;padding:0;}
body .ap-mobile{display:none!important;}
body .ap-side-toggle{display:none!important;}
body .ap-main .woocommerce ul.products,body .ap-main ul.products{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;}
body .ap-main ul.products li.product{width:auto!important;float:none!important;margin:0!important;}
@media(max-width:1100px){body .ap-main ul.products,body .ap-main .woocommerce ul.products{grid-template-columns:repeat(3,minmax(0,1fr));}}
@media(max-width:700px){body .ap-layout{display:block!important;}body .ap-layout>.ap-side{display:none;}body .ap-layout>.ap-side.is-open{display:block;}body .ap-side-toggle{display:block!important;}body .ap-mobile{display:flex!important;}body .ap-main ul.products,body .ap-main .woocommerce ul.products{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}}

/* Header: matching Apex navigation */
body .ap-header{background:#fff;color:#171717;border-bottom:1px solid #e5e2de;font-family:system-ui,sans-serif;}
body .ap-header .ap-top{display:flex;flex-wrap:wrap;gap:16px;align-items:center;padding:16px 0 12px;}
body .ap-header .ap-logo{font-size:24px;letter-spacing:2px;font-weight:750;color:#171717;line-height:1.2;}
.ap-logo-img{max-width:180px;max-height:56px;object-fit:contain;}
body .ap-header .ap-actions{margin-left:auto;display:flex;gap:18px;align-items:center;}
body .ap-header .ap-action{display:flex;flex-direction:column;align-items:center;gap:4px;font-size:12px;color:#171717;text-decoration:none;min-width:48px;padding:5px;border-radius:12px;}
.ap-header .ap-action svg,.ap-header .ap-cat-trigger svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;}
body .ap-header .ap-action:hover,body .ap-header .ap-cat-trigger:hover{background:#f7f3ed;color:#806344;}
body .ap-header .ap-search{order:3;flex:1 0 100%;display:flex;align-items:center;border:1px solid #e5e2de;border-radius:14px;padding:4px;min-width:0;background:#fff;}
.ap-search-icon{width:22px;height:22px;margin-left:10px;flex:none;color:#555;}
body .ap-header .ap-search input{font-size:16px;min-width:0;padding:10px;border:0;box-shadow:none;background:transparent;}
body .ap-header .ap-search button{border-radius:10px;padding:10px 18px;background:#806344;color:#fff;}
body .ap-header .ap-search select{padding:8px;max-width:200px;}
body .ap-header .ap-nav{border-top:1px solid #eee;padding:10px 0;gap:20px;}
body .ap-header .ap-cat-trigger{display:flex;align-items:center;gap:8px;background:#fff;color:#171717;border:1px solid #e5e2de;border-radius:10px;padding:8px 12px;font-weight:600;}
.ap-suggestions:empty{display:none}.ap-suggestions{max-height:45vh;overflow:auto;border-radius:12px;}
@media(max-width:700px){body .ap-header .ap-logo{font-size:20px;}body .ap-header .ap-actions{gap:4px;}body .ap-header .ap-wish,body .ap-header .ap-account{display:none;}body .ap-header .ap-nav{flex-wrap:nowrap;overflow-x:auto;white-space:nowrap;gap:10px;}body .ap-header .ap-nav>a{border:1px solid #e5e2de;border-radius:20px;padding:7px 12px;}body .ap-header .ap-search button{padding:10px 12px;}body .ap-header .ap-search select{display:none;}}
/* Compact category navigation */
.ap-cat-row{display:flex;align-items:center;gap:4px;min-height:38px}.ap-cat-row>a{flex:1;min-width:0;padding:6px 0;overflow-wrap:anywhere}.ap-cat-row>a[aria-current=page]{font-weight:700;color:#806344}.ap-branch-toggle{flex:none;width:34px;height:36px;border:0;background:transparent;color:#806344;border-radius:6px;padding:8px}.ap-branch-toggle svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.ap-branch-toggle[aria-expanded=true] svg{transform:rotate(90deg)}.ap-branch-toggle:hover,.ap-cat-row:hover{background:#f7f3ed}.ap-branch[hidden],.ap-mega[hidden],.ap-mega section[hidden]{display:none!important}body .ap-cats li{padding:0!important;border-bottom:0}body .ap-cats ul{border-left:1px solid #e5ddd2;margin-left:8px!important;padding-left:10px!important}.ap-mega-anchor{position:relative}.ap-mega{position:absolute;top:calc(100% + 8px);left:0;width:min(900px,calc(100vw - 48px));max-height:70vh;overflow:auto;display:grid;grid-template-columns:230px minmax(0,1fr);background:#fff;border:1px solid #e5e2de;border-radius:12px;box-shadow:0 12px 35px #0002;z-index:100}.ap-mega-roots{padding:10px;border-right:1px solid #eee}.ap-mega-roots button{display:flex;justify-content:space-between;align-items:center;text-align:left;width:100%;padding:12px 10px;border:0;background:white;color:#292724;border-radius:7px;gap:8px}.ap-mega-roots button[aria-pressed=true]{background:#f1e9df;color:#806344;font-weight:600}.ap-mega-content{padding:20px;min-width:0}.ap-mega-title{display:block;font-size:19px;font-weight:700;margin-bottom:16px}.ap-mega-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}.ap-mega-group{font-weight:700;display:block;margin-bottom:6px}.ap-mega .ap-cat-row{font-size:14px;min-height:32px}.ap-mega .ap-cat-row>a{padding:3px 0}.ap-mega .ap-branch-toggle{height:30px;width:28px;padding:5px}.ap-mega button:focus-visible,.ap-branch-toggle:focus-visible{outline:2px solid #806344;outline-offset:2px}@media(max-width:700px){.ap-mega{position:fixed;top:100px;left:12px;right:12px;width:auto;max-height:70dvh;grid-template-columns:1fr;white-space:normal}.ap-mega-roots{border-right:0;border-bottom:1px solid #eee}.ap-mega-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Catalog-only logo and credits */
body.ap-market-catalog .ap-header .ap-logo{display:flex!important;align-items:center;justify-content:flex-start;position:static!important;transform:none!important;margin:0!important;padding:0!important;min-width:0;flex:0 1 auto;line-height:1.2;}
body.ap-market-catalog .ap-header .ap-logo-img{display:block!important;position:static!important;transform:none!important;margin:0!important;width:auto!important;height:auto!important;max-width:180px!important;max-height:56px!important;object-fit:contain;}
body.ap-market-catalog .ap-footer{background:#303030;color:#eee;padding:14px 0;border-top:0;}
body.ap-market-catalog .ap-footer .ap-credits{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;font-size:12px;line-height:1.5;}
body.ap-market-catalog .ap-footer a{color:#fff;text-decoration:none;}
body.ap-market-catalog .ap-credit-author{display:inline-flex;align-items:center;gap:5px;white-space:nowrap;}
body.ap-market-catalog .ap-credit-author img{display:block;height:16px;width:auto;max-width:100px;object-fit:contain;}
@media(max-width:700px){body.ap-market-catalog .ap-header .ap-top{display:grid!important;grid-template-columns:minmax(0,1fr) auto;align-items:center!important;gap:10px;padding:14px 0 10px!important;}body.ap-market-catalog .ap-header .ap-logo{grid-column:1;grid-row:1;min-height:48px;align-self:center!important;}body.ap-market-catalog .ap-header .ap-logo-img{max-width:min(180px,100%)!important;max-height:48px!important;}body.ap-market-catalog .ap-header .ap-actions{grid-column:2;grid-row:1;margin:0!important;align-self:center;}body.ap-market-catalog .ap-header .ap-search{grid-column:1/-1;grid-row:2;width:100%;box-sizing:border-box;}body.ap-market-catalog .ap-footer .ap-credits{justify-content:center;text-align:center;flex-direction:column;gap:6px;}}

/* Mobile product buttons: keep the complete WooCommerce label visible. */
@media (max-width:700px) {
 body.ap-market-catalog .ap-main ul.products li.product {min-width:0;}
 body.ap-market-catalog .ap-main ul.products li.product a.button,
 body.ap-market-catalog .ap-main ul.products li.product button.button {
  box-sizing:border-box!important; width:100%!important; max-width:100%!important; min-width:0!important;
  display:flex!important; align-items:center; justify-content:center; flex-wrap:wrap;
  padding:8px 4px!important; min-height:44px; height:auto!important;
  font-size:12px!important; line-height:1.25!important; letter-spacing:normal!important;
  white-space:normal!important; overflow:visible!important; text-overflow:clip!important;
  overflow-wrap:anywhere; text-align:center; margin-left:0!important; margin-right:0!important;
 }
}

/* Full-width desktop catalog; mobile and other pages unchanged. */
@media (min-width:1101px) {
 body.ap-market-catalog {width:100%;max-width:none;margin-left:0;margin-right:0;}
 body.ap-market-catalog .ap-header > .ap-wrap,
 body.ap-market-catalog .ap-wrap.ap-layout,
 body.ap-market-catalog .ap-footer > .ap-wrap {
  width:100%!important;max-width:none!important;box-sizing:border-box;
  padding-left:24px;padding-right:24px;margin-left:auto;margin-right:auto;
 }
 body.ap-market-catalog .ap-main ul.products,
 body.ap-market-catalog .ap-main .woocommerce ul.products {
  grid-template-columns:repeat(4,minmax(0,1fr));
 }
}
@media (min-width:1600px) {
 body.ap-market-catalog .ap-main ul.products,
 body.ap-market-catalog .ap-main .woocommerce ul.products {grid-template-columns:repeat(5,minmax(0,1fr));}
}
@media (min-width:1920px) {
 body.ap-market-catalog .ap-main ul.products,
 body.ap-market-catalog .ap-main .woocommerce ul.products {grid-template-columns:repeat(6,minmax(0,1fr));}
}

/* Native category disclosure: no JavaScript dependency. */
.ap-native-branch>summary{list-style:none;cursor:pointer;justify-content:space-between;letter-spacing:normal;text-transform:none;line-height:1.4;padding:6px 0;}
.ap-native-branch>summary::-webkit-details-marker{display:none;}
.ap-native-branch>summary>span{flex:1;min-width:0;overflow-wrap:anywhere;}
.ap-native-branch>summary>svg{width:18px;height:18px;flex:none;margin:0 8px;fill:none;stroke:#806344;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;}
.ap-native-branch[open]>summary>svg{transform:rotate(90deg);}
.ap-native-branch:not([open])>.ap-branch{display:none!important;}
.ap-native-branch>summary:focus-visible{outline:2px solid #806344;outline-offset:2px;}
.ap-all-category{display:block;font-size:13px;color:#806344;padding:6px 0 6px 10px;}

/* Consistent category typography and compact mega navigation. */
body.ap-market-catalog .ap-side .ap-cats .ap-cat-row,
body.ap-market-catalog .ap-side .ap-cats .ap-cat-row>a,
body.ap-market-catalog .ap-side .ap-cats .ap-cat-row>span{font-family:inherit!important;font-size:15px!important;font-weight:400;line-height:1.5!important;letter-spacing:normal!important;color:#292724!important;text-transform:none!important;}
body.ap-market-catalog .ap-side .ap-cats .ap-cat-row{min-height:38px;padding:6px 0;}
body.ap-market-catalog .ap-side .ap-cats .ap-cat-row>a{padding:0;}
body.ap-market-catalog .ap-side .ap-cats .ap-cat-row>a[aria-current=page]{font-weight:600;color:#806344!important;}
.ap-mega-roots .ap-mega-leaf{display:flex;align-items:center;min-height:44px;padding:10px;border-radius:7px;color:#292724;text-decoration:none;font-size:15px;line-height:1.4;}
.ap-mega-roots .ap-mega-leaf:hover,.ap-mega-roots .ap-mega-leaf:focus-visible{background:#f1e9df;color:#806344;}
.ap-mega-links,.ap-mega-links ul{list-style:none!important;padding:0!important;margin:0!important;}
.ap-mega-links li{margin:0!important;padding:3px 0!important;line-height:1.4;}
.ap-mega-links a{font-size:14px;color:#444;text-decoration:none;display:block;}
.ap-mega-links a:hover{text-decoration:underline;color:#806344;}
.ap-mega-links ul{padding-left:10px!important;border-left:1px solid #e5ddd2;}
.ap-mega-grid{align-items:start;gap:20px 24px;}
.ap-mega-only-roots{grid-template-columns:1fr;width:min(280px,90vw);}
.ap-mega-only-roots .ap-mega-content{display:none;}

/* Mobile catalog: show full product names and descriptions. */
@media (max-width:700px) {
 body.ap-market-catalog .ap-main ul.products li.product,
 body.ap-market-catalog .ap-main ul.products li.product .woocommerce-loop-product__link {min-width:0;max-width:100%;height:auto!important;overflow:visible!important;}
 body.ap-market-catalog .ap-main ul.products li.product .woocommerce-loop-product__title,
 body.ap-market-catalog .ap-main ul.products li.product h2,
 body.ap-market-catalog .ap-main ul.products li.product h3,
 body.ap-market-catalog .ap-main ul.products li.product .product-title,
 body.ap-market-catalog .ap-main ul.products li.product .woocommerce-product-details__short-description,
 body.ap-market-catalog .ap-main ul.products li.product .woocommerce-product-details__short-description p {
 display:block!important;white-space:normal!important;overflow:visible!important;text-overflow:clip!important;
 -webkit-line-clamp:unset!important;line-clamp:unset!important;max-height:none!important;height:auto!important;
 overflow-wrap:anywhere!important;word-break:normal!important;line-height:1.4!important;
 }
 body.ap-market-catalog .ap-main ul.products li.product .woocommerce-loop-product__title {font-size:14px!important;}
}
