.pdv-portal {
  width: 100%;
  height: 100dvh;
  min-height: 100vh;
  background: #f7f7f5;
  color: #151515;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
  overflow-y: auto;
}

.pdv-portal,
.pdv-portal * {
  box-sizing: border-box;
}

.pdv-portal button,
.pdv-portal input,
.pdv-portal select,
.pdv-portal textarea {
  font: inherit;
}

.pdv-portal__wrap {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 16px clamp(12px, 3vw, 32px) 96px;
}

.pdv-portal__sidebar,
.pdv-portal__desktop-order-label {
  display: none;
}

.pdv-portal__content {
  min-width: 0;
}

.pdv-portal__header {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.pdv-portal__logo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #e4efe6;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-weight: 800;
  color: #1c7c3a;
}

.pdv-portal__logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pdv-portal__store-name {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdv-portal__info-button,
.pdv-portal__cart-button,
.pdv-portal__ghost-button {
  border: 0;
  background: transparent;
  color: #171717;
  cursor: pointer;
}

.pdv-portal__info-button {
  margin-top: 4px;
  padding: 0;
  font-size: 13px;
}

.pdv-portal__cart-button {
  min-width: 48px;
  min-height: 48px;
  border-radius: 999px;
  background: #eeeeec;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
}

.pdv-portal__cart-count {
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
}

.pdv-portal__search {
  margin-top: 14px;
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
}

.pdv-portal__search input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #deded8;
  border-radius: 999px;
  background: #fff;
  padding: 0 16px;
  outline: none;
}

.pdv-portal__categories {
  margin: 14px calc(-1 * clamp(12px, 3vw, 32px)) 0;
  padding: 0 clamp(12px, 3vw, 32px) 10px;
  display: flex;
  gap: 16px;
  overflow-x: auto;
  border-bottom: 1px solid #deded8;
}

.pdv-portal__category {
  border: 0;
  background: transparent;
  padding: 10px 0;
  white-space: nowrap;
  font-weight: 700;
  color: #2f2f2f;
  border-bottom: 3px solid transparent;
}

.pdv-portal__category--active {
  color: #000;
  border-bottom-color: #000;
}

.pdv-portal__welcome {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  background: #e9ece7;
  padding: 10px 12px;
  font-size: 12px;
}

.pdv-portal__welcome > div:last-child {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

.pdv-portal__main {
  margin-top: 24px;
  display: grid;
  gap: 24px;
}

.pdv-portal__title {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 800;
}

.pdv-portal__product-summary {
  margin: -6px 0 16px;
  color: #555;
  font-size: 13px;
  font-weight: 700;
}

.pdv-portal__products {
  display: grid;
  gap: 20px;
}

.pdv-portal__product {
  min-height: 142px;
  display: grid;
  grid-template-columns: minmax(104px, 34vw) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid #ededeb;
  padding-bottom: 20px;
  overflow: hidden;
}

.pdv-portal__product-image {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
}

.pdv-portal__product-placeholder {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  background: linear-gradient(135deg, #f0f0ed, #ffffff);
  display: grid;
  place-items: center;
  color: #777;
  font-weight: 800;
}

.pdv-portal__product-name {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.pdv-portal__product-info {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.pdv-portal__product-code,
.pdv-portal__product-status {
  margin-top: 10px;
  font-size: 11px;
  color: #555;
}

.pdv-portal__product-price {
  margin-top: 28px;
  font-size: 17px;
  font-weight: 900;
}

.pdv-portal__product-actions {
  margin-top: 12px;
  display: inline-grid;
  grid-template-columns: 34px minmax(34px, 58px) 34px;
  gap: 8px;
  align-items: center;
}

.pdv-portal__product-actions button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #d9d9d4;
  background: #fff;
  color: #111;
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
}

.pdv-portal__product-actions button:last-child {
  border-color: #000;
  background: #000;
  color: #fff;
}

.pdv-portal__product-actions span {
  min-height: 32px;
  border: 1px solid #d9d9d4;
  border-radius: 5px;
  background: #fff;
  display: grid;
  place-items: center;
}

.pdv-portal__product-actions button:disabled {
  opacity: 0.3;
}

.pdv-portal__load-more {
  margin: 28px 0 8px;
  display: flex;
  justify-content: center;
}

.pdv-portal__load-more .pdv-portal__primary {
  min-width: min(100%, 260px);
}

.pdv-portal__bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  background: #fff;
  border-top: 1px solid #e4e4df;
  padding: 12px;
  display: flex;
  justify-content: center;
  gap: 20px;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
}

.pdv-portal__primary {
  border: 0;
  border-radius: 999px;
  min-height: 46px;
  padding: 0 18px;
  background: #111;
  color: #fff;
  font-weight: 900;
}

.pdv-portal__drawer {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.45);
  display: grid;
  align-items: end;
}

.pdv-portal__drawer-panel {
  max-height: 88vh;
  overflow: auto;
  background: #fff;
  border-radius: 18px 18px 0 0;
  padding: 18px;
}

.pdv-portal__drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pdv-portal__cart-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #eeeeea;
}

.pdv-portal__qty {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.pdv-portal__qty button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid #ddd;
  background: #fff;
}

.pdv-portal__field {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 700;
}

.pdv-portal__field input,
.pdv-portal__field select,
.pdv-portal__field textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #deded8;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}

.pdv-portal__success {
  margin-top: 18px;
  border-radius: 12px;
  padding: 14px;
  background: #e8f8ed;
  color: #155724;
}

.pdv-portal__error {
  background: #fff2f2;
  color: #8a1f1f;
}

.pdv-portal__honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (min-width: 860px) {
  .pdv-portal {
    background: #fff;
  }

  .pdv-portal__wrap {
    min-height: 100%;
    padding: 0;
    display: grid;
    grid-template-columns: 358px minmax(0, 1fr);
  }

  .pdv-portal__sidebar {
    position: sticky;
    top: 0;
    height: 100dvh;
    padding: 42px 40px;
    border-right: 1px solid #deded8;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 26px;
    overflow: auto;
  }

  .pdv-portal__sidebar-logo {
    width: 136px;
    height: 136px;
    border-radius: 50%;
    background: #e4efe6;
    color: #1c7c3a;
    display: grid;
    place-items: center;
    overflow: hidden;
    font-size: 42px;
    font-weight: 900;
  }

  .pdv-portal__sidebar-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .pdv-portal__sidebar h1 {
    margin: 0;
    max-width: 230px;
    font-size: 26px;
    line-height: 1.1;
    font-weight: 500;
    text-transform: uppercase;
  }

  .pdv-portal__sidebar-categories {
    display: grid;
    gap: 2px;
  }

  .pdv-portal__sidebar-categories button {
    border: 0;
    background: transparent;
    padding: 8px 0;
    text-align: left;
    font-weight: 700;
    color: #111;
    cursor: pointer;
  }

  .pdv-portal__sidebar-category--active {
    text-decoration: underline;
    text-underline-offset: 5px;
  }

  .pdv-portal__content {
    padding: 40px 24px 56px 16px;
  }

  .pdv-portal__header {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 20px;
  }

  .pdv-portal__header > .pdv-portal__logo,
  .pdv-portal__header-info {
    display: none;
  }

  .pdv-portal__desktop-order-label {
    display: block;
    white-space: nowrap;
  }

  .pdv-portal__cart-button {
    min-width: 128px;
  }

  .pdv-portal__search {
    margin-top: 0;
    grid-column: 1;
    grid-row: 1;
  }

  .pdv-portal__search input {
    min-height: 48px;
  }

  .pdv-portal__categories {
    display: none;
  }

  .pdv-portal__welcome {
    margin-top: 40px;
  }

  .pdv-portal__main {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .pdv-portal__products {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 26px;
  }

  .pdv-portal__product {
    min-height: 338px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    border: 1px solid #deded8;
    border-radius: 6px;
    background: #fff;
    padding: 14px 16px 16px;
  }

  .pdv-portal__product-image,
  .pdv-portal__product-placeholder {
    width: 100%;
    height: 190px;
  }

  .pdv-portal__product-info {
    display: flex;
    min-height: 132px;
    flex-direction: column;
  }

  .pdv-portal__product-price {
    margin-top: auto;
  }

  .pdv-portal__product-actions {
    align-self: flex-end;
    margin-top: -38px;
  }

  .pdv-portal__desktop-cart {
    display: none;
  }

  .pdv-portal__bottom-bar {
    display: none;
  }
}

@media (max-width: 859px) {
  .pdv-portal__wrap {
    padding-left: 14px;
    padding-right: 14px;
  }

  .pdv-portal__header {
    grid-template-columns: 52px minmax(0, 1fr) 44px;
  }

  .pdv-portal__cart-button {
    min-width: 44px;
    width: 44px;
    padding: 0;
  }

  .pdv-portal__cart-button span:last-child {
    display: none;
  }

  .pdv-portal__categories {
    margin-left: -14px;
    margin-right: -14px;
    padding-left: 14px;
    padding-right: 14px;
  }

  .pdv-portal__product-actions {
    grid-template-columns: 30px 34px 30px;
    gap: 6px;
  }

  .pdv-portal__product-actions button {
    width: 30px;
    height: 30px;
  }

  .pdv-portal__product {
    grid-template-columns: 132px minmax(0, 1fr);
  }

  .pdv-portal__product-name {
    font-size: 15px;
    word-break: break-all;
  }

  .pdv-portal__desktop-cart {
    display: none;
  }
}

@media (max-width: 420px) {
  .pdv-portal__product {
    grid-template-columns: 118px minmax(0, 1fr);
  }
}
