@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
    --red: #9d1718;
    --red-deep: #641314;
    --gold: #f6b928;
    --gold-soft: #fff0c7;
    --cream: #fbf7ef;
    --paper: #fffdf9;
    --ink: #241717;
    --muted: #5f504e;
    --line: #eadfd5;
    --green: #28734b;
    --green-soft: #e4f3e8;
    --danger: #a33b31;
    --shadow: 0 18px 45px rgba(82, 35, 24, .1);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: var(--cream);
    font: 15px/1.55 'Poppins', sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.field-label { color: var(--ink); font-size: 12px; font-weight: 700; }

:focus-visible {
    outline: 3px solid rgba(246, 185, 40, .8);
    outline-offset: 3px;
}

.top {
    color: #fff;
    background: var(--paper);
    border-bottom: 4px solid var(--gold);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-inner, main {
    width: min(1200px, calc(100% - 48px));
    margin: auto;
}

.top-inner {
    min-height: 78px;
    display: flex;
    align-items: center;
    gap: 28px;
}

.logo { display: flex; align-items: center; }
.logo img { width: 200px; max-height: 100px; object-fit: contain; }

.line { color: var(--red); font-size: 30px; font-weight: 700; }

.crumb {
    padding-left: 2px;
    /* border-left: 1px solid var(--red); */
    color: var(--ink);
    font-size: 30px;
    font-weight: 700;
    letter-spacing: .02em;
}

main { padding: 42px 0 72px; }

.hero {
    position: relative;
    min-height: 390px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    overflow: hidden;
    padding: 38px 42px;
    color: #fff;
    background: var(--red);
    border-radius: 0;
    box-shadow: var(--shadow);
}

.hero::before, .hero::after {
    content: '';
    position: absolute;
    border: 1px solid rgba(255, 240, 199, .28);
    border-radius: 50%;
    pointer-events: none;
}

.hero::before { display: none; }
.hero::after { width: 160px; height: 160px; right: 128px; bottom: -124px; }
.hero-copy { position: relative; z-index: 3; max-width: 50%; }
.hero-art { z-index: 1; }

.eyebrow {
    margin-bottom: 12px;
    color: var(--gold);
    font-size: 35px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.hero h1 {
    max-width: 520px;
    margin: 8px 0 10px;
    font: 800 clamp(32px, 4vw, 48px)/1.08 'Poppins', sans-serif;
    letter-spacing: 0;
}

.hero p { max-width: 510px; margin: 0; color: #fff5e9; font-weight: 500; }

.hero-art {
    position: absolute;
    width: min(52vw, 570px);
    height: min(52vw, 570px);
    right: -26px;
    top: 50%;
    transform: translateY(-50%);
}
.hero-cloth { position: absolute; width: 62%; right: -10%; bottom: -8%; transform: rotate(16deg); }
.hero-dish { position: absolute; width: 92%; right: 5%; top: 4%; animation: spin-dish 32s linear infinite; filter: drop-shadow(0 18px 12px rgba(55, 0, 0, .28)); }

@keyframes spin-dish { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.primary, .secondary {
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.primary {
    padding: 12px 18px;
    color: #482300;
    background: var(--gold);
    border: 0;
    box-shadow: 0 5px 12px rgba(41, 0, 0, .22);
}
.primary:hover { background: #ffd467; transform: translateY(-1px); }

.summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 24px 0;
}

.metric {
    position: relative;
    padding: 22px 24px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 5px 16px rgba(75, 37, 24, .04);
}
.metric::after { content: ''; position: absolute; right: 20px; top: 22px; width: 8px; height: 8px; background: var(--gold); border-radius: 50%; }
.metric:nth-child(2)::after { background: var(--green); }
.metric:nth-child(3)::after { background: var(--danger); }
.metric small { display: block; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.metric strong { display: block; margin-top: 4px; font: 700 32px/1.1 'Poppins', sans-serif; }

.panel {
    overflow: hidden;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(75, 37, 24, .05);
}

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.toolbar-copy h2 { margin: 0; font: 700 24px/1.2 'Poppins', sans-serif; }
.toolbar-copy p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.toolbar-controls { display: flex; align-items: center; gap: 10px; }
.toolbar-controls label { color: var(--ink); font-size: 12px; font-weight: 700; white-space: nowrap; }
.search { width: 450px; max-width: 100%; padding: 12px 15px 12px 42px; color: var(--ink); background: #fffaf3 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%23776968' stroke-width='2'%3E%3Ccircle cx='8' cy='8' r='5.5'/%3E%3Cpath d='m12 12 4 4'/%3E%3C/svg%3E") 14px center no-repeat; border: 1px solid var(--line); border-radius: 8px; }
.search::placeholder { color: #a49791; }
.search:focus { border-color: var(--red); outline: 3px solid rgba(157, 23, 24, .12); }

.product-list { display: grid; gap: 0; }
.product-card { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 30px; padding: 26px 30px; border-top: 1px solid var(--line); }
.product-card:first-child { border-top: 0; }
.product-card:hover { background: #fffaf3; }
.product-image { width: 260px; height: 190px; object-fit: cover; border-radius: 14px; background: var(--gold-soft); box-shadow: 0 8px 18px rgba(82, 35, 24, .14); }
.product-details { display: flex; min-width: 0; flex-direction: column; justify-content: center; }
.product-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.name { font-weight: 700; }
.name { color: var(--red); font-size: 24px; }
.category { margin-top: 3px; color: var(--muted); font-size: 13px; font-weight: 600; }
.sub { max-width: 620px; margin: 17px 0 22px; color: var(--muted); font-size: 14px; font-weight: 500; }
.price { font-weight: 700; white-space: nowrap; }
.product-heading .price { padding: 8px 15px; color: #fff; background: var(--red); border-radius: 99px; box-shadow: 0 5px 12px rgba(157, 23, 24, .2); }
.product-footer { display: flex; align-items: center; gap: 14px; }
.stock { color: var(--muted); font-size: 13px; font-weight: 600; }
.badge { display: inline-block; padding: 5px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.available { color: var(--green); background: var(--green-soft); }
.out-of-stock { color: #963c32; background: #fbe5df; }
.actions { display: flex; gap: 8px; }
.secondary { padding: 8px 11px; color: var(--red-deep); background: transparent; border: 1px solid #d7c2b7; font-size: 12px; }
.secondary:hover { background: #fff1e5; border-color: #b98f80; }
.secondary.delete { color: var(--danger); }
.empty { padding: 46px 22px; color: var(--muted); text-align: center; }

dialog { width: min(600px, calc(100% - 32px)); max-height: calc(100vh - 32px); padding: 0; color: var(--ink); background: var(--paper); border: 0; border-radius: 16px; box-shadow: 0 24px 80px rgba(38, 12, 8, .28); }
dialog::backdrop { background: rgba(43, 14, 10, .58); backdrop-filter: blur(3px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 25px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font: 700 25px/1.2 'Poppins', sans-serif; }
.close { width: 34px; height: 34px; color: var(--muted); background: transparent; border: 0; border-radius: 50%; cursor: pointer; font-size: 25px; line-height: 1; }
.close:hover { color: var(--red); background: #fff1e5; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; padding: 24px 25px 25px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label, .field-label { color: var(--ink); font-size: 12px; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; padding: 11px 12px; color: var(--ink); background: #fffaf3; border: 1px solid var(--line); border-radius: 7px; }
.field textarea { min-height: 80px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--red); outline: 3px solid rgba(157, 23, 24, .12); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; grid-column: 1 / -1; padding-top: 7px; }

.category-form { padding: 22px 25px; border-bottom: 1px solid var(--line); }
.category-form label { display: block; margin-bottom: 6px; color: var(--ink); font-size: 12px; font-weight: 700; }
.category-create-row { display: flex; gap: 10px; }
.category-create-row input { flex: 1; min-width: 0; padding: 11px 12px; color: var(--ink); background: #fffaf3; border: 1px solid var(--line); border-radius: 7px; }
.category-list { max-height: 310px; overflow: auto; }
.category-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 25px; border-bottom: 1px solid var(--line); font-weight: 600; }
.category-row:last-child { border-bottom: 0; }

.confirm-dialog { width: min(390px, calc(100% - 32px)); padding: 28px; text-align: center; }
.confirm-icon { width: 42px; height: 42px; margin: 0 auto 14px; color: #fff; background: var(--danger); border-radius: 50%; font-size: 27px; font-weight: 700; line-height: 42px; }
.confirm-dialog h2 { margin: 0; font: 700 25px/1.2 'Poppins', sans-serif; }
.confirm-dialog p { margin: 10px 0 24px; color: var(--muted); font-size: 14px; }
.confirm-actions { display: flex; justify-content: center; gap: 10px; }
.danger-button { padding: 10px 14px; color: #fff; background: var(--danger); border: 0; border-radius: 8px; cursor: pointer; font-weight: 700; }
.danger-button:hover { background: #842d27; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 10; max-width: min(360px, calc(100% - 32px)); padding: 13px 17px; color: #fff; background: var(--ink); border-left: 4px solid var(--gold); border-radius: 7px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(12px); transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 760px) {
    .top-inner, main { width: min(100% - 32px, 600px); }
    .top-inner { min-height: 70px; gap: 16px; }
    .logo img { width: 92px; }
    .crumb { padding-left: 16px; font-size: 12px; }
    main { padding: 24px 0 48px; }
    .hero { min-height: 470px; align-items: flex-start; padding: 28px 24px; }
    .hero-copy { max-width: 100%; }
    .hero h1 { font-size: 37px; }
    .hero p { max-width: 290px; }
    .hero-art { width: 390px; height: 390px; right: -92px; top: auto; bottom: -36px; transform: none; }
    .summary { gap: 9px; }
    .metric { padding: 16px 13px; }
    .metric small { font-size: 10px; line-height: 1.25; }
    .metric strong { font-size: 25px; }
    .toolbar { align-items: stretch; flex-direction: column; gap: 14px; padding: 16px; }
    .toolbar-copy h2 { font-size: 22px; }
    .toolbar-controls { align-items: stretch; flex-direction: column; }
    .toolbar-controls label { width: 100%; }
    .search { width: 100%; }
    .product-card { grid-template-columns: 1fr; gap: 18px; padding: 20px 16px; }
    .product-image { width: 100%; height: min(58vw, 230px); }
    .product-heading { gap: 12px; }
    .name { font-size: 21px; }
    .sub { margin: 12px 0 16px; }
    .product-footer { align-items: flex-start; flex-wrap: wrap; }
    .actions { width: 100%; }
    .sub { max-width: 100%; }
    .actions { margin-left: auto; }
    .form { grid-template-columns: 1fr; padding: 20px 18px; }
    .field.full { grid-column: auto; }
    .form-actions { grid-column: auto; }
    .category-form { padding: 20px 18px; }
    .category-row { padding: 14px 18px; }
    .photo-picker { grid-template-columns: repeat(6, 1fr); }
    .toast { right: 16px; bottom: 16px; }
}

@media (min-width: 761px) and (max-width: 980px) {
    .hero { min-height: 460px; align-items: flex-start; padding: 34px; }
    .hero-copy { max-width: 58%; }
    .hero-art { width: 430px; height: 430px; right: -70px; top: auto; bottom: -95px; transform: none; }
    .toolbar { align-items: flex-start; flex-direction: column; gap: 14px; }
    .toolbar-controls { width: 100%; }
    .search { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
    .hero-dish { animation: none; }
}

button:disabled{opacity:.5;cursor:not-allowed}
