:root {
  --brand: #e74659;
  --background: #f5f5f8;
  --foreground: #151515;
  --card: #fff;
  --soft: #f1f2f4;
  --muted: #777;
  --border: #e5e7eb;
  color-scheme: light;
}

.dark {
  --background: #111216;
  --foreground: #f7f7f8;
  --card: #1a1b1f;
  --soft: #25262b;
  --muted: #aaa;
  --border: #303239;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: #f1f1f5; scroll-behavior: smooth; }
body { margin: 0; background: #f1f1f5; color: var(--foreground); font: 16px Arial, Helvetica, sans-serif; }
body.locked { overflow: hidden; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.svg-sprite, .topbar { display: none !important; }
.bottom-nav { display: none; }

.site-shell {
  max-width: 512px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 0 28px;
  overflow: hidden;
  background: var(--background);
  box-shadow: 0 8px 34px rgb(31 41 55 / 5%);
}

.page-content { min-height: 100vh; padding: 20px 12px 28px; }
.brand-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin: 0 0 30px; }
.brand-copy { padding: 0; border: 0; background: transparent; color: var(--foreground); text-align: left; }
.brand-copy small { display: block; color: #ef5464; font-size: 12px; font-weight: 700; line-height: 15px; }
.brand-copy strong { display: block; margin-top: 2px; font-size: 26px; font-weight: 800; line-height: 32px; letter-spacing: -.4px; }
.menu-button { display: grid; width: 38px; height: 38px; margin-top: 8px; place-items: center; border: 0; border-radius: 9px; background: var(--brand); color: #fff; }
.menu-button svg { width: 23px; height: 23px; }

.search-box { display: flex; height: 51px; margin: 0 0 22px; padding: 0 15px; align-items: center; gap: 10px; border-radius: 16px; background: var(--card); box-shadow: 0 11px 24px rgb(40 48 68 / 5%); }
.search-box > svg { display: block; width: 20px; height: 20px; flex: 0 0 20px; color: var(--foreground); }
.search-box input { width: 100%; height: 49px; padding: 0; border: 0; outline: 0; background: transparent; color: var(--foreground); font-size: 13px; }
.search-box input::placeholder { color: #71717a; opacity: 1; }

.section-title { margin: 0 0 12px; font-size: 17px; font-weight: 800; line-height: 21px; }
.category-strip { display: grid; grid-auto-flow: column; grid-auto-columns: 204px; gap: 16px; overflow-x: auto; padding: 0 0 18px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.category-strip::-webkit-scrollbar { display: none; }
.category-card { position: relative; height: 150px; overflow: hidden; padding: 0; border: 0; border-radius: 15px; background: #222; box-shadow: 0 10px 22px rgb(17 17 17 / 14%); scroll-snap-align: start; }
.category-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.category-card:hover img { transform: scale(1.03); }
.category-card::after { content: ''; position: absolute; inset: 38% 0 0; background: linear-gradient(transparent, rgb(0 0 0 / 78%)); }
.category-card span { position: absolute; z-index: 1; right: 10px; bottom: 13px; left: 10px; color: #fff; font-size: 17px; font-weight: 800; line-height: 20px; text-shadow: 0 2px 4px #000; }

.breadcrumb-row { display: flex; height: 58px; margin: 12px 0 18px; padding: 0 16px; align-items: center; gap: 9px; border-radius: 16px; background: var(--card); color: #5e6470; font-size: 15px; }
.breadcrumb-row button { padding: 0; border: 0; background: transparent; color: #ed4558; font-size: 15px; font-weight: 400; }

.catalog-list { display: grid; gap: 18px; }
.product-card { display: grid; min-height: 134px; padding: 16px; grid-template-columns: 120px minmax(0, 1fr); gap: 28px; overflow: hidden; border-radius: 16px; background: var(--card); }
.product-image { width: 120px; height: 91px; min-height: 91px; padding: 0; overflow: hidden; align-self: start; border: 0; border-radius: 14px; background: #eee; }
.product-image img { display: block; width: 120px; height: 91px; object-fit: cover; }
.product-info { display: flex; min-width: 0; flex-direction: column; }
.product-title { padding: 1px 0 8px; border: 0; background: transparent; color: var(--foreground); font-size: 16px; font-weight: 800; line-height: 19px; text-align: left; }
.product-buy-row { display: flex; min-height: 49px; margin-top: 0; padding: 7px 7px 7px 0; align-items: center; justify-content: space-between; gap: 7px; border-top: 1px solid #d9dce1; border-bottom: 1px solid #d9dce1; }
.product-buy-row strong { color: var(--foreground); font-size: 16px; line-height: 20px; white-space: nowrap; }
.primary, .buy-button { border: 0; background: var(--brand); color: #fff; font-weight: 700; }
.product-buy-row .buy-button, .buy-button { display: inline-flex; min-width: 89px; height: 32px; padding: 0 10px; align-items: center; justify-content: center; gap: 6px; border-radius: 9px; font-size: 14px; white-space: nowrap; }
.buy-button svg { width: 15px; height: 15px; flex: 0 0 15px; }
.product-info p { margin: 0; padding: 8px 0 0; border: 0; color: #858585; font-size: 12px; line-height: 16px; }
.pagination { display: flex; margin: 20px 0 4px; justify-content: center; flex-wrap: wrap; gap: 6px; }
.pagination button { min-width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 9px; background: var(--card); color: var(--foreground); font-weight: 700; }
.pagination button.active { border-color: var(--brand); background: var(--brand); color: #fff; }
.pagination button:disabled { cursor: not-allowed; opacity: .4; }
.load-sentinel { display: block; width: 100%; height: 1px; }

.info-page { display: grid; gap: 21px; }
.contact-search { margin: 0; }
.contact-panel { overflow: hidden; padding: 8px 16px 0; border-radius: 15px; background: var(--card); box-shadow: 0 12px 25px rgb(40 48 68 / 4%); }
.contact-intro { padding: 12px 0 6px; border-bottom: 1px solid #ececef; }
.contact-intro h2 { margin: 0 0 10px; font-size: 18px; font-weight: 800; line-height: 20px; }
.contact-intro h2:nth-of-type(2) { margin-top: 7px; }
.contact-intro a { display: block; color: #087cff; font-size: 14px; line-height: 18px; text-decoration: none; }
.contact-intro p { margin: 0; color: var(--muted); font-size: 14px; line-height: 24px; }
.social-row { display: grid; min-height: 56px; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; border-bottom: 1px solid #ececef; color: var(--foreground); font-size: 13px; }
.social-row:last-child { border-bottom: 0; }
.social-row > svg { width: 17px; height: 17px; justify-self: center; }
.social-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.social-row .phone, .social-row .whatsapp-color { color: #23b563; }
.social-row .instagram { color: #f44776; }
.social-row .facebook { color: #4969a5; }
.social-row .tiktok { color: var(--foreground); }
.social-row .youtube { color: #ea4d62; }
.social-action { padding: 5px 7px; background: var(--brand); color: #fff; font-size: 9px; font-weight: 800; line-height: 10px; text-decoration: none; white-space: nowrap; }
.link-icon { display: grid; place-items: center; color: #929292; }
.link-icon svg { width: 14px; height: 14px; }

.empty-state { display: flex !important; min-height: 220px; padding: 34px 20px; flex-direction: column; align-items: center; justify-content: center; border-radius: 16px; background: var(--card); color: var(--muted); text-align: center; }
.empty-icon { color: var(--brand); font-size: 42px; }
.empty-state h1, .empty-state h3 { margin: 13px 0 3px; color: var(--foreground); }
.empty-state p { margin: 4px 0; }
.empty-state.compact { min-height: 180px; }

.overlay { position: fixed; z-index: 60; inset: 0; background: rgb(0 0 0 / 48%); backdrop-filter: blur(2px); }
.drawer { position: fixed; z-index: 70; display: flex; background: var(--card); color: var(--foreground); box-shadow: 0 0 40px rgb(0 0 0 / 26%); transition: transform .22s ease; flex-direction: column; }
.drawer.left { inset: 0 auto 0 0; width: min(84vw, 340px); padding: 18px; transform: translateX(-105%); }
.drawer.right { inset: 0 0 0 auto; width: min(100%, 500px); transform: translateX(105%); }
.drawer.bottom { bottom: 12px; left: 50%; width: min(476px, calc(100% - 24px)); padding: 18px; visibility: hidden; border-radius: 20px; transform: translate(-50%, 120%); }
.drawer.open.left, .drawer.open.right { transform: translateX(0); }
.drawer.open.bottom { visibility: visible; transform: translate(-50%, 0); }
.drawer .close, .dialog-close { position: absolute; z-index: 2; top: 9px; right: 12px; width: 34px; height: 34px; border: 0; background: transparent; color: var(--foreground); font-size: 28px; }
.drawer header { padding: 10px 4px 14px; }
.basket-drawer header { padding: 22px 18px 12px; }
.drawer h2 { margin: 0 0 4px; font-size: 25px; }
.drawer header p { margin: 0; color: var(--muted); font-size: 14px; }
.category-menu, .page-menu { display: grid; overflow-y: auto; }
.category-menu button, .page-menu button { padding: 13px 5px; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--foreground); font-weight: 650; text-align: left; }
.page-menu { margin-top: 12px; border-top: 1px solid var(--border); }
.sheet-cart-button { min-height: 44px; margin-top: 15px; border-radius: 9px; }
.copyright { margin: auto 5px 5px; color: var(--muted); font-size: 12px; }
.setting-row { display: flex; padding: 14px; align-items: center; justify-content: space-between; border-radius: 14px; background: var(--soft); }
.setting-row > div { display: flex; align-items: center; gap: 10px; }
.switch { position: relative; width: 48px; height: 27px; border: 0; border-radius: 20px; background: #aaa; }
.switch i { position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; transition: .2s; }
.switch.on { background: var(--brand); }
.switch.on i { left: 24px; }
.accent-settings { padding: 17px 4px 4px; }
.accent-settings > div { display: flex; margin-top: 12px; gap: 11px; }
.accent-dot { width: 36px; height: 36px; border: 0; border-radius: 50%; color: transparent; box-shadow: inset 0 0 0 2px rgb(255 255 255 / 40%); }
.accent-dot.selected { color: #fff; }

.basket-scroll { overflow-y: auto; flex: 1; padding: 0 16px 18px; }
.basket-row { display: grid; padding: 10px 0; grid-template-columns: 64px 1fr 28px; align-items: start; gap: 10px; border-bottom: 1px solid var(--border); }
.basket-row > img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; }
.basket-row > div { display: flex; flex-direction: column; gap: 4px; }
.basket-row strong { font-size: 14px; line-height: 1.2; }
.basket-row span { color: var(--brand); font-weight: 800; }
.quantity { display: flex; margin-top: 3px; align-items: center; gap: 9px; }
.quantity button { width: 26px; height: 26px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--foreground); }
.quantity b { min-width: 18px; text-align: center; }
.trash { padding: 5px 0; border: 0; background: transparent; color: var(--muted); }
.checkout-form { display: grid; padding-top: 17px; gap: 10px; }
.checkout-form h3 { margin: 8px 0 0; }
.promo-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.promo-row button { border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--foreground); font-weight: 700; }
.service-switch { display: grid; padding: 4px; grid-template-columns: 1fr 1fr; gap: 5px; border-radius: 11px; background: var(--soft); }
.service-switch button { padding: 9px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-weight: 700; }
.service-switch button.active { background: var(--card); color: var(--brand); box-shadow: 0 3px 9px rgb(0 0 0 / 8%); }
.checkout-form input, .checkout-form textarea { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px; outline: 0; background: var(--card); color: var(--foreground); }
.checkout-form textarea { min-height: 84px; resize: vertical; }
.checkout-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.35; }
.basket-footer { display: grid; padding: 12px 16px 16px; gap: 9px; border-top: 1px solid var(--border); background: var(--card); }
.basket-footer > div { display: flex; justify-content: space-between; font-size: 18px; }
.basket-footer strong { color: var(--brand); }
.basket-footer .whatsapp { min-height: 46px; border-radius: 9px; }
.whatsapp { background: #16a34a !important; }
.clear-cart { border: 0; background: transparent; color: var(--muted); font-size: 13px; }

.product-dialog { width: min(430px, calc(100% - 28px)); padding: 0; overflow: hidden; border: 0; border-radius: 18px; background: var(--card); color: var(--foreground); box-shadow: 0 25px 70px rgb(0 0 0 / 34%); }
.product-dialog::backdrop { background: rgb(0 0 0 / 56%); backdrop-filter: blur(3px); }
.product-dialog img { width: 100%; height: 260px; object-fit: cover; }
.dialog-copy { padding: 14px 18px 18px; }
.dialog-copy h2 { margin: 0 30px 8px 0; font-size: 22px; line-height: 1.15; }
.dialog-copy p { color: var(--muted); line-height: 1.4; }
.dialog-copy > div { display: flex; margin-top: 16px; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-copy > div strong { color: var(--brand); font-size: 19px; }
.toast { position: fixed; z-index: 100; bottom: 18px; left: 50%; display: flex; width: min(420px, calc(100% - 34px)); min-height: 46px; padding: 11px 16px; transform: translateX(-50%); align-items: center; justify-content: center; gap: 9px; border-radius: 12px; background: #15803d; color: #fff; font-weight: 700; box-shadow: 0 12px 30px rgb(0 0 0 / 22%); }

@media (max-width: 640px) {
  .site-shell { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
  .page-content { padding-bottom: 28px; }
  .bottom-nav {
    position: fixed;
    z-index: 50;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    width: min(512px, 100%);
    min-height: calc(74px + env(safe-area-inset-bottom));
    margin: 0 auto;
    padding: 8px 4px calc(7px + env(safe-area-inset-bottom));
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: center;
    border-top: 1px solid rgb(17 24 39 / 7%);
    background: color-mix(in srgb, var(--card) 96%, transparent);
    box-shadow: 0 -7px 24px rgb(17 24 39 / 8%);
    backdrop-filter: blur(15px);
  }
  .bottom-nav button {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 58px;
    padding: 2px 1px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 0;
    background: transparent;
    color: var(--foreground);
  }
  .bottom-nav button.active { color: var(--brand); }
  .bottom-nav svg { width: 26px; height: 26px; }
  .bottom-nav span { overflow: hidden; max-width: 100%; font-size: 11px; line-height: 14px; text-overflow: ellipsis; white-space: nowrap; }
  .bottom-nav em {
    position: absolute;
    top: 1px;
    left: calc(50% + 8px);
    display: grid;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    place-items: center;
    border: 2px solid var(--card);
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-size: 9px;
    font-style: normal;
    font-weight: 800;
  }
  .pagination { min-height: 1px; margin: 0; }
  .toast { bottom: calc(88px + env(safe-area-inset-bottom)); }
  .drawer.bottom.open { bottom: calc(86px + env(safe-area-inset-bottom)); }
}

@media (max-width: 410px) {
  .product-card { padding: 14px; grid-template-columns: 104px minmax(0, 1fr); gap: 14px; }
  .product-image, .product-image img { width: 104px; height: 91px; }
  .product-buy-row .buy-button { min-width: 82px; padding: 0 8px; }
}

[hidden] { display: none !important; }
