:root {
    --bg: #f8efe4;
    --surface: #fff9f2;
    --surface-2: #fffdf9;
    --brand-900: #173f39;
    --brand-700: #1f5b54;
    --brand-500: #1f5b54;
    --brand-300: #9dcac3;
    --text: #1f5b54;
    --muted: #5f817b;
    --line: #e8d3c2;
    --shadow: 0 14px 32px rgba(31, 91, 84, 0.14);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Sora", sans-serif;
    color: var(--text);
    background:
        radial-gradient(700px 280px at -12% -8%, #ffe6ce 0%, transparent 64%),
        radial-gradient(860px 320px at 110% 0%, #ffd7b6 0%, transparent 58%),
        linear-gradient(180deg, #f9f1e7 0%, #f6ece2 100%);
}

.container {
    width: min(1140px, 92vw);
    margin: 0 auto;
}

.top {
    padding: 20px 0 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    animation: rise 560ms ease both;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.top h1 {
    margin: 0;
    font-size: clamp(1.2rem, 3vw, 2rem);
    font-family: "Fraunces", serif;
    color: var(--brand-700);
}

.back-link,
.profile-btn,
.cart-link {
    text-decoration: none;
    border: 1px solid #d7b59c;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 244, 234, 0.95);
    color: var(--brand-700);
    font-weight: 700;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.profile-btn { cursor: pointer; }

.back-link:hover,
.profile-btn:hover,
.cart-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 14px rgba(84, 42, 20, 0.12);
}

.cart-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cart-count {
    min-width: 20px;
    height: 20px;
    display: inline-grid;
    place-items: center;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--brand-700);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

.toolbar { margin-top: 18px; }

.product-ref-note {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
}

.search-wrap {
    display: flex;
    gap: 8px;
    max-width: 560px;
    animation: rise 620ms ease both;
}

.search-wrap input {
    flex: 1;
    border: 1px solid #d8bca7;
    border-radius: 12px;
    padding: 12px 14px;
    background: #fffdf9;
}

.search-wrap button {
    border: none;
    background: linear-gradient(120deg, var(--brand-700), var(--brand-700));
    color: #fff;
    border-radius: 12px;
    padding: 0 18px;
    font-weight: 700;
    cursor: pointer;
}

.categories { margin-top: 20px; }

.category-grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.category-card {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 168px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: linear-gradient(155deg, #2f4d43 0%, #1d302a 100%);
    border-radius: 16px;
    padding: 14px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
    opacity: 0;
    transform: translateY(10px);
    text-decoration: none;
    color: #fff;
    isolation: isolate;
}

.category-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(20, 31, 28, 0.12) 0%, rgba(18, 26, 24, 0.5) 52%, rgba(14, 18, 17, 0.86) 100%);
}

.category-card.reveal {
    animation: rise 480ms ease forwards;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 32px rgba(69, 32, 13, 0.18);
    border-color: rgba(255, 255, 255, 0.3);
}

.category-card:hover .category-card-media img {
    transform: scale(1.06);
    filter: saturate(1.02);
}

.category-card.active {
    border-color: #f4d5ae;
}

.category-card-media {
    position: absolute;
    inset: 0;
    z-index: -2;
}

.category-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.02);
    filter: saturate(0.94) contrast(1.02);
    transition: transform 240ms ease, filter 240ms ease;
}

.category-card-content {
    position: relative;
    display: grid;
    gap: 12px;
    width: 100%;
}

.category-card h3 {
    margin: 0;
    color: #fff;
    font-size: 18px;
    line-height: 1.2;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.34);
}

.products { margin: 22px 0 52px; }

.selected-category {
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #dcbfa9;
    background: #fff7ee;
    border-radius: 999px;
    padding: 7px 12px;
    color: var(--brand-700);
    font-size: 13px;
    font-weight: 600;
}

.selected-category button {
    border: none;
    border-radius: 999px;
    background: var(--brand-700);
    color: #fff;
    font-size: 11px;
    padding: 4px 8px;
    cursor: pointer;
}

.head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.head h2 {
    margin: 0;
    color: var(--brand-700);
}

.head p {
    margin: 0;
    color: var(--muted);
}

.grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
    gap: 12px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transform: translateY(10px);
    opacity: 0;
}

.card.reveal {
    animation: rise 520ms ease forwards;
}

.thumb {
    height: 136px;
    background: linear-gradient(130deg, #f7ddc8, #f8f0e7);
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.body { padding: 11px; }

.title-row {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 8px;
}

.title-row h3 {
    margin: 0;
    font-size: 14px;
    line-height: 1.3;
}

.price {
    color: var(--brand-700);
    font-weight: 800;
    font-size: 13px;
}

.meta {
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
}

.qty-row {
    margin-top: 9px;
    display: inline-flex;
    border: 1px solid #d5baa5;
    border-radius: 999px;
    overflow: hidden;
}

.qty-row button {
    border: none;
    background: #f6e5d6;
    width: 30px;
    cursor: pointer;
    font-weight: 800;
}

.qty-row input {
    width: 34px;
    text-align: center;
    border: none;
    outline: none;
    background: #fff;
}

.action-row {
    margin-top: 8px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.action-row button,
.related-btn {
    border: none;
    border-radius: 10px;
    padding: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 140ms ease;
}

.action-row button:hover,
.related-btn:hover {
    transform: translateY(-1px);
}

.cart-btn {
    background: #ecd7c4;
    color: var(--brand-700);
}

.buy-btn {
    background: linear-gradient(120deg, var(--brand-700), var(--brand-700));
    color: #fff;
}

.related-btn {
    width: 100%;
    margin-top: 8px;
    background: transparent;
    border: 1px solid #d4b69f;
    color: var(--brand-500);
}

.out {
    margin-top: 6px;
    font-size: 12px;
    color: #b93325;
}

.empty {
    border: 1px dashed #d8b9a0;
    border-radius: 14px;
    padding: 24px;
    color: var(--muted);
    background: #fff8ef;
}

.related-panel {
    position: fixed;
    right: 14px;
    bottom: 14px;
    width: min(430px, 95vw);
    border: 1px solid #e4ccb8;
    border-radius: 15px;
    background: rgba(255, 253, 249, 0.94);
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow);
    z-index: 20;
    animation: rise 260ms ease both;
}

.hidden { display: none; }

.related-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #efddcf;
}

.related-head h3 {
    margin: 0;
    color: var(--brand-700);
}

.related-head button {
    border: none;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
    color: var(--brand-700);
}

.related-list {
    max-height: 290px;
    overflow: auto;
    padding: 10px;
    display: grid;
    gap: 8px;
}

.related-item {
    border: 1px solid #eddac9;
    border-radius: 10px;
    padding: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toast {
    position: fixed;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 9px 12px;
    z-index: 30;
    animation: toast-in 260ms ease both;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-in {
    from { opacity: 0; transform: translate(-50%, 8px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

@media (max-width: 700px) {
    .top {
        flex-wrap: wrap;
    }

    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.has-customer-menu .top {
    padding-left: 58px;
    align-items: flex-start;
}

.top-leading {
    flex: 1;
}

.top-leading .site-copy {
    gap: 5px;
}

.top-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

@media (max-width: 900px) {
    .top {
        flex-direction: column;
    }

    .top-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 700px) {
    .has-customer-menu .top {
        padding-left: 46px;
    }

    .search-wrap {
        max-width: none;
        flex-wrap: wrap;
    }

    .search-wrap button {
        width: 100%;
        min-height: 46px;
    }

    .head {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

@media (max-width: 520px) {
    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .card .thumb {
        height: 118px;
    }

    .card .body {
        padding: 10px;
    }

    .title-row h3 {
        font-size: 13px;
    }

    .price,
    .meta {
        font-size: 11px;
    }

    .action-row {
        grid-template-columns: 1fr;
    }

    .qty-row {
        width: 100%;
        justify-content: space-between;
    }

    .qty-row input {
        flex: 1;
    }
}

.category-card-cta {
    display: inline-flex;
    align-items: center;
    width: max-content;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(255, 252, 246, 0.16);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.browse-note {
    margin: 20px 0 52px;
    padding: 18px;
    border: 1px solid #ead2be;
    border-radius: 18px;
    background: rgba(255, 249, 242, 0.92);
    box-shadow: var(--shadow);
}

.browse-note h2 {
    margin: 0 0 6px;
    color: var(--brand-700);
    font-family: "Fraunces", serif;
    font-size: clamp(1.15rem, 2.2vw, 1.6rem);
}

.browse-note p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

@media (max-width: 520px) {
    .category-card__cta {
        width: 100%;
        justify-content: center;
    }

    .browse-note {
        padding: 14px;
    }
}


@media (max-width: 640px) {
    .category-card {
        min-height: 158px;
    }

    .category-card h3 {
        font-size: 17px;
    }
}


.empty--coming-soon {
    display: grid;
    gap: 10px;
    place-items: center;
    text-align: center;
    min-height: 220px;
    padding: 28px 22px;
    background:
        radial-gradient(circle at top, rgba(255, 222, 188, 0.9), transparent 48%),
        linear-gradient(160deg, #fff8ef 0%, #ffe8d3 100%);
    border: 1px dashed #d2a47d;
    box-shadow: 0 18px 34px rgba(90, 46, 22, 0.08);
}

.empty--coming-soon strong {
    color: var(--brand-700);
    font-size: 1.05rem;
    line-height: 1.35;
}

.empty--coming-soon span {
    max-width: 34ch;
    color: var(--muted);
    font-size: 0.96rem;
    line-height: 1.55;
}

/* Out-of-stock owner contact presentation */
.out {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid #f1c1b9;
    background: #fff4f2;
    font-size: 12px;
    font-weight: 700;
    color: #b93325;
}

.out-contact {
    margin-top: 6px;
    padding: 7px 10px;
    border-radius: 10px;
    border: 1px solid #ead7c8;
    background: #fffaf4;
    color: #5f5a52;
    font-size: 12px;
    line-height: 1.45;
}

.out-contact a {
    color: var(--brand-700);
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px dashed rgba(31, 91, 84, 0.45);
}

.out-contact a:hover {
    border-bottom-color: var(--brand-700);
}

.out-contact span {
    color: var(--brand-700);
    font-weight: 700;
}
