/* VIP BRICK BUILDING — main stylesheet
   Color palette inspired by classic brick toys:
   primary red, accent yellow, deep blue, white, soft cream.
*/
:root {
    --primary: #d62828;
    --primary-dark: #9d1c1c;
    --accent: #fcbf49;
    --accent-dark: #f59e0b;
    --blue: #003566;
    --bg: #fff8e7;
    --surface: #ffffff;
    --text: #1a1a1a;
    --text-dim: #6b7280;
    --border: #e5e7eb;
    --success: #16a34a;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.10);
    --radius: 12px;
}

[data-theme="dark"] {
    --bg: #1a1a1a;
    --surface: #2a2a2a;
    --text: #f5f5f5;
    --text-dim: #9ca3af;
    --border: #404040;
    --blue: #60a5fa;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* ---- Header ---- */
.site-header {
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    padding-bottom: 12px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}
.logo-icon { width: 40px; height: 40px; }
.logo-text strong { color: var(--accent); }
.site-header nav { display: flex; gap: 24px; }
.site-header nav a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.2s;
}
.site-header nav a:hover { background: rgba(255,255,255,0.15); }

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.lang-switcher select {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    padding: 6px 28px 6px 10px;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='%23fff'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 10px center;
    background-size: 10px;
    transition: background-color 0.2s;
}
.lang-switcher select:hover { background-color: rgba(255,255,255,0.25); }
.lang-switcher select option {
    background: #1a1a1a;
    color: #fff;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---- Hero ---- */
.hero {
    text-align: center;
    padding: 60px 20px 30px;
}
.hero h1 {
    font-size: 2.5rem;
    color: var(--blue);
    margin-bottom: 12px;
}
.hero-sub {
    font-size: 1.1rem;
    color: var(--text-dim);
}

/* ---- Search bar ---- */
.search-bar {
    display: flex;
    gap: 10px;
    margin: 30px 0;
    flex-wrap: wrap;
}
.search-bar input,
.search-bar select {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
}
.search-bar input:focus,
.search-bar select:focus {
    outline: none;
    border-color: var(--primary);
}

.result-count {
    margin: 10px 0 24px;
    color: var(--text-dim);
}

/* ---- Buttons ---- */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-family: inherit;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-buy {
    background: var(--success);
    color: #fff;
    font-weight: 700;
}
.btn-buy:hover { background: #15803d; transform: translateY(-1px); }
.btn-buy-lg {
    padding: 14px 32px;
    font-size: 1.1rem;
    width: 100%;
    text-align: center;
    margin-top: 16px;
}
.btn-ghost {
    background: transparent;
    color: var(--text-dim);
    border: 2px solid var(--border);
}
.btn-ghost:hover { background: var(--surface); }

/* ---- Sets grid ---- */
.sets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 60px;
}
.set-card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}
.set-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.set-image-link {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 4/3;
    background: #f3f4f6;
}
.set-image-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}
.set-card:hover .set-image-link img { transform: scale(1.05); }
.badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent);
    color: var(--blue);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}
.set-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.set-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
    line-height: 1.3;
}
.set-title a {
    color: var(--text);
    text-decoration: none;
}
.set-title a:hover { color: var(--primary); }
.set-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.tag {
    background: var(--bg);
    color: var(--text-dim);
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
}
.tag-featured {
    background: var(--accent);
    color: var(--blue);
    font-weight: 700;
}
.set-description {
    color: var(--text-dim);
    font-size: 0.92rem;
    margin-bottom: 16px;
    flex: 1;
}
.set-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    padding-top: 12px;
    margin-top: auto;
}
.price {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
}

/* ---- Detail page ---- */
.set-detail { padding: 20px 0 60px; }
.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.back-link:hover { text-decoration: underline; }
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    background: var(--surface);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}
.detail-image img {
    width: 100%;
    border-radius: var(--radius);
}
/* ---- Carousel ---- */
.carousel {
    position: relative;
    width: 100%;
    background: #f3f4f6;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 4/3;
    user-select: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.carousel-track {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
}
.carousel-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.35s ease-in-out;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}
.carousel-slide.active {
    opacity: 1;
    pointer-events: auto;
}
.carousel-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s, transform 0.2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.carousel-btn:hover {
    background: rgba(0, 0, 0, 0.85);
    transform: translateY(-50%) scale(1.08);
}
.carousel-prev { left: 12px; }
.carousel-next { right: 12px; }

.carousel-counter {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 2;
    letter-spacing: 0.3px;
}

.carousel-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
    justify-content: center;
}
.carousel-thumb {
    background: none;
    border: 2px solid transparent;
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s, opacity 0.2s;
    opacity: 0.65;
    width: 70px;
    height: 70px;
}
.carousel-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.carousel-thumb:hover {
    opacity: 1;
    transform: scale(1.05);
}
.carousel-thumb.active {
    border-color: var(--primary);
    opacity: 1;
}

@media (max-width: 480px) {
    .carousel-btn { width: 36px; height: 36px; font-size: 22px; }
    .carousel-thumb { width: 56px; height: 56px; }
}

/* Old thumb-strip kept for any future variant; safe to remove */
.thumb-strip { display: none; }
.detail-body h1 {
    font-size: 2rem;
    color: var(--blue);
    margin-bottom: 16px;
}
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}
.detail-description {
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 20px;
}
.detail-price {
    padding: 16px 20px;
    background: var(--bg);
    border-radius: var(--radius);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.price-label { color: var(--text-dim); }
.price-value { font-size: 1.8rem; font-weight: 800; color: var(--primary); }
.affiliate-note {
    font-size: 0.85rem;
    color: var(--text-dim);
    text-align: center;
    margin-top: 8px;
}

/* ---- Empty state ---- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}
.empty-state h1 { font-size: 4rem; color: var(--primary); margin-bottom: 10px; }
.empty-state p { color: var(--text-dim); margin-bottom: 20px; }

/* ---- About page ---- */
.about-page { max-width: 700px; margin: 0 auto; padding: 40px 20px; }
.about-page h1 { color: var(--blue); margin-bottom: 20px; }
.about-page h2 { color: var(--blue); margin: 24px 0 12px; }
.about-page p, .about-page li { font-size: 1.05rem; line-height: 1.7; margin-bottom: 10px; }
.about-page ul { padding-right: 24px; }
.about-page .disclaimer {
    background: var(--bg);
    padding: 16px;
    border-radius: var(--radius);
    border-right: 4px solid var(--accent);
    margin-top: 24px;
}

/* ---- Footer ---- */
.site-footer {
    background: var(--blue);
    color: #fff;
    padding: 30px 0;
    text-align: center;
    margin-top: auto;
}
.site-footer p { margin: 6px 0; }
.site-footer .disclaimer { font-size: 0.85rem; opacity: 0.8; }
.site-footer .credit { font-size: 0.9rem; color: var(--accent); font-weight: 600; }

/* ---- Mobile ---- */
@media (max-width: 768px) {
    .hero h1 { font-size: 1.8rem; }
    .detail-grid { grid-template-columns: 1fr; gap: 20px; padding: 20px; }
    .site-header .container { flex-direction: column; gap: 10px; }
    .site-header nav { gap: 12px; }
    .search-bar { flex-direction: column; }
    .search-bar input, .search-bar select { width: 100%; }
    .header-right { flex-direction: column; gap: 10px; }
}
