/* PärPixel — Photography-first design */

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

:root {
    --primary: #1a1a1a;
    --accent: #c8a87c;
    --bg: #111;
    --bg-surface: #1a1a1a;
    --bg-card: #222;
    --text: #e8e8e8;
    --text-muted: #888;
    --text-dim: #555;
    --border: #333;
    --radius: 4px;
}

html { font-size: 16px; }

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

a { color: var(--accent); text-decoration: none; }
a:hover { opacity: 0.8; }

img { max-width: 100%; height: auto; display: block; }

main { flex: 1; }

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(17, 17, 17, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text);
}

.site-nav {
    display: flex;
    gap: 2rem;
}

.site-nav a {
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: color 0.2s;
}

.site-nav a:hover { color: var(--text); opacity: 1; }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    transition: 0.2s;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 2rem;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.85rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.footer-links a { color: var(--text-muted); }

/* Portfolio hero */
.portfolio-hero {
    text-align: center;
    padding: 4rem 2rem 2rem;
}

.portfolio-hero h1 {
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 4px;
    text-transform: uppercase;
}

.tagline {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-top: 0.5rem;
    font-weight: 300;
}

/* Gallery filter */
.gallery-filter, .shop-filter {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding: 1rem 2rem 2rem;
}

.gallery-filter a, .shop-filter a {
    color: var(--text-muted);
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
}

.gallery-filter a.active, .shop-filter a.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

/* Gallery grid */
.gallery-grid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.gallery-card {
    display: block;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--bg-card);
    transition: transform 0.3s;
}

.gallery-card:hover { transform: translateY(-4px); opacity: 1; }

.gallery-card-image {
    aspect-ratio: 4/3;
    overflow: hidden;
}

.gallery-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.gallery-card:hover .gallery-card-image img { transform: scale(1.03); }

.gallery-card-info {
    padding: 1.2rem;
}

.gallery-card-info h2 {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text);
}

.gallery-card-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.photo-count {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 0.5rem;
    display: block;
}

/* Gallery detail — masonry */
.gallery-header {
    text-align: center;
    padding: 3rem 2rem 2rem;
}

.gallery-header h1 {
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 3px;
}

.gallery-header p {
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.masonry-grid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem 4rem;
    column-count: 3;
    column-gap: 0.75rem;
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 0.75rem;
    cursor: pointer;
    border-radius: var(--radius);
    overflow: hidden;
}

.masonry-item img {
    width: 100%;
    display: block;
    transition: opacity 0.3s;
}

.masonry-item:hover img { opacity: 0.85; }

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

[x-cloak] { display: none !important; }

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2.5rem;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
}

.lightbox-prev, .lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    color: rgba(255,255,255,0.6);
    background: none;
    border: none;
    cursor: pointer;
    padding: 1rem;
    z-index: 10;
}

.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }
.lightbox-prev:hover, .lightbox-next:hover { color: #fff; }

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
}

.lightbox-content img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
}

.lightbox-info {
    text-align: center;
    padding: 0.75rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

/* Product grid */
.shop-header {
    text-align: center;
    padding: 3rem 2rem 1rem;
}

.shop-header h1 {
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.product-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    display: block;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
    transition: transform 0.3s;
}

.product-card:hover { transform: translateY(-4px); opacity: 1; }

.product-card-image {
    aspect-ratio: 1;
    overflow: hidden;
}

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

.product-card-info {
    padding: 1rem;
}

.product-card-info h3 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
}

.product-price {
    color: var(--accent);
    font-size: 0.95rem;
    margin-top: 0.3rem;
    display: block;
}

/* Product detail */
.product-detail {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.preview-main {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
}

.preview-main img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.preview-thumbs {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.preview-thumbs button {
    width: 60px;
    height: 60px;
    border: 2px solid transparent;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    background: none;
}

.preview-thumbs button.active { border-color: var(--accent); }
.preview-thumbs button img { width: 100%; height: 100%; object-fit: cover; }

.product-info h1 {
    font-size: 1.8rem;
    font-weight: 400;
    margin-bottom: 1rem;
}

.product-description {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.license-selector {
    margin-bottom: 1.5rem;
}

.license-selector > label:first-child {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
}

.license-option {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.license-option.selected { border-color: var(--accent); }
.license-option input[type="radio"] { display: none; }

.license-name { font-weight: 500; flex: 1; }
.license-price { color: var(--accent); font-weight: 600; }
.license-desc {
    width: 100%;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.included-files {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.included-files h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.included-files ul { list-style: none; }

.included-files li {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.product-tags {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    font-size: 0.8rem;
    padding: 0.3rem 0.8rem;
    background: var(--bg-surface);
    border-radius: 20px;
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: opacity 0.2s;
    letter-spacing: 0.5px;
}

.btn:hover { opacity: 0.85; }

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
    width: 100%;
}

.btn-link {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    text-decoration: underline;
}

/* Cart */
.cart-page {
    max-width: 700px;
    margin: 0 auto;
    padding: 2rem;
}

.cart-page h1 {
    font-size: 1.8rem;
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 2rem;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: var(--radius);
    object-fit: cover;
}

.cart-item-info { flex: 1; }
.cart-item-info h3 { font-size: 1rem; font-weight: 500; }
.cart-item-license { font-size: 0.85rem; color: var(--text-muted); }
.cart-item-price { color: var(--accent); font-weight: 600; }

.cart-summary {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

/* Checkout */
.checkout-page {
    max-width: 500px;
    margin: 0 auto;
    padding: 2rem;
}

.checkout-page h1 {
    font-size: 1.8rem;
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 2rem;
}

.checkout-form .form-group {
    margin-bottom: 1.5rem;
}

.checkout-form label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.checkout-form input[type="email"] {
    width: 100%;
    padding: 0.8rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 1rem;
}

.checkout-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Order status */
.order-status-page {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
}

.order-status-page h1 {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 1rem;
}

.order-status-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.status-delivered { background: #1a3a1a; color: #6c6; }
.status-awaiting_payment { background: #3a3a1a; color: #cc6; }
.status-paid { background: #1a2a3a; color: #6ac; }
.status-expired { background: #3a1a1a; color: #c66; }

.download-cta {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius);
    text-align: center;
    margin: 1.5rem 0;
}

.download-cta p { margin-bottom: 1rem; }

.order-items {
    margin-top: 2rem;
}

.order-items h2 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.order-item-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.item-license { color: var(--text-muted); font-size: 0.85rem; }

.order-total-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    font-weight: 600;
    font-size: 1.1rem;
}

.order-vat-note {
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* Download page */
.download-page {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
}

.download-page h1 {
    font-size: 1.8rem;
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 1rem;
}

.download-info {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.file-list { display: flex; flex-direction: column; gap: 1rem; }

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius);
}

.file-details { flex: 1; }
.file-name { font-weight: 500; display: block; }
.file-size { font-size: 0.85rem; color: var(--text-muted); }

/* Expired */
.expired-page {
    max-width: 500px;
    margin: 0 auto;
    padding: 4rem 2rem;
    text-align: center;
}

.expired-page h1 { margin-bottom: 1rem; }
.expired-page p { color: var(--text-muted); }

/* CMS page */
.cms-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.page-hero {
    margin: -2rem -2rem 2rem;
    border-radius: var(--radius);
    overflow: hidden;
}

.page-hero img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
}

.cms-page h1 {
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
}

.page-body {
    color: var(--text-muted);
    line-height: 1.8;
}

.page-body h2, .page-body h3 { color: var(--text); margin: 1.5rem 0 0.75rem; }
.page-body p { margin-bottom: 1rem; }
.page-body a { color: var(--accent); }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state h2 { color: var(--text); margin-bottom: 0.5rem; }

/* Alerts */
.alert { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.alert-error { background: #3a1a1a; color: #c66; }

/* Mobile */
@media (max-width: 768px) {
    .site-nav { display: none; }
    .site-header.open .site-nav {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg);
        padding: 1rem 2rem;
        border-bottom: 1px solid var(--border);
    }
    .nav-toggle { display: flex; }
    .header-inner { padding: 0.75rem 1.5rem; }

    .masonry-grid { column-count: 2; padding: 0 0.5rem; }
    .gallery-grid { grid-template-columns: 1fr; padding: 0 1rem; }
    .product-grid { grid-template-columns: repeat(2, 1fr); padding: 0 1rem; gap: 1rem; }
    .product-detail { grid-template-columns: 1fr; padding: 1rem; gap: 1.5rem; }

    .portfolio-hero { padding: 2rem 1rem 1rem; }
    .portfolio-hero h1 { font-size: 1.8rem; }

    .lightbox-prev, .lightbox-next { font-size: 2rem; }
}

@media (max-width: 480px) {
    .masonry-grid { column-count: 1; }
    .product-grid { grid-template-columns: 1fr; }
}
