/* PAYAYOO marketplace theme v1 – a flat, white-card "marketplace" look inspired by large Persian online shops
 * (light-grey page, white rounded sections, flat header, title + «مشاهده همه» rails, price-first product cards).
 * Brand colour stays pink: change --mk-accent to re-colour everything. To switch the theme off: remove
 * marketplace-theme.css from tools/apply-design-polish.js and run it again. */
:root{--mk-bg:#f1f2f4;--mk-line:#e5e7eb;--mk-text:#23254e;--mk-muted:#81858b;--mk-accent:#f05b88;--mk-radius:16px}
html body{background:var(--mk-bg)!important;background-image:none!important}
html body::before{display:none!important}

/* ---------- header (desktop): two rows like marketplace sites ----------
 * row 1: logo | wide search | login button | cart      row 2: «دسته‌بندی کالاها» drop-down (mega menu) + links
 * .nav-center uses display:contents so its children can be ordered inside the flex-wrap .navbar; ::after is the row break. */
@media(min-width:781px){
  /* html/body had overflow-x:hidden, which turns <body> into the scroll container and breaks position:sticky; clip does not */
  html,body{overflow-x:clip!important;overflow-y:visible!important}
  body #navMount{position:sticky;top:0;z-index:60;background:#fff!important;border-bottom:1px solid var(--mk-line)!important;box-shadow:none!important;margin:0!important;padding:0!important}
  body #navMount::before,body #navMount::after{display:none!important}
  body #navMount .navbar{display:flex!important;flex-wrap:wrap!important;justify-content:flex-start!important;align-content:flex-start;align-items:center!important;position:relative;max-width:1280px!important;width:100%!important;margin:0 auto!important;padding:0 16px!important;gap:0!important;min-height:0!important;height:auto!important;border:0!important;border-radius:0!important;box-shadow:none!important;background:transparent!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important}
  body #navMount .navbar::before{display:none!important}
  body #navMount .navbar::after{content:""!important;display:block!important;position:static!important;flex:0 0 100%;order:5;width:100%!important;height:0!important;margin:0!important;padding:0!important;background:none!important;border:0!important;box-shadow:none!important;opacity:1!important;transform:none!important}
  body #navMount .nav-center{display:contents!important}
  body #navMount .mobile-menu-auth,body #navMount .social-links,body #navMount .mobile-nav-toggle,body #navMount .mobile-header-auth{display:none!important}

  /* row 1 */
  body #navMount .navbar>.brand{order:1;margin:14px 0!important;color:var(--mk-text)!important;font-size:20px!important}
  body #navMount .dk-search{order:2;flex:1 1 auto;max-width:640px;min-width:240px;margin:14px 28px!important;height:46px;display:flex;align-items:center;gap:8px;padding:0 14px;background:#f0f0f1;border:1px solid transparent;border-radius:12px;transition:box-shadow .15s,background .15s,border-color .15s}
  body #navMount .dk-search:focus-within{background:#fff;border-color:var(--mk-accent);box-shadow:0 0 0 3px rgba(240,91,136,.14)}
  body #navMount .dk-search button{order:1;border:0!important;background:transparent!important;background-image:none!important;box-shadow:none!important;border-radius:0!important;width:auto!important;height:auto!important;min-height:0!important;color:var(--mk-muted)!important;padding:0!important;display:flex;cursor:pointer;transform:none!important}
  body #navMount .dk-search input{order:2;flex:1;min-width:0;border:0!important;outline:0!important;background:transparent!important;box-shadow:none!important;font:inherit;font-size:14px;color:var(--mk-text);padding:0!important;height:auto!important}
  body #navMount .dk-search input::placeholder{color:var(--mk-muted)}
  body #navMount .auth-actions{order:3;margin:0 0 0 0!important;margin-inline-start:auto!important;display:flex!important;align-items:center;gap:8px}
  body #navMount .nav-auth.dk-login{display:inline-flex!important;align-items:center;gap:8px;height:44px;padding:0 16px!important;background:#fff!important;color:var(--mk-text)!important;border:1px solid #d6d9de!important;border-radius:10px!important;box-shadow:none!important;font-size:13.5px!important;font-weight:700!important;white-space:nowrap}
  body #navMount .nav-auth.dk-login:hover{border-color:var(--mk-accent)!important;color:var(--mk-accent)!important}
  body #navMount .dk-login-short{display:none}
  body #navMount .nav-auth.logout{height:44px;background:transparent!important;color:var(--mk-muted)!important;border:0!important;box-shadow:none!important}
  body #navMount .cart-nav-link{order:4;position:relative;display:inline-flex!important;align-items:center;justify-content:center;width:46px;height:44px;margin-inline-start:14px;padding:0 0 0 0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;color:var(--mk-text)!important;border-inline-start:1px solid var(--mk-line)!important;padding-inline-start:14px!important;width:auto;min-width:48px}
  body #navMount .cart-nav-link .cart-ico{width:26px;height:26px}
  body #navMount .cart-nav-link .cart-badge{position:absolute;top:2px;inset-inline-start:30px;min-width:18px;height:18px;border-radius:9px;background:var(--mk-accent)!important;color:#fff!important;font-size:11px;line-height:18px;text-align:center;padding:0 4px}

  /* row 2 */
  body #navMount .nav-center>.nav-mega{order:10;position:relative}
  body #navMount .nav-center>a[href="/index.html"]{order:11}
  body #navMount .nav-center>a[href="/products.html"]{order:12}
  body #navMount .nav-center>a[href="/articles.html"]{order:13}
  body #navMount .nav-center>a[href="/account.html"]{order:14}
  body #navMount .nav-center>a[href="seller-dashboard.html"]{order:15}
  body #navMount .nav-center>a[href="/contact.html"]{order:16}
  body #navMount .nav-center>a[href="/seller-register.html"]{order:17}
  body #navMount .nav-center>.nav-dropdown:not(.nav-mega){order:18}
  body #navMount .nav-center>a:not(.cart-nav-link),body #navMount .nav-center>.nav-dropdown>button{display:inline-flex!important;align-items:center;height:44px;padding:0 14px!important;background:transparent!important;color:#3f4064!important;font-size:13.5px!important;font-weight:600!important;border:0!important;border-radius:0!important;box-shadow:none!important}
  body #navMount .nav-center>a:not(.cart-nav-link):hover,body #navMount .nav-center>.nav-dropdown>button:hover{color:var(--mk-accent)!important;background:transparent!important}
  body #navMount .nav-center>a.active:not(.cart-nav-link){color:var(--mk-accent)!important;box-shadow:inset 0 -2px 0 var(--mk-accent)!important}
  body #navMount .nav-mega>button{gap:8px;font-weight:800!important;color:var(--mk-text)!important;padding-inline-start:0!important;margin-inline-end:6px;border-inline-end:1px solid var(--mk-line)!important;padding-inline-end:16px!important}
  body #navMount .nav-mega:hover>button{color:var(--mk-accent)!important}

  /* mega menu: roots on the right, the hovered root's sub-categories on the left */
  body #navMount .mega-menu{display:none!important;position:absolute!important;top:100%;inset-inline-start:0!important;inset-inline-end:auto!important;width:min(980px,calc(100vw - 48px));min-height:340px;margin:0!important;padding:0!important;background:#fff!important;border:1px solid var(--mk-line)!important;border-top:0!important;border-radius:0 0 16px 16px!important;box-shadow:0 18px 40px rgba(20,22,50,.16)!important;overflow:hidden;z-index:80;transform:none!important;opacity:1!important;visibility:visible!important}
  body #navMount .nav-mega:hover>.mega-menu,body #navMount .nav-mega:focus-within>.mega-menu{display:flex!important}
  body #navMount .mega-menu::before{content:"";position:absolute;top:-14px;inset-inline:0;height:14px}
  body #navMount .mega-roots{flex:0 0 250px;background:#f7f7f8;padding:8px 0;border-inline-end:1px solid var(--mk-line);overflow:auto;max-height:70vh}
  body #navMount .mega-roots .mega-root{display:flex!important;align-items:center;justify-content:space-between;padding:12px 18px!important;color:var(--mk-text)!important;font-size:14px!important;font-weight:700!important;background:transparent!important;border-radius:0!important;box-shadow:none!important;text-decoration:none}
  body #navMount .mega-roots .mega-root.is-active{background:#fff!important;color:var(--mk-accent)!important;box-shadow:inset -3px 0 0 var(--mk-accent)!important}
  body #navMount .mega-roots .mega-root[data-mega]::after{content:"‹";color:var(--mk-muted);font-weight:400}
  body #navMount .mega-roots .mega-allcats{color:var(--mk-muted)!important;font-weight:600!important;border-bottom:1px solid var(--mk-line);margin-bottom:4px}
  body #navMount .mega-panels{flex:1;min-width:0;padding:20px 26px}
  body #navMount .mega-panel{display:none}
  body #navMount .mega-panel.is-active{display:block}
  body #navMount .mega-panel .mega-all{display:inline-flex!important;align-items:center;padding:0 0 12px!important;margin:0 0 12px!important;width:100%;color:var(--mk-accent)!important;font-size:14px!important;font-weight:800!important;background:transparent!important;border-bottom:1px solid var(--mk-line)!important;border-radius:0!important;box-shadow:none!important}
  body #navMount .mega-panel .mega-all::before{content:"همه محصولات ";white-space:pre}
  body #navMount .mega-panel .mega-all::after{content:" ‹";white-space:pre}
  body #navMount .mega-cols{columns:3;column-gap:28px}
  body #navMount .mega-cols a{display:block!important;break-inside:avoid;padding:8px 0!important;color:#3f4064!important;font-size:13.5px!important;font-weight:500!important;background:transparent!important;border:0!important;box-shadow:none!important;border-radius:0!important}
  body #navMount .mega-cols a:hover{color:var(--mk-accent)!important}
  body:has(#navMount .nav-mega:hover)::after{content:"";position:fixed;inset:0;background:rgba(15,16,40,.42);z-index:55;pointer-events:none}

  /* after scrolling: only row 1 stays */
  body #navMount.dk-compact .nav-center>*:not(.cart-nav-link):not(.auth-actions),body #navMount.dk-compact .navbar::after{display:none!important}
  body .top-search-section{display:none!important}
}
@media(max-width:780px){
  body #navMount .dk-search{display:none!important}
  body #navMount .dk-login-full{display:none}
  body #navMount .mega-roots .mega-root:not(.mega-allcats){display:none!important}
  body #navMount .mega-roots,body #navMount .mega-panels,body #navMount .mega-panel,body #navMount .mega-cols{display:contents!important}
  body #navMount .mega-all::before,body #navMount .mega-all::after{content:none}
}

/* ---------- search bar: flat grey field ---------- */
body .top-search-section{max-width:1240px;margin-inline:auto}
body .top-search-section :is(input,button,a,.top-search-box,form){box-shadow:none!important}
body .top-search-section .top-search-box{background:#fff!important;border:1px solid var(--mk-line)!important;border-radius:12px!important;min-height:46px}
body .top-search-section .top-search-box:hover{border-color:#cfd3da!important}
body .top-search-section .top-search-bell{background:#fff!important;color:var(--mk-accent)!important;border:1px solid var(--mk-line)!important}

/* ---------- hero, categories: contained white/rounded blocks ---------- */
body .home-main-slider-section{max-width:1240px!important;width:calc(100% - 28px)!important;margin:14px auto 16px!important;border-radius:var(--mk-radius)!important;overflow:hidden}
body #homeCategories{max-width:1240px!important;width:calc(100% - 28px)!important;box-sizing:border-box;margin:0 auto 16px!important;background:#fff;border:1px solid var(--mk-line);border-radius:var(--mk-radius);padding:14px 10px!important}
body #homeCategories .home-category-img{box-shadow:none!important;border:1px solid var(--mk-line)!important;background:#fff!important}
body #homeCategories .home-category-card h3{font-size:13px!important;font-weight:700!important;color:var(--mk-text)!important}
body #discountProductsSection:not([hidden]){max-width:1240px;width:calc(100% - 28px);margin:0 auto 16px!important;border-radius:var(--mk-radius);background:linear-gradient(135deg,#f05b88,#e0405f)!important;padding:16px 18px!important}
body #discountProductsSection :is(h2,.eyebrow,p){color:#fff!important}

/* ---------- rails: white card, title with accent bar, «مشاهده همه» ---------- */
body #latestProducts{max-width:1240px!important;width:calc(100% - 28px);margin:0 auto!important;padding:0!important}
body #latestProducts .home-rail-section{background:#fff!important;border:1px solid var(--mk-line)!important;border-radius:var(--mk-radius)!important;padding:16px 18px 18px!important;margin:0 0 16px!important;box-shadow:none!important}
body #latestProducts .rail-title{display:flex!important;align-items:center;gap:10px;text-align:right!important;margin:0 0 14px!important;padding:0!important}
body #latestProducts .rail-title>span{display:none!important}
body #latestProducts .rail-title h2{position:relative;margin:0!important;padding-inline-start:14px;font-size:18px!important;font-weight:800!important;color:var(--mk-text)!important;line-height:1.6!important;text-align:right!important}
body #latestProducts .rail-title h2::before{content:"";position:absolute;inset-inline-start:0;top:16%;bottom:16%;width:4px;border-radius:4px;background:var(--mk-accent)}
body .rail-see-all{margin-inline-start:auto;color:var(--mk-accent)!important;font-size:13px;font-weight:700;text-decoration:none;white-space:nowrap}
body .rail-see-all::after{content:" ‹"}
body #latestProducts .home-rail-section:has(.rail-see-all) .center-actions{display:none!important}
body #homeLatestArticles{max-width:1240px;width:calc(100% - 28px);margin-inline:auto!important;background:#fff;border:1px solid var(--mk-line);border-radius:var(--mk-radius);padding:18px!important}

/* ---------- product cards (desktop): flat, image + title + price. :is(#latestProducts,main) = id-strength, to beat home.min.css ---------- */
@media(min-width:781px){
  body :is(#latestProducts,main) .product-card{background:#fff!important;border:1px solid transparent!important;border-radius:12px!important;box-shadow:none!important;padding:10px!important;transition:box-shadow .2s,border-color .2s;cursor:pointer}
  body :is(#latestProducts,main) .product-card:hover{border-color:var(--mk-line)!important;box-shadow:0 8px 24px rgba(35,37,78,.10)!important;transform:none!important}
  body :is(#latestProducts,main) .product-card .product-card-image{aspect-ratio:1/1;height:auto!important;border-radius:10px!important;object-fit:cover}
  body :is(#latestProducts,main) .product-card>p:not(.price),body :is(#latestProducts,main) .product-card .specs,body :is(#latestProducts,main) .product-card .hover-summary,body :is(#latestProducts,main) .product-card .product-card-actions{display:none!important}
  body :is(#latestProducts,main) .product-card .new-price{color:var(--mk-text)!important;font-weight:800!important;font-size:15.5px!important}
  body :is(#latestProducts,#products,main) .product-card.unified-product-card .product-price .new-price{color:var(--mk-text)!important;font-weight:800!important}
  body :is(#latestProducts,main) .product-card .old-price{color:var(--mk-muted)!important;font-size:12px!important}
  body :is(#latestProducts,main) .product-card .product-media-wrap{height:auto!important;aspect-ratio:1/1!important}
  body :is(#latestProducts,main) .product-card .product-media-wrap img{width:100%!important;height:100%!important;object-fit:cover}
  body :is(#latestProducts,main) .product-card h3,body :is(#latestProducts,main) .product-card h3 a{font-size:13px!important;font-weight:700!important;color:var(--mk-text)!important;line-height:1.85!important}
  body :is(#latestProducts,main) .product-card h3{min-height:48px!important;margin:6px 0 4px!important}
  body :is(#latestProducts,main) .product-card .price,body :is(#latestProducts,main) .product-card .product-price{font-size:15.5px!important;font-weight:800!important;color:var(--mk-text)!important;text-align:left!important;margin:6px 0 0!important;min-height:0!important}
  body #latestProducts :is(#products,#bestSellerRail,#girlRail,#boyRail) .product-card .price{color:var(--mk-text)!important}
  /* home rails: one tidy row, "see all" shows the rest */
  body #latestProducts :is(#products,#bestSellerRail,#girlRail,#boyRail){grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:12px!important;padding:0!important;margin:0!important}
  body #latestProducts :is(#products,#bestSellerRail,#girlRail,#boyRail)>.product-card:nth-child(n+5){display:none!important}
  /* listing pages */
  body main .products:not(.product-rail){grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:14px!important}
}
@media(min-width:1100px){
  body #latestProducts :is(#products,#bestSellerRail,#girlRail,#boyRail){grid-template-columns:repeat(6,minmax(0,1fr))!important}
  body #latestProducts :is(#products,#bestSellerRail,#girlRail,#boyRail)>.product-card:nth-child(n+5){display:flex!important}
  body #latestProducts :is(#products,#bestSellerRail,#girlRail,#boyRail)>.product-card:nth-child(n+7){display:none!important}
  body main .products:not(.product-rail){grid-template-columns:repeat(5,minmax(0,1fr))!important}
}

/* ---------- listing pages (products / category): compact heading, white grid card, full-width cards ---------- */
@media(min-width:781px){
  body main>.section-title{display:block!important;text-align:right!important;padding:18px 4px 6px!important;margin:0!important}
  body main>.section-title h1{font-size:24px!important;line-height:1.6!important;margin:0 0 4px!important;text-align:right!important}
  body main>.section-title>span{display:none!important}
  body main>.section-title p{font-size:13px!important;color:var(--mk-muted)!important;margin:0!important;text-align:right!important}
  body main .advanced-search-toggle{background:#fff!important;color:var(--mk-text)!important;border:1px solid var(--mk-line)!important;box-shadow:none!important;border-radius:10px!important}
  body main #products.all-products,body main .products.category-products{background:#fff;border:1px solid var(--mk-line);border-radius:var(--mk-radius);padding:14px!important}
  body main .products:not(.product-rail)>.product-card{width:100%!important;max-width:none!important;min-width:0!important}
  body main .products:not(.product-rail) .product-card .price{color:var(--mk-text)!important}
}

/* ---------- mobile: same flat sections ---------- */
@media(max-width:780px){
  body #latestProducts .home-rail-section{background:#fff!important;border:1px solid var(--mk-line)!important;border-radius:14px!important;padding:12px!important;margin:0 0 12px!important;box-shadow:none!important}
  body #latestProducts .rail-title{display:flex!important;align-items:center;text-align:right!important;margin:0 0 10px!important}
  body #latestProducts .rail-title>span{display:none!important}
  body #latestProducts .rail-title h2{position:relative;margin:0!important;padding-inline-start:12px;font-size:16px!important;font-weight:800!important;text-align:right!important}
  body #latestProducts .rail-title h2::before{content:"";position:absolute;inset-inline-start:0;top:16%;bottom:16%;width:4px;border-radius:4px;background:var(--mk-accent)}
  body #homeCategories{background:#fff;border:1px solid var(--mk-line);border-radius:14px;margin:0 10px 12px!important}
  body #homeLatestArticles{background:#fff;border:1px solid var(--mk-line);border-radius:14px;margin-inline:10px!important;padding:14px!important}
}

/* ---------- both: dark price (marketplace style), flat header line ---------- */
body :is(#latestProducts,#products,main) .product-card.unified-product-card .product-price .new-price{color:var(--mk-text)!important}
@media(max-width:780px){
  body #navMount{background:#fff!important;border-bottom:1px solid var(--mk-line)!important;box-shadow:none!important}
  body #navMount::before,body #navMount::after,body #navMount .navbar::before,body #navMount .navbar::after{display:none!important}
  body #navMount .navbar{background:transparent!important;box-shadow:none!important;border:0!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important}
}

/* ---------- footer: white block with a top line ---------- */
body footer.footer{background:#fff!important;border-top:1px solid var(--mk-line)!important;border-radius:0!important;box-shadow:none!important;margin-top:24px!important}
body footer.footer .home-footer-shell{background:transparent!important;box-shadow:none!important}
body footer.footer button[type=submit],body footer.footer form button{background:var(--mk-accent)!important;background-image:none!important;color:#fff!important;box-shadow:none!important}
