:root {
    --bg: #36414f;
    --fg: #f5f5f5;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--fg);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
}

main {
    width: 100%;
    max-width: 900px;
    height: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
}

h1 {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3em;
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: clamp(1rem, 3vh, 2rem);
}

/* 404 page — centered (via body's flex) title-sized link home. */
.error-link {
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--fg);
    text-decoration: underline;
    transition: opacity 0.2s;
}

.error-link:hover {
    opacity: 0.7;
}

.title-logo {
    height: 1.1em;
    width: auto;
    flex-shrink: 0;
}

.carousel {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    background: #eee;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease;
}

.carousel-track .slide {
    position: relative;
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.carousel-track picture {
    display: block;
    width: 100%;
    height: 100%;
}

.carousel-track .slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.carousel-track .slide img.loaded {
    opacity: 1;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.85);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 2;
}

.carousel-btn:hover {
    background: #fff;
}

.carousel-btn.prev { left: 12px; }
.carousel-btn.next { right: 12px; }

.carousel-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 2;
}

.carousel-dots button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 0;
    transition: background 0.2s;
}

.carousel-dots button.active {
    background: #fff;
}

.carousel-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #888;
    font-style: italic;
}

footer {
    flex: 0 0 auto;
    margin-top: clamp(1rem, 3vh, 2.5rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.footer-actions {
    display: flex;
    align-items: baseline;
    justify-content: center;
}

.footer-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 1.5rem;
}

.price,
.specs {
    font-size: 0.85rem;
    opacity: 0.7;
}

footer a {
    color: #f5f5f5;
    text-decoration: none;
    font-size: 1.1rem;
    border-bottom: 1px solid #f5f5f5;
    padding-bottom: 2px;
    transition: opacity 0.2s;
}

footer a:hover {
    opacity: 0.6;
}

footer .separator {
    margin: 0 1rem;
    color: #aaa;
    font-size: 1.1rem;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.92);
    overscroll-behavior: contain;
    touch-action: none;
}

.lightbox.open {
    display: flex;
}

.lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform-origin: center center;
    cursor: grab;
    will-change: transform;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

.lightbox-img.dragging {
    cursor: grabbing;
}

.lightbox-close {
    position: absolute;
    top: max(16px, env(safe-area-inset-top));
    right: max(16px, env(safe-area-inset-right));
    z-index: 2;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    color: #222;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.lightbox-close:hover {
    background: #fff;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.6);
}

.modal.open {
    display: flex;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: var(--bg);
    color: var(--fg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
    text-align: left;
}

.modal-carousel {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
    background: #eee;
}

.modal-carousel .slide img {
    cursor: default;
}

.modal-carousel .carousel-btn {
    width: 34px;
    height: 34px;
    font-size: 1rem;
}

.modal-carousel .carousel-btn.prev { left: 8px; }
.modal-carousel .carousel-btn.next { right: 8px; }

.modal-content p {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--fg);
}

.modal-content p + p {
    margin-top: 0.9rem;
}

.modal-content a {
    color: var(--fg);
    text-decoration: underline;
}

.ext-arrow {
    display: inline-block;
    margin-left: 0.15em;
    font-size: 0.8em;
    text-decoration: none;
    vertical-align: baseline;
}
