/*
Theme Name: AliShop Affiliate
Theme URI: https://example.local/alishop-affiliate
Author: Codex
Description: Lekki motyw WordPress dla portalu afiliacyjnego z kategoriami po lewej stronie i produktami kierującymi do AliExpress.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: alishop-affiliate
*/

:root {
  --page: #f7f5f0;
  --surface: #ffffff;
  --surface-soft: #fdfbf7;
  --text: #1f2528;
  --muted: #687175;
  --border: #ded8cc;
  --accent: #0c7c72;
  --accent-dark: #075f58;
  --accent-warm: #d64b2a;
  --shadow: 0 12px 30px rgba(27, 32, 35, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  height: auto;
  max-width: 100%;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header__inner,
.site-footer__inner,
.site-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header__inner {
  align-items: center;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  min-height: 64px;
}

.site-branding {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 180px;
}

.site-logo,
.custom-logo-link {
  align-items: center;
  display: inline-flex;
  max-width: 180px;
}

.custom-logo {
  height: 42px !important;
  max-height: 42px !important;
  max-width: 180px !important;
  object-fit: contain;
  width: auto !important;
}

.site-header .custom-logo-link img {
  height: 42px !important;
  max-height: 42px !important;
  max-width: 180px !important;
  width: auto !important;
}

.site-title {
  color: var(--accent-dark);
  display: block;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0;
}

.site-description {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.primary-menu {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: flex-end;
  list-style: none;
  margin: 0;
  padding: 0;
}

.primary-menu a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.primary-menu a:hover {
  color: var(--accent);
}

.site-shell {
  display: grid;
  gap: 28px;
  grid-template-columns: 260px minmax(0, 1fr);
  padding: 34px 0 48px;
}

.sidebar {
  align-self: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
  position: sticky;
  top: 98px;
}

.sidebar__title {
  font-size: 15px;
  font-weight: 800;
  margin: 0 0 12px;
  text-transform: uppercase;
}

.sidebar__title--secondary {
  margin-top: 22px;
}

.category-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.category-list li + li {
  border-top: 1px solid var(--border);
}

.category-list a {
  align-items: center;
  color: var(--text);
  display: flex;
  font-weight: 650;
  justify-content: space-between;
  padding: 11px 0;
}

.category-list a:hover,
.category-list .current-cat > a {
  color: var(--accent);
}

.category-list__empty {
  color: var(--muted);
  display: block;
  font-size: 14px;
  padding: 10px 0;
}

.content-header {
  align-items: end;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 18px;
}

.content-header h1 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
  margin: 0;
}

.content-header p {
  color: var(--muted);
  margin: 8px 0 0;
  max-width: 680px;
}

.product-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.product-card__image {
  aspect-ratio: 4 / 3;
  background: #ece6da;
  overflow: hidden;
}

.product-card__image img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.product-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
}

.product-card__title {
  font-size: 17px;
  line-height: 1.25;
  margin: 0;
}

.product-card__excerpt {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

.product-card__meta {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-top: auto;
}

.price {
  color: var(--accent-warm);
  font-size: 18px;
  font-weight: 850;
}

.button,
.wp-block-button__link {
  align-items: center;
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font-size: 14px;
  font-weight: 800;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  text-align: center;
}

.button:hover,
.wp-block-button__link:hover {
  background: var(--accent-dark);
  color: #ffffff;
}

.product-detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 44%) minmax(0, 1fr);
  padding: 24px;
}

.product-detail__image {
  background: var(--surface-soft);
  border-radius: 8px;
  overflow: hidden;
}

.product-detail__content h1 {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.08;
  margin: 0 0 14px;
}

.product-detail__actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 22px 0;
}

.notice {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  margin-top: 22px;
  padding: 14px 16px;
}

.pagination {
  margin-top: 28px;
}

.pagination .nav-links,
.pagination .page-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.pagination a,
.pagination span {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  min-width: 40px;
  padding: 8px 12px;
  text-align: center;
}

.pagination .current {
  background: var(--accent);
  color: #ffffff;
}

.site-footer {
  background: var(--text);
  color: #ffffff;
}

.site-footer__inner {
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  padding: 24px 0;
}

@media (max-width: 820px) {
  .site-header__inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 16px 0;
  }

  .primary-menu {
    justify-content: flex-start;
  }

  .site-shell {
    grid-template-columns: 1fr;
    padding-top: 22px;
  }

  .sidebar {
    position: static;
  }

  .content-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .product-detail {
    grid-template-columns: 1fr;
    padding: 16px;
  }
}
