:root {
    --bg: #f0e3d4;
    --bg-strong: #e2ccb3;
    --surface: rgba(255, 250, 244, 0.88);
    --surface-strong: #fffaf4;
    --line: rgba(112, 74, 49, 0.18);
    --text: #2f241d;
    --muted: #6d5849;
    --brand: #9f4f33;
    --brand-dark: #6f3524;
    --accent: #315f53;
    --danger: #8f2f2f;
    --shadow: 0 18px 40px rgba(73, 45, 28, 0.12);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.55), transparent 34%),
        linear-gradient(135deg, #f1e4d6 0%, #e9d7c3 52%, #dec4ab 100%);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

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

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

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

button {
    cursor: pointer;
}

.page-shell {
    width: min(1200px, calc(100% - 32px));
    margin: 24px auto 40px;
}

.site-header,
.hero-section,
.category-card,
.product-card,
.summary-card,
.form-card,
.admin-panel,
.order-card,
.empty-state,
.flash {
    backdrop-filter: blur(12px);
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) + 4px);
    box-shadow: var(--shadow);
    position: sticky;
    top: 14px;
    z-index: 5;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-mark {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff7f0;
    font-family: "Palatino Linotype", Georgia, serif;
    font-size: 1.12rem;
    letter-spacing: 0.03em;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.72rem;
}

.brand-name,
h1,
h2,
h3 {
    font-family: "Palatino Linotype", Georgia, serif;
}

.brand-name {
    font-size: 1.35rem;
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.main-nav a {
    padding: 12px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid transparent;
    transition: 180ms ease;
}

.main-nav a:hover,
.main-nav a.active {
    border-color: var(--line);
    background: #fffaf4;
}

.main-nav span {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    margin-left: 6px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-size: 0.8rem;
}

.admin-header-tools {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.mailbox-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.62);
    color: var(--text);
    transition: 180ms ease;
}

.mailbox-link:hover {
    border-color: rgba(159, 79, 51, 0.45);
    background: #fffaf4;
}

.mailbox-link span {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff7f0;
    font-size: 0.78rem;
}

main {
    display: grid;
    gap: 24px;
    margin-top: 26px;
}

.hero-section {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: 24px;
    padding: 34px;
    background:
        linear-gradient(130deg, rgba(255, 250, 244, 0.95), rgba(248, 232, 208, 0.92)),
        linear-gradient(45deg, #ffffff, #efe4d3);
    border: 1px solid var(--line);
    border-radius: 34px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.hero-with-photo {
    background:
    linear-gradient(110deg, rgba(255, 250, 244, 0.88) 0%, rgba(255, 250, 244, 0.8) 42%, rgba(255, 250, 244, 0.32) 100%),
        var(--hero-photo) center right / cover no-repeat;
}

.hero-copy h1 {
    margin: 0;
    font-size: clamp(2.2rem, 4vw, 4.4rem);
    line-height: 0.95;
    max-width: 11ch;
}

.hero-text,
.section-note,
.product-copy p,
.cart-product p,
.site-footer,
.summary-line span,
.admin-product-row p,
.admin-product-row small,
.empty-state p {
    color: var(--muted);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.button-primary,
.button-secondary,
.product-footer button,
.danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 18px;
    border: 0;
    border-radius: 16px;
    transition: transform 180ms ease, opacity 180ms ease, background 180ms ease;
}

.button-primary,
.product-footer button {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff8f2;
}

.button-secondary {
    background: #fffaf4;
    color: var(--text);
    border: 1px solid var(--line);
}

.danger-button {
    background: #f8e5e3;
    color: var(--danger);
}

.button-primary:hover,
.button-secondary:hover,
.product-footer button:hover,
.danger-button:hover {
    transform: translateY(-2px);
}

.hero-panel {
    display: grid;
    gap: 10px;
    justify-items: end;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 78%;
    padding: 10px 12px;
    border-radius: 18px;
    background: #fffaf4;
    border: 1px solid var(--line);
    min-height: 92px;
}

.hero-stat strong {
    display: block;
    font-size: 2rem;
    line-height: 1.08;
    font-family: "Palatino Linotype", Georgia, serif;
}

.hero-stat span {
    font-size: 1rem;
}

.hero-stat.accent {
    background: linear-gradient(135deg, #9f4f33, #6f3524);
    color: #f8f7f2;
}

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

.section-head.compact {
    align-items: start;
}

.section-head h1,
.section-head h2 {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.mini-link {
    color: var(--brand);
}

.footer-link {
    color: var(--brand-dark);
    border-bottom: 1px solid rgba(112, 74, 49, 0.22);
}

.footer-link:hover {
    border-bottom-color: var(--brand-dark);
}

.footer-cta-wrap {
    margin: 14px 0 0;
}

.footer-contact-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid rgba(159, 79, 51, 0.35);
    background: linear-gradient(135deg, #fff8f0 0%, #f5dfca 100%);
    color: #6f3524;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.footer-contact-cta:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #fff2e5 0%, #efd3b8 100%);
    border-color: rgba(111, 53, 36, 0.5);
}

.category-grid,
.product-grid,
.orders-grid {
    display: grid;
    gap: 18px;
}

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

.category-card {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 18px;
    border: 1px solid rgba(159, 79, 51, 0.25);
    border-radius: 24px;
    background: #fffaf4;
    box-shadow: 0 8px 20px rgba(80, 48, 30, 0.1);
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.category-card:hover {
    transform: translateY(-2px);
    border-color: rgba(159, 79, 51, 0.45);
    box-shadow: 0 12px 24px rgba(80, 48, 30, 0.16);
}

.category-card.selected {
    background: linear-gradient(135deg, #9f4f33, #6f3524);
    color: #fff7f0;
}

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

.newest-pagination {
    margin-top: 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
}

.newest-pagination .button-secondary {
    justify-self: center;
    min-width: 170px;
}

.newest-page-label {
    font-family: "Palatino Linotype", Georgia, serif;
    color: var(--brand-dark);
}

.newest-pagination-placeholder {
    min-height: 1px;
}

.product-card,
.summary-card,
.form-card,
.admin-panel,
.order-card,
.empty-state {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.product-card {
    overflow: hidden;
}

.product-image-wrap {
    aspect-ratio: 4 / 3;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(232, 215, 194, 0.7), rgba(255, 250, 244, 0.9));
}

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

.product-link-overlay {
    display: block;
    width: 100%;
    height: 100%;
}

.product-carousel {
    position: relative;
    width: 100%;
    height: 100%;
}

.product-carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 260ms ease;
}

.product-carousel-slide {
    min-width: 100%;
    height: 100%;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: #2f241d;
    font-size: 1.5rem;
    line-height: 1;
    display: grid;
    place-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease;
    z-index: 2;
}

.carousel-nav.prev {
    left: 8px;
}

.carousel-nav.next {
    right: 8px;
}

.carousel-dots {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease;
    z-index: 2;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 0;
    background: rgba(47, 36, 29, 0.35);
    padding: 0;
}

.carousel-dot.active {
    background: var(--brand);
}

.product-card:hover .carousel-nav,
.product-card:hover .carousel-dots,
.product-card:focus-within .carousel-nav,
.product-card:focus-within .carousel-dots {
    opacity: 1;
    pointer-events: auto;
}

.product-copy,
.product-footer,
.summary-card,
.form-card,
.admin-panel,
.order-card,
.empty-state {
    padding: 22px;
}

.product-copy h3 {
    margin: 8px 0;
    font-size: 1.5rem;
}

.product-title-link:hover {
    color: var(--brand);
}

.product-category,
.order-id {
    margin: 0;
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.75rem;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px solid var(--line);
}

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

.product-actions .button-secondary {
    padding: 10px 14px;
}

.detail-layout {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 22px;
}

.gallery-panel,
.detail-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
}

.main-photo-wrap {
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: linear-gradient(135deg, rgba(232, 215, 194, 0.65), rgba(255, 250, 244, 0.9));
}

.main-photo {
    width: 100%;
    height: min(68vh, 620px);
    object-fit: cover;
}

.thumb-grid {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    gap: 10px;
}

.thumb-button {
    padding: 0;
    border-radius: 12px;
    border: 2px solid transparent;
    overflow: hidden;
    background: transparent;
}

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

.thumb-button.active {
    border-color: var(--brand);
}

.detail-card h1 {
    margin: 10px 0 14px;
    font-size: clamp(2rem, 3vw, 3rem);
}

.detail-description {
    color: var(--muted);
    line-height: 1.55;
}

.detail-price {
    display: block;
    margin: 18px 0;
    font-size: 2rem;
    font-family: "Palatino Linotype", Georgia, serif;
}

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.product-footer strong,
.summary-card strong,
.summary-total strong,
.order-head strong {
    font-family: "Palatino Linotype", Georgia, serif;
    font-size: 1.35rem;
}

.flash {
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
}

.flash-success {
    background: rgba(227, 242, 232, 0.9);
}

.flash-error,
.inline-errors {
    background: rgba(250, 228, 226, 0.92);
}

.cart-layout,
.checkout-layout,
.admin-grid {
    display: grid;
    gap: 22px;
}

.admin-single-panel {
    display: block;
}

.admin-single-panel .form-card {
    width: 100%;
}

.admin-quick-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.admin-quick-nav .button-secondary {
    width: 100%;
}

.admin-quick-nav .button-secondary.active {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff8f2;
    border-color: transparent;
}

.orders-head-center {
    justify-content: center;
    text-align: center;
    margin-bottom: 10px;
}

.order-send-form {
    margin-top: 14px;
}

#admin-orders,
#admin-messages,
#admin-add-product,
#admin-products,
#admin-categories {
    scroll-margin-top: 112px;
}

.messages-grid,
.contact-layout {
    display: grid;
    gap: 18px;
}

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

.message-card {
    padding: 22px;
}

.message-card.unread {
    border-color: rgba(159, 79, 51, 0.45);
    box-shadow: 0 18px 34px rgba(80, 48, 30, 0.16);
}

.message-body {
    margin: 14px 0;
    line-height: 1.55;
    color: var(--text);
}

.contact-layout {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 760px;
    margin-inline: auto;
}

.contact-form {
    padding: 28px;
}

.cart-layout,
.checkout-layout {
    grid-template-columns: 1.3fr 0.7fr;
}

.cart-table {
    display: grid;
    gap: 14px;
}

.cart-table-head,
.cart-row {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) 0.6fr 0.45fr 0.6fr;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.cart-product {
    display: flex;
    align-items: center;
    gap: 14px;
}

.cart-product img,
.admin-product-row img {
    width: 88px;
    height: 88px;
    border-radius: 18px;
    object-fit: cover;
    background: var(--bg-strong);
}

.cart-row input,
.form-card input:not([type="checkbox"]):not([type="radio"]),
.form-card textarea,
.form-card select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.7);
}

.phone-field {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 8px;
}

.phone-prefix {
    display: inline-flex;
    align-items: center;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.7);
    color: var(--text);
    line-height: 1;
}

.cart-update {
    justify-self: start;
}

.summary-card {
    display: grid;
    gap: 16px;
    align-content: start;
    height: fit-content;
}

.summary-card.tall {
    min-height: 100%;
}

.summary-line,
.summary-total,
.order-head,
.admin-product-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.summary-total {
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.form-card {
    display: grid;
    gap: 16px;
}

.form-card label,
.stack-form {
    display: grid;
    gap: 8px;
}

.inline-checkboxes {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.62);
}

.inline-checkboxes legend {
    padding: 0 6px;
    color: var(--muted);
}

.inline-checkboxes label {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: start;
    column-gap: 10px;
}

.inline-checkboxes input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 2px;
}

.category-checkbox-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    column-gap: 18px;
    row-gap: 10px;
}

.inline-form {
    display: grid;
    gap: 8px;
}

.inline-form input[type="text"] {
    min-width: 180px;
}

.admin-product-edit-row {
    align-items: start;
}

.category-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
}

.category-assign-form {
    min-width: 260px;
}

.product-edit-form {
    gap: 10px;
}

.product-edit-form .fixed-field {
    display: grid;
    gap: 6px;
}

.product-edit-form .fixed-field span {
    font-weight: 600;
}

.product-edit-form .inline-field {
    grid-template-columns: 140px minmax(0, 1fr);
    align-items: center;
    column-gap: 12px;
}

.product-edit-form .inline-field input {
    margin: 0;
}

.product-edit-form .textarea-field {
    gap: 8px;
}

.product-edit-form .textarea-field textarea {
    min-height: 130px;
    resize: vertical;
}

.gallery-manage-form {
    min-width: 320px;
}

.gallery-block {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.56);
}

.gallery-block h4 {
    margin: 0;
    font-family: "Palatino Linotype", Georgia, serif;
    font-size: 1.1rem;
}

.upload-block .stack-form {
    gap: 10px;
}

.product-gallery-admin {
    display: grid;
    grid-template-columns: repeat(auto-fill, 160px);
    gap: 12px;
    justify-content: start;
}

.gallery-thumb-card {
    display: grid;
    gap: 10px;
    width: 160px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.64);
}

.gallery-thumb-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--line);
    display: block;
}

.gallery-thumb-actions {
    display: grid;
    gap: 8px;
}

.upload-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 160px);
    gap: 10px;
    justify-content: start;
}

.upload-preview-item {
    display: grid;
    gap: 6px;
    width: 160px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
}

.upload-preview-item img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
    display: block;
}

.upload-preview-item small {
    color: var(--muted);
    word-break: break-word;
}

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

.file-picker-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.file-status {
    color: var(--muted);
    font-size: 0.92rem;
}

.file-trigger {
    padding: 10px 14px;
}

.preview-remove-btn {
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 0.82rem;
}

.primary-choice {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    color: var(--text);
}

.primary-choice input[type="radio"] {
    margin: 0;
}

.category-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.category-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.78);
    color: var(--text);
    font-size: 0.82rem;
}

.category-badge.muted {
    color: var(--muted);
}

.form-card small {
    color: var(--danger);
}

.admin-grid {
    grid-template-columns: 0.9fr 1.1fr;
}

.admin-list,
.order-items {
    display: grid;
    gap: 14px;
}

.admin-product-row {
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.admin-product-row:last-child {
    border-bottom: 0;
}

.product-list-compact {
    gap: 10px;
}

.product-list-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
}

.product-list-row.active-row {
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.66);
    padding: 14px;
}

.product-row-actions {
    display: grid;
    gap: 8px;
    justify-items: end;
}

.product-edit-panel {
    margin-top: 18px;
}

.product-edit-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    margin-top: 14px;
}

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

.site-footer {
    padding: 24px 4px 8px;
    text-align: center;
}

@media (max-width: 1080px) {
    .category-grid,
    .product-grid,
    .orders-grid,
    .messages-grid,
    .admin-grid,
    .detail-layout,
    .cart-layout,
    .checkout-layout,
    .contact-layout,
    .hero-section {
        grid-template-columns: 1fr;
    }

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

    .category-checkbox-grid {
        grid-template-columns: 1fr;
    }

    .product-list-row,
    .product-edit-layout {
        grid-template-columns: 1fr;
    }

    .product-row-actions {
        justify-items: start;
    }

    .product-edit-form .inline-field {
        grid-template-columns: 1fr;
        row-gap: 6px;
    }
}

@media (max-width: 760px) {
    .page-shell {
        width: min(100% - 20px, 1200px);
        margin-top: 12px;
    }

    .site-header {
        padding: 10px 12px;
        gap: 10px;
        border-radius: 18px;
        top: 8px;
    }

    .brand-block {
        gap: 8px;
    }

    .brand-mark {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        font-size: 0.88rem;
    }

    .eyebrow {
        margin-bottom: 2px;
        font-size: 0.62rem;
        letter-spacing: 0.1em;
    }

    .brand-name {
        font-size: 1rem;
    }

    .main-nav {
        gap: 6px;
    }

    .admin-header-tools {
        width: 100%;
    }

    .admin-header-actions .mailbox-link {
        margin-left: 0;
    }

    .mailbox-link {
        margin-left: auto;
        font-size: 0.88rem;
    }

    .main-nav a {
        padding: 8px 10px;
        font-size: 0.88rem;
    }

    .main-nav span {
        min-width: 18px;
        height: 18px;
        font-size: 0.72rem;
    }

    .site-header,
    .section-head,
    .order-head,
    .summary-line,
    .summary-total,
    .admin-product-row,
    .product-footer,
    .detail-actions {
        display: grid;
    }

    .cart-table-head {
        display: none;
    }

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

    .cart-product,
    .brand-block {
        align-items: start;
    }

    .admin-quick-nav {
        grid-template-columns: 1fr;
    }

    .newest-pagination {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .newest-pagination .button-secondary {
        width: 100%;
        max-width: 280px;
    }

    .newest-pagination-placeholder {
        display: none;
    }

    .category-row {
        grid-template-columns: 1fr;
        align-items: start;
    }
}


.auth-wrap {
    display: grid;
    place-items: center;
    min-height: 70vh;
}

.auth-card {
    width: min(460px, 100%);
    display: grid;
    gap: 16px;
    padding: 28px;
    background: rgba(255, 250, 244, 0.92);
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.auth-card h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3rem);
}

.auth-card label,
.form-card label {
    display: grid;
    gap: 8px;
}

.auth-card input,
.form-card input,
.form-card textarea,
.form-card select,
.cart-row input[type="number"] {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(112, 74, 49, 0.18);
    background: rgba(255, 255, 255, 0.78);
    outline: none;
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.auth-card input:focus,
.form-card input:focus,
.form-card textarea:focus,
.form-card select:focus,
.cart-row input[type="number"]:focus {
    border-color: rgba(159, 79, 51, 0.55);
    box-shadow: 0 0 0 4px rgba(159, 79, 51, 0.10);
    transform: translateY(-1px);
}

.form-card small,
.auth-card small {
    color: var(--danger);
    font-size: 0.88rem;
}

.inline-errors {
    padding: 12px 14px;
    border-radius: 16px;
    background: #f8e5e3;
    color: var(--danger);
    border: 1px solid rgba(143, 47, 47, 0.18);
}

.admin-user-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(159, 79, 51, 0.12), rgba(111, 53, 36, 0.08));
    border: 1px solid rgba(159, 79, 51, 0.35);
    white-space: nowrap;
    font-weight: 700;
    color: var(--brand-dark);
    font-size: 0.95rem;
    margin-bottom: 6px;
}

.logout-form {
    margin: 0;
}

.logout-button {
    min-height: 42px;
}

.admin-header-tools {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.admin-header-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.product-card,
.category-card,
.summary-card,
.form-card,
.cart-table,
.detail-card,
.gallery-panel,
.empty-state {
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.product-card {
    overflow: hidden;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 46px rgba(73, 45, 28, 0.16);
}

.product-card img,
.main-photo {
    border-radius: 22px;
}

.button-primary,
.button-secondary,
.product-footer button,
.danger-button {
    min-height: 46px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.button-primary:hover,
.button-secondary:hover,
.product-footer button:hover,
.danger-button:hover {
    transform: translateY(-2px) scale(1.01);
}

.flash {
    margin-top: 18px;
    padding: 14px 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
}

.flash-success {
    background: rgba(232, 245, 236, 0.9);
}

.flash-error {
    background: rgba(248, 229, 227, 0.92);
}

.site-footer {
    margin-top: 28px;
    padding: 22px 20px 34px;
    text-align: center;
}

.footer-contact-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    border-radius: 999px;
    background: #fffaf4;
    border: 1px solid var(--line);
    transition: 180ms ease;
}

.footer-contact-cta:hover {
    transform: translateY(-2px);
    border-color: rgba(159, 79, 51, 0.45);
}

.phone-field {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 10px;
    align-items: center;
}

.phone-prefix {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(112, 74, 49, 0.18);
    font-weight: 700;
}

@media (max-width: 900px) {
    .site-header {
        position: static;
        padding: 16px;
    }

    .brand-block {
        width: 100%;
        justify-content: center;
    }

    .main-nav,
    .admin-header-tools {
        width: 100%;
        justify-content: center;
    }

    .hero-section,
    .detail-layout,
    .cart-layout,
    .checkout-layout,
    .contact-layout {
        grid-template-columns: 1fr !important;
    }

    .hero-copy h1 {
        max-width: none;
    }
}


/* === Max UI polish additions === */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 12% 15%, rgba(255,255,255,0.35), transparent 22%),
        radial-gradient(circle at 88% 10%, rgba(255,255,255,0.18), transparent 18%),
        radial-gradient(circle at 50% 100%, rgba(255,255,255,0.18), transparent 22%);
}

main {
    gap: 28px;
}

.site-header {
    padding: 18px 24px;
}

.brand-mark {
    box-shadow: 0 12px 24px rgba(111, 53, 36, 0.24);
}

.brand-name {
    display: inline-block;
    letter-spacing: 0.01em;
}

.main-nav a,
.mailbox-link,
.admin-user-badge,
.footer-contact-cta {
    box-shadow: 0 10px 22px rgba(73, 45, 28, 0.08);
}

.main-nav a:hover,
.main-nav a.active,
.mailbox-link:hover,
.footer-contact-cta:hover {
    transform: translateY(-1px);
}

.hero-section {
    min-height: 430px;
    align-items: end;
}

.hero-section::after {
    content: "";
    position: absolute;
    inset: auto -10% -25% auto;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 72%);
}

.hero-copy {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 14px;
}

.hero-copy p {
    max-width: 54ch;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 2px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 250, 244, 0.74);
    border: 1px solid rgba(112, 74, 49, 0.14);
    color: var(--text);
    font-size: 0.92rem;
    backdrop-filter: blur(10px);
}

.hero-panel {
    position: relative;
    z-index: 1;
    display: grid;
    align-content: end;
    gap: 14px;
}

.hero-stat {
    padding: 20px;
    border-radius: 24px;
    border: 1px solid rgba(112, 74, 49, 0.14);
    background: rgba(255, 250, 244, 0.72);
    backdrop-filter: blur(10px);
    box-shadow: 0 16px 30px rgba(73, 45, 28, 0.08);
}

.hero-stat strong {
    display: block;
    font-size: clamp(1.6rem, 3vw, 2.5rem);
    font-family: "Palatino Linotype", Georgia, serif;
}

.hero-stat.accent {
    background: linear-gradient(135deg, rgba(49,95,83,0.96), rgba(67,115,103,0.9));
    color: #f8f2ea;
}

.hero-stat.accent span,
.hero-stat.accent p,
.hero-stat.accent small {
    color: rgba(248,242,234,0.84);
}

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

.section-kicker {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.55);
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.88rem;
}

.category-grid {
    gap: 14px;
}

.category-card {
    position: relative;
    overflow: hidden;
    padding: 22px 20px;
}

.category-card::before {
    content: "";
    position: absolute;
    inset: auto -10% -40% auto;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.25), transparent 70%);
}

.category-card strong {
    position: relative;
    z-index: 1;
}

.category-card.selected {
    border-color: rgba(159, 79, 51, 0.34);
    box-shadow: 0 18px 34px rgba(73, 45, 28, 0.12);
}

.product-grid {
    gap: 20px;
}

.product-card {
    position: relative;
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 100%;
    border: 1px solid rgba(112, 74, 49, 0.12);
}

.product-image-wrap {
    padding: 14px 14px 0;
}

.product-carousel,
.product-link-overlay,
.product-carousel-slide img {
    border-radius: 22px;
}

.product-carousel-slide img {
    aspect-ratio: 1 / 1.08;
    object-fit: cover;
}

.product-copy {
    display: grid;
    gap: 12px;
    padding: 18px 20px 4px;
}

.product-copy h3 {
    margin: 0;
    font-size: 1.34rem;
    line-height: 1.08;
}

.product-copy p {
    margin: 0;
}

.product-category {
    display: inline-flex;
    align-items: center;
    align-self: start;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(255,255,255,0.56);
    border: 1px solid rgba(112, 74, 49, 0.12);
    font-size: 0.82rem;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 20px;
}

.product-footer strong {
    font-family: "Palatino Linotype", Georgia, serif;
    font-size: 1.32rem;
}

.product-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.product-title-link:hover {
    color: var(--brand);
}

.product-card::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 4px;
    background: linear-gradient(90deg, rgba(159,79,51,0.9), rgba(49,95,83,0.8));
    opacity: 0;
    transition: opacity 180ms ease;
}

.product-card:hover::after {
    opacity: 1;
}

.newest-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.newest-page-label {
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(255,255,255,0.62);
    border: 1px solid var(--line);
}

.detail-layout,
.cart-layout,
.checkout-layout,
.contact-layout {
    align-items: start;
}

.gallery-panel,
.detail-card,
.summary-card,
.cart-table,
.form-card,
.empty-state,
.order-card,
.admin-panel {
    background: rgba(255, 250, 244, 0.9);
    border: 1px solid rgba(112, 74, 49, 0.14);
}

.gallery-panel {
    padding: 18px;
}

.main-photo-wrap {
    overflow: hidden;
    border-radius: 28px;
}

.main-photo {
    aspect-ratio: 1 / 1.08;
    object-fit: cover;
    transition: transform 280ms ease;
}

.main-photo:hover {
    transform: scale(1.02);
}

.thumb-grid {
    margin-top: 14px;
    gap: 10px;
}

.thumb-button {
    padding: 4px;
    border-radius: 18px;
    border: 1px solid rgba(112, 74, 49, 0.14);
    background: rgba(255,255,255,0.76);
}

.thumb-button.active {
    border-color: rgba(159, 79, 51, 0.52);
    box-shadow: 0 10px 18px rgba(73, 45, 28, 0.12);
}

.thumb-button img {
    border-radius: 14px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.detail-card {
    padding: 28px;
    display: grid;
    gap: 18px;
}

.detail-card h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 0.98;
}

.detail-description {
    font-size: 1.04rem;
    line-height: 1.7;
    color: var(--muted);
}

.detail-price {
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    font-family: "Palatino Linotype", Georgia, serif;
}

.detail-meta {
    display: grid;
    gap: 10px;
    padding: 16px 18px;
    border-radius: 22px;
    background: rgba(255,255,255,0.56);
    border: 1px solid rgba(112, 74, 49, 0.12);
}

.detail-meta-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
}

.detail-meta-item strong {
    color: var(--text);
}

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

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

.info-chip {
    padding: 16px 18px;
    border-radius: 22px;
    background: rgba(255,255,255,0.54);
    border: 1px solid rgba(112, 74, 49, 0.12);
}

.info-chip strong {
    display: block;
    margin-bottom: 6px;
}

.cart-table,
.form-card,
.summary-card {
    padding: 22px;
}

.cart-table-head {
    border-bottom: 1px solid rgba(112,74,49,0.12);
    padding-bottom: 14px;
    margin-bottom: 6px;
}

.cart-row {
    padding: 18px 0;
    border-bottom: 1px solid rgba(112,74,49,0.08);
}

.cart-row:last-of-type {
    border-bottom: 0;
}

.cart-product img {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(73, 45, 28, 0.10);
}

.cart-summary-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.summary-badge {
    padding: 9px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.58);
    border: 1px solid rgba(112,74,49,0.12);
    color: var(--muted);
    font-size: 0.9rem;
}

.summary-card.tall {
    gap: 12px;
}

.summary-card .summary-total {
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid rgba(112,74,49,0.12);
}

.checkout-form-grid,
.contact-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.checkout-form-grid .full,
.contact-form-grid .full {
    grid-column: 1 / -1;
}

.form-intro-card {
    display: grid;
    gap: 10px;
    padding: 18px;
    border-radius: 24px;
    background: rgba(255,255,255,0.58);
    border: 1px solid rgba(112,74,49,0.12);
    margin-bottom: 6px;
}

.form-intro-card p,
.form-help-text {
    margin: 0;
    color: var(--muted);
}

.contact-side-card {
    display: grid;
    gap: 14px;
    padding: 22px;
    border-radius: 28px;
    background: rgba(255, 250, 244, 0.9);
    border: 1px solid rgba(112, 74, 49, 0.14);
    box-shadow: var(--shadow);
}

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

.contact-side-item {
    padding: 14px 16px;
    border-radius: 20px;
    background: rgba(255,255,255,0.58);
    border: 1px solid rgba(112,74,49,0.12);
}

.empty-state {
    padding: 42px 28px;
    text-align: center;
}

.empty-state h3 {
    margin-top: 0;
    font-size: 1.9rem;
}

.site-footer {
    margin-top: 18px;
    padding: 26px 18px 36px;
    text-align: center;
}

.footer-meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.92rem;
}

.footer-pill {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.52);
    border: 1px solid rgba(112,74,49,0.12);
}

.auth-card {
    box-shadow: 0 24px 44px rgba(73,45,28,0.14);
}

.admin-grid,
.order-grid,
.messages-grid {
    gap: 18px;
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    border: 1px solid var(--line);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(73,45,28,0.08);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--brand);
    margin-bottom: 8px;
}

.stat-label {
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 12px;
}

.stat-link {
    display: inline-block;
    padding: 8px 16px;
    background: var(--brand);
    color: white;
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: background 0.2s ease;
}

.stat-link:hover {
    background: var(--brand-dark);
}

/* Statistics styles */
.period-selector {
    display: flex;
    align-items: center;
}

.stat-period {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 4px;
}

.top-products-list,
.category-revenue-list {
    max-height: 400px;
    overflow-y: auto;
}

.top-product-row:hover,
.category-revenue-row:hover {
    background: rgba(255,255,255,0.5);
    border-radius: 8px;
    padding-left: 8px;
    padding-right: 8px;
}

.recent-order-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(73,45,28,0.1);
}

.monthly-revenue-chart {
    margin: 20px 0;
}

@media (max-width: 900px) {
    .checkout-form-grid,
    .contact-form-grid,
    .info-strip {
        grid-template-columns: 1fr;
    }

    .hero-section {
        min-height: auto;
    }
}

@media (max-width: 720px) {
    .page-shell {
        width: min(100% - 20px, 1200px);
        margin-top: 14px;
    }

    .site-header,
    .hero-section,
    .gallery-panel,
    .detail-card,
    .cart-table,
    .form-card,
    .summary-card,
    .contact-side-card {
        border-radius: 24px;
    }

    .product-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .product-actions,
    .detail-actions {
        width: 100%;
    }

    .product-actions > *,
    .detail-actions > * {
        flex: 1 1 100%;
    }
}
