:root {
    --bg: #f5f7f2;
    --panel: #ffffff;
    --text: #16221d;
    --muted: #6a756f;
    --line: #dbe4dc;
    --brand: #43b883;
    --brand-dark: #2a8a61;
    --shadow: 0 14px 32px rgba(22, 34, 29, 0.08);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(circle at top right, rgba(var(--brand-rgb), 0.18), transparent 34%),
        linear-gradient(180deg, rgba(var(--brand-rgb), 0.08) 0%, var(--bg) 100%);
    color: var(--text);
}

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

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

.page-shell {
    width: min(100%, 1380px);
    margin: 0 auto;
    padding: 0 12px 28px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    margin: 10px 8px 0;
    padding: 14px 14px 12px;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.22), transparent 30%),
        linear-gradient(145deg, var(--brand-dark) 0%, var(--brand) 54%, var(--brand-light) 100%);
    border-radius: 24px;
    box-shadow: 0 18px 38px rgba(var(--brand-dark-rgb), 0.18);
    overflow: hidden;
}

.topbar::after {
    content: "";
    position: absolute;
    inset: auto -30px -50px auto;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.brand-row,
.search-row,
.page-title,
.product-head {
    display: flex;
    align-items: center;
}

.brand-row {
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.brand-group {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.18);
    color: #fffef7;
    font-weight: 800;
    letter-spacing: 0.04em;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.brand-logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
    overflow: hidden;
}

.brand-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand-copy {
    display: grid;
    min-width: 0;
}

.brand-kicker {
    color: rgba(245, 255, 248, 0.76);
    font-size: 0.68rem;
    line-height: 1.1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.brand {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: #fffef7;
    line-height: 1.05;
}

.admin-link,
.ghost-link,
.chip,
.action-button,
.login-button {
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 999px;
}

.admin-link,
.ghost-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    color: #fff;
    font-size: 0.88rem;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(6px);
    position: relative;
    z-index: 1;
}

.admin-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d7ffe8;
    box-shadow: 0 0 0 4px rgba(215, 255, 232, 0.16);
}

.search-row {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-input {
    flex: 1;
    min-height: 48px;
    padding: 0 16px;
    background: rgba(248, 255, 251, 0.96);
    border-radius: 999px;
    box-shadow: 0 10px 24px rgba(27, 76, 55, 0.12);
    border: 0;
    font-size: 0.96rem;
    color: var(--text);
}

.admin-link-inline {
    flex: 0 0 auto;
}

.search-input:focus {
    outline: none;
}
.action-button,
.login-button {
    border: 0;
    min-height: 48px;
    padding: 0 18px;
    font-weight: 700;
    color: #fff;
    background: var(--brand-dark);
}

.product-card,
.detail-panel,
.login-panel,
.dashboard-panel {
    background: var(--panel);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--brand-dark);
    font-weight: 700;
}

.detail-panel h1,
.login-panel h1,
.dashboard-panel h1 {
    margin: 0;
    line-height: 1.15;
}

.detail-panel p,
.meta-text,
.helper-text {
    color: var(--muted);
}

.category-strip {
    position: relative;
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    overflow-y: visible;
    padding: 10px 2px 6px;
    align-items: center;
    scrollbar-width: none;
}

.category-strip::-webkit-scrollbar {
    display: none;
}

.chip {
    flex: 0 0 auto;
    padding: 10px 14px;
    background: #fff;
    border-color: var(--line);
    color: var(--text);
}

.chip.active {
    background: var(--brand-dark);
    color: #fff;
    border-color: var(--brand-dark);
}

.more-categories {
    flex: 0 0 auto;
}

.more-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.more-toggle::after {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-1px);
    opacity: 0.9;
}

.more-categories.is-open .more-toggle::after {
    transform: rotate(225deg) translateY(-1px);
}

.more-menu {
    width: min(100%, 1040px);
    display: grid;
    gap: 6px;
    margin: 4px auto 10px;
    padding: 10px;
    border: 1px solid #d6e4d9;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 14px 28px rgba(24, 41, 31, 0.12);
}

.more-menu[hidden] {
    display: none !important;
}

.more-link {
    display: block;
    padding: 9px 12px;
    border-radius: 12px;
    color: #2f4339;
    white-space: nowrap;
}

.more-link.active,
.more-link:hover {
    background: rgba(var(--brand-rgb), 0.12);
    color: var(--brand-dark);
}

.product-grid,
.detail-grid {
    display: grid;
    gap: 14px;
}

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

.product-card {
    overflow: hidden;
    border-radius: 10px;
    box-shadow: none;
    border: 1px solid #d8ddd7;
    background: rgba(255, 255, 255, 0.96);
}

.product-thumb {
    position: relative;
    overflow: hidden;
    border-radius: 9px 9px 0 0;
}

.product-card img {
    width: 100%;
    aspect-ratio: 0.86 / 1;
    object-fit: cover;
}

.stock-badge {
    position: absolute;
    right: 6px;
    bottom: 6px;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(22, 34, 29, 0.66);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    backdrop-filter: blur(4px);
}

.card-body {
    padding: 6px 6px 8px;
    border-top: 1px solid #ecefe9;
    background: #fff;
}

.product-code {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-head {
    justify-content: space-between;
    gap: 12px;
}

.pagination-wrap {
    display: grid;
    justify-items: center;
    gap: 12px;
    padding: 22px 0 8px;
}

.pagination-summary {
    color: var(--muted);
    font-size: 0.92rem;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.page-link {
    min-width: 42px;
    padding: 10px 14px;
    border: 1px solid #d6e4d9;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.86);
    color: #446055;
    text-align: center;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(25, 38, 31, 0.06);
}

.page-link.active {
    border-color: var(--brand-dark);
    background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%);
    color: #fff;
}

.page-link.page-edge {
    padding-inline: 16px;
}

.detail-panel {
    padding: 16px;
    margin: 18px 0 16px;
}

.detail-hero {
    margin-top: 8px;
}

.detail-summary {
    margin: 0 0 12px;
    padding: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 252, 249, 0.98) 100%);
}

.detail-header-row,
.detail-meta-row,
.detail-actions,
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.detail-header-row {
    align-items: flex-start;
}

.detail-summary h1 {
    margin: 0;
    font-size: 2rem;
    line-height: 1.05;
}

.detail-name {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.5;
}

.detail-meta-row {
    justify-content: flex-start;
    flex-wrap: wrap;
    margin: 14px 0 10px;
}

.detail-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(var(--brand-rgb), 0.14);
    color: var(--brand-dark);
    font-size: 0.84rem;
    font-weight: 700;
}

.detail-chip.subtle {
    background: rgba(22, 34, 29, 0.07);
    color: #43534b;
}

.detail-description {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.6;
    white-space: pre-line;
}

.detail-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-top: 16px;
}

.detail-link {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: #e8f6ee;
    color: var(--brand-dark);
    font-weight: 700;
}

.detail-link.muted {
    background: #f3f7f4;
    color: #556760;
}

.product-head {
    align-items: flex-start;
    margin-bottom: 16px;
}

.badge {
    flex: 0 0 auto;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(var(--brand-rgb), 0.12);
    color: var(--brand-dark);
    font-weight: 700;
}

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

.detail-section {
    margin: 10px 0 18px;
}

.section-head {
    margin: 0 0 10px;
}

.section-head h2 {
    margin: 0;
    font-size: 1.2rem;
}

.section-head p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.detail-photo-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.detail-photo-card {
    overflow: hidden;
    border: 1px solid #d8ddd7;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
}

.detail-photo-card img {
    width: 100%;
    aspect-ratio: 0.9 / 1;
    object-fit: cover;
}

.detail-photo-meta {
    padding: 8px 9px 10px;
    background: #fff;
}

.detail-photo-meta p,
.detail-photo-meta span {
    margin: 0;
}

.detail-photo-meta p {
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-photo-meta span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.76rem;
}

.related-section {
    padding-bottom: 4px;
}

.related-grid {
    gap: 12px;
}

.detail-grid figure {
    margin: 0;
}

.detail-grid img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 16px;
}

.detail-grid figcaption {
    padding-top: 8px;
    color: var(--muted);
    font-size: 0.88rem;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}

.login-panel,
.dashboard-panel {
    width: min(100%, 720px);
    padding: 20px;
}

.login-form {
    display: grid;
    gap: 14px;
}

.field {
    display: grid;
    gap: 8px;
}

.field input {
    border: 1px solid var(--line);
    border-radius: 14px;
    min-height: 46px;
    padding: 0 14px;
    font-size: 1rem;
}

.message {
    padding: 12px 14px;
    border-radius: 14px;
    margin-bottom: 14px;
}

.message.error {
    color: #8a2231;
    background: #fdecef;
}

.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 14px 0 20px;
}

.table-list {
    display: grid;
    gap: 12px;
}

.table-item {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
}

.table-item img {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    object-fit: cover;
}

.footer-shell {
    padding: 10px 20px 30px;
}

.footer-inner {
    width: min(100%, 1040px);
    margin: 0 auto;
    padding: 18px 20px 20px;
    text-align: center;
    border: 1px solid rgba(var(--brand-rgb), 0.12);
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(var(--brand-rgb), 0.05) 100%);
    box-shadow: 0 14px 30px rgba(var(--brand-dark-rgb), 0.08);
}

.footer-kicker,
.footer-copy {
    margin: 0;
    color: var(--muted);
}

.footer-kicker {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.footer-brand {
    display: block;
    margin-top: 6px;
    font-size: 1rem;
    color: var(--text);
}

.footer-copy {
    margin-top: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
}

@media (min-width: 720px) {
    .page-shell {
        padding-inline: 24px;
    }

    .topbar {
        margin: 14px auto 0;
        padding: 16px 20px 14px;
        width: min(calc(100% - 40px), 1040px);
    }

    .brand-row {
        margin-bottom: 0;
    }

    .search-row,
    .brand-row {
        max-width: 100%;
    }

    .search-row {
        justify-self: end;
        width: min(100%, 560px);
    }

    .topbar {
        display: grid;
        grid-template-columns: minmax(220px, auto) minmax(0, 1fr);
        align-items: center;
        column-gap: 20px;
    }

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

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

    .detail-hero,
    .detail-section {
        width: min(100%, 1040px);
        margin-inline: auto;
    }
}

@media (min-width: 980px) {
    .page-shell {
        padding-inline: 28px;
    }

    .product-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 12px;
    }

    .detail-hero,
    .detail-section {
        width: min(100%, 1040px);
    }

    .product-card img {
        aspect-ratio: 0.84 / 1;
    }

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

@media (min-width: 1280px) {
    .topbar {
        grid-template-columns: 340px minmax(0, 1fr);
        column-gap: 22px;
    }

    .brand-row {
        margin: 0;
    }

    .search-row {
        width: min(52%, 620px);
    }

    .brand-kicker {
        font-size: 0.78rem;
    }

    .category-strip,
    .product-grid,
    .pagination-wrap {
        width: min(100%, 1040px);
        margin-inline: auto;
    }

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

}
