/*
 * SHARPI — Homepage UX Pack
 * Wersja: 1.1.6
 * Zakres: tylko strona główna (body.sharpi-home)
 */

/* ============================================================
   Bazowe kontenery i rytm
============================================================ */
body.sharpi-home {
  --sharpi-accent: #ff8a00;
  --sharpi-card-bg: #ffffff;
  --sharpi-surface: #f6f6f6;
  --sharpi-text: #0b0b0b;
  --sharpi-muted: #6b7280;
  --sharpi-radius: 16px;
  --sharpi-shadow: 0 10px 30px rgba(0,0,0,.08);
}


/* ============================================================
   Nagłówki sekcji (WYŁĄCZONE — stabilność)
   Neutralizacja ewentualnych pozostałości po starszych wersjach
============================================================ */
body.sharpi-home .sharpi-section-heading{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  white-space:normal !important;
  word-break:normal !important;
  overflow-wrap:normal !important;
  text-align:center !important;
  margin: 0 auto 18px !important;
  grid-column: 1 / -1 !important;
  justify-self: center !important;
  flex: 0 0 100% !important;
}
body.sharpi-home .sharpi-section-heading::before,
body.sharpi-home .sharpi-section-heading::after{
  content:none !important;
  display:none !important;
}

/* ============================================================
   Nagłówek: menu w 1 linii (bez łamania) + przewijanie poziome
   Uwaga: klasa .sharpi-nav-nowrap jest dodawana przez JS do UL z głównym menu.
============================================================ */
body.sharpi-home .sharpi-nav-nowrap {
  display: flex !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

body.sharpi-home .sharpi-nav-nowrap::-webkit-scrollbar {
  display: none;
}

body.sharpi-home .sharpi-nav-nowrap > li {
  flex: 0 0 auto;
}

body.sharpi-home .sharpi-section {
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

body.sharpi-home .sharpi-section + .sharpi-section {
  margin-top: 48px;
}

body.sharpi-home .sharpi-section__title {
  margin: 0 0 18px 0;
  text-align: center;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 12px;
}

body.sharpi-home .sharpi-section__title::after {
  content: "";
  display: block;
  width: 20px;
  height: 2px;
  margin: 10px auto 0;
  background: var(--sharpi-accent);
  border-radius: 2px;
}

/* Ukryj duplikat paska USP pod hero (ten w formie "pigułki") */
body.sharpi-home .sharpi-usp-strip-duplicate {
  display: none !important;
}

/* ============================================================
   Wyszukiwarka (jeśli jest Ajax Search) — porządek wizualny
   Obsługa popularnych pluginów: FiboSearch (dgwt-wcas) i AWS.
============================================================ */
body.sharpi-home.sharpi-has-ajax-search .dgwt-wcas-search-wrapp,
body.sharpi-home.sharpi-has-ajax-search .aws-search-form {
  border-radius: 999px;
}

body.sharpi-home.sharpi-has-ajax-search .dgwt-wcas-search-wrapp input,
body.sharpi-home.sharpi-has-ajax-search .aws-search-field {
  border-radius: 999px !important;
  padding: 12px 14px !important;
  border: 1px solid rgba(0,0,0,.12) !important;
  box-shadow: 0 10px 28px rgba(0,0,0,.08) !important;
}

body.sharpi-home.sharpi-has-ajax-search .dgwt-wcas-suggestions-wrapp,
body.sharpi-home.sharpi-has-ajax-search .aws-results-container {
  border-radius: 16px !important;
  box-shadow: 0 18px 46px rgba(0,0,0,.14) !important;
  overflow: hidden;
}

body.sharpi-home.sharpi-has-ajax-search .dgwt-wcas-suggestion,
body.sharpi-home.sharpi-has-ajax-search .aws_result_item {
  padding: 12px 14px !important;
}

/* ============================================================
   HERO — dołóż panel po prawej i popraw czytelność
============================================================ */
body.sharpi-home .sharpi-hero {
  position: relative;
}

body.sharpi-home .sharpi-hero .sharpi-hero-panel {
  position: absolute;
  top: 50%;
  right: clamp(14px, 3vw, 72px);
  transform: translateY(-50%);
  width: min(360px, 32vw);
  max-width: calc(100% - 24px);
  background: rgba(0,0,0,.45);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 18px;
  padding: 16px 16px 14px;
  color: #fff;
}

/* Ukryj pusty placeholder w hero (półprzezroczysty prostokąt) */
body.sharpi-home .sharpi-hero .sharpi-hero-ghost {
  display: none !important;
}

body.sharpi-home .sharpi-hero-panel__title {
  font-weight: 800;
  font-size: 14px;
  margin: 0 0 8px;
  letter-spacing: .02em;
}

body.sharpi-home .sharpi-hero-panel__meta {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
}

body.sharpi-home .sharpi-hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  font-size: 12px;
  line-height: 1.2;
}

body.sharpi-home .sharpi-hero-panel__cta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

body.sharpi-home .sharpi-hero-panel__cta a,
body.sharpi-home .sharpi-hero-panel__cta button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 10px 12px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

body.sharpi-home .sharpi-cta--primary {
  background: var(--sharpi-accent);
  color: #111;
}

body.sharpi-home .sharpi-cta--ghost {
  background: rgba(255,255,255,.10);
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
}

@media (max-width: 980px) {
  body.sharpi-home .sharpi-hero .sharpi-hero-panel {
    position: static;
    transform: none;
    width: auto;
    margin: 14px 16px 0;
  }
}

/* ============================================================
   Pasek: "Dobierz ostrzałkę w 30 sekund" (wstrzykiwany)
============================================================ */
body.sharpi-home .sharpi-quick-assistant {
  background: var(--sharpi-card-bg);
  border-radius: var(--sharpi-radius);
  box-shadow: var(--sharpi-shadow);
  padding: 18px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

/* Lekki "overlap" na hero – usuwa wrażenie pustki między hero a środkiem strony */
body.sharpi-home .sharpi-quick-wrap {
  margin-top: -34px;
  position: relative;
  z-index: 5;
}

@media (max-width: 740px) {
  body.sharpi-home .sharpi-quick-wrap {
    margin-top: -18px;
  }
}

body.sharpi-home .sharpi-quick-assistant__left {
  display: grid;
  gap: 4px;
}

body.sharpi-home .sharpi-quick-assistant__title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .01em;
}

body.sharpi-home .sharpi-quick-assistant__desc {
  margin: 0;
  color: var(--sharpi-muted);
  font-size: 13px;
}

body.sharpi-home .sharpi-quick-assistant__right {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

body.sharpi-home .sharpi-quick-assistant__right a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
  text-decoration: none;
}

body.sharpi-home .sharpi-quick-assistant__right a.sharpi-assistant-primary {
  background: var(--sharpi-accent);
  color: #111;
}

body.sharpi-home .sharpi-quick-assistant__right a.sharpi-assistant-secondary {
  background: #111;
  color: #fff;
}

@media (max-width: 740px) {
  body.sharpi-home .sharpi-quick-assistant {
    flex-direction: column;
    align-items: flex-start;
  }
  body.sharpi-home .sharpi-quick-assistant__right {
    width: 100%;
    justify-content: flex-start;
  }
}

/* ============================================================
   Kategorie — większe karty, lepszy hover i równy grid
============================================================ */
body.sharpi-home .sharpi-categories-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 980px) {
  body.sharpi-home .sharpi-categories-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  body.sharpi-home .sharpi-categories-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

body.sharpi-home .sharpi-category-card {
  background: var(--sharpi-card-bg);
  border-radius: var(--sharpi-radius);
  box-shadow: 0 8px 20px rgba(0,0,0,.06);
  padding: 16px;
  text-decoration: none;
  color: var(--sharpi-text);
  display: grid;
  gap: 10px;
  transition: transform .15s ease, box-shadow .15s ease;
}

body.sharpi-home .sharpi-category-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(0,0,0,.10);
}

body.sharpi-home .sharpi-category-card__icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255,138,0,.14);
  border: 1px solid rgba(255,138,0,.24);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.sharpi-home .sharpi-category-card__icon svg {
  width: 22px;
  height: 22px;
  color: var(--sharpi-accent);
}

body.sharpi-home .sharpi-category-card__title {
  margin: 0;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: .01em;
}

body.sharpi-home .sharpi-category-card__meta {
  margin: 0;
  color: var(--sharpi-muted);
  font-size: 12px;
  line-height: 1.35;
}

body.sharpi-home .sharpi-category-card__btn {
  margin-top: 2px;
  display: inline-flex;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f2f2f2;
  color: #111;
  font-weight: 800;
  font-size: 12px;
}

/* ============================================================
   Produkty (Woo blocks) — szerszy grid, większa czytelność kart
============================================================ */
body.sharpi-home .sharpi-products-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 18px !important;
  align-items: stretch;
}

@media (max-width: 980px) {
  body.sharpi-home .sharpi-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

body.sharpi-home .sharpi-product-card {
  background: var(--sharpi-card-bg) !important;
  border-radius: var(--sharpi-radius) !important;
  box-shadow: 0 8px 22px rgba(0,0,0,.06) !important;
  padding: 14px !important;
  display: grid !important;
  gap: 10px !important;
  height: 100% !important;
}

body.sharpi-home .sharpi-product-card img {
  width: 100% !important;
  height: auto !important;
  border-radius: 12px !important;
}

body.sharpi-home .sharpi-product-title {
  margin: 0 !important;
  font-weight: 900 !important;
  font-size: 13px !important;
  line-height: 1.25 !important;
}

body.sharpi-home .sharpi-product-price {
  font-weight: 900 !important;
  font-size: 13px !important;
}

body.sharpi-home .sharpi-add-to-cart,
body.sharpi-home .sharpi-product-card button,
body.sharpi-home .sharpi-product-card .wp-block-button__link {
  width: 100% !important;
  border-radius: 999px !important;
  padding: 10px 14px !important;
  font-weight: 900 !important;
}

body.sharpi-home .sharpi-add-to-cart {
  background: #111 !important;
  color: #fff !important;
}

body.sharpi-home .sharpi-add-to-cart:hover {
  filter: brightness(1.05);
}

/* ============================================================
   "Zobacz więcej" pod sekcjami (Popularne teraz / Promocje)
============================================================ */
body.sharpi-home .sharpi-view-more-wrap {
  text-align: center;
  margin-top: 18px;
}

body.sharpi-home a.sharpi-view-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 13px;
  text-decoration: none;
  background: rgba(255,138,0,.14);
  color: #111;
  border: 1px solid rgba(255,138,0,.35);
}

body.sharpi-home a.sharpi-view-more:hover {
  background: rgba(255,138,0,.22);
}

/* ============================================================
   Stopka / trust row (wstrzykiwany)
============================================================ */
body.sharpi-home .sharpi-trust-row {
  background: #0f0f10;
  color: #fff;
  border-radius: 20px;
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 980px) {
  body.sharpi-home .sharpi-trust-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

body.sharpi-home .sharpi-trust-item {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  padding: 12px;
  display: grid;
  gap: 4px;
}

body.sharpi-home .sharpi-trust-item__title {
  font-weight: 900;
  font-size: 13px;
  margin: 0;
}

body.sharpi-home .sharpi-trust-item__desc {
  margin: 0;
  color: rgba(255,255,255,.78);
  font-size: 12px;
  line-height: 1.35;
}

body.sharpi-home .sharpi-trust-item a {
  color: #fff;
  text-decoration: none;
}

body.sharpi-home .sharpi-trust-item a:hover {
  text-decoration: underline;
}

/* ============================================================
   Drobne porządki: nagłówki i odstępy w sekcjach
============================================================ */
body.sharpi-home .sharpi-section p {
  margin: 0;
}

/* ============================================================
   Szukajka (opcjonalnie) — styling pod popularne wtyczki
   - FiboSearch (dgwt-wcas)
   - Ajax Search (aws)
============================================================ */
body.sharpi-home.sharpi-has-ajax-search .dgwt-wcas-search-wrapp input[type="search"],
body.sharpi-home.sharpi-has-ajax-search .aws-search-field {
  border-radius: 999px !important;
  padding: 12px 14px !important;
  border: 1px solid rgba(0,0,0,.10) !important;
  outline: none;
}

body.sharpi-home.sharpi-has-ajax-search .dgwt-wcas-search-wrapp input[type="search"]:focus,
body.sharpi-home.sharpi-has-ajax-search .aws-search-field:focus {
  border-color: rgba(255,138,0,.55) !important;
  box-shadow: 0 0 0 4px rgba(255,138,0,.18) !important;
}

body.sharpi-home.sharpi-has-ajax-search .dgwt-wcas-suggestions-wrapp,
body.sharpi-home.sharpi-has-ajax-search .aws-search-result {
  border-radius: 16px !important;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0,0,0,.18) !important;
}


/* ============================================================
   Kategorie — wygląd 1:1 jak w mockupie (kafelki + ilustracje)
============================================================ */

body.sharpi-home .sharpi-home-manager-cats{
  max-width: 1240px;
  margin: 0 auto 34px;
  padding: 0 24px;
}

body.sharpi-home .sharpi-home-manager-cats .sharpi-section-head{
  text-align: center;
  margin: 18px 0 16px;
}

body.sharpi-home .sharpi-home-manager-cats .sharpi-section-title{
  margin: 0;
  font-weight: 900;
  letter-spacing: -.02em;
  font-size: clamp(16px, 1.6vw, 18px);
}

body.sharpi-home .sharpi-home-manager-cats .sharpi-section-underline{
  width: 34px;
  height: 3px;
  border-radius: 999px;
  background: var(--sharpi-accent);
  margin: 10px auto 0;
}

body.sharpi-home .sharpi-cat-mockup-grid{
  display: flex;
  gap: 22px;
  justify-content: center;
  align-items: stretch;
  flex-wrap: wrap;
}

/* Desktop: zawsze jedna linia (bez zawijania) */
@media (min-width: 1024px){
  body.sharpi-home .sharpi-cat-mockup-grid{ flex-wrap: nowrap; }
}

/* Bezpieczniki: jeżeli jakiś skrypt wstrzyknie stare elementy (ikonki/meta) do mockupu — ukrywamy je */
body.sharpi-home .sharpi-cat-mockup-card .sharpi-category-card__icon,
body.sharpi-home .sharpi-cat-mockup-card .sharpi-category-card__meta{
  display: none !important;
}

body.sharpi-home .sharpi-cat-mockup-card{
  width: 210px;
  background: #fff;
  border: 1px solid rgba(17,24,39,.10);
  border-radius: 18px;
  box-shadow: 0 18px 46px rgba(0,0,0,.16);
  padding: 16px 16px 14px;
  text-decoration: none !important;
  color: inherit !important;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

body.sharpi-home .sharpi-cat-mockup-card:hover{
  transform: translateY(-4px);
  box-shadow: 0 22px 55px rgba(0,0,0,.22);
  border-color: rgba(255,138,0,.55);
}

body.sharpi-home .sharpi-cat-mockup-illus{
  height: 118px;
  border-radius: 16px;
  background: transparent;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 12px;
}

body.sharpi-home .sharpi-cat-mockup-card.is-featured{
  border: 2px solid rgba(255,138,0,.95);
  box-shadow: 0 22px 70px rgba(255,138,0,.28);
}

body.sharpi-home .sharpi-cat-mockup-card.is-featured .sharpi-cat-mockup-illus{
  background: transparent;
  box-shadow: none;
}

body.sharpi-home .sharpi-cat-illus{
  width: 92px;
  height: 92px;
  display: block;
}

body.sharpi-home .sharpi-cat-illus-img{
  width: 92px;
  height: 92px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 12px 20px rgba(0,0,0,.12));
}

body.sharpi-home .sharpi-cat-mockup-title{
  font-weight: 800;
  font-size: 18px;
  line-height: 1.15;
  margin: 6px 2px 0;
  color: #111827;
  text-align: center;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.sharpi-home .sharpi-cat-mockup-slogan{
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.25;
  color: rgba(17,24,39,.70);
  text-align: center;
  min-height: 16px;
}

body.sharpi-home .sharpi-cat-mockup-btn{
  margin-top: 14px;
  width: 100%;
  height: 40px;
  border-radius: 12px;
  background: var(--sharpi-accent);
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 22px rgba(255,138,0,.25);
}

body.sharpi-home .sharpi-cat-mockup-card:hover .sharpi-cat-mockup-btn{
  box-shadow: 0 14px 28px rgba(255,138,0,.34);
}

@media (max-width: 1024px){
  body.sharpi-home .sharpi-cat-mockup-card{ width: 220px; }
}
@media (max-width: 640px){
  body.sharpi-home .sharpi-home-manager-cats{ padding: 0 16px; }
  body.sharpi-home .sharpi-cat-mockup-grid{ gap: 14px; }
  body.sharpi-home .sharpi-cat-mockup-card{ width: calc(50% - 7px); }
  body.sharpi-home .sharpi-cat-mockup-illus{ height: 112px; }
  body.sharpi-home .sharpi-cat-mockup-title{ font-size: 16px; min-height: 38px; }
}


/* FIX: MU category icons (PNG) should never be hidden */
#home-categories .category-icon img[src*="/mu-plugins/assets/home-categories-icons/"]{
  display:block !important;
  visibility:visible !important;
  opacity:1 !important;
}



/* =========================================================
 * Blog (4 ostatnie wpisy) — kompaktowa sekcja SEO
 * =======================================================*/
body.sharpi-home .sharpi-blog-section {
  padding-top: 10px;
}

body.sharpi-home .sharpi-blog__desc {
  max-width: 760px;
  margin: -6px auto 16px;
  text-align: center;
  color: var(--sharpi-muted);
  font-size: 13px;
  line-height: 1.35;
}

body.sharpi-home .sharpi-blog-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  max-width: var(--sharpi-container);
  margin: 0 auto;
  padding: 0 16px;
}

@media (max-width: 980px) {
  body.sharpi-home .sharpi-blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  body.sharpi-home .sharpi-blog-grid {
    grid-template-columns: 1fr;
  }
}

body.sharpi-home .sharpi-blog-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(0,0,0,.06);
  transition: transform .14s ease, box-shadow .14s ease;
}

body.sharpi-home .sharpi-blog-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(0,0,0,.10);
}

body.sharpi-home .sharpi-blog-card__link {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

body.sharpi-home .sharpi-blog-card__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #f3f4f6;
  overflow: hidden;
}

body.sharpi-home .sharpi-blog-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

body.sharpi-home .sharpi-blog-card__thumb--placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(120px 80px at 30% 30%, rgba(255,255,255,.9), rgba(255,255,255,0) 60%),
    linear-gradient(135deg, rgba(255,153,51,.18), rgba(0,0,0,0) 55%),
    #f3f4f6;
}

body.sharpi-home .sharpi-blog-card__body {
  padding: 12px 12px 13px;
}

body.sharpi-home .sharpi-blog-card__title {
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 800;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.sharpi-home .sharpi-blog-card__excerpt {
  margin: 0 0 10px;
  color: var(--sharpi-muted);
  font-size: 12px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.sharpi-home .sharpi-blog-card__date {
  font-size: 11px;
  color: rgba(17, 24, 39, .55);
}

body.sharpi-home .sharpi-blog__more {
  text-align: center;
  margin-top: 14px;
}

