/* Requires themes.css (loaded first) for color tokens */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-dark);
    line-height: 1.65;
    min-height: 100vh;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--header-border);
    box-shadow: var(--header-shadow);
}

.site-header nav {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.logo {
    font-weight: 800;
    font-size: 1rem;
    color: var(--text-dark);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-mark {
    width: 52px;
    height: 52px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}

.nav-back {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary-dark);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 10px;
    background: var(--surface-hover);
}

.nav-back:hover { background: var(--border-soft); }

.product-page {
    max-width: 900px;
    margin: 28px auto 48px;
    padding: 0 20px;
}

.breadcrumb {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.breadcrumb a {
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 600;
}

.breadcrumb a:hover { text-decoration: underline; }

.product-hero-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

.product-hero-card::before {
    content: '';
    display: block;
    height: 4px;
    background: var(--main-top-bar);
}

.product-layout {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 32px;
    padding: 32px;
}

@media (max-width: 720px) {
    .product-layout { grid-template-columns: 1fr; padding: 24px; }
}

.product-image-wrap {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: var(--surface-hover);
    aspect-ratio: 4 / 3;
}

.product-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 10px;
    line-height: 1.5;
}

.image-hint code {
    background: var(--surface-hover);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.74rem;
}

.product-emoji-fallback {
    position: absolute;
    bottom: 12px;
    right: 12px;
    font-size: 2.5rem;
    background: var(--surface);
    border-radius: 12px;
    padding: 6px 10px;
    line-height: 1;
    border: 1px solid var(--border-soft);
}

h1 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
    line-height: 1.2;
    color: var(--text-dark);
}

.product-category {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary-dark);
    background: var(--ratio-badge-bg);
    padding: 6px 12px;
    text-decoration: none;
    border-radius: 999px;
    margin-bottom: 16px;
    border: 1px solid var(--ratio-badge-border);
    transition: background 0.15s ease, color 0.15s ease;
}

a.product-category:hover {
    background: var(--surface-hover);
    color: var(--primary);
}

.products-index-page .pm-category-select {
    max-width: 340px;
    margin: 0 auto 20px;
}

.products-index-lead {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.products-index-list {
    columns: 2;
    gap: 2rem;
    line-height: 1.85;
    list-style: none;
    padding: 0;
    margin: 0 0 32px;
}

.products-index-list li {
    break-inside: avoid;
    margin-bottom: 0.35rem;
}

.products-index-cat {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 0.35rem;
}

@media (max-width: 640px) {
    .products-index-list {
        columns: 1;
    }
}

.seo-lead {
    color: var(--text-muted);
    font-size: 0.98rem;
    margin-bottom: 20px;
}

.macro-highlight {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.macro-pill {
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
}

.macro-pill strong {
    display: block;
    font-size: 1.35rem;
    color: var(--text-dark);
    margin-top: 4px;
}

.macro-pill span { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }

.macro-pill.kcal-pill {
    grid-column: span 2;
    background: var(--ratio-badge-bg);
    border-color: var(--ratio-badge-border);
}

.macro-pill.product-price-pill {
    background: var(--kcal-badge-bg);
    border-color: var(--kcal-badge-border);
}

.macro-pill.product-price-pill strong {
    color: var(--kcal-badge-color);
}

.product-price-updated {
    margin: -8px 0 16px;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.product-price-updated strong {
    color: var(--primary-dark);
    font-weight: 700;
}

.nutrition-section {
    padding: 0 32px 32px;
}

.nutrition-section h2 {
    font-size: 1.15rem;
    margin-bottom: 16px;
    color: var(--primary-dark);
}

.nutrition-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    font-size: 0.92rem;
}

.nutrition-table th,
.nutrition-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-soft);
}

.nutrition-table th {
    background: var(--surface-hover);
    font-weight: 700;
    width: 45%;
}

.seo-block {
    margin-top: 28px;
    padding: 24px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    font-size: 0.95rem;
    line-height: 1.75;
}

.seo-block h2 {
    font-size: 1.1rem;
    color: var(--primary-dark);
    margin-bottom: 12px;
}

.seo-keywords {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.seo-keywords span {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 5px 10px;
    background: var(--surface-hover);
    color: var(--text-muted);
    border-radius: 999px;
}

.similar-products {
    margin-top: 28px;
    padding: 24px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
}

.similar-products h2 {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.similar-products-lead {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.similar-products-list {
    list-style: none;
    display: grid;
    gap: 10px;
}

@media (min-width: 560px) {
    .similar-products-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

.similar-product-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    background: var(--surface-hover);
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.similar-product-link:hover {
    border-color: var(--primary);
    background: var(--ratio-badge-bg);
    transform: translateY(-1px);
}

.similar-product-emoji {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.similar-product-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.similar-product-name {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-dark);
}

.similar-product-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.similar-products-more {
    margin-top: 18px;
    font-size: 0.88rem;
    font-weight: 600;
}

.similar-products-more a {
    color: var(--primary-dark);
    text-decoration: none;
}

.similar-products-more a:hover {
    text-decoration: underline;
}

.extra-box {
    margin-top: 16px;
    padding: 14px 16px;
    background: var(--kcal-badge-bg);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.site-footer {
    text-align: center;
    padding: 28px 24px;
    font-size: 0.88rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    background: var(--header-bg);
}

.site-footer-brand {
    margin: 0;
}

.site-footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.35rem 0.55rem;
    margin: 14px 0 10px;
}

.site-footer-nav a {
    color: var(--primary-dark);
    font-weight: 600;
    text-decoration: none;
}

.site-footer-nav a:hover {
    text-decoration: underline;
}

.site-footer-nav span[aria-hidden="true"] {
    color: var(--text-muted);
    user-select: none;
}

.site-footer-copy {
    margin: 0;
    font-size: 0.82rem;
}

.site-footer strong {
    color: var(--text-dark);
    font-weight: 700;
}
