:root { --paper: #f7f4ef; --surface: #fffdf9; --ink: #272c27; --muted: #77796f; --line: #dedfd5; --wine: #723d42; --wine-dark: #552b30; --green: #47604b; --control-height: 48px; --compact-height: 38px; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 15px; line-height: 1.5; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #b5c7ab; outline-offset: 4px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; line-height: 1.12; letter-spacing: -.035em; }
h1 { font-size: clamp(34px, 4vw, 54px); }
h2 { font-size: 32px; }
h3 { font-size: 18px; font-weight: 600; line-height: 1.35; }
.site-header { min-height: 108px; display: flex; align-items: center; justify-content: space-between; gap: 24px; max-width: 1248px; padding: 24px 32px; margin: auto; border-bottom: 1px solid var(--line); }
.brand { text-decoration: none; color: var(--wine); font-family: Georgia, serif; font-weight: 600; font-size: 25px; letter-spacing: -.5px; line-height: 1.15; }
.brand span { display: block; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 11px; font-weight: 400; color: var(--muted); letter-spacing: .03em; margin-top: 7px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid var(--wine); border-radius: 6px; padding: 11px 19px; min-height: var(--control-height); line-height: 22px; color: white; background: var(--wine); text-decoration: none; font-weight: 500; }
.button:hover:not(:disabled) { background: var(--wine-dark); border-color: var(--wine-dark); }
.button.secondary { border-color: #d4d5c9; background: transparent; color: var(--ink); }
.button.secondary:hover:not(:disabled) { background: #eceee5; border-color: #bbbfaf; }
.button.small { padding: 8px 13px; min-height: var(--compact-height); line-height: 20px; font-size: 13px; }
.cart-button { white-space: nowrap; }
.cart-button #cart-count { background: rgba(255,255,255,.14); min-width: 24px; border-radius: 3px; padding: 1px 5px; text-align: center; }
.page { max-width: 1248px; padding: 0 32px 80px; margin: auto; min-height: calc(100vh - 207px); }
.section-heading, .dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.section-heading { margin-bottom: 23px; }
.section-heading h1, .section-heading h2, .section-heading h3 { margin: 0; }
.muted { color: var(--muted); font-size: 14px; }
.category-list, .admin-tabs { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 30px; }
.category-button { border: 1px solid var(--line); background: transparent; border-radius: 5px; padding: 9px 17px; color: var(--ink); }
.category-button:hover { background: #eceee5; }
.category-button.active { background: var(--green); border-color: var(--green); color: white; }
.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.product-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.product-picture { display: block; border: none; background: #efefe6; padding: 0; width: 100%; aspect-ratio: 1.1; overflow: hidden; }
.product-picture img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform 200ms; }
.product-picture:hover img { transform: scale(1.025); }
.product-content { padding: 20px 17px 17px; display: flex; flex-direction: column; flex: 1; }
.product-content h3 { margin-bottom: 8px; }
.product-title { overflow-wrap: anywhere; background: none; border: 0; padding: 0; text-align: left; color: inherit; font-weight: 600; }
.product-title:hover { color: var(--wine); }
.product-description { color: var(--muted); font-size: 13px; margin-bottom: 23px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; line-height: 1.6; }
.product-footer { margin-top: auto; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.product-price { font-size: 17px; white-space: nowrap; }
.image-placeholder { display: grid; place-content: center; min-height: 100%; height: 100%; background: #eeeee5; color: #808370; padding: 12px; font-size: 12px; text-align: center; }
.empty-state { padding: 66px 24px; border: 1px dashed #cfd2c3; border-radius: 8px; text-align: center; color: var(--muted); }
.empty-state h3 { color: var(--ink); margin-bottom: 8px; }
.empty-state p { margin-bottom: 10px; }
.site-footer { max-width: 1184px; margin: auto; padding: 27px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; font-size: 12px; color: var(--muted); }
.site-footer a { text-decoration-color: #b8bbae; text-underline-offset: 4px; }
.toast { position: fixed; bottom: 25px; left: 50%; transform: translateX(-50%); background: var(--ink); color: white; padding: 14px 22px; border-radius: 7px; z-index: 100; max-width: calc(100% - 32px); text-align: center; box-shadow: 0 4px 25px #0002; }
dialog { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 28px; width: min(720px, calc(100% - 24px)); max-height: calc(100dvh - 36px); overflow-y: auto; box-shadow: 0 16px 80px #1e28212b; }
dialog::backdrop { background: #17221bcc; }
.dialog-heading { align-items: flex-start; margin-bottom: 24px; }
.dialog-heading h2 { margin: 0; font-size: 30px; }
.close-button { background: transparent; border: 0; font-size: 30px; line-height: 1; width: 34px; height: 34px; color: var(--muted); flex-shrink: 0; padding: 0; }
.detail-images { display: flex; gap: 12px; overflow-x: auto; margin-bottom: 22px; scroll-snap-type: x mandatory; }
.detail-images > * { flex: 0 0 100%; width: 100%; height: 340px; object-fit: contain; background: #efefe7; border-radius: 5px; scroll-snap-align: start; }
.description { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; color: #666a5b; }
.cart-row { display: grid; grid-template-columns: 52px minmax(0,1fr) auto auto; align-items: center; gap: 12px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.cart-image { width: 52px; height: 64px; object-fit: cover; border-radius: 4px; min-height: 0; }
.cart-image.image-placeholder { font-size: 8px; padding: 3px; }
.cart-product-info { display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
.cart-product-info strong { font-size: 14px; }
.cart-row .text-button { grid-column: 2; justify-self: start; margin-top: -10px; }
.quantity-controls { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 5px; }
.quantity-button { border: 0; background: transparent; padding: 4px 9px; color: var(--ink); font-size: 19px; min-height: 36px; }
.quantity-value { min-width: 20px; text-align: center; font-size: 13px; }
.cart-row-price { font-size: 14px; white-space: nowrap; }
.cart-total { padding: 25px 0 30px; display: flex; justify-content: space-between; font-size: 18px; }
.cart-total strong { font-size: 23px; }
label { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 500; margin-bottom: 18px; }
input, textarea, select { width: 100%; border: 1px solid #cfd3c5; background: #fff; padding: 11px 12px; border-radius: 5px; color: var(--ink); min-width: 0; font-size: 15px; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="range"]), select { height: var(--control-height); min-height: var(--control-height); line-height: 22px; }
select { -webkit-appearance: none; appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%2377796f' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; background-size: 12px 8px; cursor: pointer; }
input::placeholder, textarea::placeholder { color: #989c8d; }
textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.full-width { grid-column: 1 / -1; width: 100%; }
.form-note { font-size: 12px; color: var(--muted); line-height: 1.6; margin: 12px 0 0; }
.message { background: #f6e8e4; border-left: 3px solid #a86653; padding: 12px 15px; border-radius: 3px; color: #753d2e; line-height: 1.6; font-size: 14px; }
.message.success { background: #e9eee4; border-color: #798b64; color: #3b5a3c; }
.notice { background: #f2eee1; padding: 14px; border-radius: 4px; color: #70613c; font-size: 13px; line-height: 1.7; }
.order-success { text-align: center; padding: 40px 10px; }
.order-success h3 { font-family: Georgia, serif; font-size: 34px; font-weight: 400; color: var(--green); }
.order-success p { color: var(--muted); line-height: 1.8; }
.login-page { display: grid; place-items: start center; padding: 74px 24px; }
.login-card { width: min(100%, 420px); }
.login-card h1 { font-size: 38px; margin-bottom: 8px; }
.login-card form { margin-top: 34px; }
.header-actions { display: flex; gap: 22px; align-items: center; }
.text-link, .text-button { font-size: 13px; color: var(--green); text-decoration: underline; text-underline-offset: 4px; }
.text-button { padding: 0; border: 0; background: transparent; }
.text-button.danger { color: #934d4d; }
.admin-page { padding-top: 42px; }
.admin-page > h1 { font-size: 40px; margin-bottom: 25px; }
.admin-tabs { border-bottom: 1px solid var(--line); padding-bottom: 25px; margin-bottom: 34px; }
.admin-panel { max-width: 950px; }
.admin-product-list { display: flex; flex-direction: column; gap: 12px; }
.admin-product-row { display: flex; align-items: center; gap: 20px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; }
.admin-product-image { width: 80px; height: 84px; min-height: 0; object-fit: cover; border-radius: 4px; font-size: 10px; flex-shrink: 0; }
.admin-product-details { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.admin-product-details h3 { margin-bottom: 3px; }
.admin-product-details p { margin-bottom: 6px; }
.row-actions { display: flex; align-items: center; gap: 18px; }
.inline-form { display: flex; gap: 14px; align-items: flex-end; max-width: 650px; margin: 30px 0; }
.inline-form label { margin: 0; flex: 1; }
.category-edit-row { display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); padding: 16px 0; }
.category-edit-row input { max-width: 420px; }
.category-edit-row input:not([type]), .category-edit-row select { height: var(--compact-height); min-height: var(--compact-height); padding-top: 8px; padding-bottom: 8px; line-height: 20px; font-size: 13px; }
.current-images { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.current-images img { width: 80px; height: 80px; object-fit: cover; border-radius: 4px; }
.checkbox-label { flex-direction: row; align-items: center; gap: 10px; margin-top: 20px; }
.checkbox-label input { width: 17px; height: 17px; accent-color: var(--wine); }
.settings-card { background: var(--surface); border: 1px solid var(--line); padding: 25px; border-radius: 8px; max-width: 620px; margin: 20px 0; }
.settings-card .checkbox-label { margin-top: 0; }
.orders-list { display: grid; gap: 18px; }
.order-card { background: var(--surface); border: 1px solid var(--line); padding: 26px; border-radius: 8px; }
.order-card p { margin-bottom: 7px; overflow-wrap: anywhere; }
.order-card .section-heading { margin-bottom: 20px; flex-wrap: wrap; }
.customer-name { font-weight: 600; }
.order-items { padding: 17px 0 17px 18px; border-top: 1px solid var(--line); margin-top: 22px; }
.order-items li { padding: 4px 0; }
.order-status { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; margin-top: 23px; font-size: 12px; }
.status-ok { color: var(--green); }
.status-pending { color: #96622b; }
.locale-selectors { display: flex; gap: 10px; align-items: center; }
.locale-selectors select { width: auto; padding: 11px 35px 11px 12px; font-size: 13px; border-color: var(--line); background-color: transparent; }
.locale-selectors label { margin: 0; }
.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; }
.rate-notice { font-size: 12px; color: var(--muted); margin: -18px 0 25px; }
@media (max-width: 1000px) { .product-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } .site-footer { margin: 0 32px; } .brand { font-size: 22px; } .header-actions { gap: 12px; } }
@media (max-width: 760px) {
    .product-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
    .site-header { flex-wrap: wrap; padding: 22px; gap: 18px; }
    .site-header > .header-actions { flex-wrap: wrap; }
    .page { padding: 0 22px 60px; }
    .admin-page { padding-top: 30px; }
    .site-footer { margin: 0 22px; }
    .product-content { padding: 16px 13px; }
    .admin-product-row { gap: 12px; flex-wrap: wrap; }
    .row-actions { margin-left: 92px; }
    .locale-selectors select { max-width: 120px; }
}
@media (max-width: 450px) {
    .site-header { padding: 18px 16px; }
    .site-header > .header-actions { justify-content: space-between; width: 100%; }
    .brand { font-size: 24px; }
    .page { padding-left: 16px; padding-right: 16px; }
    h1 { font-size: 37px; } h2 { font-size: 28px; }
    .product-grid { gap: 12px; }
    .product-footer { align-items: stretch; }
    .product-footer .button { width: 100%; }
    .product-content h3 { font-size: 16px; }
    .product-description { font-size: 12px; margin-bottom: 15px; }
    .site-footer { flex-direction: column; gap: 9px; margin: 0 16px; }
    dialog { padding: 20px 16px; }
    .form-grid { grid-template-columns: 1fr; }
    .cart-row { grid-template-columns: 44px 1fr auto; gap: 10px; }
    .cart-image { width: 44px; height: 55px; }
    .cart-row-price { grid-column: 2; font-size: 13px; }
    .cart-row .text-button { grid-column: 3; margin-top: 0; }
    .quantity-button { padding: 4px 7px; }
    .detail-images > * { height: 260px; }
    .inline-form { flex-direction: column; align-items: stretch; }
    .category-edit-row { gap: 10px; flex-wrap: wrap; }
    .category-edit-row input { flex-basis: 100%; }
    .order-card, .settings-card { padding: 20px 16px; }
    .section-heading { gap: 12px; flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

.shop-page { padding-top: 32px; }
.shop-page #catalog-title { font-size: 36px; }
@media (max-width: 450px) { .shop-page { padding-top: 26px; } .shop-page #catalog-title { font-size: 30px; } }

.payment-page { max-width: 640px; padding: 46px 24px 70px; margin: auto; min-height: calc(100vh - 207px); }
.payment-page h1 { font-size: 40px; }
.payment-page h2 { font-size: 25px; }
.payment-page .section-heading { margin-top: 32px; flex-wrap: wrap; }
.payment-page .order-items { margin-bottom: 0; }
.payment-page .message { margin-top: 18px; }
.source-language { max-width: 160px; }
.product-price { white-space: normal; }
@media (max-width: 450px) { .payment-page { padding: 30px 16px 50px; } }

.shop-logo { display: block; width: auto; height: auto; max-width: min(240px, 65vw); max-height: 60px; object-fit: contain; }
.logo-preview { display: block; max-width: 100%; max-height: 100px; object-fit: contain; margin-bottom: 18px; }
#shop-logo-form .row-actions { margin-left: 0; flex-wrap: wrap; margin-top: 18px; }
#shop-rules-form .button { margin-top: 18px; }
.site-footer { align-items: center; justify-content: center; text-align: center; }
.footer-copyright { overflow-wrap: anywhere; min-width: 0; }
.footer-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 20px; }

.cart-delivery-row { display: flex; justify-content: space-between; gap: 16px; padding-top: 12px; font-size: 14px; }
.cart-delivery-row strong { text-align: right; }
#delivery-status { margin-top: 0; }
#retry-delivery { margin-bottom: 16px; }
