/*
Theme Name: MyOffers365
Description: Lightweight affiliate product showcase theme
Version: 2.1
Author: MyOffers365
Text Domain: myoffers365
*/

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --color-bg: #f5f5f5;
  --color-surface: #fff;
  --color-text: #111;
  --color-text-secondary: #777;
  --color-accent: #e85d2a;
  --color-accent-hover: #d14a1a;
  --color-border: #eee;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-card: 0 2px 8px rgba(0,0,0,0.04);
  --shadow-card-hover: 0 12px 32px rgba(0,0,0,0.10);
  --max-width: 1200px;
  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Noto Sans SC", sans-serif;
}

body {
  font-family: var(--font-stack);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* === Layout === */
.site-container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* === Header === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.92);
  border-bottom: 1px solid var(--color-border);
}
.site-header .site-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.site-logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.03em;
}
.site-logo span { color: var(--color-accent); }

/* Category nav */
.cat-nav {
  display: flex;
  gap: 6px;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 4px 0;
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav a {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
  transition: all 0.15s;
}
.cat-nav a:hover {
  color: var(--color-accent);
  background: rgba(232,93,42,0.06);
}
.cat-nav .active a {
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  background: rgba(232,93,42,0.06);
}

/* === Hero Banner === */
.hero-banner {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 48px 0 44px;
  text-align: center;
}
.hero-logo {
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--color-text);
  margin-bottom: 8px;
}
.hero-logo span { color: var(--color-accent); }
.hero-tagline {
  font-size: 1rem;
  color: var(--color-text-secondary);
  font-weight: 400;
}

/* === Product Grid === */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 24px 0 40px;
}

/* === Card === */
.product-card {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.25s, transform 0.25s;
}
.product-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-3px);
}

.card-img {
  position: relative;
  overflow: hidden;
  height: 220px;
  background: #f0f0f0;
}
.card-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
  transition: transform 0.4s;
}
.product-card:hover .card-img img {
  transform: scale(1.03);
}

/* Badge always visible */
.card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 6px;
  z-index: 2;
}

/* Overlay on hover */
.card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 14px 12px;
  background: linear-gradient(transparent, rgba(0,0,0,0.65));
  color: #fff;
  opacity: 0;
  transition: opacity 0.25s;
}
.product-card:hover .card-overlay {
  opacity: 1;
}
.card-overlay .card-title {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card body (always visible below image) */
.card-body {
  padding: 12px 14px 14px;
}
.card-body-title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--color-text);
}
.card-body-excerpt {
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* === Pagination === */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 0 0 48px;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-card);
  transition: all 0.15s;
}
.pagination a:hover {
  background: var(--color-accent);
  color: #fff;
}
.pagination .current {
  background: var(--color-accent);
  color: #fff;
}

/* === Single Post === */
.single-post-header {
  max-width: 720px;
  margin: 48px auto 28px;
  text-align: center;
}
.single-post-header .post-cat {
  display: inline-block;
  background: rgba(232,93,42,0.08);
  color: var(--color-accent);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 5px 14px;
  border-radius: 6px;
  margin-bottom: 14px;
}
.single-post-header h1 {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}
.single-post-header .post-meta {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.single-post-content {
  max-width: 720px;
  margin: 0 auto 60px;
}
.single-post-content p {
  margin-bottom: 1.25em;
  font-size: 1rem;
  line-height: 1.8;
}
.single-post-content h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 2em 0 0.75em;
}
.single-post-content h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 1.5em 0 0.5em;
}
.single-post-content ul, .single-post-content ol {
  margin: 0 0 1.25em 1.5em;
}
.single-post-content li { margin-bottom: 0.4em; }

.single-post-content .wp-block-image {
  margin: 1.5em 0;
  text-align: center;
}
.single-post-content .wp-block-image img {
  border-radius: var(--radius-sm);
  margin: 0 auto;
  max-width: 100%;
  box-shadow: var(--shadow-card);
}
.single-post-content .wp-block-image figcaption {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  margin-top: 8px;
}
.single-post-content .wp-block-image a {
  display: block;
  background: none;
  padding: 0;
  margin: 0;
  border-radius: 0;
}
.single-post-content .wp-block-image a:hover { background: none; }

.single-post-content p > a[href*="click.aliexpress"],
.single-post-content p > a[href*="aliaff"] {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  margin: 8px 0 16px;
  transition: background 0.15s, transform 0.1s;
}
.single-post-content p > a[href*="click.aliexpress"]:hover,
.single-post-content p > a[href*="aliaff"]:hover {
  background: var(--color-accent-hover);
  color: #fff;
  transform: translateY(-1px);
}

/* Related posts */
.related-section {
  max-width: 720px;
  margin: 0 auto 48px;
}
.related-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.related-card {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s, transform 0.2s;
}
.related-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}
.related-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
}
.related-card-body {
  padding: 12px 14px 14px;
}
.related-card-body h4 {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* === Archive header === */
.archive-header {
  padding: 32px 0 8px;
}
.archive-header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.archive-header p {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* === Footer === */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 20px 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

/* === Responsive === */
@media (max-width: 768px) {
  .site-header .site-container { height: 50px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .card-img { height: 180px; }
  .single-post-header h1 { font-size: 1.5rem; }
  .single-post-content { padding: 0 4px; }
  .related-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card-img { height: 150px; }
  .card-body { padding: 10px 12px 12px; }
  .card-body-title { font-size: 0.82rem; }
  .card-overlay { opacity: 1; }
}
