:root {
  --ink: #1e2228;
  --muted: #67707d;
  --line: #d9dee6;
  --paper: #fbfaf7;
  --panel: #ffffff;
  --green: #176b5b;
  --green-dark: #0e4d42;
  --coral: #d95d49;
  --gold: #d49b36;
  --blue: #315f8f;
  --shadow: 0 18px 45px rgba(30, 34, 40, 0.12);
  --topbar-bg: rgba(251, 250, 247, 0.96);
  --primary-shadow: rgba(23, 107, 91, 0.22);
  --hero-banner-image: url("banner-smile-shop.jpeg?v=mobile-fit-2");
  --product-card-width: 230px;
  --product-photo-height: 190px;
  --cart-width: 340px;
  --cart-height: 680px;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  overflow-x: hidden;
}

[hidden] {
  display: none !important;
}

.simple-hidden {
  display: none !important;
}

.admin-extra {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.client-locked {
  overflow: hidden;
}

body.client-locked > :not(#clientAccountModal) {
  filter: blur(2px);
  pointer-events: none;
  user-select: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  color: white;
  background: var(--green);
  font-size: 26px;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.05;
}

.brand strong {
  font-size: 24px;
  letter-spacing: 0;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.search {
  display: flex;
  align-items: center;
  min-width: 0;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  padding: 0 14px;
}

.search svg {
  flex: 0 0 auto;
  width: 19px;
}

.search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  padding: 0 0 0 10px;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

#languageToggle {
  order: 9;
}

#favoritesButton {
  order: 10;
}

#reviewToggle {
  order: 11;
}

#installAppButton {
  order: 12;
}

#clientChatToggle {
  order: 13;
}

#clientOrdersToggle {
  order: 14;
}

#cartToggle {
  order: 15;
}

#notificationsToggle {
  order: 20;
  margin-left: 6px;
}

#ordersToggle {
  order: 21;
}

#adminChatsToggle {
  order: 22;
}

#adminReviewsToggle {
  order: 23;
}

#sharesToggle {
  order: 24;
}

#submissionsToggle {
  order: 25;
}

#editToggle {
  order: 30;
  margin-left: 6px;
}

#organizeToggle {
  order: 31;
}

#whatsappPhotoToggle {
  order: 32;
}

.icon-button,
.cart-button,
.admin-button,
.ghost-button,
.primary-button,
.chip,
.quantity-button {
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}

.icon-button:hover,
.cart-button:hover,
.admin-button:hover,
.ghost-button:hover,
.chip:hover,
.quantity-button:hover {
  border-color: #aeb8c5;
  transform: translateY(-1px);
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
}

.icon-button.active {
  border-color: var(--green);
  color: white;
  background: var(--green);
}

.icon-button.compact {
  width: 36px;
  height: 36px;
}

.cart-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 12px;
}

.admin-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 13px;
  font-weight: 800;
  white-space: nowrap;
}

.admin-button svg,
.cart-button svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}

.customer-button {
  border-color: rgba(49, 95, 143, 0.24);
  background: #eef5fb;
  color: var(--blue);
}

.language-button {
  min-width: 112px;
}

html[dir="rtl"] body {
  direction: rtl;
}

html[dir="rtl"] .search input {
  padding: 0 10px 0 0;
}

html[dir="rtl"] .product-card,
html[dir="rtl"] .cart-line,
html[dir="rtl"] .order-card,
html[dir="rtl"] .detail-layout {
  direction: rtl;
}

.admin-tool {
  border-color: rgba(23, 107, 91, 0.24);
  background: #f2faf6;
  color: var(--green-dark);
}

.admin-button.active {
  border-color: var(--green);
  color: white;
  background: var(--green);
}

.admin-button.active svg {
  fill: currentColor;
}

.admin-button.has-notification {
  border-color: rgba(217, 93, 73, 0.45);
}

#ordersToggle.has-notification {
  border-color: var(--coral);
  background: #fff1ee;
  color: var(--coral);
  box-shadow: 0 0 0 4px rgba(217, 93, 73, 0.12);
}

#ordersToggle.has-notification svg {
  stroke-width: 2.8;
}

.notification-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border: 2px solid var(--panel);
  border-radius: 999px;
  background: var(--coral);
  color: white;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.cart-button strong {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  color: white;
  background: var(--coral);
  font-size: 13px;
}

.shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) var(--cart-width);
  gap: 24px;
  align-items: start;
  padding: 26px 28px 36px;
}

.filters,
.cart-panel {
  position: sticky;
  top: 92px;
  transform: translateX(-10px);
}

.filters,
.cart-panel,
.stats-row article,
.product-card,
.seller-callout {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.filters,
.cart-panel {
  padding: 18px;
  box-shadow: 0 10px 30px rgba(30, 34, 40, 0.06);
}

.panel-title,
.content-head,
.card-footer,
.rating-line,
.cart-line,
.cart-summary div,
.range-line,
.check-line {
  display: flex;
  align-items: center;
}

.panel-title,
.content-head,
.card-footer,
.cart-line,
.cart-summary div {
  justify-content: space-between;
  gap: 14px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 760px;
  font-size: 44px;
  line-height: 1.03;
  letter-spacing: 0;
}

h2 {
  font-size: 20px;
}

h3 {
  font-size: 14px;
}

.eyebrow {
  margin-bottom: 7px;
  color: var(--coral);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.filter-group {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.filter-group h3 {
  margin-bottom: 12px;
}

.segmented {
  display: grid;
  gap: 8px;
}

.chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 0 11px;
  text-align: left;
}

.chip.active {
  border-color: var(--green);
  color: white;
  background: var(--green);
}

.range-line {
  gap: 12px;
}

.range-line input {
  width: 100%;
  accent-color: var(--green);
}

.range-line span {
  min-width: 74px;
  color: var(--muted);
  text-align: right;
}

.check-line {
  gap: 10px;
  min-height: 34px;
  color: var(--ink);
}

.check-line input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.seller-callout {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
}

.seller-callout svg {
  color: var(--green);
}

.ghost-button {
  min-height: 34px;
  padding: 0 10px;
  color: var(--muted);
}

.ghost-button.wide {
  width: 100%;
  margin-top: 10px;
}

.primary-button.wide {
  width: 100%;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 0;
  background: var(--green);
  color: white;
  font-weight: 800;
}

.primary-button:hover {
  background: var(--green-dark);
  box-shadow: 0 10px 24px var(--primary-shadow);
  transform: translateY(-1px);
}

.whatsapp-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: #21a55b;
  color: white;
  font-weight: 800;
}

.whatsapp-button.wide {
  width: 100%;
}

.whatsapp-button:hover {
  background: #168846;
  box-shadow: 0 10px 24px rgba(33, 165, 91, 0.22);
  transform: translateY(-1px);
}

.social-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  color: white;
  font-weight: 800;
}

.social-button.instagram {
  background: #c13584;
}

.social-button.facebook {
  background: #1877f2;
}

.social-button.tiktok {
  background: #111827;
}

.social-button:hover {
  box-shadow: 0 10px 24px rgba(30, 34, 40, 0.18);
  filter: brightness(0.94);
  transform: translateY(-1px);
}

.social-visit {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.social-visit .social-button {
  min-height: 40px;
  padding: 0 13px;
}

.location-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid rgba(49, 95, 143, 0.28);
  border-radius: 8px;
  background: #eef5fb;
  color: var(--blue);
  font-weight: 800;
}

.location-button:hover,
.location-button.active {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
  transform: translateY(-1px);
}

.location-message {
  min-height: 18px;
  margin: -4px 0 0;
}

.order-panel .location-button {
  width: 100%;
}

.last-order-box {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(217, 93, 73, 0.24);
  border-radius: 8px;
  background: #fff8f6;
  padding: 12px;
}

.last-order-box div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.last-order-box strong {
  color: var(--ink);
  font-size: 14px;
}

.last-order-box span {
  color: var(--coral);
  font-size: 12px;
  font-weight: 900;
}

.last-order-box p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.last-order-details {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(217, 93, 73, 0.18);
  border-radius: 8px;
  background: white;
  padding: 9px;
}

.last-order-details[hidden] {
  display: none;
}

.last-order-details p {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 8px;
  margin: 0;
}

.last-order-details strong {
  font-size: 12px;
}

.last-order-details span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.last-order-details.refused {
  border-color: rgba(217, 93, 73, 0.45);
  background: #fff3f0;
}

.last-order-details.refused #lastOrderStatus {
  color: var(--coral);
}

.client-orders-panel {
  width: min(760px, 100%);
}

.client-orders-list {
  display: grid;
  gap: 12px;
}

.client-order-card {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

.client-order-card header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.client-order-card h3 {
  font-size: 16px;
}

.client-order-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.client-order-card strong {
  color: var(--ink);
}

.client-order-card.order-refused {
  border-color: rgba(217, 93, 73, 0.38);
  background: #fffafa;
}

.order-cancel-box {
  background: #fffaf8;
}

.hero-title-form,
.banner-form,
.whatsapp-form,
.social-form,
.sort-text-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.color-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.layout-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.color-form input[type="color"] {
  width: 100%;
  min-height: 44px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid rgba(217, 93, 73, 0.35);
  border-radius: 8px;
  background: #fff0ed;
  color: var(--coral);
  font-weight: 800;
}

.danger-button:hover {
  border-color: var(--coral);
  background: var(--coral);
  color: white;
}

.content {
  min-width: 0;
}

.content-head {
  position: relative;
  overflow: hidden;
  min-height: 280px;
  margin-bottom: 18px;
  border-radius: 8px;
  padding: 34px;
  background:
    linear-gradient(90deg, rgba(18, 31, 37, 0.82), rgba(18, 31, 37, 0.42)),
    var(--hero-banner-image);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  color: white;
  box-shadow: var(--shadow);
}

.content-head > * {
  position: relative;
  z-index: 1;
}

.content-head h1 {
  color: white;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.28);
}

.content-head .eyebrow {
  color: #ffd98a;
}

.sort {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  white-space: nowrap;
}

.content-head .sort {
  color: white;
}

.sort select {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 0 10px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stats-row article {
  padding: 14px;
}

.stats-row strong,
.stats-row span {
  display: block;
}

.stats-row strong {
  color: var(--blue);
  font-size: 24px;
}

.stats-row span {
  color: var(--muted);
  font-size: 13px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--product-card-width), 1fr));
  gap: 18px;
}

.product-card {
  overflow: hidden;
  min-width: 0;
  box-shadow: 0 12px 28px rgba(30, 34, 40, 0.08);
}

.product-media {
  position: relative;
  overflow: hidden;
  height: var(--product-photo-height);
  background: #eef1f4;
}

.product-media img {
  position: relative;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.product-open-photo {
  cursor: zoom-in;
}

.badge {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 2;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--green-dark);
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 800;
}

.favorite-product {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: var(--coral);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 22px rgba(30, 34, 40, 0.16);
}

.favorite-product:hover {
  transform: translateY(-1px);
}

.favorite-product.active {
  color: white;
  background: var(--coral);
}

.favorite-product.active svg,
.icon-button.active svg {
  fill: currentColor;
}

.gallery-button {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  width: 34px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-50%);
  box-shadow: 0 10px 22px rgba(30, 34, 40, 0.14);
}

.gallery-button.previous {
  left: 10px;
}

.gallery-button.next {
  right: 10px;
}

.gallery-button:hover {
  background: white;
}

.photo-count {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 2;
  border-radius: 999px;
  background: rgba(30, 34, 40, 0.74);
  color: white;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
}

.remove-photo {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 2;
  display: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  place-items: center;
  color: white;
  background: rgba(217, 93, 73, 0.95);
}

.edit-product {
  position: absolute;
  right: 52px;
  top: 10px;
  z-index: 2;
  display: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  place-items: center;
  color: white;
  background: rgba(49, 95, 143, 0.95);
}

body.editing .remove-photo,
body.editing .edit-product {
  display: grid;
}

.edit-card-button {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--blue);
  border-radius: 8px;
  background: #eef5fb;
  color: var(--blue);
  font-weight: 800;
}

.catalog-card-button,
.organize-card-button,
.detail-card-button,
.share-card-button,
.review-card-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--ink);
  font-weight: 800;
}

.catalog-card-button {
  display: none;
  border-color: var(--blue);
  background: #eef5fb;
  color: var(--blue);
}

.organize-card-button {
  display: none;
  border-color: var(--green);
  background: #e8f6ef;
  color: var(--green-dark);
}

.organize-card-button.active {
  border-color: var(--gold);
  background: #fff6df;
  color: #8a5b00;
}

.organize-card-button.active svg {
  fill: currentColor;
}

.detail-card-button:hover,
.catalog-card-button:hover,
.organize-card-button:hover,
.share-card-button:hover,
.review-card-button:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: #eef5fb;
}

body.editing .edit-card-button {
  display: inline-flex;
}

body.editing .organize-card-button {
  display: inline-flex;
}

body.editing .catalog-card-button {
  display: inline-flex;
}

.product-body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.product-body h3 {
  min-height: 40px;
  font-size: 17px;
  line-height: 1.2;
}

.store-name,
.product-category,
.rating-line,
.meta-line {
  color: var(--muted);
  font-size: 13px;
}

.product-category {
  margin: -2px 0 2px;
  font-weight: 800;
}

.product-reviews {
  display: grid;
  gap: 8px;
  border: 1px solid #edf0f4;
  border-radius: 8px;
  background: #fbfcfd;
  padding: 10px;
}

.product-reviews-head,
.product-review-mini div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.product-reviews-head strong {
  color: var(--green-dark);
  font-size: 13px;
}

.product-reviews-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.product-review-list {
  display: grid;
  gap: 8px;
}

.product-review-mini {
  display: grid;
  gap: 4px;
  border-top: 1px solid #edf0f4;
  padding-top: 8px;
}

.product-review-mini:first-child {
  border-top: 0;
  padding-top: 0;
}

.product-review-mini strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-review-mini p,
.product-review-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.review-stars {
  flex: 0 0 auto;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0;
}

.review-card-button {
  min-height: 36px;
  font-size: 13px;
}

.rating-line {
  gap: 5px;
}

.rating-line svg {
  width: 16px;
  height: 16px;
  color: var(--gold);
  fill: currentColor;
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.meta-line span {
  border-radius: 999px;
  background: #f0f2f5;
  padding: 5px 8px;
}

.price {
  color: var(--blue);
  font-size: 20px;
  font-weight: 900;
}

.add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 112px;
  padding: 0 12px;
}

.cart-panel {
  display: grid;
  height: min(calc(100vh - 118px), var(--cart-height));
  max-height: min(calc(100vh - 118px), var(--cart-height));
  grid-template-rows: auto minmax(140px, 1fr) auto;
}

.cart-items {
  display: grid;
  align-content: start;
  gap: 12px;
  overflow: auto;
  padding: 16px 2px;
}

.cart-line {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.cart-line h3 {
  margin-bottom: 4px;
  font-size: 14px;
}

.cart-line p {
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.quantity {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quantity-button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
}

.cart-summary {
  display: grid;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.cart-summary span {
  color: var(--muted);
}

#cartTotal {
  color: var(--blue);
}

.checkout {
  justify-self: center;
  width: calc(100% - 22px);
  max-width: 290px;
  min-width: 0;
  padding-inline: 12px;
  white-space: normal;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 28px;
  background: var(--panel);
  color: var(--muted);
  text-align: center;
}

.photo-form {
  display: grid;
  gap: 10px;
}

.add-category-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.quick-catalogs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-catalogs button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--ink);
  padding: 0 10px;
  font-weight: 800;
}

.quick-catalogs button:hover {
  border-color: var(--green);
  color: var(--green-dark);
  background: #e8f6ef;
}

.organize-preview {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.organize-preview img {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
  background: #eef1f4;
}

.organize-preview strong,
.organize-preview span {
  display: block;
}

.organize-preview strong {
  color: var(--ink);
}

.whatsapp-photo-preview {
  border-top-color: rgba(37, 211, 102, 0.32);
}

.photo-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.photo-form input,
.photo-form select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 0 10px;
}

.photo-form input:focus,
.photo-form select:focus {
  outline: 2px solid rgba(23, 107, 91, 0.18);
  border-color: var(--green);
}

.paste-photo-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 72px;
  border: 1px dashed var(--blue);
  border-radius: 8px;
  background: #eef5fb;
  color: var(--blue);
  padding: 12px;
  font-weight: 900;
  text-align: center;
  outline: 0;
  caret-color: transparent;
  user-select: text;
}

.paste-photo-box:focus,
.paste-photo-box.active {
  border-color: var(--green);
  background: #e8f6ef;
  color: var(--green-dark);
}

.paste-photo-box svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.paste-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 8px;
  align-items: start;
}

.paste-preview img {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: #eef1f4;
}

.paste-preview .ghost-button {
  grid-column: 1 / -1;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(30, 34, 40, 0.46);
}

.modal[hidden] {
  display: none;
}

.modal-panel {
  display: grid;
  width: min(560px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
  box-shadow: var(--shadow);
}

.modal-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.modal-panel input,
.modal-panel select,
.modal-panel textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 0 10px;
}

.modal-panel textarea {
  min-height: 88px;
  padding: 10px;
  resize: vertical;
}

.order-message {
  min-height: 22px;
  color: var(--muted);
  font-size: 14px;
}

.order-message.success {
  color: var(--green);
  font-weight: 800;
}

.order-message.error {
  color: var(--coral);
  font-weight: 800;
}

.orders-panel {
  width: min(720px, 100%);
}

.notifications-panel {
  width: min(720px, 100%);
}

.review-panel {
  width: min(520px, 100%);
}

.review-product-hint {
  border: 1px solid rgba(49, 95, 143, 0.18);
  border-radius: 8px;
  background: #eef5fb;
  color: var(--blue);
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 800;
}

.seller-panel {
  width: min(560px, 100%);
}

.chat-panel {
  width: min(620px, 100%);
}

.chat-admin-panel {
  width: min(980px, 100%);
}

.chat-identity,
.chat-send-form,
.chat-reply-form {
  display: grid;
  gap: 10px;
}

.chat-identity {
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 10px;
}

.chat-thread {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 260px;
  max-height: 44vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f8fa;
  padding: 12px;
}

.chat-message {
  display: grid;
  width: min(82%, 420px);
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 10px 12px;
}

.chat-message > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.chat-message strong {
  color: var(--ink);
}

.chat-message time {
  white-space: nowrap;
}

.chat-message p {
  color: var(--ink);
  line-height: 1.45;
}

.chat-message.admin {
  justify-self: start;
  border-color: rgba(49, 95, 143, 0.22);
}

.chat-message.client {
  justify-self: end;
  border-color: rgba(23, 107, 91, 0.28);
  background: #eef8f4;
}

.chat-send-form,
.chat-reply-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.chat-send-form textarea,
.chat-reply-form textarea {
  min-height: 48px;
  max-height: 140px;
}

.chat-admin-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.45fr);
  gap: 12px;
  min-height: 420px;
}

.chat-sessions-list,
.chat-admin-thread {
  min-height: 420px;
}

.chat-sessions-list {
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 8px;
}

.chat-session-button {
  display: grid;
  gap: 5px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 10px;
  text-align: left;
}

.chat-session-button.active,
.chat-session-button:hover {
  border-color: var(--blue);
  background: #eef5fb;
}

.chat-session-button span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-session-button small,
.chat-session-button p {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-session-button em {
  justify-self: start;
  min-width: 22px;
  border-radius: 999px;
  background: var(--coral);
  color: white;
  padding: 2px 7px;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.chat-admin-thread {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
}

.chat-thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 10px;
}

.chat-thread-head p {
  color: var(--muted);
  font-size: 13px;
}

.admin-thread-messages {
  min-height: 0;
  max-height: none;
}

.reviews-panel {
  width: min(720px, 100%);
}

.shares-panel {
  width: min(720px, 100%);
}

.submissions-panel {
  width: min(760px, 100%);
}

.login-panel {
  width: min(420px, 100%);
}

.login-panel .primary-button {
  width: 100%;
}

.account-modal {
  z-index: 90;
}

.account-panel {
  width: min(440px, 100%);
}

.account-intro {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.account-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.account-actions .primary-button,
.account-actions .ghost-button {
  min-height: 42px;
}

.detail-panel {
  width: min(1080px, 100%);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.detail-media {
  display: grid;
  gap: 10px;
}

.detail-image-stage {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #eef1f4;
}

.detail-image-stage > img {
  width: 100%;
  max-height: 72vh;
  aspect-ratio: 1 / 1;
  display: block;
  object-fit: contain;
}

.detail-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  width: 44px;
  height: 52px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: 0 10px 22px rgba(30, 34, 40, 0.18);
  transform: translateY(-50%);
}

.detail-arrow.previous {
  left: 12px;
}

.detail-arrow.next {
  right: 12px;
}

.detail-arrow:hover {
  background: white;
  color: var(--blue);
}

.detail-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.detail-thumb {
  flex: 0 0 72px;
  overflow: hidden;
  height: 72px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: transparent;
  padding: 0;
}

.detail-thumb.active {
  border-color: var(--green);
}

.detail-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.detail-info {
  display: grid;
  gap: 14px;
}

.detail-price {
  color: var(--blue);
  font-size: 30px;
  font-weight: 900;
}

.detail-text {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.detail-edit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--blue);
  border-radius: 8px;
  background: #eef5fb;
  color: var(--blue);
  font-weight: 900;
}

.detail-edit-button[hidden] {
  display: none;
}

.detail-editor {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.detail-editor[hidden] {
  display: none;
}

.detail-editor label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.detail-editor textarea {
  width: 100%;
  resize: vertical;
  min-height: 120px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--ink);
  font: inherit;
}

.detail-editor-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.detail-actions .frame-toggle.active {
  border-color: var(--coral);
  color: white;
  background: var(--coral);
}

.detail-actions .frame-toggle.active svg {
  fill: currentColor;
}

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

.notifications-list {
  display: grid;
  gap: 10px;
}

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

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

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

.order-card,
.notification-card,
.review-card,
.share-card,
.submission-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.order-card header,
.order-card footer,
.notification-card header,
.review-card header,
.share-card header,
.submission-card header,
.submission-card footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.order-card footer {
  align-items: center;
  flex-wrap: wrap;
}

.order-card h3,
.notification-card h3,
.review-card h3,
.share-card h3 {
  font-size: 16px;
}

.submission-card h3 {
  font-size: 16px;
}

.order-card p,
.order-card li,
.notification-card p,
.review-card p,
.share-card p {
  color: var(--muted);
  font-size: 13px;
}

.submission-card p {
  color: var(--muted);
  font-size: 13px;
}

.review-card strong,
.notification-card strong,
.share-card strong {
  color: var(--green);
  white-space: nowrap;
}

.notification-card header {
  align-items: center;
}

.notification-kind {
  border-radius: 999px;
  background: #eef5fb;
  color: var(--blue);
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 900;
}

.notification-kind.urgent {
  background: #fff0ed;
  color: var(--coral);
}

.submission-card strong {
  color: var(--green);
}

.submission-card footer {
  align-items: center;
  flex-wrap: wrap;
}

.review-photo {
  width: 100%;
  max-height: 280px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: #eef1f4;
}

.map-link {
  color: var(--green);
  font-weight: 900;
}

.order-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.order-card.order-refused {
  border-color: rgba(217, 93, 73, 0.38);
  background: #fffafa;
}

.order-items {
  list-style: none;
  padding-left: 0 !important;
}

.order-items li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.order-items li.no-image {
  grid-template-columns: minmax(0, 1fr);
}

.order-item-image {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: cover;
  background: #eef1f4;
}

.status-pill {
  border-radius: 999px;
  padding: 6px 9px;
  background: #eef5fb;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.status-preparation {
  background: #fff6df;
  color: #8a5b00;
}

.status-acceptee {
  background: #e8f6ef;
  color: var(--green-dark);
}

.status-livree {
  background: #e8f6ef;
  color: var(--green-dark);
}

.status-refusee {
  background: #fff0ed;
  color: var(--coral);
}

.status-annulee {
  background: #fff0ed;
  color: var(--coral);
}

.cancel-notice {
  border-radius: 8px;
  background: #fff0ed;
  color: var(--coral) !important;
  padding: 8px 10px;
  font-weight: 800;
}

.order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.accept-order-button,
.refuse-order-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  border-radius: 8px;
  padding: 0 11px;
  font-weight: 900;
  border: 0;
  cursor: pointer;
}

.accept-order-button {
  background: var(--green);
  color: white;
}

.refuse-order-button {
  background: var(--coral);
  color: white;
}

.accept-order-button:disabled,
.refuse-order-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.accept-order-button svg,
.refuse-order-button svg {
  width: 16px;
  height: 16px;
}

.status-control {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.status-control select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 0 8px;
}

.edit-preview {
  overflow: hidden;
  width: 100%;
  height: 280px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef1f4;
}

.edit-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.frame-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--blue);
  border-radius: 8px;
  background: #eef5fb;
  color: var(--blue);
  font-weight: 800;
}

.extra-photo-box {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.photo-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.photo-thumb {
  display: grid;
  gap: 7px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: white;
}

.photo-thumb img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
  background: #eef1f4;
}

.photo-thumb span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.photo-thumb div {
  display: flex;
  gap: 6px;
}

.photo-order-buttons {
  flex-wrap: wrap;
}

.thumb-button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--blue);
}

.thumb-button.order-number {
  color: var(--green-dark);
  font-weight: 900;
}

.thumb-button.order-number.active,
.thumb-button.order-number:disabled {
  border-color: var(--green);
  background: var(--green);
  color: white;
}

.thumb-button:disabled {
  cursor: not-allowed;
  opacity: 0.82;
}

.thumb-button.danger {
  color: var(--coral);
}

.frame-controls {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f7f9fb;
}

.frame-controls[hidden] {
  display: none;
}

.frame-controls input[type="range"] {
  accent-color: var(--green);
}

@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 250px minmax(0, 1fr);
  }

  .cart-panel {
    position: fixed;
    top: 82px;
    right: 30px;
    bottom: 20px;
    z-index: 30;
    width: min(var(--cart-width), calc(100vw - 60px));
    height: min(calc(100vh - 102px), var(--cart-height));
    max-height: min(calc(100vh - 102px), var(--cart-height));
    transform: translateX(calc(100% + 30px));
    box-shadow: var(--shadow);
    transition: transform 180ms ease;
  }

  .cart-panel.open {
    transform: translateX(0);
  }
}

@media (max-width: 820px) {
  .topbar {
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 10px 12px;
  }

  .search {
    grid-column: 1 / -1;
    order: 3;
    height: 42px;
  }

  .top-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
    justify-content: flex-start;
    order: 2;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .top-actions::-webkit-scrollbar {
    display: none;
  }

  .top-actions > button {
    flex: 0 0 auto;
  }

  .shell {
    display: block;
    width: 100%;
    padding: 14px 12px 24px;
  }

  .filters {
    position: static;
    margin-bottom: 14px;
    padding: 14px;
  }

  .cart-panel {
    top: 10px;
    right: 18px;
    bottom: 10px;
    left: 6px;
    z-index: 60;
    width: auto;
    max-height: none;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow-y: auto;
    transform: translateY(calc(100% + 24px));
  }

  .cart-panel.open {
    transform: translateY(0);
  }

  .cart-items {
    min-height: 0;
  }

  .content-head {
    display: grid;
    align-items: start;
    min-height: 210px;
    padding: 20px;
    background:
      linear-gradient(180deg, rgba(18, 31, 37, 0.86), rgba(18, 31, 37, 0.44)),
      var(--hero-banner-image);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
  }

  h1 {
    font-size: 34px;
  }

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

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(var(--product-card-width), 180px), 1fr));
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .topbar {
    padding: 9px 10px;
  }

  .top-actions {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    font-size: 23px;
  }

  .brand small {
    display: none;
  }

  .admin-button,
  .cart-button {
    min-height: 36px;
    gap: 4px;
    padding: 0 5px;
    font-size: 11px;
  }

  .language-button {
    min-width: 0;
    max-width: 78px;
  }

  #languageButtonLabel {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .admin-button svg,
  .cart-button svg {
    width: 16px;
    height: 16px;
  }

  .cart-button strong {
    min-width: 21px;
    height: 21px;
    font-size: 11px;
  }

  #cartToggle {
    width: 48px;
    padding: 0;
  }

  #cartToggle span {
    display: none;
  }

  #installAppButton {
    width: 40px;
    padding: 0;
  }

  #installAppButton span {
    display: none;
  }

  #clientChatToggle {
    width: 40px;
    padding: 0;
  }

  #clientChatToggle span {
    display: none;
  }

  #clientOrdersToggle {
    width: 40px;
    padding: 0;
  }

  #clientOrdersToggle span {
    display: none;
  }

  .brand strong {
    font-size: 20px;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 28px;
  }

  .modal {
    padding: 10px;
  }

  .modal-panel {
    max-height: calc(100dvh - 20px);
    padding: 16px;
  }

  .chat-identity,
  .chat-send-form,
  .chat-reply-form,
  .account-actions,
  .chat-admin-layout {
    grid-template-columns: 1fr;
  }

  .chat-admin-layout,
  .chat-sessions-list,
  .chat-admin-thread {
    min-height: auto;
  }

  .chat-sessions-list {
    max-height: 190px;
  }

  .chat-thread {
    min-height: 230px;
    max-height: 45dvh;
  }

  .chat-message {
    width: min(92%, 420px);
  }
}
