/* ============================================
   KOLIBER — Custom Theme CSS
   Nowoczesny design z animacjami
   ============================================ */

/* ---- CZCIONKA (Google Fonts) ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ---- ZMIENNE KOLORÓW — LIGHT MODE ---- */
:root {
  --k-primary:       #2a7d5f;
  --k-primary-hover: #236b50;
  --k-accent:        #e0a940;
  --k-accent-hover:  #c99535;
  --k-bg:            #f4f6f4;
  --k-bg-2:          #ffffff;
  --k-bg-3:          #eef1ee;
  --k-card-bg:       #ffffff;
  --k-white:         #ffffff;
  --k-text:          #1a2e24;
  --k-text-light:    #4a6558;
  --k-border:        #d4e2da;
  --k-sidebar-bg:    #eaf2ed;
  --k-shadow-sm:     0 2px 8px rgba(42,125,95,0.08);
  --k-shadow-md:     0 8px 24px rgba(42,125,95,0.12);
  --k-shadow-lg:     0 16px 48px rgba(42,125,95,0.16);
  --k-radius:        10px;
  --k-transition:    0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- GLOBALNE ---- */
html, body {
  min-height: 100vh !important;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif !important;
  color: var(--k-text) !important;
  background-color: #f4f6f4 !important;
  background-image: url('/themes/koliber/assets/img/tlo.png') !important;
  background-size: cover !important;
  background-attachment: fixed !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
}

/* Wszystkie kontenery przezroczyste */
#wrapper, .wrapper, main,
.home-layout, .row,
.container, .container-fluid, .container-md,
#center-column, .center-column,
.page-content, .page-content--home,
#content, .col, [class*="col-"],
.section-title, section,
.module-products, .module-products__list,
.ps-featuredproducts, .ps-newproducts,
.ps-customtext, .ps-categorytree {
  background-color: transparent !important;
  background-image: none !important;
}

a {
  color: var(--k-primary) !important;
  transition: color var(--k-transition);
}
a:hover {
  color: var(--k-accent) !important;
  text-decoration: none !important;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  color: var(--k-text) !important;
}

/* ---- HEADER ---- */
.header-bottom,
.header-top {
  background: var(--k-bg-2) !important;
  box-shadow: 0 2px 16px rgba(0,0,0,0.4) !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
  border-bottom: 2px solid var(--k-primary) !important;
}

.header-nav-full-width {
  background: var(--k-primary) !important;
}

.header-nav-full-width a,
.header-nav-full-width .top-menu > li > a,
.header-nav-full-width .top-menu a {
  color: rgba(255,255,255,0.95) !important;
  font-weight: 500 !important;
  letter-spacing: 0.02em !important;
  padding: 0.65rem 1.1rem !important;
  transition: color var(--k-transition), background var(--k-transition) !important;
}

.header-nav-full-width a:hover,
.header-nav-full-width .top-menu > li > a:hover,
.header-nav-full-width .top-menu a:hover {
  color: var(--k-accent) !important;
  background: rgba(255,255,255,0.1) !important;
  border-radius: 6px !important;
}

/* Dropdown menu */
.header-nav-full-width .top-menu .sub-menu {
  background: var(--k-white);
  border-radius: var(--k-radius);
  box-shadow: var(--k-shadow-lg);
  border: 1px solid var(--k-border);
  animation: fadeInDown 0.2s ease;
}

.header-nav-full-width .top-menu .sub-menu a {
  color: var(--k-text) !important;
  padding: 0.5rem 1.2rem;
}

.header-nav-full-width .top-menu .sub-menu a:hover {
  color: var(--k-primary) !important;
  background: var(--k-bg);
}

/* ---- UKRYJ GÓRNE MENU (kategorie są w sidebarze) ---- */
.ps-mainmenu--desktop {
  display: none !important;
}

/* ---- IKONY NAGŁÓWKA ---- */
.header-block__icon {
  color: var(--k-primary);
  transition: color var(--k-transition), transform var(--k-transition);
}
.header-block:hover .header-block__icon {
  color: var(--k-accent);
  transform: scale(1.15);
}

.header-block__badge {
  background: var(--k-accent) !important;
  color: var(--k-white) !important;
}

/* ---- PRZYCISKI ---- */
.btn-primary {
  background-color: var(--k-primary) !important;
  border-color: var(--k-primary) !important;
  color: #ffffff !important;
  border-radius: 8px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: all var(--k-transition);
}
.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--k-primary-hover) !important;
  border-color: var(--k-primary-hover) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(26,107,90,0.35);
}

.btn-outline-primary {
  color: var(--k-primary) !important;
  border-color: var(--k-primary) !important;
  border-radius: 8px;
  font-weight: 500;
  transition: all var(--k-transition);
}
.btn-outline-primary:hover {
  background-color: var(--k-primary) !important;
  border-color: var(--k-primary) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(26,107,90,0.25);
}

/* ---- KARTY PRODUKTÓW — ANIMACJE ---- */
.product-miniature {
  background: var(--k-card-bg) !important;
  border-radius: var(--k-radius) !important;
  overflow: hidden !important;
  box-shadow: var(--k-shadow-sm) !important;
  transition: transform var(--k-transition), box-shadow var(--k-transition) !important;
  border: 1px solid var(--k-border) !important;
}

.product-miniature__bottom,
.product-miniature__infos {
  background: var(--k-card-bg) !important;
}

.product-miniature:hover {
  transform: translateY(-10px);
  box-shadow: var(--k-shadow-lg);
}

/* Zoom zdjęcia produktu */
.product-miniature__top {
  overflow: hidden;
  position: relative;
}

.product-miniature__top .product-miniature-image,
.product-miniature__top img {
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-miniature:hover .product-miniature-image,
.product-miniature:hover .product-miniature__top img {
  transform: scale(1.07);
}

/* Overlay przy najechaniu */
.product-miniature__top::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26,107,90,0.15) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--k-transition);
  pointer-events: none;
  z-index: 1;
}
.product-miniature:hover .product-miniature__top::after {
  opacity: 1;
}

/* Nazwa i cena produktu */
.product-miniature__title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--k-text);
  transition: color var(--k-transition);
  display: block;
  margin-bottom: 0.25rem;
}
.product-miniature:hover .product-miniature__title {
  color: var(--k-primary);
}

.product-miniature__price {
  color: var(--k-primary);
  font-weight: 700;
  font-size: 1.05rem;
}

.product-miniature__regular-price {
  color: var(--k-text-light);
  text-decoration: line-through;
  font-size: 0.85rem;
}

/* Przycisk "Dodaj do koszyka" — slide-up */
.product-miniature__actions {
  transform: translateY(8px);
  opacity: 0;
  transition: transform var(--k-transition), opacity var(--k-transition);
}

.product-miniature:hover .product-miniature__actions {
  transform: translateY(0);
  opacity: 1;
}

/* Fallback dla mobile — zawsze widoczny */
@media (hover: none) {
  .product-miniature__actions {
    transform: none;
    opacity: 1;
  }
}

/* ---- SIDEBAR (lewa kolumna) ---- */
#left-column {
  background: var(--k-sidebar-bg);
  border-radius: var(--k-radius);
  padding: 1.5rem 1.25rem;
  border: 1px solid var(--k-border);
}

#left-column .block-title,
#left-column .h6,
#left-column h5,
#left-column h4 {
  color: var(--k-primary);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 2px solid var(--k-accent);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

#left-column a {
  color: var(--k-text);
  font-size: 0.92rem;
  padding: 0.3rem 0;
  display: block;
  border-radius: 6px;
  transition: color var(--k-transition), padding-left var(--k-transition);
}

#left-column a:hover {
  color: var(--k-primary);
  padding-left: 6px;
}

#left-column .category-sub-menu li {
  border-bottom: 1px solid var(--k-border);
}
#left-column .category-sub-menu li:last-child {
  border-bottom: none;
}

/* ---- FILTRY (facets) ---- */
.facets-title {
  color: var(--k-primary) !important;
  font-weight: 600;
}

.custom-checkbox .custom-control-input:checked ~ .custom-control-label::before {
  background-color: var(--k-primary);
  border-color: var(--k-primary);
}

/* ---- BREADCRUMB ---- */
.breadcrumb-item a {
  color: var(--k-primary);
}

/* ---- SEKCJE STRONY GŁÓWNEJ ---- */
.products-section-title,
.section-title {
  font-weight: 700;
  color: var(--k-text);
  position: relative;
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
}

.products-section-title::after,
.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, var(--k-primary), var(--k-accent));
  border-radius: 2px;
}

/* ---- BANERY / SLIDER ---- */
.banner,
.carousel {
  border-radius: var(--k-radius);
  overflow: hidden;
}

/* ---- STOPKA ---- */
.footer-container,
#footer,
footer {
  background: var(--k-primary) !important;
  color: rgba(255,255,255,0.88) !important;
}

.footer-container a,
#footer a,
footer a {
  color: rgba(255,255,255,0.80) !important;
  transition: color var(--k-transition);
}
.footer-container a:hover,
#footer a:hover,
footer a:hover {
  color: var(--k-accent) !important;
}

.footer-container .h3,
.footer-container h3,
.footer-container .block-contact .h3,
#footer h3, #footer h4 {
  color: var(--k-white) !important;
  border-bottom: 1px solid rgba(255,255,255,0.2) !important;
  padding-bottom: 0.5rem !important;
}

/* ---- WYSZUKIWARKA ---- */
.search-widget input {
  border-radius: 24px;
  border: 2px solid var(--k-border);
  transition: border-color var(--k-transition), box-shadow var(--k-transition);
}
.search-widget input:focus {
  border-color: var(--k-primary);
  box-shadow: 0 0 0 3px rgba(26,107,90,0.12);
  outline: none;
}

/* ---- POWIADOMIENIA / FLASH ---- */
.alert-success {
  background: rgba(26,107,90,0.08);
  border-color: var(--k-primary);
  color: var(--k-primary);
  border-radius: var(--k-radius);
}

/* ---- ANIMACJE ---- */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.product-miniature {
  animation: fadeInUp 0.4s ease both;
}

/* Opóźnienia dla efektu kaskadowego */
.products .product-miniature:nth-child(1)  { animation-delay: 0.05s; }
.products .product-miniature:nth-child(2)  { animation-delay: 0.10s; }
.products .product-miniature:nth-child(3)  { animation-delay: 0.15s; }
.products .product-miniature:nth-child(4)  { animation-delay: 0.20s; }
.products .product-miniature:nth-child(5)  { animation-delay: 0.25s; }
.products .product-miniature:nth-child(6)  { animation-delay: 0.30s; }
.products .product-miniature:nth-child(7)  { animation-delay: 0.35s; }
.products .product-miniature:nth-child(8)  { animation-delay: 0.40s; }

/* ---- LOADER STRONY ---- */
.page-loader {
  background: var(--k-primary) !important;
}

/* ---- SIDEBAR STRONY GŁÓWNEJ ---- */
.home-layout {
  min-height: 80vh;
}

.home-sidebar {
  background: var(--k-sidebar-bg) !important;
  border-right: 1px solid var(--k-border);
  min-height: 80vh;
  padding: 0;
}

.home-sidebar__header {
  background: var(--k-primary);
  color: var(--k-white);
  padding: 1rem 1.25rem;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.home-sidebar__header .material-icons {
  font-size: 1.2rem;
}

.home-sidebar__nav {
  padding: 0.5rem 0;
}

/* Linki kategorii w sidebarze */
.home-sidebar__nav a,
.home-sidebar__nav .category-sub-menu a,
#home-left-column a {
  display: block;
  padding: 0.6rem 1.25rem !important;
  color: var(--k-text) !important;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--k-border);
  transition: all var(--k-transition);
  text-decoration: none !important;
}

#home-left-column a:hover {
  color: var(--k-white) !important;
  background: var(--k-primary) !important;
  padding-left: 1.75rem !important;
}

/* Ukryj domyślne tytuły bloków w sidebarze */
#home-left-column .block-title,
#home-left-column .h6 {
  display: none;
}

/* Mobile — sidebar na górze */
@media (max-width: 767px) {
  .home-sidebar {
    min-height: auto;
    border-right: none;
    border-bottom: 1px solid var(--k-border);
  }
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--k-bg); }
::-webkit-scrollbar-thumb { background: var(--k-primary); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--k-accent); }

/* ---- FILTRY — PRZEZROCZYSTE TŁO ---- */
#search_filters_wrapper,
.ps-facetedsearch,
#_desktop_faceted,
#search-filters,
.search-filters,
.accordion.accordion--small,
.accordion-item,
.accordion-button,
.accordion-button:not(.collapsed),
.accordion-collapse,
.accordion-body {
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
}

/* Bootstrap accordion CSS variables override */
.accordion {
  --bs-accordion-bg: transparent;
  --bs-accordion-btn-bg: transparent;
  --bs-accordion-active-bg: transparent;
  --bs-accordion-btn-active-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%232a7d5f'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

/* ============================================
   NOWE EFEKTY — glassmorphism, animacje, back-to-top
   ============================================ */

/* ---- GLASSMORPHISM — KARTY PRODUKTÓW ---- */
.product-miniature {
  background: rgba(255, 255, 255, 0.72) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border: 1px solid rgba(255, 255, 255, 0.55) !important;
}

.product-miniature__bottom,
.product-miniature__infos {
  background: transparent !important;
}

/* ---- PRZYCISK "WRÓĆ NA GÓRĘ" ---- */
#back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 52px;
  height: 52px;
  background: var(--k-primary);
  color: var(--k-white);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(42,125,95,0.45);
  opacity: 0;
  transform: translateY(24px) scale(0.8);
  transition: opacity 0.35s ease, transform 0.35s ease,
              background 0.2s ease, box-shadow 0.2s ease;
  pointer-events: none;
  z-index: 9999;
}

#back-to-top.k-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

#back-to-top:hover {
  background: var(--k-accent);
  box-shadow: 0 8px 28px rgba(224,169,64,0.5);
  transform: translateY(-4px) scale(1.1);
}

/* Strzałka (znak unicode ⇧) */
#back-to-top {
  font-size: 1.6rem;
  line-height: 1;
  font-weight: 700;
}

/* Tooltip "Wróć na górę" */
#back-to-top::after {
  content: 'Wróć na górę';
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  background: rgba(26, 46, 36, 0.9);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.02em;
}

#back-to-top:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* Pulsujący pierścień */
#back-to-top::before {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid var(--k-primary);
  opacity: 0;
  animation: ringPulse 2.5s ease-in-out infinite;
}

@keyframes ringPulse {
  0%, 100% { opacity: 0; transform: scale(1); }
  50%       { opacity: 0.35; transform: scale(1.2); }
}

/* ---- SCROLL REVEAL ---- */
.k-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.k-reveal.k-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- SHIMMER NA CENACH ---- */
.product-miniature__price {
  position: relative;
  overflow: hidden;
  display: inline-block;
}

.product-miniature__price::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 55%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
  animation: shimmer 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes shimmer {
  0%      { left: -100%; }
  40%, 100% { left: 160%; }
}

/* ---- ANIMOWANY GRADIENT — LINIA POD TYTUŁAMI ---- */
.products-section-title::after,
.section-title::after {
  background: linear-gradient(90deg, var(--k-primary), var(--k-accent), var(--k-primary));
  background-size: 200% 100%;
  animation: gradientSlide 4s ease infinite;
  width: 64px;
}

@keyframes gradientSlide {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ---- SUBTLNY FLOAT — IKONY W HEADERZE ---- */
@keyframes floatIcon {
  0%, 100% { transform: scale(1) translateY(0); }
  50%       { transform: scale(1.15) translateY(-2px); }
}

.header-block:hover .header-block__icon {
  animation: floatIcon 0.6s ease forwards;
}

/* ---- RIPPLE NA PRZYCISKACH ---- */
.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 50%;
  background: rgba(255,255,255,0.25);
  border-radius: 50%;
  transform: scale(0);
  transition: transform 0.5s ease, opacity 0.5s ease;
  opacity: 1;
}

.btn-primary:active::after {
  inset: -50%;
  transform: scale(1);
  opacity: 0;
  transition: 0s;
}

/* ---- HOVER NA STOPCE — PODKREŚLENIE ---- */
.footer-container a,
#footer a,
footer a {
  position: relative;
  display: inline-block;
}

.footer-container a::after,
#footer a::after,
footer a::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--k-accent);
  transition: width var(--k-transition);
}

.footer-container a:hover::after,
#footer a:hover::after,
footer a:hover::after {
  width: 100%;
}

/* ---- INPUT FOCUS GLOW ---- */
input:focus,
select:focus,
textarea:focus {
  animation: inputGlow 0.3s ease forwards;
}

@keyframes inputGlow {
  from { box-shadow: 0 0 0 0 rgba(42,125,95,0); }
  to   { box-shadow: 0 0 0 4px rgba(42,125,95,0.15); }
}

/* ---- ILOŚĆ SZTUK W MAGAZYNIE ---- */
.product__stock-qty {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--k-text-light);
  margin-bottom: 8px;
}
.product__stock-qty .material-icons {
  font-size: 1rem;
  color: var(--k-primary);
}

/* --- Wyróżnienie zgody na regulamin w kasie --- */
#conditions-to-approve {
  border: 2px solid #1f7a5c;
  background: #ffffff;
  border-radius: 8px;
  padding: 14px 16px;
  margin: 22px 0;
}
#conditions-to-approve label,
#conditions-to-approve .js-terms {
  font-weight: 600;
  font-size: 1.05rem;
}
#conditions-to-approve input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #1f7a5c;
}

/* === LOGO NAGŁÓWKA — powiększenie (20.08.2026) ===
   Motyw ogranicza logo do max-width:9rem, co miażdży poziome logo Pamiątkomanii. */
.header-bottom .navbar-brand .logo {
  max-width: min(300px, 62vw);
  max-height: 4rem;
  width: auto;
  height: auto;
}

@media (min-width: 768px) {
  .header-bottom .navbar-brand .logo {
    max-width: 380px;
    max-height: 5rem;
  }
}
