:root {
    --black: #050505;
    --ink: #111318;
    --muted: #656b76;
    --line: #dfe3ea;
    --paper: #ffffff;
    --soft: #f4f5f7;
    --soft-2: #ebedf1;
    --danger: #b4232d;
    --success: #137a42;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.12);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

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

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

button,
input,
textarea,
select {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px clamp(18px, 4vw, 56px);
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 800;
}

.brand-mark {
    display: inline-grid;
    width: 32px;
    height: 32px;
    place-items: center;
    color: #fff;
    background: var(--black);
    border-radius: 8px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 22px;
    color: #3f444d;
    font-size: 14px;
    font-weight: 650;
}

.site-nav a:hover {
    color: var(--black);
}

.nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    background: var(--paper);
}

.nav-toggle svg,
.btn svg,
.icon-btn svg,
.product-meta svg,
.category-card svg,
.admin-action svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.flash {
    max-width: 1120px;
    margin: 18px auto 0;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--soft);
    font-weight: 650;
}

.flash-error {
    border-color: #f0b4b9;
    color: var(--danger);
    background: #fff6f7;
}

.flash-success {
    border-color: #a7ddb9;
    color: var(--success);
    background: #f2fff6;
}

.hero {
    position: relative;
    min-height: 78vh;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    padding: clamp(86px, 12vw, 150px) clamp(20px, 6vw, 76px) clamp(48px, 7vw, 80px);
    color: #fff;
    background: var(--black);
}

.hero-small {
    min-height: 52vh;
}

.hero-product {
    min-height: 60vh;
}

.hero-bg,
.hero-shade {
    position: absolute;
    inset: 0;
}

.hero-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-shade {
    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.48) 44%, rgba(0, 0, 0, 0.08)),
        linear-gradient(0deg, rgba(0, 0, 0, 0.64), rgba(0, 0, 0, 0));
}

.hero-content {
    position: relative;
    width: min(720px, 100%);
}

.eyebrow {
    margin: 0 0 10px;
    color: currentColor;
    opacity: 0.7;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero h1 {
    margin: 0;
    max-width: 12ch;
    font-size: clamp(48px, 9vw, 112px);
    line-height: 0.95;
    letter-spacing: 0;
}

.hero p:not(.eyebrow) {
    max-width: 620px;
    margin: 22px 0 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: clamp(16px, 2vw, 20px);
    line-height: 1.6;
}

.hero-actions,
.button-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.hero-actions {
    margin-top: 30px;
}

.btn {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 17px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 800;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-light {
    color: var(--black);
    background: #fff;
    border-color: #fff;
}

.btn-dark {
    color: #fff;
    background: #111;
    border-color: #2b2b2b;
}

.section {
    width: min(1180px, calc(100% - 40px));
    margin: clamp(52px, 9vw, 104px) auto;
}

.section-head {
    margin-bottom: 24px;
}

.section-head h2,
.empty-state h1,
.empty-state h3,
.buy-panel h2,
.admin-shell h1,
.auth-card h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 46px);
    line-height: 1.06;
    letter-spacing: 0;
}

.row-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.category-card {
    position: relative;
    min-height: 420px;
    overflow: hidden;
    border-radius: var(--radius);
    background: #111;
    border: 1px solid #20242b;
    isolation: isolate;
}

.category-card:first-child {
    grid-column: span 2;
}

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

.category-card:hover img {
    transform: scale(1.04);
}

.category-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.18) 62%, rgba(0, 0, 0, 0.06));
    z-index: 1;
}

.category-copy {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 20px;
    z-index: 2;
    color: #fff;
}

.category-copy strong {
    display: block;
    font-size: 25px;
    line-height: 1.05;
}

.category-copy span {
    display: block;
    margin-top: 9px;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.45;
}

.category-card svg {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 2;
    color: #fff;
}

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

.product-card {
    display: flex;
    min-height: 100%;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.product-card:hover {
    transform: translateY(-3px);
    border-color: #bfc5ce;
    box-shadow: var(--shadow);
}

.product-media {
    display: block;
    aspect-ratio: 1 / 0.78;
    background: #111;
    overflow: hidden;
}

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

.product-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
}

.product-body strong {
    font-size: 18px;
    line-height: 1.2;
}

.product-body span:last-child {
    color: var(--muted);
    line-height: 1.45;
}

.product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 16px 16px;
    font-weight: 850;
}

.empty-state {
    display: grid;
    place-items: start;
    gap: 14px;
    padding: 34px;
    border: 1px dashed #bfc5ce;
    border-radius: var(--radius);
    background: var(--soft);
}

.empty-state p {
    max-width: 620px;
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.product-detail {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) 420px;
    align-items: start;
    gap: 34px;
}

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

.gallery-item {
    overflow: hidden;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #111;
    cursor: pointer;
    aspect-ratio: 1 / 0.72;
}

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

.gallery-placeholder {
    grid-column: span 2;
    cursor: default;
}

.buy-panel {
    position: sticky;
    top: 92px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.price {
    margin: 18px 0;
    font-size: 26px;
    font-weight: 900;
}

.description {
    color: #3f444d;
    line-height: 1.65;
}

.paypal-buttons {
    margin-top: 24px;
}

.checkout-status {
    margin-top: 20px;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--soft);
    color: var(--ink);
    font-weight: 700;
}

.checkout-warning {
    color: var(--danger);
    border-color: #f0b4b9;
    background: #fff6f7;
}

.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 90px;
    padding: 34px clamp(20px, 6vw, 76px);
    color: #d2d6dd;
    background: var(--black);
}

.site-footer div {
    display: grid;
    gap: 5px;
}

.site-footer span {
    color: #9298a2;
}

.admin-auth {
    min-height: calc(100vh - 70px);
    display: grid;
    place-items: center;
    padding: 40px 20px;
    background: var(--soft);
}

.auth-card,
.admin-form,
.admin-table,
.stats-grid,
.admin-actions {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.auth-card {
    width: min(460px, 100%);
    display: grid;
    gap: 16px;
    padding: 26px;
    box-shadow: var(--shadow);
}

.admin-shell {
    width: min(1160px, calc(100% - 40px));
    margin: 42px auto 90px;
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    background: var(--line);
}

.stat-box {
    display: grid;
    gap: 8px;
    padding: 22px;
    background: #fff;
}

.stat-box span {
    color: var(--muted);
    font-weight: 700;
}

.stat-box strong {
    font-size: 38px;
}

.admin-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    margin-top: 18px;
    background: var(--line);
}

.admin-action {
    display: grid;
    gap: 9px;
    padding: 22px;
    background: #fff;
}

.admin-action:hover {
    background: var(--soft);
}

.admin-action span {
    color: var(--muted);
    line-height: 1.45;
}

.admin-form {
    display: grid;
    gap: 18px;
    padding: 22px;
}

.form-grid,
.upload-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

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

label {
    display: grid;
    gap: 8px;
    color: #30343b;
    font-size: 13px;
    font-weight: 800;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid #cfd5de;
    border-radius: var(--radius);
    padding: 11px 12px;
    color: var(--ink);
    background: #fff;
}

textarea {
    resize: vertical;
}

.upload-box {
    padding: 16px;
    border: 1px dashed #bfc5ce;
    border-radius: var(--radius);
    background: var(--soft);
}

.upload-box span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.admin-image-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.admin-image-grid label {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.admin-image-grid img {
    width: 100%;
    aspect-ratio: 1 / 0.72;
    object-fit: cover;
}

.admin-image-grid span {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    color: var(--muted);
}

.admin-image-grid input {
    width: auto;
}

.admin-table {
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
td {
    padding: 15px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

td span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-top: 4px;
}

.table-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.table-actions form {
    margin: 0;
}

.icon-btn {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    background: #fff;
    cursor: pointer;
}

.icon-btn:hover {
    background: var(--soft);
}

.icon-btn.danger {
    color: var(--danger);
}

.status-pill {
    display: inline-flex;
    width: max-content;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    color: #30343b;
    background: var(--soft-2);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.status-active,
.status-completed {
    color: var(--success);
    background: #eaf9ef;
}

.status-draft,
.status-created {
    color: #6c4b00;
    background: #fff6d9;
}

@media (max-width: 1060px) {
    .category-grid,
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .category-card:first-child {
        grid-column: span 1;
    }

    .product-detail {
        grid-template-columns: 1fr;
    }

    .buy-panel {
        position: static;
    }

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

@media (max-width: 760px) {
    .site-header {
        align-items: flex-start;
    }

    .nav-toggle {
        display: inline-grid;
        place-items: center;
    }

    .site-nav {
        position: absolute;
        top: 68px;
        left: 12px;
        right: 12px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: #fff;
        box-shadow: var(--shadow);
    }

    .site-nav.open {
        display: flex;
    }

    .site-nav a {
        padding: 12px;
        border-radius: 6px;
    }

    .site-nav a:hover {
        background: var(--soft);
    }

    .hero {
        min-height: 68vh;
    }

    .hero-shade {
        background:
            linear-gradient(0deg, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.22)),
            linear-gradient(90deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.12));
    }

    .category-grid,
    .product-grid,
    .gallery,
    .stats-grid,
    .admin-actions,
    .form-grid,
    .upload-grid,
    .admin-image-grid {
        grid-template-columns: 1fr;
    }

    .category-card {
        min-height: 330px;
    }

    .gallery-placeholder {
        grid-column: span 1;
    }

    .site-footer,
    .admin-topbar,
    .row-head {
        flex-direction: column;
        align-items: flex-start;
    }
}
