* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #111;
    color: #eee;
    font-family: "Segoe UI", system-ui, sans-serif;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
}

.site-header h1 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.cart-indicator {
    font-size: 1.1rem;
}

/* --- Header actions --- */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-link {
    color: #bbb;
    text-decoration: none;
    font-size: 0.9rem;
    border-bottom: 1px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.header-link:hover {
    color: #fff;
    border-color: #888;
}

.lang-switch select {
    background: #1a1a1a;
    color: #ccc;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    padding: 0.25rem 0.4rem;
    font-size: 0.8rem;
    cursor: pointer;
}

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

/* --- Foldable filter panel --- */
.filter-panel {
    padding: 0 2rem 0.5rem;
}

.filter-details {
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    background: #161616;
}

.filter-summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #ddd;
    list-style: none;
}

.filter-summary::-webkit-details-marker {
    display: none;
}

.filter-summary::before {
    content: "▸";
    display: inline-block;
    transition: transform 0.2s ease;
    color: #888;
}

.filter-details[open] .filter-summary::before {
    transform: rotate(90deg);
}

.filter-badge {
    display: inline-grid;
    place-items: center;
    min-width: 1.3rem;
    height: 1.3rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #eee;
    color: #111;
    font-size: 0.72rem;
    font-weight: 700;
}

.filter-badge[hidden] {
    display: none;
}

.filter-body {
    padding: 0.25rem 1rem 1rem;
    border-top: 1px solid #2a2a2a;
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
    margin-top: 0.9rem;
}

.filter-group-label {
    min-width: 5.5rem;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #777;
}

.filter-group-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.clear-filters {
    margin-top: 1rem;
    border: none;
    background: none;
    color: #888;
    font-size: 0.8rem;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}

.clear-filters:hover {
    color: #ddd;
}

.no-match-note {
    padding: 0 2rem 2rem;
    color: #888;
}

.tag-btn {
    border: 1px solid #444;
    border-radius: 999px;
    background: none;
    color: #bbb;
    padding: 0.35rem 0.9rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.tag-btn:hover {
    color: #fff;
    border-color: #888;
}

.tag-btn.active {
    background: #eee;
    border-color: #eee;
    color: #111;
}

.tile.tag-hidden {
    display: none;
}

/* --- Pinterest-style mosaic (CSS columns) --- */
.mosaic {
    columns: 4 260px;
    column-gap: 1rem;
    padding: 1rem 2rem 3rem;
}

.tile {
    position: relative;
    margin: 0 0 1rem;
    break-inside: avoid;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
}

.tile img {
    display: block;
    width: 100%;
    height: auto;
    filter: grayscale(100%);
    transform: scale(1);
    transition: filter 0.45s ease, transform 0.45s ease;
}

.tile:hover img,
.tile:focus-within img {
    filter: grayscale(0%);
    transform: scale(1.06);
}

.tile-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 1.5rem 0.8rem 0.6rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity 0.45s ease;
    pointer-events: none;
}

.tile:hover .tile-caption,
.tile:focus-within .tile-caption {
    opacity: 1;
}

/* --- Add to cart button --- */
.add-to-cart {
    position: absolute;
    right: 0.6rem;
    bottom: 0.6rem;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #111;
    cursor: pointer;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease;
}

.tile:hover .add-to-cart,
.tile:focus-within .add-to-cart {
    opacity: 1;
    transform: translateY(0);
}

.add-to-cart:hover {
    background: #fff;
    transform: scale(1.1);
}

.add-to-cart.added {
    background: #4caf50;
    color: #fff;
}

/* --- Full-size modal --- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    animation: modal-in 0.25s ease;
}

.modal[hidden] {
    display: none;
}

@keyframes modal-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 6px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.6);
}

.modal-info {
    text-align: center;
}

.modal-title {
    margin: 0;
    font-size: 1rem;
    color: #ddd;
}

.modal-owner {
    margin: 0.3rem 0 0;
    font-size: 0.85rem;
    color: #aaa;
}

.modal-caption {
    margin: 0.2rem 0 0;
    font-size: 0.95rem;
    color: #ddd;
    max-width: 40ch;
}

.modal-caption::before { content: "“"; }
.modal-caption::after { content: "”"; }

.modal-caption a {
    color: #8ab4ff;
}

.modal-caption code,
.markup-hint code {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    padding: 0 0.3em;
    font-size: 0.9em;
}

.modal-owner[hidden],
.modal-caption[hidden] {
    display: none;
}

/* --- Cart & checkout --- */
.home-link {
    color: inherit;
    text-decoration: none;
}

.cart-page,
.success-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 1rem 2rem 4rem;
}

.cart-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cart-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #2a2a2a;
}

.cart-item > img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    filter: grayscale(100%);
}

.cart-item-body {
    flex: 1;
}

.cart-item-head {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.cart-item-title {
    font-weight: 600;
}

.caption-field,
.owner-field {
    display: block;
    font-size: 0.8rem;
    color: #999;
}

.caption-field input {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.5rem;
    background: #1a1a1a;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    color: #eee;
    font-size: 0.9rem;
}

.markup-hint {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.72rem;
    color: #777;
}

.owner-note {
    margin: 0;
    font-size: 0.8rem;
    color: #888;
}

.cart-remove {
    border: none;
    background: none;
    color: #888;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.cart-remove:hover {
    color: #e05a3c;
}

.checkout-options {
    margin: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.anon-field {
    font-size: 0.9rem;
    color: #ccc;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
}

.cart-total {
    font-size: 1.2rem;
    font-weight: 600;
}

.confirm-btn {
    display: inline-block;
    border: none;
    border-radius: 8px;
    background: #eee;
    color: #111;
    padding: 0.7rem 1.4rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease;
}

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

.cart-note {
    font-size: 0.8rem;
    color: #777;
    margin-top: 1rem;
}

.success-page {
    display: grid;
    place-items: center;
    min-height: 70vh;
    text-align: center;
}

.success-check {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #4caf50;
    color: #fff;
    font-size: 2rem;
}

/* --- Commission page --- */
.modal-commission {
    margin-top: 0.8rem;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
}

.commission-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 1rem 2rem 4rem;
}

.privacy-note {
    color: #999;
    font-size: 0.85rem;
    line-height: 1.5;
    border-left: 2px solid #3a3a3a;
    padding-left: 0.8rem;
}

.style-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 0.8rem;
    background: #161616;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
}

.style-preview img {
    width: 84px;
    height: 84px;
    object-fit: cover;
    border-radius: 8px;
}

.style-preview span {
    font-size: 0.9rem;
    color: #ccc;
}

.commission-form .form-row {
    margin-bottom: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.commission-form label {
    font-size: 0.85rem;
    color: #ddd;
}

.commission-form input[type="text"],
.commission-form input[type="email"],
.commission-form input[type="number"],
.commission-form input[type="file"],
.commission-form textarea,
.commission-form select {
    width: 100%;
    padding: 0.55rem;
    background: #1a1a1a;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    color: #eee;
    font-size: 0.95rem;
    font-family: inherit;
}

.commission-form textarea {
    resize: vertical;
}

.commission-form .help {
    font-size: 0.75rem;
    color: #777;
}

.field-error,
.form-errors {
    font-size: 0.8rem;
    color: #ff8a70;
}

.form-errors {
    margin-bottom: 1rem;
    padding: 0.6rem 0.8rem;
    border: 1px solid #5a2a22;
    border-radius: 6px;
    background: #2a1512;
}

.form-errors ul {
    margin: 0;
    padding-left: 1rem;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    border: none;
    background: none;
    color: #fff;
    font-size: 2.2rem;
    line-height: 1;
    cursor: pointer;
}

.empty-note {
    color: #888;
}
