.office-header { background: var(--surface); }
.office { padding-block: 35px 65px; }
.office h1 { margin: 18px 0 20px; }
.office h2 { font-size: clamp(1.45rem, 3vw, 2rem); }
.office-nav { display: flex; gap: 14px; margin-bottom: 28px; border-bottom: 1px solid #eedce1; }
.office-nav a { padding: 10px 12px; border-bottom: 3px solid transparent; }
.office-nav [aria-current] { border-color: var(--accent); font-weight: 700; }
.office-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); align-items: start; gap: 24px; }
.search { display: grid; gap: 5px; margin: 20px 0 12px; }
input { border: 1px solid #938c8d; border-radius: 8px; padding: 7px 10px; color: var(--ink); font: inherit; }
.stock article { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; align-items: center; gap: 12px; border-bottom: 1px solid #eedce1; padding: 12px 0; }

.stock input { width: 82px; }
.stock label { display: grid; gap: 3px; font-size: .875rem; }
.basket { background: var(--surface); padding: 20px; border-radius: 16px; }
#orders ul { padding-left: 22px; }
.basket-summary { padding: 14px; border: 1px solid #eedce1; border-radius: 12px; background: white; }
.basket-summary h2 { margin: 0; font-size: 1.35rem; }
#basket-empty { margin: 8px 0 0; font-size: .9rem; }
#basket-items { list-style: none; padding: 0; margin: 4px 0 0; }
#basket-items li { padding: 8px 0; overflow-wrap: anywhere; }
#basket-items li + li, #subtotal { border-top: 1px solid #eedce1; }
#basket-items span { display: block; font-size: .9rem; }
.basket-line-price { font-weight: 700; }
#basket-items label { display: grid; gap: 3px; margin-top: 6px; font-size: .85rem; }
#basket-items input { min-width: 0; width: 100%; }
.order-line-comment { margin: 3px 0 0; overflow-wrap: anywhere; }
@media (min-width: 731px) and (min-height: 450px) {
  .basket { position: sticky; top: 16px; max-height: calc(100dvh - 32px); overflow-y: auto; }
}
#subtotal { margin: 0; padding-top: 8px; font-weight: 700; }
.basket .button { margin-top: 12px; }
.button:disabled { opacity: .58; cursor: default; }
#notice { margin-top: 8px; }
#orders { margin-top: 12px; }
@media (max-width: 730px) {
  .office-layout { grid-template-columns: 1fr; }
  .stock article { grid-template-columns: 64px minmax(0, 1fr) auto; gap: 8px; }
}
.auth { max-width: 440px; }
.auth label { display: grid; gap: 5px; margin-top: 12px; }
#sign-out { float: right; }
#account-status:not(:empty) { margin: 12px 0; }
#shop-profile { max-width: 660px; display: grid; gap: 16px; }
#shop-profile > .button { justify-self: start; }
#profile-status { margin: 0; }
.profile-fields { display: grid; gap: 12px; margin: 0; border: 1px solid #eedce1; border-radius: 12px; padding: 14px; min-width: 0; }
.profile-fields legend { font-weight: 700; }
.profile-fields label { display: grid; gap: 4px; }
.profile-fields input:not([type="radio"]) { width: 100%; min-width: 0; }
#profile-addresses { display: grid; gap: 10px; }
.profile-address-row { display: grid; gap: 8px; border-bottom: 1px solid #eedce1; padding-bottom: 10px; }
.profile-address-row label:has([type="radio"]) { display: flex; align-items: center; }
.profile-fields .button { justify-self: start; }
#delivery-address > label { margin-bottom: 3px; }
#saved-delivery-address { border: 1px solid #938c8d; border-radius: 8px; background: white; text-overflow: ellipsis; }

.office-nav { flex-wrap: wrap; }
@media (max-width: 480px) {
  #sign-out { float: none; }
  .office-nav { gap: 2px; }
  .office-nav a { padding-inline: 6px; }
}

.stock select {
  min-width: 90px;
  min-height: 40px;
  padding: 6px;
  font: inherit;
  color: var(--ink);
  background: white;
  border: 1px solid #938c8d;
  border-radius: 8px;
}

.stock-preview {
  display: grid;
  align-content: center;
  justify-items: center;
  min-width: 0;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface);
  color: #4e5c4d;
  text-align: center;
}
.stock-preview img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}
.stock-preview-flower {
  width: 28px;
  height: 28px;
  background: url('../assets/logo.svg') left center / auto 28px no-repeat;
  opacity: .65;
}
@media (max-width: 520px) {
  .stock article { grid-template-columns: 60px minmax(0, 1fr); }
  .stock article > label { grid-column: 2; justify-self: start; }
  .stock-preview { align-self: start; }
}

.stock-photo-button {
  border: 0;
  padding: 0;
  width: 100%;
  background: transparent;
}
#delivery-gallery {
  width: min(700px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
}
#delivery-gallery form { margin-bottom: 16px; }
#delivery-gallery-content { display: grid; gap: 16px; margin-top: 16px; }
#delivery-gallery figure { margin: 0; }
#delivery-gallery figure img { width: 100%; max-height: 55vh; object-fit: contain; border-radius: 12px; background: var(--surface); }
#delivery-gallery figcaption { margin-top: 6px; }
.delivery-photo-panel { margin-bottom: 24px; }
#delivery-photo-form { display: grid; gap: 12px; max-width: 480px; padding-top: 12px; }
#delivery-photo-form label { display: grid; gap: 4px; min-width: 0; font-weight: 600; }
#delivery-photo-form select, #delivery-photo-form input { max-width: 100%; }
#delivery-photo-form select { padding: 8px; font: inherit; }

#delivery-fields {
  display: grid;
  gap: 9px;
  margin: 16px 0 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
#delivery-fields legend { padding: 0; margin-bottom: 8px; font-size: 1.125rem; font-weight: 700; }
#delivery-fields label[hidden] { display: none; }
#delivery-fields label { display: grid; gap: 3px; font-size: .9rem; }
#delivery-fields input { width: 100%; min-width: 0; background: white; }
.order-delivery-details {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px;
  margin: 12px 0;
}
.order-delivery-details dt { font-weight: 700; }
.order-delivery-details dd { margin: 0; overflow-wrap: anywhere; }

#delivery-fields select { width: 100%; min-width: 0; padding: 7px 10px; font: inherit; color: inherit; }
#total { font-weight: 700; }
.welcome-delivery { background: white; padding: 8px 10px; border-radius: 8px; font-size: .9rem; }

.stock-stepper, .mobile-cart { display: none; }

@media (max-width: 730px) {
  body[data-role="shop"] { background: #fcf9fa; }
  body[data-role="shop"] .office-header { border-bottom: 1px solid #eedce1; background: white; }
  body[data-role="shop"] .topbar { min-height: 60px; gap: 8px; }
  body[data-role="shop"] .brand img { width: clamp(100px, 30vw, 148px); height: auto; }
  body[data-role="shop"] .cabinet-links { flex-wrap: nowrap; gap: 2px; }
  body[data-role="shop"] .cabinet-links a {
    display: grid;
    place-items: center;
    min-height: 44px;
    padding-inline: 8px;
    border-radius: 10px;
    font-size: .875rem;
    text-decoration: none;
  }
  body[data-role="shop"] .cabinet-links [aria-current] { background: var(--surface); color: #b90839; }
  body[data-role="shop"] .office { padding-block: 18px 100px; }
  #shop-name { margin: 0 0 16px; font-size: clamp(1.35rem, 5vw, 1.75rem); line-height: 1.2; overflow-wrap: anywhere; }
  body[data-role="shop"] #sign-out { float: right; min-height: 44px; padding: 6px 10px; margin: -5px 0 4px 12px; font-size: .875rem; }
  body[data-role="shop"] .office-nav {
    clear: both;
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    gap: 3px;
    margin-bottom: 20px;
    padding: 4px;
    border: 1px solid #eedce1;
    border-radius: 14px;
    background: #f7eef1;
  }
  body[data-role="shop"] .office-nav a {
    display: grid;
    place-items: center;
    min-height: 44px;
    padding: 4px;
    border: 0;
    border-radius: 10px;
    font-size: .875rem;
    line-height: 1.2;
    text-align: center;
  }
  body[data-role="shop"] .office-nav [aria-current] { background: white; box-shadow: 0 1px 3px #33152020; color: #b90839; }
  #catalog-time { margin-top: 4px; font-size: .875rem; color: #546352; }
  .search { margin-block: 12px; font-size: .875rem; }
  body[data-role="shop"] input:not([type="radio"]), body[data-role="shop"] select { min-height: 44px; font-size: 1rem; background: white; }
  .stock { display: grid; gap: 10px; }
  .stock article {
    grid-template-columns: 64px minmax(0, 1fr);
    align-items: start;
    gap: 8px 12px;
    padding: 12px;
    border: 1px solid #eedce1;
    border-radius: 15px;
    background: white;
  }
  .stock h3 { font-size: 1rem; line-height: 1.25; margin-bottom: 4px; }
  .stock article p { font-size: .875rem; line-height: 1.4; }
  .stock article > label { display: none; }
  .stock-stepper {
    display: grid;
    grid-column: 2;
    grid-template-columns: 44px minmax(54px, auto) 44px;
    justify-self: start;
    align-items: center;
    border: 1px solid #eedce1;
    border-radius: 12px;
    background: var(--surface);
  }
  .stock-stepper button { min-height: 44px; border: 0; border-radius: 11px; background: transparent; color: #b90839; font-size: 1.3rem; }
  .stock-stepper button[aria-disabled="true"] { opacity: .45; cursor: default; }
  .stock-stepper output { padding-inline: 4px; text-align: center; font-weight: 700; font-size: .875rem; }
  #checkout { scroll-margin-top: 12px; padding: 14px; border: 1px solid #eedce1; }
  #checkout #submit { width: 100%; min-height: 48px; }
  .mobile-cart {
    position: fixed;
    z-index: 5;
    inset: auto 0 0;
    display: block;
    padding: 8px max(16px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    background: white;
    border-top: 1px solid #eedce1;
  }
  .mobile-cart .button { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 48px; padding-block: 8px; }
}
