/*
Theme Name: kasiama
Description: Lekki motyw sklepu kasiama.pl (WooCommerce) - zielono-szara szata, menu kategorii, karuzela.
Version: 1.0
Text Domain: kasiama
*/

:root {
    --green: #2e7d32;
    --green-d: #1b5e20;
    --ink: #1f2328;
    --muted: #6b7280;
    --line: #e5e7eb;
    --bg: #f7f8fa;
    --card: #ffffff;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,.08);
}

* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ink);
    background: var(--bg); line-height: 1.5; font-size: 16px; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
img[hidden] { display: none; }
/* przenikanie zdjec (crossfade), gdy produkt ma >1 zdjecie */
.cyc > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
    opacity: 0; transition: opacity .7s ease; }
.cyc > img.active { opacity: 1; }
h1 { font-size: 1.7rem; margin: .2em 0 .5em; }
h2 { font-size: 1.3rem; }
.muted { color: var(--muted); }
.container { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.screen-reader-text { position: absolute !important; left: -9999px; }

/* --- Naglowek --- */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; gap: 22px; padding: 12px 16px; }
.logo { font-size: 1.6rem; font-weight: 800; letter-spacing: -.5px; color: var(--green-d); white-space: nowrap; flex-shrink: 0; }
.logo span { color: var(--muted); font-weight: 600; }
.main-nav ul { display: flex; gap: 18px; list-style: none; margin: 0; padding: 0; }
.main-nav a { font-weight: 600; color: var(--green-d); }
.main-nav a:hover { color: var(--green); text-decoration: underline; }
.search { display: flex; flex: 1; max-width: 560px; margin-left: auto; position: relative; }
.search input[type=search] { flex: 1; padding: 10px 14px; border: 1px solid var(--line); border-right: 0;
    border-radius: 8px 0 0 8px; font-size: 16px; outline: none; min-width: 0; }
.search input[type=search]:focus { border-color: var(--green); }
.search button { padding: 10px 18px; border: 0; background: var(--green); color: #fff;
    border-radius: 0 8px 8px 0; cursor: pointer; font-weight: 600; font-size: 15px; }
.search button:hover { background: var(--green-d); }
.search-suggest { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff;
    border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 60; overflow: hidden; }
.search-suggest a { display: flex; flex-direction: column; padding: 9px 12px; border-bottom: 1px solid #f0f1f3; }
.search-suggest a:last-child { border-bottom: 0; }
.search-suggest a:hover, .search-suggest a.active { background: #eaf3ea; }
.ss-name { font-size: .95rem; font-weight: 500; line-height: 1.25; }
.ss-sku { font-size: .8rem; color: var(--muted); }

/* --- Kafelki kategorii (telefon) --- */
.cat-nav-mobile { display: none; background: #fff; border-bottom: 1px solid var(--line); padding: 12px 0; }
.cat-tiles-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; padding: 0 16px; }
.cat-green-tile { background: var(--green-d); color: #fff; border-radius: 8px; padding: 11px 8px; text-align: center;
    font-size: .85rem; font-weight: 500; line-height: 1.2; display: flex; align-items: center; justify-content: center; min-height: 46px; }
.cat-green-tile:hover { background: var(--green); }

/* --- Uklad: sidebar + tresc --- */
.layout { display: flex; gap: 22px; align-items: flex-start; max-width: 1240px; margin: 0 auto; padding: 22px 16px 48px; }
.sidebar { flex: 0 0 225px; position: sticky; top: 80px; display: flex; flex-direction: column; gap: 12px; }
.sidebar-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.sidebar-head { background: var(--green-d); color: #fff; font-weight: 600; padding: 10px 14px; font-size: 1rem; }
.sidebar-cat { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 14px;
    border-top: 1px solid #f0f1f3; font-size: .95rem; }
.sidebar-cat:hover, .sidebar-cat.current { background: #eaf3ea; color: var(--green-d); }
.sidebar-cat.current { font-weight: 700; }
.sc-count { color: #9ca3af; font-size: .82rem; }
.sidebar-filter { padding: 10px 14px; font-size: .95rem; display: flex; align-items: center; gap: 8px; }
.sidebar-filter .box { width: 18px; height: 18px; border: 2px solid var(--green); border-radius: 4px; display: inline-flex;
    align-items: center; justify-content: center; font-size: 13px; color: #fff; }
.sidebar-filter.on .box { background: var(--green); }
.sidebar-sub { padding: 8px 14px 2px; font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; border-top: 1px solid #f0f1f3; }
.content { flex: 1; min-width: 0; }
.page-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 26px; font-size: 1.05rem; }
.page-box a { color: var(--green-d); text-decoration: underline; }
.cat-green-tile.current { background: var(--green); outline: 3px solid #a5d6a7; }

/* --- Karuzela --- */
.carousel { position: relative; margin: 0 0 26px; }
.carousel-track { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 2px; }
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-item { flex: 0 0 calc((100% - 28px) / 3); scroll-snap-align: start; }
.car-img { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; background: #fff; border: 1px solid var(--line); }
.car-img img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.car-noimg { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #c1c6cc; background: #eef0f2; }
.car-name { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.72); padding: 5px 9px;
    font-size: .75rem; font-weight: 600; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.car-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 50%;
    background: #fff; border: 1px solid var(--line); color: var(--green-d); display: flex; align-items: center;
    justify-content: center; cursor: pointer; z-index: 3; box-shadow: var(--shadow); font-size: 20px; }
.car-prev { left: -6px; } .car-next { right: -6px; }
.car-dots { display: flex; gap: 6px; justify-content: center; margin-top: 12px; }
.car-dots button { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 4px; background: #cfd4da; cursor: pointer; }
.car-dots button.active { width: 20px; background: var(--green-d); }

/* --- Siatka produktow (WooCommerce) --- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 4px 0 16px;
    border-bottom: 2px solid var(--line); padding-bottom: 8px; }
.section-head h1, .section-head h2 { margin: 0; }
.head-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.woocommerce .head-right .woocommerce-ordering { float: none; margin: 0; }
.woocommerce ul.products, ul.products { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px; margin: 0 0 20px !important; padding: 0; list-style: none; }
ul.products::before, ul.products::after { display: none !important; }
.woocommerce ul.products li.product, ul.products li.product { width: auto !important; float: none !important; margin: 0 !important;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow); position: relative; display: flex; flex-direction: column; transition: transform .12s, box-shadow .12s; }
ul.products li.product:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(0,0,0,.10); }
ul.products li.product > a { display: flex; flex-direction: column; flex: 1; }
.card-img { position: relative; height: 150px; background: #fff; border-bottom: 1px solid #f0f1f3; }
.card-img img { width: 100% !important; height: 100% !important; object-fit: contain; padding: 8px; margin: 0 !important; }
.card-noimg { height: 100%; display: flex; align-items: center; justify-content: center; color: #aab; font-size: .85rem; background: #f0f1f3; }
.badge { position: absolute; top: 8px; left: 8px; font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 20px; color: #fff; z-index: 2; }
.badge-in { background: var(--green); }
.badge-out { background: #b0752a; }
.woocommerce ul.products li.product .woocommerce-loop-product__title, ul.products li.product h2 {
    font-size: 1.12rem !important; font-weight: 600; line-height: 1.3; padding: 10px 12px 0 !important; margin: 0 !important;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 3em; color: var(--ink); }
.woocommerce ul.products li.product .price, ul.products li.product .price { display: block; margin-top: auto !important;
    padding: 8px 12px 12px; font-size: 1.2rem !important; font-weight: 700; color: var(--green-d) !important; }
.ask-price { color: var(--muted); font-weight: 600; }
.woocommerce ul.products li.product .button, ul.products li.product .add_to_cart_button { display: none !important; }
.woocommerce-result-count { color: var(--muted); }
.woocommerce .woocommerce-ordering select { padding: 8px; border-radius: 8px; border: 1px solid var(--line); font-size: 15px; }
.woocommerce nav.woocommerce-pagination ul { border: 0 !important; display: flex; gap: 6px; justify-content: center; }
.woocommerce nav.woocommerce-pagination ul li { border: 0 !important; }
.woocommerce nav.woocommerce-pagination ul li a, .woocommerce nav.woocommerce-pagination ul li span {
    padding: 8px 14px !important; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-weight: 600; }
.woocommerce nav.woocommerce-pagination ul li span.current { background: var(--green-d); color: #fff; }

/* --- Karta produktu --- */
.woocommerce div.product { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.woocommerce div.product .product_title { font-size: 1.7rem; }
.woocommerce div.product p.price, .woocommerce div.product span.price { color: var(--green-d) !important; font-size: 1.9rem !important; font-weight: 800; }
.price-net { color: var(--muted); font-size: 1rem; margin: -6px 0 14px; }
.stock-badge { display: inline-block; font-weight: 700; font-size: .9rem; padding: 5px 12px; border-radius: 20px; margin-bottom: 12px; }
.stock-badge.in { background: #e8f5e9; color: var(--green-d); }
.stock-badge.out { background: #fdf0dd; color: #91631d; }
.btn-ask { display: inline-block; background: var(--green); color: #fff !important; padding: 14px 26px; border-radius: 8px;
    font-weight: 700; font-size: 1.05rem; margin: 6px 8px 6px 0; }
.ask-buttons { margin: 14px 0 18px; }
.btn-ask:hover { background: var(--green-d); }
.btn-ask.alt { background: #fff; color: var(--green-d) !important; border: 2px solid var(--green); }
.woocommerce div.product .woocommerce-tabs ul.tabs li.active { border-bottom-color: #fff; }
.woocommerce div.product form.cart { display: none; }
.woocommerce div.product .related, .woocommerce div.product .up-sells { clear: both; padding-top: 18px; }
.woocommerce div.product .related > h2 { font-size: 1.3rem; }
.woocommerce div.product p.price { margin-bottom: 4px; }
.woocommerce-breadcrumb { font-size: .9rem; color: var(--muted); margin-bottom: 14px !important; }
.woocommerce .woocommerce-breadcrumb a { color: var(--green-d); }

/* --- Stopka --- */
.site-footer { background: #1f2328; color: #cbd0d6; margin-top: 40px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 28px; justify-content: space-between; padding: 30px 16px; }
.footer-inner strong { color: #fff; }
.footer-inner p { margin: 5px 0 0; font-size: 1rem; line-height: 1.6; }
.footer-about { max-width: 580px; }
.footer-about > strong { font-size: 1.25rem; }
.footer-contact .fc-head { color: #fff; font-weight: 600; margin-bottom: 6px; font-size: 1.1rem; }
.footer-contact p { margin: 4px 0 0; font-size: 1rem; }
.footer-contact a { color: #cbd0d6; }
.footer-contact a:hover { color: #fff; }
.footer-copy { width: 100%; border-top: 1px solid #333; padding-top: 14px; font-size: .85rem; color: #8b9199; }

/* --- Telefon --- */
@media (max-width: 900px) {
    .layout { display: block; padding: 14px 16px 40px; }
    .sidebar { display: none; }
    .cat-nav-mobile { display: block; }
    .main-nav { display: none; }
    .header-inner { flex-wrap: wrap; gap: 10px; }
    .search { max-width: none; width: 100%; order: 3; }
    .carousel-item { flex: 0 0 82%; }
    .car-prev { left: 2px; } .car-next { right: 2px; }
    .woocommerce ul.products, ul.products { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .card-img { height: 130px; }
    .woocommerce ul.products li.product .woocommerce-loop-product__title, ul.products li.product h2 {
        font-size: 1rem !important; -webkit-line-clamp: 3; min-height: 3.9em; padding: 9px 10px 0 !important; }
    .woocommerce ul.products li.product .price, ul.products li.product .price { font-size: 1.05rem !important; padding: 6px 10px 10px; }
    .section-head { flex-wrap: wrap; }
    .head-right { width: 100%; justify-content: space-between; }
    .woocommerce .head-right .woocommerce-ordering select { max-width: 60vw; }
    .header-inner { padding: 8px 16px; }
    .logo { font-size: 1.45rem; }
    .woocommerce div.product { padding: 14px; }
}
