/* Public customer shop — mobile-first, uses the POS design tokens. */

.shop-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 64px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}

.shop-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.shop-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: var(--color-white);
  flex-shrink: 0;
}

.shop-brand-name {
  font-weight: 700;
  font-size: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shop-cart-fab {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 35;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 16px 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--color-primary);
  color: var(--color-white);
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 10px 24px rgba(241, 90, 0, 0.35);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.shop-cart-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(241, 90, 0, 0.42);
}

.shop-cart-fab:active {
  transform: scale(0.97);
}

.shop-cart-fab-label {
  display: none;
}

.shop-cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--color-white);
  color: var(--color-primary-dark);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 640px) {
  .shop-cart-fab-label {
    display: inline;
  }
}

.shop-main {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 20px 16px 56px;
}

.shop-hero {
  padding: 8px 0 18px;
}

.shop-hero-title {
  margin: 0;
  font-size: clamp(24px, 5vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.shop-hero-subtitle {
  margin: 8px 0 0;
  color: var(--color-text-muted);
  font-size: 15px;
  max-width: 52ch;
}

.shop-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.shop-search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 14px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  box-shadow: var(--shadow-xs);
}

.shop-search:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.shop-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 15px;
  color: var(--color-text);
}

.shop-category-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.shop-category-filters::-webkit-scrollbar {
  display: none;
}

.shop-category-chip {
  flex-shrink: 0;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-text);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.shop-category-chip:hover {
  border-color: var(--color-primary);
}

.shop-category-chip.is-active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
}

.shop-status {
  margin-bottom: 12px;
  color: var(--color-text-muted);
  font-size: 14px;
}

.shop-status.is-error {
  color: var(--color-error);
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.shop-card {
  display: flex;
  flex-direction: column;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

.shop-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.shop-card-media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  background: var(--color-primary-light);
  border: 0;
  padding: 0;
  overflow: hidden;
}

.shop-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease;
}

.shop-card:hover .shop-card-media img {
  transform: scale(1.03);
}

.shop-card-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  color: var(--color-text-muted);
  font-size: 12px;
  background: var(--color-primary-light);
}

.shop-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  flex: 1;
}

.shop-card-category {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.shop-card-name {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.shop-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}

.shop-card-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.shop-add-btn {
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-weight: 700;
  font-size: 13px;
  transition: all var(--transition-fast);
}

.shop-add-btn:hover {
  background: var(--color-primary);
  color: var(--color-white);
}

.shop-add-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.shop-empty {
  grid-column: 1 / -1;
  padding: 48px 20px;
  text-align: center;
  background: var(--color-white);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--color-text-muted);
}

.shop-empty-title {
  margin: 0 0 6px;
  color: var(--color-text);
  font-size: 18px;
  font-weight: 700;
}

.shop-empty-desc {
  margin: 0;
  font-size: 14px;
}

.shop-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e6e6e6 37%, #f0f0f0 63%);
  background-size: 400% 100%;
  animation: shop-shimmer 1.3s ease infinite;
  border-radius: var(--radius-lg);
  aspect-ratio: 4 / 5;
}

@keyframes shop-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.shop-footer {
  padding: 22px 16px 96px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 13px;
  border-top: 1px solid var(--color-border);
  background: var(--color-white);
}

.shop-footer p {
  margin: 0;
}

.shop-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(36, 36, 36, 0.42);
  opacity: 1;
  transition: opacity var(--transition-fast);
}

.shop-cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  width: min(400px, 100%);
  height: 100%;
  height: 100dvh;
  background: var(--color-white);
  box-shadow: var(--shadow-md);
  transform: translateX(0);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.shop-cart-drawer.is-hidden,
.shop-modal.is-hidden,
.shop-backdrop.is-hidden,
.shop-toast.is-hidden {
  display: none;
}

.shop-cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--color-border);
}

.shop-cart-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.shop-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-white);
  color: var(--color-text);
  font-size: 20px;
  line-height: 1;
}

.shop-icon-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
}

.shop-cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px;
}

.shop-cart-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}

.shop-cart-item:last-child {
  border-bottom: 0;
}

.shop-cart-item-media {
  width: 64px;
  height: 80px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--color-primary-light);
}

.shop-cart-item-info {
  min-width: 0;
}

.shop-cart-item-name {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.shop-cart-item-price {
  margin: 2px 0 8px;
  color: var(--color-text-muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.shop-qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  overflow: hidden;
}

.shop-qty-control .shop-icon-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 0;
  font-size: 16px;
}

.shop-qty-control span {
  min-width: 30px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
}

.shop-cart-item-end {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.shop-cart-item-total {
  font-weight: 700;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.shop-remove-btn {
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 12px;
  text-decoration: underline;
}

.shop-remove-btn:hover {
  color: var(--color-error);
}

.shop-cart-empty {
  padding: 48px 12px;
  text-align: center;
  color: var(--color-text-muted);
}

.shop-cart-empty-title {
  margin: 0 0 6px;
  color: var(--color-text);
  font-weight: 700;
}

.shop-cart-footer {
  padding: 16px;
  border-top: 1px solid var(--color-border);
  background: var(--color-white);
  box-shadow: 0 -8px 24px rgba(36, 36, 36, 0.06);
}

.shop-cart-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-size: 14px;
}

.shop-cart-row strong {
  color: var(--color-text);
  font-size: 15px;
}

.shop-cart-total {
  margin-bottom: 12px;
  padding: 12px;
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-size: 17px;
  font-weight: 700;
}

.shop-cart-total strong {
  color: var(--color-primary-dark);
  font-size: 19px;
}

.shop-whatsapp-btn {
  height: 50px;
  margin-bottom: 8px;
  border: 1px solid #1DA851;
  background: #25D366;
  color: var(--color-white);
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(37, 211, 102, 0.28);
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.shop-whatsapp-btn:hover:not(:disabled) {
  background: #1DA851;
  box-shadow: 0 10px 22px rgba(37, 211, 102, 0.36);
  transform: translateY(-1px);
}

.shop-whatsapp-btn:disabled {
  border-color: #B7E2C7;
  background: #EAF6EF;
  color: #16864A;
  box-shadow: none;
  opacity: 1;
  cursor: not-allowed;
}

.shop-cart-hint {
  margin: 4px 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--color-warning);
  border-radius: var(--radius-md);
  background: var(--color-warning-bg);
  color: #7A5200;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}

.shop-cart-hint.is-hidden {
  display: none;
}

#continueShoppingBtn {
  height: 44px;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-text);
  font-weight: 600;
  border-radius: var(--radius-md);
}

#continueShoppingBtn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
}

.shop-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.shop-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(36, 36, 36, 0.55);
}

.shop-modal-card {
  position: relative;
  z-index: 1;
  width: min(880px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  background: var(--color-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.shop-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.94);
}

.shop-product-modal-card {
  display: grid;
  grid-template-columns: 1fr;
}

.shop-product-modal-image {
  background: var(--color-primary-light);
  cursor: zoom-in;
}

.shop-product-modal-image img {
  width: 100%;
  max-height: 46dvh;
  object-fit: contain;
}

.shop-product-modal-body {
  padding: 18px;
}

.shop-product-category {
  margin: 0 0 4px;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.shop-product-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 700;
}

.shop-product-price {
  margin: 8px 0 0;
  color: var(--color-primary-dark);
  font-size: 20px;
  font-weight: 700;
}

.shop-product-description {
  margin: 10px 0 0;
  color: var(--color-text-muted);
  font-size: 14px;
}

.shop-product-sizes {
  margin: 8px 0 0;
  color: var(--color-text-muted);
  font-size: 13px;
}

.shop-product-sizes:empty {
  display: none;
}

.shop-qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 14px;
}

.shop-zoom-card {
  width: min(1000px, 100%);
}

.shop-zoom-stage {
  max-height: 76dvh;
  overflow: auto;
  background: #111;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.shop-zoom-stage img {
  display: block;
  max-width: none;
  height: auto;
  margin: 0 auto;
  user-select: none;
}

.shop-zoom-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
}

.shop-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 80;
  transform: translateX(-50%);
  max-width: min(420px, calc(100% - 32px));
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--color-text);
  color: var(--color-white);
  font-size: 14px;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.shop-toast.is-error {
  background: var(--color-error);
}

.shop-toast.is-success {
  background: var(--color-success);
}

@media (min-width: 640px) {
  .shop-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }

  .shop-toolbar {
    flex-direction: row;
    align-items: center;
  }

  .shop-search {
    width: min(360px, 100%);
  }

  .shop-product-modal-card {
    grid-template-columns: 1.1fr 1fr;
  }

  .shop-product-modal-image img {
    max-height: 72dvh;
  }
}

@media (min-width: 960px) {
  .shop-main {
    padding-top: 28px;
  }

  .shop-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .shop-card-body {
    padding: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shop-card,
  .shop-card-media img,
  .shop-cart-drawer,
  .shop-backdrop {
    transition: none;
  }
}