/* =====================================================================
 * ubrania - skin sklepu odziezowego, styl wzorowany na 4F.com.pl:
 * czern + biel + czerwony akcent, duze zdjecia produktow, gesta siatka.
 * Konwencja klas: .ub-top .ub-nav .ub-hero .ub-main .ub-rail .ub-grid
 *                 .ub-card .ub-price .ub-listing .ub-foot
 * ===================================================================== */
:where(.logout-button) { appearance: none; -webkit-appearance: none; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: inherit; font: inherit; text-align: inherit; cursor: pointer; text-decoration: none; }
.logout-button:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

:root {
    --ink:      #111111;
    --ink-2:    #333333;
    --muted:    #767676;
    --line:     #e5e5e5;
    --bg:       #ffffff;
    --panel:    #f7f7f7;
    --accent:   #e4002b;
    --accent-d: #c40025;
    --radius:   2px;
}
* { box-sizing: border-box; }
body.ub { margin: 0; color: var(--ink); background: var(--bg); line-height: 1.5;
    font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
.ub a { text-decoration: none; color: inherit; }
.ub .muted { color: var(--muted); }
.ub-wrap { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* ===== Header ===== */
.ub-top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.ub-top-row { display: flex; align-items: center; gap: 24px; height: 64px; }
.ub-logo { font-weight: 900; font-size: 1.35rem; letter-spacing: -.02em; color: var(--ink); white-space: nowrap; }
.ub-logo .a { color: var(--accent); }
.ub-nav { display: flex; gap: 20px; align-items: center; }
.ub-nav a { font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); white-space: nowrap; }
.ub-nav a:hover { color: var(--accent); }
.ub-search { flex: 1; display: flex; max-width: 420px; margin-left: auto; }
.ub-search input { flex: 1; border: 1px solid var(--line); background: var(--panel); border-radius: 999px 0 0 999px;
    padding: 9px 16px; font-size: .88rem; outline: none; }
.ub-search input:focus { background: #fff; border-color: var(--ink); }
.ub-search button { border: 1px solid var(--line); border-left: 0; background: var(--panel); border-radius: 0 999px 999px 0;
    padding: 0 16px; cursor: pointer; font-size: .95rem; }
.ub-icons { display: flex; align-items: center; gap: 6px; }
.ub-ic { position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 999px; font-size: 1.05rem; color: var(--ink); }
.ub-ic:hover { background: var(--panel); }
.ub-ic-text { width: auto; padding: 0 12px; font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.ub-cta {
    display: inline-flex; align-items: center; justify-content: center; height: 38px;
    padding: 0 16px; border-radius: 999px; background: var(--accent); color: #fff;
    font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .02em;
    white-space: nowrap;
}
.ub-cta:hover { background: var(--accent-d); }
.ub-badge { position: absolute; top: 2px; right: 2px; background: var(--accent); color: #fff; font-size: .62rem;
    font-weight: 800; border-radius: 999px; min-width: 15px; height: 15px; display: inline-flex; align-items: center;
    justify-content: center; padding: 0 3px; }

/* ===== Hero ===== */
.ub-hero { background: var(--ink); padding: 44px 0; }
.ub-hero h1 { margin: 0 0 8px; font-size: 2rem; font-weight: 900; color: #fff; letter-spacing: -.01em; }
.ub-hero p { margin: 0; color: #c9c9c9; font-size: .98rem; }

/* ===== Layout glowny ===== */
.ub-main { display: grid; grid-template-columns: 250px 1fr; gap: 32px; padding: 30px 24px 60px; align-items: start; }
.ub-rail h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 900;
    color: var(--ink); margin: 0 0 10px; padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.ub-all { display: block; padding: 7px 0; font-weight: 800; font-size: .9rem; color: var(--ink); margin-bottom: 6px; }
.ub-all.active, .ub-all:hover { color: var(--accent); }
.ub-cat-group { margin-bottom: 14px; }
.ub-cat-parent { display: block; padding: 5px 0; font-weight: 800; font-size: .88rem; color: var(--ink); text-transform: uppercase; letter-spacing: .02em; }
.ub-cat-parent.active, .ub-cat-parent:hover { color: var(--accent); }
.ub-cat-list { list-style: none; margin: 4px 0 0; padding: 0 0 0 2px; }
.ub-cat-list a { display: block; padding: 4px 0; font-size: .84rem; color: var(--ink-2); }
.ub-cat-list a:hover { color: var(--accent); }
.ub-cat-list a.active { color: var(--accent); font-weight: 800; }
.ub-count { color: var(--muted); font-weight: 600; font-size: .78rem; }

/* Breadcrumbs / tytul */
.ub-crumbs { font-size: .78rem; color: var(--muted); margin: 0 0 10px; }
.ub-crumbs a { color: var(--muted); }
.ub-crumbs a:hover { color: var(--ink); }
.ub-title { font-size: 1.5rem; font-weight: 900; margin: 0 0 18px; letter-spacing: -.01em; }
.ub-flash { background: #fef3e2; color: #92600b; padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }

/* ===== Wybor sprzedawcy (RenderSellerPicker, core/core.php) ===== */
.shop-seller-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 18px; }
.shop-seller-picker label { color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.shop-seller-tools { width: 100%; }
.shop-seller-picker { max-width: 100%; }
.shop-seller-picker select {
    flex: 1 1 220px; min-width: 0; max-width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: var(--radius);
    background: #fff; color: var(--ink); padding: 0 12px; font-size: .86rem; font-family: inherit;
}
.shop-seller-picker select:focus { border-color: var(--ink); outline: none; }
.shop-seller-picker button {
    display: inline-flex; align-items: center; justify-content: center; min-height: 42px;
    border: 1px solid var(--ink); border-radius: 999px; background: #fff; color: var(--ink);
    padding: 0 20px; font-weight: 800; font-size: .78rem; text-transform: uppercase; letter-spacing: .02em;
    cursor: pointer; font-family: inherit;
}
.shop-seller-picker button:hover { background: var(--ink); color: #fff; }
.shop-seller-picker a { color: var(--muted); font-size: .82rem; text-decoration: underline; }
.shop-seller-picker a:hover { color: var(--accent); }

/* ===== Siatka + karty ===== */
.ub-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px 20px; }
.ub-card-wrap { position: relative; }
.ub-card { display: block; color: var(--ink); }
.ub-thumb { position: relative; aspect-ratio: .82; background: var(--panel); overflow: hidden; }
.ub-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ub-thumb-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 2.4rem; color: #ccc; }
.ub-heart { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 999px; background: rgba(255,255,255,.92);
    display: flex; align-items: center; justify-content: center; font-size: 1rem; color: var(--ink); box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.ub-badge-sale { position: absolute; top: 10px; left: 10px; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 900;
    padding: 3px 8px; border-radius: 2px; }
.ub-cbody { padding: 10px 2px 0; }
.ub-cat { margin: 0 0 2px; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.ub-cbody h3 { margin: 0 0 6px; font-size: .88rem; font-weight: 600; line-height: 1.35; color: var(--ink); }
.ub-price { margin: 0; font-weight: 900; font-size: .98rem; color: var(--ink); display: flex; align-items: baseline; gap: 8px; }
.ub-price.is-sale { color: var(--accent); }
.ub-price-orig { font-weight: 600; font-size: .82rem; color: var(--muted); text-decoration: line-through; }
.ub-empty { padding: 48px; text-align: center; color: var(--muted); border: 1px dashed var(--line); }

.ub-add { position: absolute; right: 10px; bottom: 66px; z-index: 2; border: 0; border-radius: 999px; background: var(--ink);
    color: #fff; font-weight: 800; font-size: .72rem; text-transform: uppercase; letter-spacing: .03em;
    padding: 8px 14px; cursor: pointer; box-shadow: 0 5px 14px rgba(0,0,0,.22); opacity: 0; transition: opacity .15s; }
.ub-card-wrap:hover .ub-add, .ub-add:focus { opacity: 1; }
.ub-add:hover { background: var(--accent); }

/* Pager */
.ub-pager { display: flex; align-items: center; gap: 14px; margin: 30px 0 0; color: var(--muted); font-size: .88rem; }
.ub-pager a { color: var(--ink); font-weight: 800; }

/* ===== Widok produktu ===== */
.ub-listing { padding: 26px 24px 60px; }
.ub-listing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; margin-top: 8px; align-items: start; }
.ub-listing-img { position: relative; aspect-ratio: .85; background: var(--panel); overflow: hidden; }
.ub-listing-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ub-listing-info h1 { margin: 0 0 4px; font-size: 1.5rem; font-weight: 900; letter-spacing: -.01em; }
.ub-listing-price { font-size: 1.7rem; font-weight: 900; margin: 14px 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ub-listing-price.is-sale { color: var(--accent); }
.ub-facts { list-style: none; margin: 0 0 16px; padding: 0; font-size: .88rem; color: var(--ink-2); display: grid; gap: 4px; }
.ub-listing-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }
.ub-add-lg { position: static; opacity: 1; padding: 13px 26px; font-size: .82rem; }
.ub-desc { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; }
.ub-desc h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .04em; margin: 0 0 8px; }

.listing-message-btn {
    display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
    padding: 0 22px; border: 1px solid var(--ink); border-radius: 999px; background: #fff;
    color: var(--ink); font-weight: 800; font-size: .82rem; text-transform: uppercase; letter-spacing: .02em;
}
.listing-message-btn:hover { background: var(--ink); color: #fff; }

.listing-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.listing-badge { display: inline-flex; align-items: center; width: fit-content; padding: 3px 10px; border-radius: 999px;
    font-size: .7rem; font-weight: 900; line-height: 1.2; text-transform: uppercase; letter-spacing: .04em; }
.listing-badge-compact { margin-left: 6px; padding: 2px 8px; font-size: .64rem; vertical-align: middle; }
.listing-badge-demo { border: 1px solid var(--ink); background: #fff; color: var(--ink); }
.listing-badge-sold { background: var(--ink); color: #fff; }
.listing-badge-reserved { background: #0f766e; color: #fff; }
.listing-badge-stale { border: 1px solid rgba(107, 114, 128, .3); background: rgba(107, 114, 128, .08); color: #9ca3af; text-transform: none; letter-spacing: 0; opacity: 0.75; }
.listing-badge-views { border: 1px solid #abefc6; background: #ecfdf3; color: #067647; text-transform: none; letter-spacing: 0; }

/* ===== Footer ===== */
.ub-foot { background: var(--panel); border-top: 1px solid var(--line); padding: 32px 0; margin-top: 30px; }
.ub-foot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.ub-foot-col { display: flex; flex-direction: column; gap: 8px; }
.ub-foot-col h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; margin: 0 0 4px; color: var(--ink); }
.ub-foot-col a { color: var(--muted); font-size: .86rem; }
.ub-foot-col a:hover { color: var(--ink); }
.ub-foot-brand { align-items: flex-start; }
.ub-foot-brand strong { font-size: .95rem; }
.sub-footer-signature { display: inline-block; color: var(--muted); font-size: .8rem; }
.sub-footer-signature a { color: inherit; font-weight: 800; }

@media (max-width: 960px) {
    .ub-grid { grid-template-columns: repeat(2, 1fr); }
    .ub-main { grid-template-columns: 1fr; }
    .ub-rail { order: -1; }
    .ub-listing-grid { grid-template-columns: 1fr; }
    .ub-foot-grid { grid-template-columns: 1fr; }
    .ub-search { max-width: none; order: 3; flex-basis: 100%; }
    .ub-top-row { flex-wrap: wrap; height: auto; padding: 10px 0; }
}
@media (max-width: 560px) {
    .ub-grid { grid-template-columns: repeat(2, 1fr); gap: 16px 12px; }
    .ub-hero { padding: 28px 0; }
    .ub-hero h1 { font-size: 1.5rem; }
    .ub-nav { overflow-x: auto; gap: 14px; }
    .ub-main { padding: 20px 16px 40px; }
    .ub-wrap { padding: 0 16px; }
    .shop-seller-picker { flex-direction: column; align-items: stretch; }
    .shop-seller-picker select { min-width: 0; width: 100%; }
}
