/* ===== header ===== */
.site-top {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.brand {
    color: #ff9700;
    font-weight: 800;
    font-size: 1.4rem;
    text-decoration: none;
    letter-spacing: 0.02em;
}
.top-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.top-nav a {
    color: #ccc;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid #2b2b2b;
    background: #111;
    font-size: 0.95rem;
}
.top-nav a.active,
.top-nav a:hover {
    color: #000;
    background: #ff9700;
    border-color: #ff9700;
}
.top-nav a.nav-cta {
    background: #ff9700;
    color: #000;
    border-color: #ff9700;
    font-weight: 700;
}

/* ===== hero ===== */
.hero-mini {
    text-align: center;
    padding: 36px 20px 10px;
    position: relative;
    z-index: 1;
}
.hero-rich { padding: 48px 20px 28px; }
.hero-kicker {
    display: inline-block;
    color: #ff9700;
    border: 1px solid #3a2a10;
    background: rgba(255,151,0,.08);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 14px;
}
.hero-mini h1 {
    color: #ff9700;
    font-size: clamp(2rem, 5vw, 3.2rem);
    margin: 0 0 12px;
    letter-spacing: 0.02em;
}
.hero-lead {
    color: #f2f2f2;
    font-size: clamp(1.05rem, 2.2vw, 1.3rem);
    font-weight: 600;
    margin: 0 0 8px;
}
.hero-sub {
    color: #9a9a9a;
    margin: 0 0 22px;
    font-size: 0.98rem;
}

.catalog-meta {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 18px;
}
.api-error {
    background: #1a1010;
    border: 1px solid #5a2a2a;
    color: #ffb4b4;
    border-radius: 16px;
    padding: 20px;
    margin: 20px 0;
}

/* ===== product cards: avatar + text, fixed image size ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    align-items: stretch;
}

.product-card {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 14px;
    text-decoration: none;
    color: inherit;
    background: #151515;
    border: 1px solid #2b2b2b;
    border-radius: 18px;
    padding: 14px;
    overflow: hidden;
    min-height: 112px;
    box-sizing: border-box;
    transition: border-color .2s, transform .2s;
}
.product-card:hover {
    border-color: #ff9700;
    transform: translateY(-2px);
}

.product-media {
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    border-radius: 16px;
    overflow: hidden;
    background: #0d0d0d;
    border: 1px solid #2b2b2b;
}
.product-media img {
    width: 72px !important;
    height: 72px !important;
    max-width: 72px !important;
    max-height: 72px !important;
    object-fit: cover;
    object-position: center;
    display: block;
}

.product-body {
    flex: 1 1 auto;
    min-width: 0; /* allow text truncate in flex */
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.product-cat {
    color: #ff9700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.product-name {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}
.product-desc {
    color: #999;
    font-size: 0.86rem;
    line-height: 1.4;
    margin: 0;
    min-height: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-shop {
    color: #bbb;
    font-size: 0.82rem;
    border-top: 1px solid #2b2b2b;
    padding-top: 8px;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== detail page ===== */
.detail-wrap {
    max-width: 860px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}
.detail-card {
    background: #151515;
    border: 1px solid #2b2b2b;
    border-radius: 22px;
    padding: 28px;
}
.detail-with-media {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 22px;
    align-items: start;
}
.detail-media {
    width: 120px;
}
.detail-media img {
    width: 120px !important;
    height: 120px !important;
    max-width: 120px !important;
    max-height: 120px !important;
    object-fit: cover;
    border-radius: 20px;
    border: 1px solid #2b2b2b;
    background: #0d0d0d;
    display: block;
}
.detail-card h1 {
    margin: 0 0 8px;
    font-size: clamp(1.35rem, 3vw, 1.8rem);
    line-height: 1.25;
    word-break: break-word;
}
.detail-meta {
    color: #aaa;
    margin-bottom: 18px;
}
.detail-meta a { color: #ff9700; }
.detail-body {
    color: #ddd;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: none;
}
.back-link {
    display: inline-block;
    margin-bottom: 16px;
    color: #ff9700;
    text-decoration: none;
}

/* ===== product reviews ===== */
.reviews-block {
    margin-top: 28px;
    background: #151515;
    border: 1px solid #2b2b2b;
    border-radius: 22px;
    padding: 24px;
}
.reviews-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 16px;
    margin-bottom: 16px;
}
.reviews-title {
    margin: 0;
    font-size: 1.25rem;
    color: #fff;
}
.reviews-count {
    color: #ff9700;
    font-weight: 700;
}
.reviews-note {
    color: #777;
    font-size: 0.8rem;
}
.reviews-empty {
    color: #999;
    margin: 0;
}
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.review-card {
    background: #101010;
    border: 1px solid #2b2b2b;
    border-left: 3px solid #ff9700;
    border-radius: 14px;
    padding: 14px 16px;
}
.review-text {
    color: #e8e8e8;
    line-height: 1.55;
    word-break: break-word;
}
.review-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 10px;
    font-size: 0.82rem;
    color: #999;
}
.review-pack {
    color: #ff9700;
}
.reviews-more-hint {
    margin: 14px 0 0;
    color: #777;
    font-size: 0.85rem;
}

/* ===== shops list avatars (override style.css stretch) ===== */
.shops-grid .shop-avatar,
.shop-bubble img.shop-avatar {
    width: 56px !important;
    height: 56px !important;
    max-width: 56px !important;
    max-height: 56px !important;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.shop-bubble .shop-info-text {
    color: #999;
    font-size: 0.88rem;
    margin-top: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.shop-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 720px) {
    .detail-with-media {
        grid-template-columns: 1fr;
    }
    .detail-media,
    .detail-media img {
        width: 96px !important;
        height: 96px !important;
        max-width: 96px !important;
        max-height: 96px !important;
    }
    .products-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 640px) {
    .site-top { padding-top: 16px; }
    .hero-mini { padding-top: 24px; }
    .product-media,
    .product-media img {
        width: 64px !important;
        height: 64px !important;
        max-width: 64px !important;
        max-height: 64px !important;
        border-radius: 14px;
    }
}

/* ===== BY light theme: white + logo yellow ===== */
.theme-by {
    --accent: #F18B2C;
    --accent-soft: #fbbd6d;
    --accent-hot: #e67a1a;
    --accent-dim: rgba(241, 139, 44, 0.14);
    --accent-border: #f5d4a8;
    --bg: #ffffff;
    --bg-warm: #fff8ef;
    --surface: #ffffff;
    --text: #1f160c;
    --muted: #8a7355;
    --line: #f0e2cf;
    --shadow: 0 2px 10px rgba(241, 139, 44, 0.08);
    --shadow-hover: 0 12px 28px rgba(241, 139, 44, 0.16);
    --card-radius: 14px;
}

body.theme-by,
body.theme-by.theme-light {
    background: #ffffff !important;
    color: var(--text) !important;
}

.theme-by .main-container {
    padding-top: 0;
    background:
        radial-gradient(ellipse 70% 45% at 0% 0%, rgba(251,189,109,0.28), transparent 55%),
        radial-gradient(ellipse 55% 40% at 100% 5%, rgba(241,139,44,0.12), transparent 50%),
        #ffffff;
}
.theme-by .radial { display: none !important; }

.theme-by .by-top {
    background: #ffffff;
    border-bottom: 2px solid var(--accent-border);
    padding: 16px 20px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    position: sticky;
    top: 0;
    z-index: 20;
}
.theme-by .site-top.by-top {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.theme-by .brand-block {
    display: flex;
    align-items: center;
    gap: 12px;
}
.theme-by .brand-logo {
    display: block;
    line-height: 0;
}
.theme-by .brand-logo img {
    height: 36px;
    width: auto;
    display: block;
}
.theme-by .brand-flag {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-soft));
    padding: 4px 8px;
    border-radius: 6px;
}

.theme-by .top-nav a {
    color: var(--text) !important;
    background: var(--bg-warm) !important;
    border: 1px solid var(--accent-border) !important;
    border-radius: 10px;
}
.theme-by .top-nav a.active,
.theme-by .top-nav a:hover,
.theme-by .top-nav a.nav-cta,
.theme-by .hero-cta,
.theme-by a.hero-cta {
    background: linear-gradient(135deg, var(--accent), var(--accent-soft)) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
    border-radius: 10px !important;
    box-shadow: 0 6px 16px rgba(241,139,44,0.3);
}

.theme-by .by-hero {
    text-align: left;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 24px;
}
.theme-by .hero-logo-wrap {
    margin-bottom: 18px;
}
.theme-by .hero-logo-wrap img {
    height: clamp(48px, 8vw, 72px);
    width: auto;
    display: block;
}
.theme-by .hero-kicker {
    color: var(--accent-hot) !important;
    border: 1px solid var(--accent-border);
    background: var(--accent-dim);
    border-radius: 8px;
    letter-spacing: 0.1em;
    margin-bottom: 14px;
}
.theme-by .by-hero h1,
.theme-by .by-hero .hero-lead {
    color: var(--text) !important;
    font-size: clamp(1.45rem, 3.2vw, 2rem);
    font-weight: 700;
    margin: 0 0 10px;
    line-height: 1.25;
}
.theme-by .hero-sub {
    color: var(--muted) !important;
}
.theme-by .hero-cta {
    border-radius: 12px !important;
    padding: 14px 28px;
}

.theme-by .catalog-meta,
.theme-by .page-info {
    color: var(--muted) !important;
}
.theme-by .section-title {
    color: var(--text) !important;
    text-align: left;
    margin-bottom: 0;
}
.theme-by .sort-controls {
    margin-bottom: 18px;
}
.theme-by .product-cat,
.theme-by .back-link,
.theme-by .detail-meta a,
.theme-by .footer-links a {
    color: var(--accent) !important;
}

.theme-by .api-error {
    background: #fff7ed;
    border: 1px solid #fdba74;
    color: #9a3412;
}

.theme-by .shops-section {
    background: transparent;
}
.theme-by .by-section .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.theme-by .product-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 14px;
    padding: 14px;
    background: #ffffff !important;
    border: 1px solid var(--line) !important;
    border-left: 3px solid var(--accent) !important;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
    color: var(--text) !important;
}
.theme-by .product-card:hover {
    border-color: var(--accent-soft) !important;
    border-left-color: var(--accent) !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}
.theme-by .product-card .product-media {
    flex: 0 0 80px;
    width: 80px;
    min-width: 80px;
    height: 80px;
    margin: 0;
    border-radius: 12px;
    border: 1px solid var(--accent-border);
    background: var(--bg-warm);
}
.theme-by .product-card .product-media img {
    width: 80px !important;
    height: 80px !important;
    max-width: 80px !important;
    max-height: 80px !important;
}
.theme-by .product-name {
    color: var(--text) !important;
}
.theme-by .product-desc {
    color: var(--muted) !important;
}
.theme-by .product-shop {
    color: #6e5a40 !important;
    border-top-color: var(--line) !important;
}

.theme-by .shop-bubble {
    background: #ffffff !important;
    border: 1px solid var(--line) !important;
    border-top: 3px solid var(--accent) !important;
    border-radius: var(--card-radius) !important;
    box-shadow: var(--shadow);
    color: var(--text) !important;
}
.theme-by .shop-bubble:hover {
    border-color: var(--accent) !important;
    box-shadow: var(--shadow-hover);
}
.theme-by .shop-bubble .shop-title,
.theme-by .shop-title {
    color: var(--text) !important;
}
.theme-by .shop-bubble .shop-info-text {
    color: var(--muted) !important;
}
.theme-by .shop-header .shop-location,
.theme-by .shop-location {
    color: var(--muted) !important;
}
.theme-by .shop-stats,
.theme-by .detail-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 8px;
    font-size: 0.82rem;
    color: var(--muted);
}
.theme-by .shop-rating,
.theme-by .shop-rating-inline {
    color: var(--accent) !important;
    font-weight: 700;
}
.theme-by .shop-orders-inline {
    color: var(--muted);
    margin-left: 6px;
}
.theme-by .product-shop .shop-rating-inline {
    margin-left: 8px;
}
.theme-by .detail-stats {
    margin-bottom: 16px;
    font-size: 0.95rem;
}
.theme-by .online-status {
    background: var(--accent) !important;
}

.theme-by .detail-card {
    background: #ffffff !important;
    border: 1px solid var(--line) !important;
    border-top: 3px solid var(--accent) !important;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
    color: var(--text) !important;
}
.theme-by .detail-card h1 {
    color: var(--text) !important;
}
.theme-by .detail-meta {
    color: var(--muted) !important;
}
.theme-by .detail-body {
    color: #4a3b2a !important;
}
.theme-by .detail-media img {
    border-color: var(--accent-border) !important;
    background: var(--bg-warm) !important;
}

.theme-by .reviews-block {
    background: #ffffff !important;
    border: 1px solid var(--line) !important;
    border-top: 3px solid var(--accent);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
}
.theme-by .reviews-title {
    color: var(--text) !important;
}
.theme-by .reviews-count,
.theme-by .review-pack {
    color: var(--accent) !important;
}
.theme-by .reviews-note,
.theme-by .reviews-empty,
.theme-by .reviews-more-hint,
.theme-by .review-meta {
    color: var(--muted) !important;
}
.theme-by .review-card {
    background: var(--bg-warm) !important;
    border: 1px solid var(--line) !important;
    border-left: 3px solid var(--accent) !important;
}
.theme-by .review-text {
    color: var(--text) !important;
}

.theme-by .sort-btn,
.theme-by .page-btn {
    background: var(--bg-warm) !important;
    color: var(--text) !important;
    border: 1px solid var(--accent-border) !important;
    border-radius: 10px;
}
.theme-by .sort-btn:hover,
.theme-by .page-btn:hover,
.theme-by .sort-btn.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-soft)) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
}

.theme-by .footer {
    background: #ffffff !important;
    border-top: 2px solid var(--accent-border) !important;
    color: var(--muted) !important;
}
.theme-by .footer > p,
.theme-by .footer-section {
    color: var(--muted) !important;
}

@media (max-width: 640px) {
    .theme-by .brand-logo img { height: 30px; }
    .theme-by .by-hero { text-align: center; }
    .theme-by .hero-logo-wrap img { margin: 0 auto; }
    .theme-by .product-card { flex-direction: row; }
}
