/* Mobile layout is the baseline. Larger screens opt into columns below. */
html, body, #app { min-width: 0; width: 100%; max-width: 100%; }
main, section, article, .shopgrid, .adminmain, .panelbody, .dialogbody { min-width: 0; }
:root { --mobile-dock-space: calc(94px + env(safe-area-inset-bottom, 0px)); }
.shopgrid { display: block; }
.shopgrid > .cart { display: none; }
.layout { padding: 16px max(12px, env(safe-area-inset-right, 0px)) var(--mobile-dock-space) max(12px, env(safe-area-inset-left, 0px)); }
.topinner { gap: 8px; padding: 10px max(12px, env(safe-area-inset-right, 0px)) 10px max(12px, env(safe-area-inset-left, 0px)); }
.brand { min-width: 0; gap: 9px; }
.brand img { width: 36px; height: 36px; }
.brand > div { min-width: 0; }
.storebar .brand strong { font-size: 17px; line-height: 1.2; }
.storebar .brand small { font-size: 8px; letter-spacing: .8px; }
.storebar .live { display: none; }
.adminbar .brand small { display: none; }
.topinner > .row { flex-shrink: 0; gap: 6px; }
.topinner .btn { padding: 10px; font-size: 12px; min-height: 44px; }
.minas-intro { padding: 16px; margin-bottom: 20px; }
.minas-intro h1 { max-width: 100%; font-size: 25px; line-height: 1.14; }
.minas-intro > p { max-width: 100%; font-size: 12px; }
.minas-intro > .eyebrow { font-size: 9px; letter-spacing: .6px; }
.minas-landscape { width: 42%; opacity: .13; }
.minas-intro .tag { margin-top: 12px; white-space: normal; }
.shop-section-title { display: block; }
.shop-section-title h2 { font-size: 22px; }
.shop-section-title > small { display: block; max-width: none; text-align: left; margin-top: 5px; }
.toolbar { gap: 10px; }
.toolbar .search { min-width: 0; width: 100%; flex: 1 1 100%; }
.toolbar select { min-width: 0; max-width: 100%; }
.tabs { display: flex; flex-wrap: wrap; gap: 7px; overflow: visible; }
.tab { padding: 10px 12px; min-height: 44px; font-size: 12px; }
.products { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.product { display: grid; grid-template-columns: 60px minmax(0, 1fr); border-radius: 12px; }
.productvisual { min-width: 0; width: 100%; height: 100%; min-height: 140px; border-bottom: 0; border-right: 1px solid var(--line); }
.productvisual small { display: none; }
.productvisual::after { width: 44px; height: 44px; margin-top: 0; }
.productvisual .icon { width: 29px; height: 29px; margin-top: 0; }
.productbody { padding: 12px; min-width: 0; }
.product h3 { min-height: 0; margin: 6px 0; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.productbody > small { font-size: 11px; line-height: 1.5; }
.productprice { min-width: 0; display: flex; flex-wrap: wrap; gap: 10px; padding-top: 12px; margin-top: auto; }
.productprice > .price { font-size: 19px; }
.productprice > .btn { width: auto; min-height: 44px; font-size: 12px; padding: 10px 12px; margin-left: auto; }
.productprice > .qty { width: auto; margin-left: auto; justify-content: space-between; gap: 4px; }
.qty button, .cartline .qty button { width: 44px; height: 44px; min-width: 44px; flex: 0 0 44px; }
.qty span { min-width: 22px; }
.mobilecart { display: flex; inset: auto 0 0; align-items: center; gap: 12px; padding: 10px max(12px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); }
.mobilecart > div { min-width: 0; }
.mobilecart .btn { min-width: 0; max-width: 58%; padding: 12px 15px; white-space: normal; }
.fields { grid-template-columns: minmax(0, 1fr); }
input, textarea, select { width: 100%; min-width: 0; max-width: 100%; font-size: 16px; }
.overlay { height: 100vh; height: var(--visual-height, 100vh); }
.dialog { max-height: calc(100vh - 24px); max-height: calc(var(--visual-height, 100vh) - 24px); min-width: 0; }
.dialogheader { gap: 10px; padding: 12px 16px; }
.dialogheader h2 { font-size: 19px; line-height: 1.3; }
.dialogbody { padding: 16px; }
.dialog .cartline > .row { flex-wrap: wrap; }
.purchase-values { gap: 8px; }
.purchase-values strong { overflow-wrap: anywhere; }
.footer { padding-bottom: var(--mobile-dock-space); }
.keyboard-open .mobilecart, .keyboard-open .sidebar { display: none; }
@media (max-width: 359px) {
  .productprice > .btn, .productprice > .qty { width: 100%; margin-left: 0; }
  .productprice > .qty { justify-content: space-between; }
  .storebar .brand strong { font-size: 16px; }
}
@media (min-width: 640px) {
  .layout { padding-inline: max(24px, env(safe-area-inset-left, 0px)); }
  .topinner { padding: 14px 24px; }
  .brand img { width: 44px; height: 44px; }
  .storebar .brand strong { font-size: 21px; }
  .storebar .live { display: inline-flex; }
  .adminbar .brand small { display: block; }
  .minas-intro { padding: 28px; }
  .minas-intro h1 { max-width: 70%; font-size: 32px; }
  .minas-intro > p { max-width: 60%; font-size: 13px; }
  .minas-landscape { width: 39%; opacity: .95; }
  .shop-section-title { display: flex; }
  .shop-section-title > small { text-align: right; margin-top: 0; }
  .toolbar .search { width: auto; flex: 1 1 220px; }
  .products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .product { display: flex; flex-direction: column; }
  .productvisual { height: 110px; min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .productvisual small { display: block; }
  .productvisual::after { width: 66px; height: 66px; }
  .productvisual .icon { width: 40px; height: 40px; }
  .productbody { padding: 16px; }
  .product h3 { min-height: 40px; }
  .productprice > .btn, .productprice > .qty { width: auto; }
  .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dialogheader { padding: 18px 24px; }
  .dialogbody { padding: 24px; }
}
@media (min-width: 1100px) {
  .layout { padding: 30px 28px 70px; }
  .shopgrid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 30px; }
  .shopgrid > .cart { display: block; }
  .mobilecart { display: none; }
  .minas-intro h1 { font-size: 34px; }
  .minas-intro > p { max-width: 57%; }
  .footer { padding-bottom: 28px; }
}
/* Keep seller navigation visible while the document scrolls. */
@media (min-width: 761px) {
  .sidebar {
    position: sticky;
    top: 73px;
    align-self: start;
    height: calc(100dvh - 73px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}
@media print {
  .mobilecart { display: none; }
  .sidebar { position: static; height: auto; overflow: visible; }
  .overlay { height: auto; }
  .dialog { max-height: none; }
}

.delivery-area { margin-block: 16px; }
#checkout > .delivery-area { margin: 0; }

/* Print only the open order, without the dashboard behind it. */
@media print {
  body.modal-open #app { display: none !important; }
  body.modal-open { overflow: visible !important; }
  .dialog, .dialogbody { max-height: none; overflow: visible; }
  .overlay { backdrop-filter: none; }
}

.address-fields { border: 0; padding: 0; margin: 0; min-width: 0; width: 100%; }
.address-fields[hidden] { display: none; }
.address-fields legend { font-size: 13px; font-weight: 700; margin-bottom: 12px; color: var(--minas-coffee); }
.cep-status { margin: 0; line-height: 1.5; }
.cep-status[data-state="found"] { background: #edf4e8; color: #426140; }
.cep-status[data-state="error"] { background: #fff2d4; color: #78521c; }

.photo-gallery { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 14px 0; }
.photo-gallery img { width: 100%; height: 170px; object-fit: contain; border-radius: 10px; background: #efefeb; }
.photo-gallery small { display: block; margin-top: 6px; }
.photo-library-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.photo-library-grid > article { min-width: 0; }
.photo-library-grid img { width: 100%; height: 150px; object-fit: contain; background: #efefeb; border-radius: 10px; }
.photo-library-grid h3 { margin-block: 8px; font-size: 12px; }
.photo-library-grid p { font-size: 11px; margin-bottom: 8px; overflow-wrap: anywhere; }
.productvisual.has-product-photo::after { display: none; }
.productvisual.has-product-photo { background: #fffaf3; }
.productvisual.has-product-photo > a { display: block; width: 100%; height: 100%; }
.productvisual.has-product-photo img { width: 100%; height: 100%; object-fit: contain; }
.photo-group-note { font-size: 10px; color: var(--muted); margin-top: 5px; }
@media(min-width:900px){.photo-library-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }}

.product.with-photo { grid-template-columns: 100px minmax(0,1fr); }
.public-photo-gallery { display: grid; gap: 20px; }
.public-photo-gallery figure { margin: 0; }
.public-photo-gallery img { display: block; width: 100%; height: auto; border-radius: 12px; }
.public-photo-gallery figcaption { font-size: 12px; line-height: 1.5; color: var(--muted); margin-top: 10px; }
@media(min-width:640px){.product.with-photo .productvisual { height: 220px; min-height: 0; }}
.delivery-coverage { display: grid; gap: 10px; margin-top: 16px; min-width: 0; }
.delivery-coverage [data-state=inside] { background: #e9eddd; color: #4d603b; }
.delivery-coverage [data-state=outside],.delivery-coverage [data-state=boundary],.delivery-coverage [data-state=unverified],.delivery-coverage [data-state=unavailable] { background: #fbece7; color: #963d30; }
.delivery-coverage small { line-height: 1.5; }
.delivery-coverage a:not(.btn) { text-decoration: underline; }
.delivery-contact[hidden] { display: none; }
.product-image-uploader { display: grid; gap: 12px; padding-block: 18px; border-block: 1px solid var(--line); min-width: 0; }
.product-image-uploader > p { font-size: 13px; }
.photo-file-picker { position: relative; overflow: hidden; }
.photo-file-picker input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.photo-file-picker:focus-within { outline: 3px solid #b48845; outline-offset: 3px; }
.photo-editor { display: grid; gap: 14px; min-width: 0; }
.photo-editor[hidden] { display: none; }
.photo-editor canvas { display: block; width: 100%; max-width: 320px; height: auto; aspect-ratio: 1; margin-inline: auto; border: 1px solid var(--line); border-radius: 12px; }
.photo-editor input[type=range] { padding: 0; width: 100%; min-width: 0; accent-color: var(--green); }
.photo-gallery article { min-width: 0; }
.photo-gallery article .row { gap: 6px; margin-top: 8px; }
.photo-gallery article .btn { white-space: normal; }
.photo-upload-status { overflow-wrap: anywhere; }
.product-save-bar { position: sticky; bottom: 0; z-index: 2; padding: 12px 0 max(12px,env(safe-area-inset-bottom)); background: #fffaf3; border-top: 1px solid var(--line); }
