/** Shopify CDN: Minification failed

Line 998:0 Unexpected "}"

**/
/**
 * RX Components Styles
 * Styles for the prescription product page Web Components
 * BEM Architecture - No Tailwind dependencies
 */

/* ============================================================================
   CSS VARIABLES
   ============================================================================ */

:root {
  /* Spacing scale - Mobile first */
  --rx-panel-gap: 1rem;
  --rx-section-gap: 0.75rem;
  --rx-grid-gap: 0.5rem;
  --rx-container-width: 90%;
  --rx-container-max: 500px;

  /* Z-index scale - header is z-index: 4, so stay below */
  --rx-z-base: 1;
  --rx-z-dropdown: 3;
  --rx-z-overlay: 3;
  --rx-z-drawer: 3;
  --rx-z-sticky: 3;
  --rx-z-modal: 3;

  /* Component variables */
  --rx-border-radius: 0;
  --rx-border-radius-lg: 8px;
  --rx-transition: 0.2s ease;
  --rx-touch-target: 44px;
}

/* Desktop spacing */
@media (min-width: 700px) {
  :root {
    --rx-panel-gap: 1.5rem;
    --rx-section-gap: 1rem;
    --rx-grid-gap: 0.75rem;
  }
}

/* ============================================================================
   SECTION & PAGE BASE
   ============================================================================ */

.rx-product-section {
  padding: 0;
  margin-bottom: 4rem;
}

@media (min-width: 700px) {
  .rx-product-section {
    margin-bottom: 6.25rem;
  }
}

.rx-product-page {
  display: block;
  font-family: var(--font-heading-family, inherit);
}

rx-product-page {
  display: block;
  font-family: var(--font-heading-family, inherit);
}

rx-product-page.initialized {
  opacity: 1;
  transition: opacity var(--rx-transition);
}

/* ============================================================================
   LAYOUT
   ============================================================================ */

.rx-product-layout {
  margin-bottom: 1.5rem;
}

@media (min-width: 700px) {
  .rx-product-layout {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0;
  }
}

@media (min-width: 1000px) {
  .rx-product-layout {
    gap: 1.5rem;
    padding-left: var(--page-gutter);
    padding-right: var(--page-gutter);
  }
}

@media (min-width: 1200px) {
  .rx-product-layout {
    gap: 2.5rem;
  }
}

/* ============================================================================
   PRODUCT MEDIA
   ============================================================================ */

.rx-product-media {
  position: relative;
  margin-bottom: 1rem;
  transition: top 0.5s ease-in-out;
}

@media (min-width: 700px) {
  .rx-product-media {
    margin-bottom: 1.5rem;
  }
}

@media (min-width: 700px) {
  .rx-product-media {
    width: 50%;
    max-width: 1330px;
    margin-bottom: 0;
  }
}

@media (min-width: 1000px) {
  .rx-product-media {
    position: sticky;
    top: var(--top-offset, 100px);
    z-index: var(--rx-z-base);
  }
}

.rx-product-media__frame-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem var(--page-gutter);
  background: rgb(var(--background, 255 255 255));
}

@media (min-width: 1000px) {
  .rx-product-media__frame-header {
    justify-content: space-between;
    padding: 1.5rem 0 1rem 0.5rem;
  }
}

.rx-product-media__frame-trigger {
  display: flex;
  justify-content: center;
  margin: 0 auto;
}

@media (min-width: 1000px) {
  .rx-product-media__frame-trigger {
    width: 33.333%;
  }
}

/* ============================================================================
   PRODUCT FORM WRAPPER
   ============================================================================ */

.rx-product-form {
  width: var(--rx-container-width);
  max-width: var(--rx-container-max);
  margin: 0 auto;
  padding: 0;
  transition: all 0.3s ease;
}

@media (min-width: 700px) {
  .rx-product-form {
    position: sticky;
    top: var(--header-height, 60px);
    z-index: 2;
    width: 50%;
    max-width: none;
    margin: 0;
    padding: 1rem 0 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
}

@media (min-width: 1000px) {
  .rx-product-form {
    padding-top: 1.5rem;
  }
}

/* Inner content wrapper for centering */
.rx-product-form > * {
  width: 100%;
  max-width: 500px;
}

/* ============================================================================
   RX OPTIONS PANEL - Main Container
   ============================================================================ */

.rx-options-panel {
  display: flex;
  flex-direction: column;
  gap: var(--rx-panel-gap);
}

.rx-options-panel__section {
  display: flex;
  flex-direction: column;
  gap: var(--rx-section-gap);
}

.rx-options-panel__section--frames {
  border: none;
  margin: 0;
  padding: 0;
}

.rx-options-panel__legend {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  margin-bottom: var(--rx-section-gap);
  padding: 0;
  width: 100%;
}

.rx-options-panel__legend-label {
  color: rgb(var(--text-color, 29 29 29) / 0.5);
}

.rx-options-panel__legend-value {
  font-weight: 700;
  text-transform: uppercase;
  color: rgb(var(--text-color, 29 29 29));
}

/* Legacy class support */
.rx-options-panel__section--frames legend {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  margin-bottom: var(--rx-section-gap);
  padding: 0;
}

.rx-options-panel__section--frames legend .label {
  color: rgb(var(--text-color, 29 29 29) / 0.5);
}

.rx-options-panel__section--frames legend .value {
  font-weight: 700;
  text-transform: uppercase;
  color: rgb(var(--text-color, 29 29 29));
}

.rx-options-panel__section--colors {
  position: relative;
  z-index: var(--rx-z-base);
}

.rx-options-panel__section--options {
  padding: 0.5rem;
  border-radius: var(--rx-border-radius-lg);
  background-color: #f2f2f2;
}

.rx-options-panel__grid--2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--rx-grid-gap);
  position: relative;
  z-index: 2;
}

/* ============================================================================
   RX PRODUCT FORM HEADER
   ============================================================================ */

.rx-product-form__header {
  display: none;
  margin-bottom: 1.25rem;
  gap: 1.25rem;
  min-height: 61px;
}

@media (min-width: 1000px) {
  .rx-product-form__header {
    display: flex;
    flex-direction: column;
  }
}

.rx-product-form__header-content {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.rx-product-form__header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.rx-product-form__title-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.rx-product-form__title {
  margin: 0 0 0.5rem;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  text-transform: capitalize;
  color: rgb(var(--text-color, 29 29 29));
}

.rx-product-form__subtitle {
  display: block;
  max-width: 280px;
  font-family: var(--font-body-family, inherit);
  font-size: 0.875rem;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: rgb(var(--text-color, 29 29 29) / 0.4);
}

.rx-product-form__price-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.rx-product-form__atc {
  display: flex;
  flex-direction: column;
}

.rx-product-form__description {
  margin-top: var(--rx-panel-gap);
  font-size: 0.8125rem;
  line-height: 1.5;
}

@media (min-width: 700px) {
  .rx-product-form__description {
    font-size: 0.875rem;
    line-height: 1.6;
  }
}

.rx-product-form__sku {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: rgb(var(--text-color, 29 29 29) / 0.5);
}

@media (min-width: 700px) {
  .rx-product-form__sku {
    margin-top: 1rem;
  }
}

/* ============================================================================
   RX ACCORDIONS
   ============================================================================ */

.rx-accordions {
  display: flex;
  flex-direction: column;
  margin-top: var(--rx-panel-gap);
  border-top: 1px solid rgb(var(--text-color, 29 29 29) / 0.1);
}

.rx-accordion {
  border-bottom: 1px solid rgb(var(--text-color, 29 29 29) / 0.1);
}

.rx-accordion__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem 0;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

@media (min-width: 700px) {
  .rx-accordion__header {
    gap: 1rem;
    padding: 1.25rem 0;
  }
}

.rx-accordion__header::-webkit-details-marker {
  display: none;
}

.rx-accordion__header::marker {
  display: none;
  content: '';
}

.rx-accordion__title {
  font-family: var(--font-heading-family, inherit);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgb(var(--text-color, 29 29 29));
  line-height: 1.3;
}

@media (min-width: 700px) {
  .rx-accordion__title {
    font-size: 0.875rem;
  }
}

.rx-accordion__icon {
  position: relative;
  flex-shrink: 0;
  width: 10px;
  height: 10px;
}

@media (min-width: 700px) {
  .rx-accordion__icon {
    width: 12px;
    height: 12px;
  }
}

.rx-accordion__icon::before,
.rx-accordion__icon::after {
  content: '';
  position: absolute;
  background: rgb(var(--text-color, 29 29 29));
  transition: transform 0.3s ease;
}

/* Horizontal line */
.rx-accordion__icon::before {
  top: 50%;
  left: 0;
  width: 100%;
  height: 1.5px;
  transform: translateY(-50%);
}

/* Vertical line */
.rx-accordion__icon::after {
  top: 0;
  left: 50%;
  width: 1.5px;
  height: 100%;
  transform: translateX(-50%);
}

/* Open state - rotate vertical line to form minus */
.rx-accordion[open] .rx-accordion__icon::after {
  transform: translateX(-50%) rotate(90deg);
}

.rx-accordion__content {
  padding: 0 0 1rem 0;
  font-family: var(--font-body-family, inherit);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: rgb(var(--text-color, 29 29 29) / 0.75);
}

@media (min-width: 700px) {
  .rx-accordion__content {
    padding: 0 0 1.25rem 0;
    font-size: 0.875rem;
    line-height: 1.6;
  }
}

.rx-accordion__content p {
  margin: 0 0 1rem;
}

.rx-accordion__content p:last-child {
  margin-bottom: 0;
}

.rx-accordion__content ul,
.rx-accordion__content ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.rx-accordion__content li {
  margin-bottom: 0.5rem;
}

.rx-accordion__content li:last-child {
  margin-bottom: 0;
}

.rx-accordion__content a {
  color: rgb(var(--text-color, 29 29 29));
  text-decoration: underline;
  text-underline-offset: 2px;
}

.rx-accordion__content a:hover {
  text-decoration: none;
}

/* Focus state */
.rx-accordion__header:focus-visible {
  outline: 2px solid rgb(var(--text-color, 29 29 29));
  outline-offset: 2px;
}

/* Hover state */
.rx-accordion__header:hover .rx-accordion__title {
  color: rgb(var(--text-color, 29 29 29) / 0.7);
}

/* Legacy class support */
.rx-product-form__accordions {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: var(--rx-panel-gap);
}

.rx-product-form__atc-button {
  width: 100%;
}

/* ============================================================================
   GALLERY STYLES
   ============================================================================ */

rx-gallery {
  display: block;
}

.rx-gallery__mobile {
  padding: 0 5%;
  background: rgb(var(--background, 255 255 255));
}

@media (min-width: 700px) {
  .rx-gallery__mobile {
    padding: 0 var(--page-gutter);
  }
}

@media (min-width: 1000px) {
  .rx-gallery__mobile {
    display: none;
  }
}

.rx-gallery__swiper {
  border-radius: var(--rx-border-radius-lg);
  margin: 0 -1px;
}

.rx-gallery__slide {
  overflow: hidden;
  border-radius: var(--rx-border-radius-lg);
}

.rx-gallery__mobile .swiper-slide {
  height: auto !important;
}

.rx-gallery__image-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: var(--rx-border-radius-lg);
  background: rgb(var(--background, 255 255 255));
}

/* Mobile: cropped rectangle (15% top + 15% bottom = landscape) */
@media (max-width: 999px) {
  .rx-gallery__mobile .rx-gallery__slide,
  .rx-gallery__mobile .rx-gallery__image-wrapper {
    height: 180px !important;
    max-height: 180px !important;
  }

  .rx-gallery__mobile .rx-gallery__image {
    position: absolute !important;
    top: 50% !important;
    left: 0 !important;
    transform: translateY(-50%) !important;
    width: 100% !important;
    height: auto !important;
    min-height: 140% !important;
    object-fit: cover !important;
    object-position: center center !important;
  }
}

@media (min-width: 480px) and (max-width: 999px) {
  .rx-gallery__mobile .rx-gallery__slide,
  .rx-gallery__mobile .rx-gallery__image-wrapper {
    height: 220px !important;
    max-height: 220px !important;
  }
}

.rx-gallery__scrollbar-wrapper {
  padding: 0 0.5rem;
}

.rx-gallery__scrollbar {
  position: relative !important;
  bottom: 0 !important;
  height: 4px !important;
  margin-top: 0.5rem !important;
  padding: 0 !important;
  background: rgba(0, 0, 0, 0.1);
  --swiper-pagination-color: rgba(0, 0, 0, 0.5);
}

.rx-gallery__desktop {
  display: none;
}

@media (min-width: 1000px) {
  .rx-gallery__desktop {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.625rem;
  }

  .rx-gallery__desktop--no-header {
    padding-top: 1.5rem;
  }
}

.rx-gallery__grid-item {
  display: flex;
  width: 100%;
  flex-shrink: 0;
  overflow: hidden;
  background: #f8f8f8;
  border-radius: 12px;
}

.rx-gallery__grid-item--featured {
  grid-column: span 2;
}

.rx-gallery__grid-image-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  flex-basis: 100%;
  background: rgb(var(--background, 255 255 255));
}

@media (min-width: 1200px) {
  .rx-gallery__grid-image-wrapper {
    max-height: 700px;
  }
}

@media (min-width: 2560px) {
  .rx-gallery__grid-image-wrapper {
    max-height: none;
  }
}

.rx-gallery__image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 1000px;
  object-fit: cover;
  object-position: center;
}

/* Legacy selectors for backwards compatibility */
rx-gallery [data-mobile-slider] {
  border-radius: var(--rx-border-radius-lg);
  overflow: hidden;
}

rx-gallery [data-desktop-grid] {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

rx-gallery [data-desktop-grid] > div:first-child {
  grid-column: span 2;
}

rx-gallery img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* ============================================================================
   LENS SELECTOR TABS
   ============================================================================ */

rx-lens-selector {
  display: block;
  margin-bottom: var(--rx-panel-gap);
}

rx-lens-selector[hidden] {
  display: none;
}

.rx-lens-selector__tabs {
  display: flex;
  align-items: center;
  width: 100%;
}

.rx-lens-selector__tab {
  position: relative;
  flex: 1;
  min-height: 40px;
  padding: 0.5rem 0.25rem;
  background: rgb(var(--background, 255 255 255));
  border: none;
  cursor: pointer;
  font-family: var(--font-heading-family, inherit);
  font-size: 0.75rem;
  line-height: 1;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: rgb(var(--text-color, 29 29 29));
  transition: all var(--rx-transition);
}

@media (min-width: 700px) {
  .rx-lens-selector__tab {
    min-height: var(--rx-touch-target);
    padding: 0.625rem 0.5rem;
    font-size: 0.875rem;
  }
}

.rx-lens-selector__tab::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 1px;
  width: 100%;
  background: rgb(var(--text-color, 29 29 29) / 0.3);
  transition: all var(--rx-transition);
}

.rx-lens-selector__tab:hover::after {
  background: rgb(var(--text-color, 29 29 29) / 0.5);
}

.rx-lens-selector__tab:focus-visible {
  outline: 2px solid rgb(var(--text-color, 29 29 29));
  outline-offset: -2px;
}

.rx-lens-selector__tab[aria-selected="true"]::after {
  height: 2px;
  background: rgb(var(--text-color, 29 29 29));
}

.rx-lens-selector__tab[aria-selected="true"] {
  font-weight: 500;
}

@media (min-width: 1000px) {
  .rx-lens-selector__tab {
    font-size: 1.125rem;
  }
}

/* ============================================================================
   VISION SELECTOR TABS (Single Vision / Progressive)
   ============================================================================ */

rx-vision-selector {
  display: block;
  margin-bottom: var(--rx-section-gap);
}

rx-vision-selector[hidden] {
  display: none;
}

.rx-vision-selector__tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem;
  background: rgb(var(--text-color, 29 29 29) / 0.04);
  border-radius: 8px;
}

@media (min-width: 700px) {
  .rx-vision-selector__tabs {
    gap: 0.625rem;
    padding: 0.5rem;
  }
}

.rx-vision-selector__tab {
  position: relative;
  flex: 1;
  min-height: 36px;
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-heading-family, inherit);
  font-size: 0.75rem;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgb(var(--text-color, 29 29 29) / 0.65);
  transition: all var(--rx-transition);
}

@media (min-width: 700px) {
  .rx-vision-selector__tab {
    min-height: 40px;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
  }
}

.rx-vision-selector__tab:hover {
  color: rgb(var(--text-color, 29 29 29) / 0.85);
  background: rgb(var(--background, 255 255 255) / 0.5);
}

.rx-vision-selector__tab:focus-visible {
  outline: 2px solid rgb(var(--text-color, 29 29 29));
  outline-offset: -2px;
}

.rx-vision-selector__tab[aria-selected="true"] {
  background: rgb(var(--background, 255 255 255));
  color: rgb(var(--text-color, 29 29 29));
  font-weight: 600;
  box-shadow: 0 1px 3px rgb(var(--text-color, 29 29 29) / 0.1);
}

@media (min-width: 1000px) {
  .rx-vision-selector__tab {
    font-size: 0.9375rem;
  }
}

/* ============================================================================
   COLOR PICKER DROPDOWN
   ============================================================================ */

rx-color-picker {
  display: block;
  position: relative;
  z-index: var(--rx-z-base);
}

rx-color-picker[hidden] {
  display: none;
}

rx-color-picker[open] {
  z-index: var(--rx-z-dropdown);
}

.rx-color-picker__wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rx-color-picker__label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgb(var(--text-color, 29 29 29));
}

@media (min-width: 700px) {
  .rx-color-picker__label {
    font-size: 0.875rem;
  }
}

.rx-color-picker__trigger {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 40px;
  padding: 0.5rem 0.625rem;
  background: rgb(var(--background, 255 255 255));
  border: 1px solid rgb(var(--border-color, 29 29 29) / 0.15);
  border-radius: var(--rx-border-radius);
  cursor: pointer;
  transition: border-color var(--rx-transition), box-shadow var(--rx-transition);
  text-align: left;
  box-shadow: 0 1px 3px rgb(var(--text-color, 29 29 29) / 0.08);
}

@media (min-width: 700px) {
  .rx-color-picker__trigger {
    gap: 0.75rem;
    min-height: var(--rx-touch-target);
    padding: 0.65rem 0.8rem;
  }
}

.rx-color-picker__trigger:hover {
  border-color: rgb(var(--border-color, 29 29 29) / 0.3);
}

.rx-color-picker__trigger:focus-visible {
  border-color: rgb(var(--text-color, 29 29 29));
  outline: 2px solid rgb(var(--text-color, 29 29 29));
  outline-offset: 2px;
}

rx-color-picker[open] .rx-color-picker__trigger {
  border-color: rgb(var(--text-color, 29 29 29));
}

.rx-color-picker__swatch {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgb(var(--border-color, 29 29 29) / 0.15);
  background-size: cover;
  background-position: center;
}

@media (min-width: 700px) {
  .rx-color-picker__swatch {
    width: 24px;
    height: 24px;
  }
}

.rx-color-picker__value {
  flex: 1;
  font-size: 0.75rem;
  color: rgb(var(--text-color, 29 29 29) / 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 700px) {
  .rx-color-picker__value {
    font-size: 0.875rem;
  }
}
}

.rx-color-picker__price {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: rgb(var(--text-color, 29 29 29));
}

.rx-color-picker__chevron {
  flex-shrink: 0;
  margin-left: auto;
  color: rgb(var(--text-color, 29 29 29) / 0.65);
  transition: transform var(--rx-transition);
}

rx-color-picker[open] .rx-color-picker__chevron {
  transform: rotate(180deg);
}

.rx-color-picker__dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: var(--rx-z-dropdown);
  background: rgb(var(--background, 255 255 255));
  border: 1px solid rgb(var(--border-color, 29 29 29) / 0.15);
  box-shadow: 2px 2px 6px rgb(var(--text-color, 29 29 29) / 0.05);
  max-height: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;
  /* Hide scrollbar */
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.rx-color-picker__dropdown::-webkit-scrollbar {
  display: none;
}

.rx-color-picker__option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: var(--rx-touch-target);
  padding: 0.75rem 0.8rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgb(var(--border-color, 29 29 29) / 0.08);
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s ease;
}

.rx-color-picker__option:last-child {
  border-bottom: none;
}

.rx-color-picker__option:hover {
  background-color: rgb(var(--text-color, 29 29 29) / 0.03);
}

.rx-color-picker__option:hover .rx-color-picker__value {
  color: rgb(var(--text-color, 29 29 29));
}

.rx-color-picker__option:focus-visible {
  outline: 2px solid rgb(var(--text-color, 29 29 29));
  outline-offset: -2px;
  background-color: rgb(var(--text-color, 29 29 29) / 0.03);
}

.rx-color-picker__option[aria-selected="true"] {
  background-color: rgb(var(--text-color, 29 29 29) / 0.05);
}

.rx-color-picker__option[aria-selected="true"] .rx-color-picker__value {
  font-weight: 600;
  color: rgb(var(--text-color, 29 29 29));
}

/* Backdrop element (hidden on desktop) */
.rx-color-picker__backdrop {
  display: none;
}

/* Mobile bottom sheet */
@media (max-width: 999px) {
  rx-color-picker[open] {
    z-index: 9999 !important;
  }

  .rx-color-picker__backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgb(var(--text-color, 29 29 29) / 0.5);
    z-index: 9998;
    animation: rx-fade-in var(--rx-transition);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  rx-color-picker[open] .rx-color-picker__dropdown {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    max-height: 60vh;
    border-radius: 16px 16px 0 0;
    padding-top: 0.5rem;
    padding-bottom: env(safe-area-inset-bottom, 0);
    animation: rx-slide-up 0.3s ease;
    box-shadow: 0 -4px 20px rgb(0 0 0 / 0.15);
  }

  rx-color-picker .rx-color-picker__option {
    padding: 1rem 1.25rem;
  }
}

/* ============================================================================
   FRAME SELECTOR GRID
   ============================================================================ */

rx-frame-selector {
  display: block;
}

rx-frame-selector[hidden] {
  display: none;
}

.rx-frame-selector__wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--rx-section-gap);
}

.rx-frame-selector__label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

@media (min-width: 700px) {
  .rx-frame-selector__label {
    gap: 0.375rem;
    font-size: 0.875rem;
  }
}

.rx-frame-selector__label-text {
  color: rgb(var(--text-color, 29 29 29) / 0.5);
}

.rx-frame-selector__label-value {
  font-weight: 700;
  text-transform: uppercase;
  color: rgb(var(--text-color, 29 29 29));
}

.rx-frame-selector__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.375rem;
}

@media (min-width: 700px) {
  .rx-frame-selector__grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
  }
}

.rx-frame-selector__item {
  width: 100%;
  max-width: 75px;
  padding: 0;
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  overflow: hidden;
  transition: border-color var(--rx-transition);
}

.rx-frame-selector__item:hover {
  border-color: rgb(var(--text-color, 29 29 29) / 0.3);
}

.rx-frame-selector__item:focus-visible {
  outline: 2px solid rgb(var(--text-color, 29 29 29));
  outline-offset: 2px;
}

.rx-frame-selector__item[aria-selected="true"] {
  border-color: rgb(var(--text-color, 29 29 29));
}

.rx-frame-selector__item img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.rx-frame-selector__item.is-selected {
  border-color: rgb(var(--text-color, 29 29 29));
}

/* Loading state */
rx-frame-selector.is-loading {
  opacity: 0.6;
  pointer-events: none;
}

rx-frame-selector.is-loading .rx-frame-selector__grid {
  position: relative;
}

rx-frame-selector.is-loading .rx-frame-selector__grid::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgb(var(--background, 255 255 255) / 0.5);
}

/* ============================================================================
   LENS OPTIONS BUTTONS
   ============================================================================ */

rx-lens-options {
  display: block;
}

rx-lens-options[hidden] {
  display: none;
}

.rx-lens-options__group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: var(--rx-section-gap);
}

@media (min-width: 700px) {
  .rx-lens-options__group {
    gap: 0.5rem;
    margin-bottom: var(--rx-panel-gap);
  }
}

.rx-lens-options__group:last-child {
  margin-bottom: 0;
}

.rx-lens-options__label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgb(var(--text-color, 29 29 29));
}

@media (min-width: 700px) {
  .rx-lens-options__label {
    gap: 0.375rem;
    font-size: 0.875rem;
  }
}

.rx-lens-options__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.375rem;
}

@media (min-width: 700px) {
  .rx-lens-options__grid {
    gap: 0.5rem;
  }
}

.rx-lens-options__button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  height: 100%;
  min-height: 38px;
  padding: 0.5rem 1.25rem 0.5rem 0.5rem;
  background: rgb(var(--background, 255 255 255));
  border: 1px solid rgb(var(--text-color, 29 29 29));
  border-radius: 4px;
  text-align: left;
  cursor: pointer;
  color: rgb(var(--text-color, 29 29 29));
  transition: all var(--rx-transition);
}

@media (min-width: 700px) {
  .rx-lens-options__button {
    gap: 2rem;
    min-height: var(--rx-touch-target);
    padding: 0.625rem 1.5rem 0.625rem 0.625rem;
  }
}

.rx-lens-options__button:hover {
  background-color: rgb(var(--text-color, 29 29 29) / 0.02);
}

.rx-lens-options__button:focus-visible {
  outline: 2px solid rgb(var(--text-color, 29 29 29));
  outline-offset: 2px;
}

.rx-lens-options__button[aria-selected="true"] {
  background: rgb(var(--text-color, 29 29 29));
  color: rgb(var(--background, 255 255 255));
}

.rx-lens-options__button-content {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

@media (min-width: 700px) {
  .rx-lens-options__button-content {
    gap: 0.625rem;
  }
}

.rx-lens-options__button-title {
  display: block;
  font-family: var(--font-heading-family, inherit);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
  text-transform: uppercase;
}

@media (min-width: 700px) {
  .rx-lens-options__button-title {
    font-size: 1rem;
  }
}

.rx-lens-options__button-description {
  display: none;
  font-family: var(--font-body-family, inherit);
  font-size: 0.6875rem;
  font-weight: 400;
}

@media (min-width: 700px) {
  .rx-lens-options__button-description {
    display: block;
    font-size: 0.75rem;
  }
}

.rx-lens-options__button-price {
  position: absolute;
  top: 0;
  right: 0;
  padding: 0.1875rem 0.3125rem;
  background: rgb(var(--text-color, 29 29 29));
  color: rgb(var(--background, 255 255 255));
  font-size: 0.625rem;
  font-weight: 700;
  border-radius: 0 4px 0 4px;
  transition: all var(--rx-transition);
}

@media (min-width: 700px) {
  .rx-lens-options__button-price {
    padding: 0.25rem 0.375rem;
    font-size: 0.75rem;
  }
}

.rx-lens-options__button[aria-selected="true"] .rx-lens-options__button-price {
  background: rgb(var(--background, 255 255 255));
  color: rgb(var(--text-color, 29 29 29));
}

/* ============================================================================
   FRAME POPUP
   ============================================================================ */

rx-frame-popup {
  display: block;
}

rx-frame-popup[hidden] {
  display: none;
}

.rx-frame-popup__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100dvh - var(--header-height, 60px));
  background: rgb(var(--background, 255 255 255) / 0.75);
  backdrop-filter: blur(6px);
  z-index: var(--rx-z-base);
  overflow: hidden;
}

.rx-frame-popup__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  padding: 0.75rem;
  overflow-y: auto;
  height: 100%;
  /* Hide scrollbar */
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.rx-frame-popup__grid::-webkit-scrollbar {
  display: none;
}

@media (min-width: 700px) {
  .rx-frame-popup__grid {
    padding: 2rem;
  }
}

@media (min-width: 1000px) {
  .rx-frame-popup__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.rx-frame-popup__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 0;
  background: none;
  border: none;
}

.rx-frame-popup__item-image {
  position: relative;
  width: 100%;
  max-width: 190px;
  overflow: hidden;
  border-radius: 4px;
  margin-bottom: 0.5rem;
  border: 1px solid rgb(var(--text-color, 29 29 29) / 0.1);
  transition: border-color var(--rx-transition);
}

.rx-frame-popup__item:hover .rx-frame-popup__item-image,
.rx-frame-popup__item[aria-selected="true"] .rx-frame-popup__item-image {
  border-color: rgb(var(--text-color, 29 29 29));
}

.rx-frame-popup__item:focus-visible {
  outline: none;
}

.rx-frame-popup__item:focus-visible .rx-frame-popup__item-image {
  outline: 2px solid rgb(var(--text-color, 29 29 29));
  outline-offset: 2px;
}

.rx-frame-popup__item img {
  display: block;
  width: 100%;
}

.rx-frame-popup__item-title {
  font-family: var(--font-heading-family, inherit);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.05em;
  text-transform: capitalize;
  color: rgb(var(--text-color, 29 29 29));
}

/* ============================================================================
   PRESCRIPTION DRAWER
   ============================================================================ */

rx-prescription-drawer {
  display: block;
}

rx-prescription-drawer[hidden] {
  display: none;
}

.rx-prescription-drawer__overlay {
  position: fixed;
  inset: 0;
  top: 0; /* Cover entire screen to escape parent stacking context */
  background: rgb(var(--background, 255 255 255));
  z-index: 9999; /* High z-index to ensure visibility above all elements */
  overflow: visible;
  color: rgb(var(--text-color, 29 29 29));
  animation: rx-fade-in var(--rx-transition);
  display: flex;
  flex-direction: column;
}

.rx-prescription-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.5rem;
  border-bottom: 1px solid rgb(var(--border-color, 29 29 29) / 0.1);
  flex-shrink: 0;
}

.rx-prescription-drawer__back {
  display: flex;
  padding: 1rem;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1;
  color: inherit;
}

.rx-prescription-drawer__close {
  padding: 1rem;
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
}

.rx-prescription-drawer__content {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  padding: 1.5rem;
  padding-bottom: 120px; /* Space for fixed button */
  max-width: 440px;
  width: 100%;
  flex: 1;
  min-height: 0; /* Important for flex scroll */
}

@media (min-width: 700px) {
  .rx-prescription-drawer__content {
    max-width: 560px;
  }
}

.rx-prescription-drawer__content::-webkit-scrollbar {
  display: none;
}

.rx-prescription-drawer__content {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.rx-prescription-drawer__step {
  display: flex;
  flex-direction: column;
}

.rx-prescription-drawer__step--initial {
  text-align: center;
}

.rx-prescription-drawer__title {
  font-size: 1.25rem;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.2;
  text-align: center;
  margin: 0 0 0.75rem;
}

@media (min-width: 700px) {
  .rx-prescription-drawer__title {
    font-size: 1.5rem;
  }
}

.rx-prescription-drawer__subtitle {
  font-family: var(--font-body-family, inherit);
  font-size: 0.875rem;
  line-height: 1.4;
  text-align: center;
  margin: 0;
  color: rgb(var(--text-color, 29 29 29) / 0.6);
}

@media (min-width: 700px) {
  .rx-prescription-drawer__subtitle {
    font-size: 1rem;
  }
}

/* Step Layout */
.rx-prescription-drawer__step-header {
  margin-bottom: 2rem;
}

.rx-prescription-drawer__step-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.rx-prescription-drawer__step-actions .button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rx-prescription-drawer__step-actions .button svg {
  flex-shrink: 0;
}

.rx-prescription-drawer__or {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgb(var(--text-color, 29 29 29) / 0.4);
  text-align: center;
}

.rx-prescription-drawer__step-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-top: 1px solid rgb(var(--border-color, 29 29 29) / 0.1);
  border-bottom: 1px solid rgb(var(--border-color, 29 29 29) / 0.1);
  margin-bottom: 1.5rem;
}

.rx-prescription-drawer__step-summary .rx-prescription-drawer__subtitle {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgb(var(--text-color, 29 29 29) / 0.5);
}

.rx-prescription-drawer__step-summary .rx-prescription-drawer__title {
  margin: 0;
  font-size: 1.25rem;
}

.rx-prescription-drawer__step-checkout {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: center;
}

.rx-prescription-drawer__step-checkout .button {
  padding: 1rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rx-prescription-drawer__step-checkout .rx-prescription-drawer__subtitle {
  font-size: 0.75rem;
  color: rgb(var(--text-color, 29 29 29) / 0.4);
  letter-spacing: 0.05em;
}

/* Fixed Footer for Manual Step */
.rx-prescription-drawer__footer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0));
  background: rgb(var(--background, 255 255 255));
  border-top: 1px solid rgb(var(--text-color, 29 29 29) / 0.08);
  box-shadow: 0 -4px 20px rgb(var(--text-color, 29 29 29) / 0.06);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.rx-prescription-drawer__footer-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  color: rgb(var(--text-color, 29 29 29) / 0.6);
}

.rx-prescription-drawer__footer-price {
  font-size: 1.125rem;
  font-weight: 700;
  color: rgb(var(--text-color, 29 29 29));
}

.rx-prescription-drawer__footer-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  min-height: 48px;
  padding: 0.875rem 1.5rem;
  background: rgb(var(--text-color, 29 29 29));
  color: rgb(var(--background, 255 255 255));
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: opacity var(--rx-transition), transform var(--rx-transition);
}

.rx-prescription-drawer__footer-btn:hover {
  opacity: 0.9;
}

.rx-prescription-drawer__footer-btn:active {
  transform: scale(0.98);
}

.rx-prescription-drawer__footer-btn:focus-visible {
  outline: 2px solid rgb(var(--text-color, 29 29 29));
  outline-offset: 2px;
}

.rx-prescription-drawer__footer-btn svg {
  flex-shrink: 0;
}

/* Loader overlay */
.rx-prescription-drawer__loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  background: rgb(var(--background, 255 255 255));
  z-index: 10;
}

.rx-loader {
  display: flex;
  align-items: center;
  justify-content: center;
}

.rx-loader__spinner {
  width: 48px;
  height: 48px;
  animation: rx-spin 1s linear infinite;
  color: rgb(var(--text-color, 29 29 29));
}

.rx-loader__spinner circle {
  stroke-dasharray: 90, 150;
  stroke-dashoffset: 0;
  stroke-linecap: round;
  opacity: 0.3;
}

.rx-prescription-drawer__loader-text {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  color: rgb(var(--text-color, 29 29 29) / 0.7);
  text-align: center;
}

@keyframes rx-spin {
  100% {
    transform: rotate(360deg);
  }
}

/* ============================================================================
   FILE UPLOAD
   ============================================================================ */

rx-file-upload {
  display: block;
}

rx-file-upload.drag-over {
  background: rgb(var(--text-color, 29 29 29) / 0.02);
  border: 2px dashed rgb(var(--text-color, 29 29 29));
  border-radius: var(--rx-border-radius-lg);
}

/* Empty state - before file selected */
.rx-file-upload__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem 1rem;
  text-align: center;
}

.rx-file-upload__icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.rx-file-upload__icon svg {
  width: 64px;
  height: 64px;
  opacity: 0.3;
  stroke-width: 1;
}

.rx-file-upload__empty .button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.rx-file-upload__hint {
  font-size: 0.875rem;
  color: rgb(var(--text-color, 29 29 29) / 0.5);
  margin: 0;
}

/* Success state - after file selected */
.rx-file-upload__success {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.rx-file-upload__success .rx-prescription-drawer__title {
  font-size: 1rem;
  margin-bottom: 0;
}

.rx-file-upload__success .button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rx-file-upload__preview {
  padding: 1rem;
  border: 1px solid rgb(34 197 94 / 0.3);
  background: rgb(34 197 94 / 0.05);
  border-radius: 8px;
}

.rx-file-upload__preview-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.rx-file-upload__preview-header svg {
  flex-shrink: 0;
  opacity: 0.5;
}

.rx-file-upload__preview-name {
  flex: 1;
  font-size: 0.875rem;
  color: rgb(var(--text-color, 29 29 29) / 0.7);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rx-file-upload__preview-remove {
  flex-shrink: 0;
  padding: 0.25rem;
  background: none;
  border: none;
  cursor: pointer;
  color: rgb(var(--text-color, 29 29 29) / 0.5);
  transition: color var(--rx-transition);
}

.rx-file-upload__preview-remove:hover {
  color: rgb(239 68 68);
}

.rx-file-upload__preview-image {
  margin-top: 1rem;
  border-radius: 4px;
  overflow: hidden;
}

.rx-file-upload__preview-image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: contain;
}

/* ============================================================================
   MANUAL FORM - Compact Table Design
   ============================================================================ */

rx-manual-form {
  display: block;
}

.rx-manual-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Table Layout */
.rx-manual-form__table {
  display: flex;
  flex-direction: column;
  background: #fafafa;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgb(var(--text-color, 29 29 29) / 0.08);
}

.rx-manual-form__table-header {
  display: grid;
  grid-template-columns: 70px 1fr 1fr;
  gap: 0.5rem;
  padding: 0.625rem 0.75rem;
  background: rgb(var(--text-color, 29 29 29) / 0.04);
  border-bottom: 1px solid rgb(var(--text-color, 29 29 29) / 0.08);
}

.rx-manual-form__table-row {
  display: grid;
  grid-template-columns: 70px 1fr 1fr;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgb(var(--text-color, 29 29 29) / 0.06);
}

.rx-manual-form__table-row:last-child {
  border-bottom: none;
}

.rx-manual-form__table-col {
  display: flex;
  align-items: center;
}

.rx-manual-form__table-col--label {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgb(var(--text-color, 29 29 29) / 0.7);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.rx-manual-form__table-col--value {
  justify-content: center;
}

.rx-manual-form__eye-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: rgb(var(--text-color, 29 29 29) / 0.5);
  text-align: center;
  width: 100%;
}

/* Compact Input Style */
.rx-form-input {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--rx-transition);
  min-height: 60px;
  background: rgb(var(--background, 255 255 255));
}

.rx-form-input--compact {
  min-height: 40px;
  padding: 0.5rem 0.625rem;
  border-radius: 6px;
  flex-direction: row;
  gap: 0.375rem;
}

.rx-form-input--compact .rx-form-input__value {
  font-size: 0.875rem;
  font-weight: 500;
}

.rx-form-input--filled {
  background: rgb(var(--text-color, 29 29 29) / 0.03);
  border-color: rgb(var(--text-color, 29 29 29) / 0.2);
}

.rx-form-input--filled .rx-form-input__value {
  color: rgb(var(--text-color, 29 29 29));
  font-weight: 600;
}

.rx-form-input:hover,
.rx-form-input:focus {
  border-color: rgb(var(--text-color, 29 29 29));
  outline: none;
  background: rgb(var(--text-color, 29 29 29) / 0.02);
}

.rx-form-input:focus-visible {
  outline: 2px solid rgb(var(--text-color, 29 29 29));
  outline-offset: 2px;
}

.rx-form-input__label {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgb(var(--text-color, 29 29 29) / 0.4);
  margin-bottom: 0.25rem;
}

.rx-form-input__mini-label {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  color: rgb(var(--text-color, 29 29 29) / 0.35);
}

.rx-form-input__value {
  font-size: 0.9375rem;
  font-weight: 500;
  color: rgb(var(--text-color, 29 29 29) / 0.6);
}

.rx-form-input--full {
  width: 100%;
}

/* Required field indicator */
.rx-manual-form__required {
  color: #dc2626;
  margin-left: 0.125rem;
  font-weight: 700;
}

.rx-manual-form__table-row--required .rx-manual-form__table-col--label span {
  color: rgb(var(--text-color, 29 29 29));
  font-weight: 600;
}

/* Error state for required fields */
.rx-form-input--error {
  border-color: #dc2626 !important;
  background: rgb(220 38 38 / 0.03);
}

.rx-form-input--error .rx-form-input__value {
  color: #dc2626;
}

/* PD Section */
.rx-manual-form__pd-section {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 0.875rem;
  background: #fafafa;
  border-radius: 8px;
  border: 1px solid rgb(var(--text-color, 29 29 29) / 0.08);
}

.rx-manual-form__pd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.rx-manual-form__pd-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: rgb(var(--text-color, 29 29 29) / 0.7);
}

.rx-manual-form__pd-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.rx-manual-form__pd-inputs .rx-form-input--full {
  grid-column: span 2;
}

/* Measure PD Button */
.rx-manual-form__measure-pd-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  margin-top: 0.75rem;
  background: transparent;
  border: 1px dashed rgb(var(--text-color, 29 29 29) / 0.3);
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgb(var(--text-color, 29 29 29) / 0.7);
  cursor: pointer;
  transition: all 0.2s ease;
}

.rx-manual-form__measure-pd-btn:hover {
  border-color: rgb(var(--text-color, 29 29 29) / 0.5);
  color: rgb(var(--text-color, 29 29 29));
  background: rgb(var(--text-color, 29 29 29) / 0.03);
}

.rx-manual-form__measure-pd-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* PD Iframe Overlay */
.rx-pd-iframe-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(255 255 255 / 0.95);
  backdrop-filter: blur(8px);
  animation: rx-fade-in 0.2s ease;
}

.rx-pd-iframe-container {
  position: relative;
  width: min(90vw, 600px);
  height: min(85vh, 700px);
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

.rx-pd-iframe-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.rx-pd-iframe-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgb(0 0 0 / 0.05);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease;
}

.rx-pd-iframe-close:hover {
  background: rgb(0 0 0 / 0.1);
}

.rx-pd-iframe-close svg {
  width: 20px;
  height: 20px;
  color: #333;
}

/* Toggle Switch */
.rx-manual-form__toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.rx-manual-form__toggle input {
  position: relative;
  width: 36px;
  height: 20px;
  appearance: none;
  background: rgb(var(--text-color, 29 29 29) / 0.15);
  border-radius: 10px;
  cursor: pointer;
  transition: background var(--rx-transition);
  flex-shrink: 0;
}

.rx-manual-form__toggle input::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: rgb(var(--background, 255 255 255));
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform var(--rx-transition);
}

.rx-manual-form__toggle input:checked {
  background: rgb(var(--text-color, 29 29 29));
}

.rx-manual-form__toggle input:checked::after {
  transform: translateX(16px);
}

.rx-manual-form__toggle-text {
  font-size: 0.75rem;
  color: rgb(var(--text-color, 29 29 29) / 0.6);
}

/* Prism Toggle */
.rx-manual-form__prism-toggle {
  padding: 0.5rem 0;
}

.rx-manual-form__prism-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  background: #fafafa;
  border-radius: 8px;
  border: 1px solid rgb(var(--text-color, 29 29 29) / 0.08);
}

/* Price Summary - Legacy (now in submit wrapper) */
.rx-manual-form__summary {
  display: none; /* Moved to fixed footer */
}

/* Legacy submit styles - moved to drawer footer */

/* Legacy classes for backwards compatibility */
.rx-manual-form__field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rx-manual-form__field-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rx-manual-form__field-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.rx-manual-form__field-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.rx-manual-form__checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.8125rem;
}

.rx-manual-form__checkbox-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 2px solid rgb(var(--text-color, 29 29 29) / 0.3);
  border-radius: 3px;
  transition: all var(--rx-transition);
}

.rx-manual-form__checkbox-box svg {
  color: rgb(var(--text-color, 29 29 29));
}

/* ============================================================================
   VALUE DRAWER
   ============================================================================ */

rx-value-drawer {
  display: contents;
}

.rx-value-drawer__backdrop {
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / 0.4);
  z-index: 9998;
  animation: rx-fade-in 0.2s ease;
  cursor: pointer;
}

.rx-value-drawer__content {
  position: fixed;
  bottom: 0;
  left: 50%;
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 20px 20px 0 0;
  max-height: 60vh;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -10px 40px rgb(0 0 0 / 0.15);
  animation: rx-drawer-slide-up 0.3s ease forwards;
}

@keyframes rx-drawer-slide-up {
  from {
    transform: translate(-50%, 100%);
  }
  to {
    transform: translate(-50%, 0);
  }
}

.rx-value-drawer__handle {
  width: 40px;
  height: 4px;
  background: #d1d5db;
  border-radius: 2px;
  margin: 10px auto;
}

.rx-value-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem 1rem;
  border-bottom: 1px dashed #d1d5db;
}

.rx-value-drawer__title {
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.rx-value-drawer__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: #f3f4f6;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease;
}

.rx-value-drawer__close:hover {
  background: #e5e7eb;
}

.rx-value-drawer__close svg {
  width: 18px;
  height: 18px;
}

.rx-value-drawer__body {
  overflow-y: auto;
  flex: 1;
  padding: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}

.rx-value-drawer__body::-webkit-scrollbar {
  width: 6px;
}

.rx-value-drawer__body::-webkit-scrollbar-track {
  background: transparent;
}

.rx-value-drawer__body::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.rx-value-drawer__body::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

.rx-value-drawer__option--wide {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  background: #f3f4f6;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.rx-value-drawer__option--wide:hover {
  background-color: #e5e7eb;
}

.rx-value-drawer__columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.rx-value-drawer__column {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.rx-value-drawer__option {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 0.625rem 0.75rem;
  text-align: center;
  font-size: 0.9375rem;
  font-weight: 500;
  background: #fff;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.rx-value-drawer__option:hover {
  background-color: #f3f4f6;
}

.rx-value-drawer__option:active {
  background-color: #e5e7eb;
}

.rx-value-drawer__option:focus-visible {
  outline: none;
  background-color: #f3f4f6;
}

/* ============================================================================
   PRISM SECTION
   ============================================================================ */

rx-prism-eye {
  display: block;
}

.rx-prism-eye {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.rx-prism-eye__label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: rgb(var(--text-color, 29 29 29) / 0.5);
}

.rx-prism-eye__fields {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rx-prism-eye__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.rx-prism-eye__field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.rx-prism-eye__field-label {
  font-size: 0.625rem;
  font-weight: 500;
  color: rgb(var(--text-color, 29 29 29) / 0.5);
}

rx-prism-eye select,
.rx-prism-eye__select {
  width: 100%;
  min-height: 38px;
  padding: 0.5rem 0.625rem;
  border: 1px solid rgb(var(--text-color, 29 29 29) / 0.15);
  border-radius: 6px;
  background: rgb(var(--background, 255 255 255));
  font-size: 0.8125rem;
  cursor: pointer;
  transition: border-color var(--rx-transition);
}

rx-prism-eye select:hover,
.rx-prism-eye__select:hover {
  border-color: rgb(var(--text-color, 29 29 29) / 0.3);
}

rx-prism-eye select:focus,
.rx-prism-eye__select:focus {
  border-color: rgb(var(--text-color, 29 29 29));
  outline: none;
}

rx-prism-eye select:focus-visible,
.rx-prism-eye__select:focus-visible {
  outline: 2px solid rgb(var(--text-color, 29 29 29));
  outline-offset: 2px;
}

/* ============================================================================
   STICKY ADD TO CART
   ============================================================================ */

rx-sticky-atc {
  display: block;
}

rx-sticky-atc[hidden] {
  display: none;
}

/* Hide sticky bar when color picker is open */
rx-product-page:has(rx-color-picker[open]) rx-sticky-atc {
  visibility: hidden;
  pointer-events: none;
}

.rx-sticky-atc__bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--rx-z-sticky);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0));
  background: rgb(var(--background, 255 255 255) / 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgb(var(--text-color, 29 29 29) / 0.06);
}

@media (min-width: 700px) {
  .rx-sticky-atc__bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1rem 2rem;
    margin: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgb(var(--text-color, 29 29 29) / 0.06);
    box-shadow: 0 4px 30px rgb(var(--text-color, 29 29 29) / 0.08);
  }
}

@media (min-width: 1200px) {
  .rx-sticky-atc__bar {
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
  }
}

.rx-sticky-atc__info {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

@media (min-width: 700px) {
  .rx-sticky-atc__info {
    flex: 1;
    align-items: center;
  }
}

.rx-sticky-atc__product {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.rx-sticky-atc__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.2;
  color: rgb(var(--text-color, 29 29 29));
  text-transform: capitalize;
}

@media (min-width: 700px) {
  .rx-sticky-atc__title {
    font-size: 1.25rem;
  }
}

.rx-sticky-atc__subtitle {
  font-size: 0.75rem;
  color: rgb(var(--text-color, 29 29 29) / 0.55);
  letter-spacing: 0.02em;
}

.rx-sticky-atc__pricing {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.125rem;
}

.rx-sticky-atc__price {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  color: rgb(var(--text-color, 29 29 29));
}

@media (min-width: 700px) {
  .rx-sticky-atc__price {
    font-size: 1.5rem;
  }
}

.rx-sticky-atc__compare-price {
  font-size: 0.875rem;
  color: rgb(var(--text-color, 29 29 29) / 0.4);
  text-decoration: line-through;
}

.rx-sticky-atc__button {
  width: 100%;
  min-height: var(--rx-touch-target);
  padding: 0.875rem 1.5rem;
  background: rgb(var(--text-color, 29 29 29));
  color: rgb(var(--background, 255 255 255));
  border: none;
  border-radius: var(--rx-border-radius);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: opacity var(--rx-transition);
}

.rx-sticky-atc__button:hover {
  opacity: 0.85;
}

.rx-sticky-atc__button:focus-visible {
  outline: 2px solid rgb(var(--text-color, 29 29 29));
  outline-offset: 2px;
}

.rx-sticky-atc__button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (min-width: 700px) {
  .rx-sticky-atc__button {
    width: auto;
    min-width: 180px;
  }
}

/* ============================================================================
   PRICE DISPLAY
   ============================================================================ */

rx-price-display {
  display: block;
}

.rx-price-display__price {
  font-family: var(--font-heading-family, inherit);
  font-size: 2rem;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1;
  color: rgb(var(--text-color, 29 29 29));
}

/* ============================================================================
   FRAME TRIGGER
   ============================================================================ */

rx-frame-trigger {
  display: block;
}

.rx-frame-trigger__button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: var(--rx-touch-target);
  padding: 0.5rem 0.75rem;
  background: #f3f4f6;
  border: none;
  border-radius: 4px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 1px 3px rgb(var(--text-color, 29 29 29) / 0.1);
  text-transform: capitalize;
  transition: box-shadow var(--rx-transition);
}

.rx-frame-trigger__button:hover,
.rx-frame-trigger__button:focus {
  box-shadow: 0 1px 3px rgb(var(--text-color, 29 29 29) / 0.2);
}

.rx-frame-trigger__button:focus-visible {
  outline: 2px solid rgb(var(--text-color, 29 29 29));
  outline-offset: 2px;
}

.rx-frame-trigger__chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: rgb(var(--text-color, 29 29 29));
  color: rgb(var(--background, 255 255 255));
  border-radius: 50%;
  transition: transform var(--rx-transition);
}

rx-frame-trigger[open] .rx-frame-trigger__chevron {
  transform: rotate(180deg);
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.rx-hidden {
  display: none !important;
}

.rx-sr-only,
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Button loading state */
.btn[aria-busy="true"] {
  pointer-events: none;
  opacity: 0.7;
}

.btn[aria-busy="true"] .btn-loader {
  display: inline-block;
}

/* Secondary button variant */
.button--secondary {
  background: transparent !important;
  color: rgb(var(--text-color, 29 29 29)) !important;
  border: 1px solid rgb(var(--border-color, 29 29 29) / 0.2) !important;
}

.button--secondary:hover {
  background: rgb(var(--text-color, 29 29 29) / 0.05) !important;
  border-color: rgb(var(--border-color, 29 29 29) / 0.3) !important;
}

/* Scrollbar hide */
.rx-scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.rx-scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

@keyframes rx-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes rx-slide-up {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

/* ============================================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================================ */

@media (max-width: 699px) {
  rx-gallery [data-desktop-grid] {
    display: none;
  }
}

@media (min-width: 700px) {
  rx-gallery [data-mobile-slider] {
    display: none;
  }
}

/* ============================================================================
   COLOR SWATCHES
   ============================================================================ */

[data-color-swatch] {
  background-size: cover;
  background-position: center;
}

/* Common color swatches */
[data-color-swatch="Black"] { background-color: #000; }
[data-color-swatch="White"] { background-color: #fff; }
[data-color-swatch="Grey"],
[data-color-swatch="Gray"] { background-color: #808080; }
[data-color-swatch="Brown"] { background-color: #8B4513; }
[data-color-swatch="Blue"] { background-color: #0066cc; }
[data-color-swatch="Green"] { background-color: #228B22; }
[data-color-swatch="Red"] { background-color: #cc0000; }
[data-color-swatch="Gold"] { background-color: #FFD700; }
[data-color-swatch="Silver"] { background-color: #C0C0C0; }
[data-color-swatch="Rose Gold"] { background: linear-gradient(135deg, #b76e79 0%, #eecda3 100%); }
