:root {
    --button-height: 40px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: #fffdf8;
    color: #243e32;
    font:
        16px Arial,
        sans-serif;
}

.api-loading-status {
    position: absolute;
    inset: 0 auto auto 0;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.api-loading {
    position: fixed;
    z-index: 30;
    inset: 0;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 12px;
    border: 0;
    place-items: center;
    background: #17291e59;
    pointer-events: none;
}

.api-loading:not([hidden]) {
    display: grid;
}

.api-loading > span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 24px;
    background: #173a2c;
    color: #fff;
    box-shadow: 0 3px 12px #173a2c33;
    font-size: 0.875rem;
    font-weight: 600;
}

.api-loading > span::before {
    content: '';
    width: 1em;
    height: 1em;
    border: 2px solid #ffffff59;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: api-loading-spin 0.8s linear infinite;
}

@keyframes api-loading-spin {
    to {
        transform: rotate(1turn);
    }
}

@media (prefers-reduced-motion: reduce) {
    .api-loading > span::before {
        animation: none;
    }
}

.wrap {
    width: min(1240px, 92%);
    margin: auto;
}

header {
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid #dddcd1;
    background: #fffdf8;
}

.nav,
.catalog-head {
    height: 76px;
    gap: 42px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font:
        bold 31px Georgia,
        serif;
    letter-spacing: -1.5px;
}

.navlink {
    font-size: 15px;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
select,
input {
    font: inherit;
}

button,
select {
    cursor: pointer;
}

button {
    border: 0;
}

.save {
    margin-left: auto;
    background: #264737;
    color: white;
    border-radius: 24px;
    padding: 11px 18px;
}

.hero {
    margin-top: 28px;
    position: relative;
    isolation: isolate;
    background: #fbebcf;
    overflow: hidden;
    min-height: 355px;
    display: flex;
    align-items: center;
}

.hero img {
    position: absolute;
    inset: 0 0 0 auto;
    width: 66%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
}

.hero:before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        #fbebcf 0%,
        #fbebcf 34%,
        #fbebcfe0 41%,
        transparent 58%
    );
    z-index: -1;
}

.hero-copy {
    padding: 36px 5%;
}

h1,
h2,
h3 {
    font-family: Georgia, 'Times New Roman', serif;
    margin: 0;
}

h1 {
    font-size: clamp(54px, 6vw, 88px);
    letter-spacing: -3px;
    line-height: 0.99;
    margin: 18px 0 25px;
    font-weight: 500;
}

h1 em {
    color: #a9481b;
}

.hero a {
    font-weight: 600;
    font-size: 15px;
    border-bottom: 1px solid;
    padding-bottom: 4px;
}

.close {
    display: grid;
    place-items: center;
    background: transparent;
    color: inherit;
    font-size: 22px;
    width: var(--button-height);
    height: var(--button-height);
    padding: 0;
    line-height: 1;
    border-radius: 8px;
}

.close:hover {
    background: #edf0e8;
}

.catalog-head {
    justify-content: space-between;
    gap: 12px;
    margin: 40px 0 22px;
}

.catalog-head h2 {
    font-size: clamp(32px, 3.4vw, 48px);
    font-weight: 500;
    letter-spacing: -1.6px;
    margin-top: 5px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 30px 22px;
}

.catalog-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
    font-variant-numeric: tabular-nums;
}

.catalog-pagination [role='status'] {
    min-width: 4ch;
    text-align: center;
}

.catalog-pagination .secondary {
    width: 44px;
    height: var(--button-height);
    padding: 0;
    font-size: 1.25rem;
}

.catalog-pagination button:disabled {
    opacity: 0.45;
    cursor: default;
}

.card {
    text-align: left;
    color: inherit;
    background: none;
    padding: 0;
}

.card img {
    width: 100%;
    aspect-ratio: 1.66;
    object-fit: cover;
    display: block;
    border-radius: 13px;
    background: #f8ebd5;
}

.card h3 {
    font-size: clamp(21px, 2vw, 29px);
    font-weight: 500;
    margin: 12px 0 5px;
}

.price,
#cost {
    color: #9a471e;
    font-weight: bold;
}

.card:hover img {
    filter: brightness(1.04);
}

footer.wrap {
    margin-top: 46px;
    border-top: 1px solid #dddcd0;
    padding: 20px 0;
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.store-footer {
    align-items: end;
}

.store-footer-brand {
    display: grid;
    gap: 4px;
}

footer span,
small {
    font-size: 13px;
    color: #637063;
}

dialog {
    color: inherit;
    border: 0;
    border-radius: 16px;
    padding: 25px;
    width: min(440px, 94vw);
    max-height: 92vh;
}

dialog::backdrop {
    background: #17291ec4;
}

form label {
    display: grid;
    gap: 6px;
    margin-top: 16px;
}

input {
    border: 1px solid #b8c1b7;
    border-radius: 8px;
    padding: 10px;
    width: 100%;
}

.save {
    width: 100%;
}

#preview {
    max-height: 120px;
    max-width: 100%;
    margin-top: 8px;
}

#photo {
    width: min(850px, 95vw);
    padding: 0;
    overflow: visible;
}

#photo > .close {
    position: absolute;
    z-index: 1;
    inset-block-start: max(-12px, -3vh);
    inset-inline-end: max(-12px, -2vw);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px #173a2c38;
}

#photo > .close:hover {
    background: #edf0e8;
}

.photo-content {
    max-height: inherit;
    overflow: auto;
    border-radius: inherit;
    padding: calc(var(--button-height) + 4px) 25px 18px;
}

.photo-details {
    display: grid;
    gap: 6px;
    margin-top: 10px;
}

#large {
    display: block;
    width: 100%;
    max-height: 68vh;
    object-fit: contain;
}

#status:empty,
#msg:empty {
    display: none;
}

@media (max-width: 700px) {
    .nav {
        gap: 12px;
        height: 64px;
    }
    .navlink {
        display: none;
    }
    .brand {
        font-size: 26px;
    }
    .hero {
        width: 100%;
        min-height: 285px;
    }
    .hero img {
        width: 75%;
    }
    .hero:before {
        background: linear-gradient(
            90deg,
            #fbebcf 8%,
            #fbebcff0 34%,
            #fbebcf50 70%,
            transparent
        );
    }
    .hero-copy {
        padding: 20px;
    }
    .hero-copy h1 {
        font-size: clamp(30px, 8.5vw, 38px);
        letter-spacing: -0.04em;
    }
    .hero-copy a {
        font-size: 13px;
    }
    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 22px 12px;
    }
    .catalog-head {
        margin: 28px 0 18px;
    }
    .card h3 {
        font-size: 21px;
    }
    .price {
        font-size: 15px;
    }
    footer.wrap {
        flex-wrap: wrap;
    }
}

[hidden] {
    display: none !important;
}

.account {
    margin-left: auto;
    display: grid;
    place-items: center;
    flex: 0 0 var(--button-height);
    border: 1px solid #ccd2c8;
    border-radius: 50%;
    width: var(--button-height);
    height: var(--button-height);
    padding: 0;
}

.account:hover,
.secondary:hover {
    background: #edf0e8;
}

.account svg {
    display: block;
    width: 24px;
    height: 24px;
}

#hero-images {
    position: absolute;
    inset: 0 0 0 31%;
    z-index: -2;
    overflow: hidden;
}

.hero img.hero-image {
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: auto;
    object-fit: cover;
    transform: translateX(0);
    transition: transform 0.64s cubic-bezier(0.65, 0, 0.35, 1);
}

.hero img.hero-image.incoming {
    transform: translateX(100%);
}

.hero img.hero-image.leaving {
    transform: translateX(-100%);
}

.hero-copy {
    padding-bottom: 57px;
}

.dots {
    position: absolute;
    bottom: 10.5px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    background: transparent;
}

.dots:empty {
    display: none;
}

.dots button {
    display: grid;
    place-items: center;
    width: 24px;
    height: var(--button-height);
    background: none;
    padding: 0;
}

.dots button::after {
    content: '';
    border-radius: 50%;
    width: 8px;
    height: 8px;
    background: #fffdf8;
    box-shadow: 0 0 0 1px #25473780;
}

.dots button[aria-current='true']::after {
    background: #254737;
}

.filters {
    display: grid;
    grid-template-columns: minmax(170px, 1fr) minmax(150px, 0.36fr) minmax(
            145px,
            0.33fr
        );
    gap: 15px;
    margin-bottom: 24px;
}

.filters label {
    display: grid;
    gap: 6px;
    font-size: 14px;
    color: #465648;
}

.filters input,
.filters select,
form select {
    width: 100%;
    border: 1px solid #cbd1c6;
    border-radius: 9px;
    padding: 11px 12px;
    background: #fffdf8;
    color: #243e32;
    font-size: 16px;
}

.actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.primary,
.secondary,
.danger {
    display: inline-block;
    border-radius: 9px;
    padding: 10px 14px;
    font: inherit;
    font-weight: 600;
}

.primary {
    background: #264737;
    color: white;
}

.secondary {
    background: #fffdf8;
    color: #264737;
    border: 1px solid #ccd2c8;
}

.danger {
    background: #9a3427;
    color: white;
}

button:disabled {
    opacity: 0.65;
    cursor: wait;
}

.login {
    max-width: 470px;
}

.login .primary,
.save {
    margin-top: 16px;
}

#notice:empty,
#delete-error:empty {
    display: none;
}

@media (max-width: 700px) {
    .filters {
        grid-template-columns: 1fr 1fr;
        gap: 9px;
    }
    .filters label:first-child {
        grid-column: 1/-1;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .hero img.hero-image {
        transition: none;
    }
}

#catalog {
    --catalog-scroll-margin: 92px;
    scroll-margin-top: calc(
        var(--catalog-scroll-margin) + var(--catalog-scroll-extra, 0px)
    );
}

@media (max-width: 700px) {
    #catalog {
        --catalog-scroll-margin: 80px;
    }
}

.nav {
    display: flex;
    align-items: center;
}

.brand-logo {
    display: block;
    flex: none;
    width: 52px;
    height: 52px;
}

@media (max-width: 700px) {
    .brand-logo {
        width: 42px;
        height: 42px;
    }
}
