/* Global chrome: floating island toolbar, modals, account page */

:root {
  --orv2-green: #3fa535;
  --orv2-green-dark: #26751f;
  --orv2-ink: #4b5563;
  --orv2-heading: #636363;
  --orv2-muted: #636363;
  --orv2-line: #d9ded8;
  --orv2-soft: #f3f6f2;
  --orv2-white: #fff;
  --orv2-danger: #a52a2a;
  --orv2-font-light: "Helvetica Neue Light", Helvetica, Inter, Arial, sans-serif;
  --orv2-font-medium: "Helvetica Neue Medium", Helvetica, Inter, Arial, sans-serif;
  --orv2-island-pad: 16px;
  --orv2-island-height: 64px;
}

body.orv2-has-toolbar {
  padding-bottom: calc(
    var(--orv2-island-height) + var(--orv2-island-pad) * 2 +
      env(safe-area-inset-bottom, 0px)
  );
}

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

.orv2-bottom-toolbar {
  position: fixed;
  left: 50%;
  bottom: calc(var(--orv2-island-pad) + env(safe-area-inset-bottom, 0px));
  z-index: 1000;
  width: min(calc(100% - 32px), 520px);
  transform: translateX(-50%);
  padding: 8px 10px;
  border: 1px solid rgba(217, 222, 216, 0.85);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 28px rgba(36, 36, 36, 0.14);
  -webkit-backdrop-filter: saturate(1.4) blur(18px);
  backdrop-filter: saturate(1.4) blur(18px);
  animation: orv2-island-in 320ms ease-out;
}

.orv2-toolbar-buttons {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 2px;
  margin: 0;
  min-height: var(--orv2-island-height);
}

.orv2-toolbar-item {
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  align-items: center;
  justify-content: center;
}

.orv2-toolbar-item a,
.orv2-toolbar-item button {
  appearance: none;
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 13px 4px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--orv2-muted);
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  transition:
    background-color 160ms ease,
    color 160ms ease,
    transform 120ms ease;
}

.orv2-toolbar-item a:hover,
.orv2-toolbar-item button:hover {
  color: var(--orv2-ink);
  background: rgba(63, 165, 53, 0.08);
}

.orv2-toolbar-item a:active,
.orv2-toolbar-item button:active {
  transform: scale(0.96);
}

.orv2-toolbar-item a:focus-visible,
.orv2-toolbar-item button:focus-visible {
  outline: 2px solid var(--orv2-green);
  outline-offset: 2px;
}

.orv2-toolbar-item.is-active a,
.orv2-toolbar-item.is-active button {
  color: var(--orv2-green-dark);
  background: rgba(63, 165, 53, 0.14);
  font-weight: 600;
}

.orv2-toolbar-item span {
  max-width: 100%;
  overflow: hidden;
  font-family: var(--orv2-font-medium);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.15;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orv2-toolbar-item img {
  width: 22px;
  height: 22px;
  margin: 0;
  opacity: 0.72;
  transition: opacity 160ms ease, transform 160ms ease;
}

.orv2-toolbar-item a:hover img,
.orv2-toolbar-item button:hover img,
.orv2-toolbar-item.is-active img {
  opacity: 1;
}

.orv2-toolbar-item.is-active img {
  transform: translateY(-1px);
}

.orv2-toolbar-item[data-orv2-nav="share"] {
  display: none !important;
}

.orv2-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(36, 36, 36, 0.42);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.orv2-modal[hidden] {
  display: none !important;
}

.orv2-modal-container {
  position: absolute;
  right: 12px;
  bottom: calc(
    var(--orv2-island-height) + var(--orv2-island-pad) * 2 + 12px +
      env(safe-area-inset-bottom, 0px)
  );
  left: 12px;
  margin: 0 auto;
  max-width: 420px;
  padding: 12px 18px 22px;
  border: 1px solid var(--orv2-line);
  border-radius: 24px;
  background: var(--orv2-white);
  box-shadow: 0 16px 40px rgba(36, 36, 36, 0.18);
  animation: orv2-sheet-in 240ms ease-out;
}

.orv2-modal-container--article {
  max-width: 680px;
  max-height: min(78vh, 760px);
  overflow: auto;
  padding-bottom: 28px;
}

.orv2-modal-article {
  color: var(--orv2-ink);
  font-size: 0.98rem;
  line-height: 1.55;
  text-align: left;
}

.orv2-modal-article img {
  display: block;
  width: min(100%, 320px);
  height: auto;
  margin: 0 auto 18px;
  object-fit: contain;
}

.orv2-modal-article h4 {
  margin: 22px 0 10px;
}

.orv2-modal-article p {
  margin: 0 0 12px;
}

.orv2-modal-article ol,
.orv2-modal-article ul {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.orv2-modal-article li {
  position: relative;
  margin: 0 0 8px;
  padding: 0 0 0 20px;
  line-height: 1.45;
}

.orv2-modal-article li:last-child {
  margin-bottom: 0;
}

.orv2-modal-article li::before {
  position: absolute;
  top: -1px;
  left: 0;
  color: var(--orv2-green);
  content: ">";
  font-family: var(--orv2-font-medium);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.45;
}

.orv2-modal-close-row {
  display: flex;
  justify-content: flex-end;
}

.orv2-modal-close {
  appearance: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: var(--orv2-soft);
  color: var(--orv2-muted);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.orv2-modal-close:hover {
  color: var(--orv2-ink);
  background: #e7eee5;
}

.orv2-modal-title {
  margin: 0 0 18px;
  /* Family/weight/colour/uppercase from global h3 */
  text-align: center;
}

#orv2-modal-professional,
#orv2-modal-professional .orv2-modal-title,
#orv2-modal-professional .orv2-modal-article,
#orv2-modal-professional .orv2-modal-article p,
#orv2-modal-weathering,
#orv2-modal-weathering .orv2-modal-title,
#orv2-modal-weathering .orv2-modal-article,
#orv2-modal-weathering .orv2-modal-article p,
#orv2-modal-hidden-surfaces,
#orv2-modal-hidden-surfaces .orv2-modal-title,
#orv2-modal-hidden-surfaces .orv2-modal-article,
#orv2-modal-hidden-surfaces .orv2-modal-article p {
  text-align: left;
}

#orv2-modal-professional .orv2-modal-article img,
#orv2-modal-weathering .orv2-modal-article img,
#orv2-modal-hidden-surfaces .orv2-modal-article img {
  margin-left: 0;
  margin-right: auto;
}

.orv2-share-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-evenly;
  gap: 12px;
}

.orv2-share-item {
  appearance: none;
  display: flex;
  min-width: 72px;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--orv2-ink);
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  transition: background-color 140ms ease;
}

.orv2-share-item:hover {
  background: var(--orv2-soft);
}

.orv2-share-item img {
  width: 28px;
  height: 28px;
  margin: 0;
}

.orv2-share-item span {
  font-family: var(--orv2-font-medium);
  font-size: 12px;
  font-weight: 600;
}

.orv2-share-status {
  min-height: 1.2em;
  margin: 14px 0 0;
  color: var(--orv2-green);
  font-size: 14px;
  text-align: center;
}

.orv2-download-buttons,
.orv2-download-buttons-small {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin: 8px auto 0;
}

.orv2-download-buttons p,
.orv2-download-buttons-small p {
  margin: 0;
}

.orv2-download-buttons img {
  display: block;
  width: min(100%, 500px);
  max-width: 500px;
  height: auto;
}

.orv2-download-buttons-small {
  display: none;
}

.orv2-download-buttons-small img {
  display: block;
  width: 72px;
  max-width: 72px;
  height: auto;
}

#orv2-modal-download,
#orv2-modal-download .orv2-modal-title {
  text-align: center;
}

.orv2-account-page {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px 120px;
}

.orv2-account-container {
  padding: 28px 24px;
  border: 1px solid var(--orv2-line);
  border-radius: 20px;
  background: var(--orv2-soft);
}

.orv2-account-title {
  margin: 0 0 20px;
  /* Family/weight/colour/uppercase from global heading */
}

.orv2-account-welcome {
  margin-bottom: 24px;
  font-size: 1rem;
}

.orv2-account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.orv2-account-admin-link {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--orv2-line);
  font-size: 13px;
}

.orv2-account-admin-link a {
  color: var(--orv2-muted);
}

.orv2-form-group {
  margin-bottom: 16px;
}

.orv2-form-group label {
  display: block;
  margin-bottom: 6px;
  color: var(--orv2-heading);
  font-family: var(--orv2-font-medium);
  font-weight: 600;
}

.orv2-form-group--checkbox label {
  font-weight: 400;
  line-height: 1.45;
}

.orv2-form-group input[type="text"],
.orv2-form-group input[type="email"],
.orv2-form-group input[type="password"] {
  box-sizing: border-box;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--orv2-line);
  border-radius: 12px;
  background: var(--orv2-white);
  font: inherit;
}

.orv2-form-group input:focus {
  border-color: var(--orv2-green);
  outline: none;
  box-shadow: 0 0 0 3px rgba(63, 165, 53, 0.18);
}

.orv2-password-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.orv2-password-wrapper input {
  flex: 1;
}

.orv2-password-toggle {
  appearance: none;
  padding: 10px 12px;
  border: 1px solid var(--orv2-line);
  border-radius: 12px;
  background: var(--orv2-white);
  color: var(--orv2-muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.orv2-form-group small {
  display: block;
  margin-top: 6px;
  color: var(--orv2-muted);
}

.orv2-forgot-link,
.orv2-form-switch,
.orv2-form-description {
  color: var(--orv2-muted);
  font-size: 14px;
  margin-top: 20px;
}

.orv2-form-switch a,
.orv2-forgot-link a {
  color: var(--orv2-green-dark);
  font-weight: 600;
}

.orv2-form-actions {
  margin-top: 18px;
}

.orv2-button {
  appearance: none;
  display: inline-block;
  padding: 12px 22px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--orv2-font-medium);
  font-size: inherit;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: inherit;
  text-decoration: none !important;
  text-transform: uppercase;
  transition: background-color 140ms ease, transform 120ms ease;
}

.orv2-button:active {
  transform: scale(0.98);
}

.orv2-button--green {
  background: var(--orv2-green);
  color: #fff !important;
}

.orv2-button--green:hover {
  background: var(--orv2-green-dark);
}

.orv2-button--muted {
  background: #e8e8e8;
  color: #333 !important;
}

.orv2-message {
  min-height: 1.2em;
  margin: 10px 0;
  font-size: 14px;
}

.orv2-message.is-error {
  color: var(--orv2-danger);
}

.orv2-message.is-success {
  color: var(--orv2-green-dark);
}

.osmo-recommends-v2 {
  margin-bottom: 24px;
}

.orv2-refcodes-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
}

.orv2-refcodes-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.orv2-refcodes-pill {
  appearance: none;
  margin: 0;
  padding: 8px 14px;
  border: 1px solid var(--orv2-line)!important;
  border-radius: 999px;
  background: var(--orv2-white)!important;
  color: var(--orv2-heading)!important;
  cursor: pointer;
  font-family: var(--orv2-font-medium)!important;
  font-size: 0.82rem!important;
  font-weight: 600;
  letter-spacing: 0.02em!important;
  line-height: 1.2!important;
  transition:
    border-color 140ms ease,
    background-color 140ms ease,
    color 140ms ease;
}

.orv2-refcodes-pill:hover,
.orv2-refcodes-pill:focus-visible {
  border-color: var(--orv2-green);
  outline: none;
}

.orv2-refcodes-pill.is-active {
  border-color: var(--orv2-green);
  background: var(--orv2-green);
  color: var(--orv2-white);
}

.orv2-refcodes-pill--interior.is-active {
  border-color: #ffcc00!important;
  background: #ffcc00!important;
  color: #4b5563!important;
}

.orv2-refcodes-pill--exterior.is-active {
  border-color: #8dbe23!important;
  background: #8dbe23!important;
  color: var(--orv2-white)!important;
}

.orv2-refcodes-pill--other.is-active {
  border-color: #5b8ec7!important;
  background: #5b8ec7!important;
  color: var(--orv2-white)!important;
}

.orv2-refcodes-category {
  position: relative;
  display: inline-flex;
  min-width: min(100%, 220px);
  max-width: 100%;
}

.orv2-refcodes-category-select {
  appearance: none;
  width: 100%;
  margin: 0;
  padding: 8px 36px 8px 14px;
  border: 1px solid var(--orv2-line);
  border-radius: 999px;
  background-color: var(--orv2-white);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--orv2-muted) 50%),
    linear-gradient(135deg, var(--orv2-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  color: var(--orv2-heading);
  cursor: pointer;
  font-family: var(--orv2-font-medium);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
  transition:
    border-color 140ms ease,
    background-color 140ms ease,
    color 140ms ease;
}

.orv2-refcodes-category-select:hover,
.orv2-refcodes-category-select:focus-visible {
  border-color: var(--orv2-green);
  outline: none;
}

.orv2-refcodes-category-select.is-active {
  border-color: var(--orv2-green);
  background-color: #eaf6e8;
  color: var(--orv2-green-dark);
}

.orv2-refcodes-search-wrap {
  position: relative;
  width: min(100%, 480px);
  margin: 0 0 28px;
}

.orv2-refcodes-search-wrap::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 16px;
  width: 16px;
  height: 16px;
  border: 2px solid var(--orv2-muted);
  border-radius: 50%;
  transform: translateY(-60%);
  pointer-events: none;
  opacity: 0.7;
}

.orv2-refcodes-search-wrap::after {
  content: "";
  position: absolute;
  top: 58%;
  left: 30px;
  width: 7px;
  height: 2px;
  background: var(--orv2-muted);
  border-radius: 1px;
  transform: rotate(45deg);
  pointer-events: none;
  opacity: 0.7;
}

.orv2-refcodes-search,
.osmo-recommends-v2 input[type="search"].orv2-refcodes-search {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  margin: 0;
  padding: 15px 18px 15px 44px!important;
  border: 1px solid #708090;
  border-radius: 999px;
  background: #f7f7f7;
  color: var(--orv2-ink);
  font: inherit;
  letter-spacing: 0.02em;
  transition:
    border-color 140ms ease,
    background-color 140ms ease,
    box-shadow 140ms ease;
}

.orv2-refcodes-search::placeholder {
  color: var(--orv2-muted);
  opacity: 0.85;
}

.orv2-refcodes-search:hover {
  border-color: #c5cec3;
  background: var(--orv2-white);
}

.orv2-refcodes-search:focus {
  border-color: var(--orv2-green);
  background: var(--orv2-white);
  outline: none;
  box-shadow: 0 0 0 3px rgba(63, 165, 53, 0.18);
}

.orv2-refcodes-groups {
  display: grid;
  gap: 28px;
}

.orv2-refcodes-group-title {
  margin: 0 0 14px;
  padding: 18px 0 0 14px;
  border-top: 2px solid var(--orv2-line);
}

.orv2-refcodes-group--interior .orv2-refcodes-group-title {
  border-top-color: #ffcc00;
}

.orv2-refcodes-group--exterior .orv2-refcodes-group-title {
  border-top-color: #8dbe23;
}

.orv2-refcodes-group--other .orv2-refcodes-group-title {
  border-top-color: #5b8ec7;
}

.orv2-refcodes-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.orv2-refcodes-list button {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  padding: 16px 12px;
  border: 1px solid #708090;
  border-radius: 20px;
  background: #f6f6f6;
  color: #333;
  cursor: pointer;
  font-family: var(--orv2-font-light)!important;
  font-size: inherit!important;
  font-weight: 400;
  line-height: 1.35!important;
  text-align: center;
  box-shadow: none;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.orv2-refcodes-list button:hover,
.orv2-refcodes-list button:focus-visible {
  background: #ebf5ec;
  color: #222;
  outline: none;
  box-shadow: none;
}

.orv2-refcodes-empty {
  color: var(--orv2-muted);
}

@keyframes orv2-island-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes orv2-sheet-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media only screen and (max-width: 420px) {
  .orv2-bottom-toolbar {
    width: calc(100% - 26px);
    padding: 6px 6px;
    border-radius: 24px;
  }

  .orv2-toolbar-item span {
    font-size: 9px;
  }

  .orv2-toolbar-item img {
    width: 20px;
    height: 20px;
  }
}

@media only screen and (max-width: 560px) {
  .orv2-download-buttons {
    display: none;
  }

  .orv2-download-buttons-small {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 28px;
  }

  .orv2-download-buttons-small img {
    width: 115px;
    max-width: 115px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .orv2-bottom-toolbar,
  .orv2-modal-container,
  .orv2-toolbar-item a,
  .orv2-toolbar-item button,
  .orv2-toolbar-item img,
  .orv2-button {
    animation: none;
    transition: none;
  }
}

@media print {
  .orv2-bottom-toolbar,
  .orv2-modal {
    display: none !important;
  }
}
