:root {
    --ink: #292b24;
    --muted: #77786f;
    --paper: #f8f6f1;
    --white: #fffefa;
    --green: #56664c;
    --green-dark: #3e4c36;
    --sage: #e8ebe1;
    --line: #e8e5dc;
    --serif: 'Playfair Display', Georgia, serif;
    --sans: 'DM Sans', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.site-header {
    height: 82px;
    padding: 0 max(6.7vw, 28px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(41, 43, 36, .07);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--serif);
    font-size: 25px;
    font-weight: 600;
    letter-spacing: -.8px;
}

.brand-mark {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid var(--green);
    border-radius: 50%;
    color: var(--green);
    font-family: var(--serif);
    font-size: 19px;
    font-style: italic;
}

.brand-dot, .heading-period { color: #a77c5d; }

.header-nav {
    display: flex;
    align-items: center;
    gap: 39px;
    font-size: 12px;
}

.nav-link { color: var(--muted); transition: color .2s ease; }
.nav-link:hover, .nav-link.active { color: var(--ink); }
.nav-link.active { font-weight: 600; }

.admin-link {
    padding: 11px 16px;
    border: 1px solid #dcd9d0;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    transition: background .2s ease, border-color .2s ease;
}

.admin-link:hover { border-color: var(--green); background: #f0efe8; }
.admin-link span { margin-left: 8px; color: var(--green); }

.hero {
    min-height: 565px;
    padding: 55px max(11vw, 40px) 57px max(13.5vw, 40px);
    display: grid;
    grid-template-columns: 1fr .83fr;
    align-items: center;
    gap: 45px;
    overflow: hidden;
}

.hero-copy { position: relative; z-index: 1; padding-top: 6px; }
.eyebrow { margin: 0; color: var(--green); font-size: 9px; font-weight: 700; letter-spacing: 2px; }
.eyebrow-line { display: inline-block; width: 25px; height: 1px; margin: 0 9px 3px 0; background: #a77c5d; }

.hero h1 {
    margin: 26px 0 19px;
    font-family: var(--serif);
    font-size: clamp(42px, 5vw, 63px);
    font-weight: 500;
    letter-spacing: -1.7px;
    line-height: 1.14;
}

.hero h1 em { color: var(--green); font-weight: 500; }
.hero-description { max-width: 368px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.9; }

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    margin-top: 24px;
    padding-bottom: 6px;
    border-bottom: 1px solid #9a8b77;
    color: var(--ink);
    font-size: 11px;
    font-weight: 600;
}

.text-link span { color: var(--green); font-size: 15px; }
.hero-note { display: flex; align-items: center; gap: 9px; margin-top: 43px; color: #858379; font-family: var(--serif); font-size: 12px; font-style: italic; }
.note-spark { color: #ad805e; font-size: 17px; }

.hero-art {
    position: relative;
    width: min(100%, 410px);
    height: 425px;
    justify-self: center;
    background: #e8e9df;
}

.hero-art::before {
    position: absolute;
    inset: 18px -18px -17px 18px;
    border: 1px solid rgba(86, 102, 76, .25);
    content: '';
}

.hero-sun {
    position: absolute;
    top: 26px;
    right: 28px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #d7c6a9;
    opacity: .7;
}

.hero-photo {
    position: absolute;
    top: 38px;
    left: 44px;
    width: 67%;
    height: 340px;
    overflow: hidden;
    box-shadow: 0 16px 35px rgba(49, 56, 42, .16);
    transform: rotate(-3deg);
}

.hero-photo img { width: 100%; height: 100%; object-fit: cover; }

.hero-sticker {
    position: absolute;
    right: 14px;
    bottom: 82px;
    display: grid;
    width: 84px;
    height: 84px;
    place-content: center;
    border-radius: 50%;
    background: #f8f4e9;
    color: var(--green-dark);
    font-size: 8px;
    line-height: 1.55;
    letter-spacing: 1.1px;
    text-align: center;
    transform: rotate(9deg);
}

.hero-caption { position: absolute; right: 8px; bottom: -34px; color: #72756b; font-family: var(--serif); font-size: 10px; font-style: italic; }
.hero-caption span { padding: 0 6px; color: #a77c5d; }

.catalog-section { padding: 73px max(8vw, 28px) 98px; background: var(--white); }

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    max-width: 1190px;
    margin: 0 auto;
}

.section-heading .eyebrow { font-size: 8px; }
.section-heading h2 { margin: 12px 0 0; font-family: var(--serif); font-size: 37px; font-weight: 500; letter-spacing: -.8px; }
.result-count { padding-bottom: 5px; color: var(--muted); font-size: 11px; }

.product-grid { max-width: 1190px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 35px 20px; }
.product-card { min-width: 0; }
.product-image-wrap { position: relative; aspect-ratio: 4 / 4.65; overflow: hidden; background: #ecebe3; }
.product-image { display: block; width: 100%; height: 100%; object-fit: contain; }

.product-details { padding-top: 13px; }
.product-price { margin: 0; color: var(--green); font-size: 12px; font-weight: 700; }

.empty-state { padding: 80px 20px; text-align: center; }
.empty-flower { color: #a77c5d; font-size: 28px; }
.empty-state h3 { margin: 14px 0 8px; font-family: var(--serif); font-size: 25px; font-weight: 500; }
.empty-state h1, .empty-state h2 { margin: 0 0 8px; font-family: var(--serif); font-size: 28px; font-weight: 500; }
.empty-state p { margin: 0; color: var(--muted); font-size: 12px; }
.empty-state .text-link { margin-top: 18px; }

.catalog-main {
    width: min(1120px, calc(100% - 48px));
    min-height: calc(100vh - 196px);
    margin: 0 auto;
    padding: 48px 0 72px;
}

.catalog-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 27px;
}

.catalog-heading h1 {
    margin: 10px 0 0;
    font-family: var(--serif);
    font-size: 34px;
    font-weight: 500;
    letter-spacing: -.5px;
}

.product-card { display: block; }
.product-card:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }
.product-price { margin: 12px 0 0; font-size: 13px; }

.detail-main {
    width: min(1050px, calc(100% - 48px));
    min-height: calc(100vh - 82px);
    margin: 0 auto;
    padding: 28px 0 64px;
}

.detail-back { display: inline-block; margin-bottom: 18px; color: var(--muted); font-size: 11px; }
.detail-back:hover { color: var(--green); }
.site-header .back-link { margin-top: 0; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(250px, .7fr); align-items: center; gap: 58px; }
.detail-image-wrap { display: grid; height: min(76vh, 760px); min-height: 430px; place-items: center; padding: 18px; background: #eeede6; }
.detail-image { display: block; width: 100%; height: 100%; object-fit: contain; }
.detail-info { padding: 28px 0; }
.detail-info h1 { margin: 15px 0 19px; font-family: var(--serif); font-size: clamp(30px, 4vw, 46px); font-weight: 500; line-height: 1.2; }
.detail-price { margin: 0; color: var(--green); font-size: 20px; font-weight: 700; }

.notice { margin: 20px auto; padding: 14px 17px; border: 1px solid #cfddc5; background: #f1f6ed; color: #3e5936; font-size: 12px; line-height: 1.6; }
.notice-error { border-color: #e7c7bd; background: #fff4f0; color: #874c3b; }
.catalog-section > .notice { max-width: 1190px; }

.site-footer {
    min-height: 114px;
    padding: 26px max(8vw, 28px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.footer-brand { font-size: 20px; }
.footer-brand .brand-mark { width: 25px; height: 25px; font-size: 16px; }
.site-footer p, .site-footer > span { color: var(--muted); font-size: 10px; }

.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; }

/* Admin */
.admin-body { min-height: 100vh; background: #f7f6f1; }
.admin-header { height: 72px; background: var(--paper); }
.admin-header-right { display: flex; align-items: center; gap: 24px; }
.admin-header-right form { margin: 0; }
.logout-button { padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 11px; }
.logout-button:hover, .back-link:hover { color: var(--green); }
.admin-main { width: min(1180px, calc(100% - 56px)); margin: 49px auto 80px; }
.admin-main > .notice { max-width: 100%; }
.admin-main > .notice:first-child { margin-top: 0; }

.admin-title-row { display: flex; justify-content: space-between; align-items: end; margin-bottom: 30px; }
.admin-title-row h1, .login-panel h1 { margin: 11px 0 8px; font-family: var(--serif); font-size: 39px; font-weight: 500; letter-spacing: -.8px; }
.panel-intro { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.admin-product-count { margin-bottom: 4px; padding: 9px 12px; border: 1px solid var(--line); color: var(--muted); font-size: 10px; }

.admin-layout { display: grid; grid-template-columns: minmax(295px, .75fr) minmax(0, 1.4fr); align-items: start; gap: 24px; }
.admin-editor, .admin-products, .login-panel { padding: 25px; border: 1px solid var(--line); background: var(--white); }
.editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 22px; }
.editor-heading h2 { margin: 0; font-family: var(--serif); font-size: 20px; font-weight: 500; }
.editor-heading > a { color: var(--green); font-size: 10px; }
.editor-heading > span { color: var(--muted); font-size: 9px; text-align: right; }

.admin-form { display: flex; flex-direction: column; gap: 9px; }
.admin-form label { margin-top: 7px; color: #505149; font-size: 10px; font-weight: 600; }
.admin-form input:not([type="checkbox"]):not([type="file"]), .admin-form select {
    width: 100%;
    height: 40px;
    padding: 0 11px;
    border: 1px solid #e4e1d8;
    border-radius: 2px;
    outline: none;
    background: #fffefa;
    color: var(--ink);
    font-size: 11px;
}

.admin-form input:focus, .admin-form select:focus { border-color: #8d9b80 !important; }
.admin-form input[type="file"] { width: 100%; color: var(--muted); font-size: 10px; }
.field-help { margin-top: -5px; color: #88877f; font-size: 9px; }
.form-two-columns { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 12px; }
.form-two-columns > div { display: flex; flex-direction: column; gap: 9px; }
.price-calculator { display: flex; flex-direction: column; gap: 9px; margin: 8px 0 4px; padding: 14px; border: 1px solid var(--line); background: #fbfaf6; }
.price-calculator h3 { margin: 0; color: var(--ink); font-family: var(--serif); font-size: 16px; font-weight: 500; }
.calculator-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.calculator-fields > div { display: flex; min-width: 0; flex-direction: column; gap: 7px; }
.calculator-fields label { min-height: 22px; }
.calculator-results { display: flex; flex-direction: column; gap: 7px; margin-top: 2px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 10px; }
.calculator-results > div { display: flex; justify-content: space-between; gap: 10px; }
.calculator-results span { color: var(--muted); }
.calculator-results strong { color: var(--green); text-align: right; }
.calculator-button { min-height: 36px; border: 1px solid #c9d1c1; background: #fff; color: var(--green); cursor: pointer; font-size: 10px; font-weight: 600; }
.calculator-button:disabled { border-color: var(--line); color: #aaa89f; cursor: not-allowed; }
.checkbox-label { display: flex; min-height: 40px; align-items: center; gap: 8px; margin: 0 !important; font-weight: 500 !important; }
.checkbox-label input { accent-color: var(--green); }

.primary-button {
    display: flex;
    width: 100%;
    min-height: 43px;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding: 0 14px;
    border: 0;
    background: var(--green);
    color: white;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: background .2s ease;
}

.primary-button:hover { background: var(--green-dark); }
.primary-button span { font-size: 17px; }
.current-image { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 9px; }
.current-image img { width: 43px; height: 48px; object-fit: cover; }
.image-preview { width: 100%; max-height: 165px; object-fit: contain; object-position: left; background: #f5f4ef; }

.admin-product-list { display: flex; flex-direction: column; }
.admin-product-row { min-height: 87px; display: flex; align-items: center; gap: 13px; padding: 12px 0; border-top: 1px solid #eeece5; }
.admin-product-row > img { width: 48px; height: 59px; flex: 0 0 auto; object-fit: cover; background: #ecebe3; }
.admin-product-info { min-width: 0; flex: 1; }
.admin-product-info h3 { overflow: hidden; margin: 0 0 4px; font-family: var(--serif); font-size: 13px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.admin-product-info p { margin: 0 0 5px; color: var(--green); font-size: 10px; font-weight: 600; }
.admin-product-info p span { color: var(--muted); font-weight: 400; }
.product-status { color: #99978e; font-size: 9px; }
.product-status.status-live { color: #5f7654; }
.row-actions { display: flex; align-items: center; gap: 11px; }
.row-actions form { margin: 0; }
.edit-link, .delete-link { padding: 4px 0; border: 0; background: transparent; color: var(--green); cursor: pointer; font-size: 10px; }
.delete-link { color: #a45b4b; }
.admin-empty { padding: 25px 0; border-top: 1px solid #eeece5; color: var(--muted); font-size: 11px; line-height: 1.7; }

.login-panel { width: min(430px, 100%); margin: 54px auto; padding: 38px; }
.login-panel h1 { margin-top: 16px; font-size: 42px; line-height: 1.2; }
.login-form { margin-top: 26px; }
.back-link { display: inline-block; margin-top: 22px; color: var(--muted); font-size: 10px; }

@media (min-width: 1500px) {
    .hero { padding-right: max(15vw, 100px); padding-left: max(17vw, 100px); }
}

@media (max-width: 900px) {
    .hero { min-height: 500px; padding-right: 7vw; padding-left: 8vw; gap: 24px; }
    .hero-art { height: 360px; }
    .hero-photo { top: 29px; left: 34px; height: 287px; }
    .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .catalog-section { padding-right: 6vw; padding-left: 6vw; }
    .admin-layout { grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr); gap: 16px; }
    .admin-editor, .admin-products { padding: 19px; }
}

@media (max-width: 640px) {
    .site-header { height: 66px; padding: 0 21px; }
    .brand { gap: 8px; font-size: 22px; }
    .brand-mark { width: 27px; height: 27px; }
    .header-nav { gap: 14px; }
    .header-nav > .nav-link { display: none; }
    .admin-link { padding: 9px 10px; font-size: 10px; }

    .hero { min-height: initial; grid-template-columns: 1fr; gap: 27px; padding: 48px 27px 48px; }
    .hero h1 { margin-top: 20px; font-size: clamp(40px, 12vw, 54px); }
    .hero-description { max-width: 340px; font-size: 11px; }
    .hero-note { margin-top: 26px; }
    .hero-art { width: min(84%, 340px); height: min(88vw, 365px); margin: 0 auto 13px; }
    .hero-photo { top: 8%; left: 12%; height: 79%; width: 66%; }
    .hero-sticker { right: 1%; bottom: 15%; width: 70px; height: 70px; font-size: 7px; }
    .hero-sun { top: 5%; right: 8%; width: 76px; height: 76px; }
    .hero-caption { bottom: -28px; font-size: 9px; }

    .catalog-section { padding: 49px 20px 65px; }
    .section-heading h2 { font-size: 29px; }
    .result-count { font-size: 9px; }
    .catalog-main { width: calc(100% - 32px); min-height: calc(100vh - 160px); padding: 34px 0 52px; }
    .catalog-heading { margin-bottom: 20px; }
    .catalog-heading h1 { font-size: 28px; }
    .product-grid { gap: 22px 12px; }
    .product-price { margin-top: 9px; font-size: 11px; }
    .detail-main { width: calc(100% - 32px); padding: 20px 0 44px; }
    .detail-layout { grid-template-columns: 1fr; gap: 18px; }
    .detail-image-wrap { height: 62vh; min-height: 300px; padding: 12px; }
    .detail-info { padding: 7px 0 15px; }
    .detail-info h1 { margin: 10px 0 12px; font-size: 30px; }
    .detail-price { font-size: 18px; }
    .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 25px 12px; }
    .product-image-wrap { aspect-ratio: 4 / 4.8; }
    .product-details { padding-top: 10px; }
    .product-price { font-size: 11px; }

    .site-footer { align-items: flex-start; flex-wrap: wrap; gap: 10px; padding: 23px 21px; }
    .footer-brand { width: 100%; }
    .site-footer p { margin: 2px 0; }
    .site-footer > span { margin-left: auto; }

    .admin-header { height: 64px; }
    .admin-header-right { gap: 13px; }
    .admin-header-right .nav-link { font-size: 9px; }
    .logout-button { font-size: 10px; }
    .admin-main { width: calc(100% - 32px); margin: 32px auto 55px; }
    .admin-title-row { align-items: start; gap: 10px; }
    .admin-title-row h1 { font-size: 30px; }
    .panel-intro { font-size: 10px; }
    .admin-product-count { padding: 7px 8px; white-space: nowrap; font-size: 9px; }
    .admin-layout { grid-template-columns: 1fr; }
    .admin-editor, .admin-products { padding: 18px; }
    .admin-products { order: 2; }
    .login-panel { margin: 31px auto; padding: 26px 22px; }
    .login-panel h1 { font-size: 37px; }
    .admin-product-row { gap: 9px; }
    .row-actions { flex-direction: column; align-items: flex-end; gap: 3px; }
    .editor-heading > span { max-width: 125px; line-height: 1.5; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
