/* ==========================================================================
   LMOFID Nova — product page (gallery, options, offers, COD form, sticky bar)
   ========================================================================== */

/* --- Layout --------------------------------------------------------------- */

.cp-product {
  display: grid;
  gap: 20px;
  align-items: start;
}

.cp-product__media,
.cp-product__info {
  min-width: 0;
}

.cp-product__info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 990px) {
  .cp-product {
    grid-template-columns: minmax(0, var(--cp-media-width, 50%)) minmax(0, 1fr);
    gap: clamp(28px, 4vw, 56px);
  }

  .cp-product--media-end .cp-product__media {
    order: 2;
  }

  .cp-product--media-end {
    grid-template-columns: minmax(0, 1fr) minmax(0, var(--cp-media-width, 50%));
  }

  .cp-product--sticky .cp-product__info,
  .cp-product--sticky .cp-gallery--slider {
    position: sticky;
    top: calc(var(--cp-header-height, 0px) + 20px);
  }
}

@media (max-width: 749px) {
  .cp-product-section .cp-product__media {
    margin-inline: calc(var(--cp-gutter, 16px) * -1);
  }

  .cp-product-section .cp-gallery__slide,
  .cp-product-section .cp-gallery__img {
    border-radius: 0;
  }

  .cp-product-section .cp-gallery__thumbs {
    padding-inline: var(--cp-gutter, 16px);
  }
}

.cp-product__title {
  margin: 0;
}

.cp-product__rating {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  font-size: 0.9rem;
  color: var(--cp-text-soft);
}

.cp-product__rating:hover .cp-product__rating-label {
  text-decoration: underline;
}

.cp-price--lg {
  gap: 10px;
  align-items: center;
}

.cp-price--lg .cp-price__current {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 1.9rem);
  font-weight: 700;
  line-height: 1.1;
}

.cp-price--lg .cp-price__compare {
  font-size: 1.05rem;
}

.cp-product__price-note {
  margin-block-start: 4px;
  font-size: 0.82rem;
  color: var(--cp-text-soft);
}

.cp-product__separator {
  width: 100%;
  margin: 0;
  border: 0;
  border-block-start: 1px solid var(--cp-line);
}

.cp-product__text--soft,
.cp-product__text--highlight {
  padding: 12px 14px;
  border-radius: var(--cp-input-radius);
  background: color-mix(in srgb, var(--cp-text) 5%, var(--cp-bg));
  font-size: 0.94rem;
}

.cp-product__text--highlight {
  background: var(--cp-accent-soft);
  border-inline-start: 3px solid var(--cp-accent);
}

.cp-product__image img {
  width: 100%;
  border-radius: var(--cp-media-radius);
}

.cp-product__accordion + .cp-product__accordion {
  margin-block-start: -16px;
}

/* --- Gallery -------------------------------------------------------------- */

.cp-gallery {
  display: grid;
  gap: 10px;
}

.cp-gallery__main {
  position: relative;
  min-width: 0;
}

.cp-gallery__track {
  align-items: start;
}

.cp-gallery__slide {
  position: relative;
  overflow: hidden;
  border-radius: var(--cp-media-radius);
  background: color-mix(in srgb, var(--cp-text) 4%, var(--cp-bg));
  aspect-ratio: var(--cp-gallery-ratio, auto);
}

.cp-gallery__zoom {
  display: block;
  width: 100%;
  height: 100%;
  cursor: zoom-in;
}

.cp-gallery__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cp-gallery__zoom-icon {
  position: absolute;
  inset-block-start: 12px;
  inset-inline-end: 12px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--cp-bg);
  color: var(--cp-text);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.cp-gallery__zoom:hover .cp-gallery__zoom-icon,
.cp-gallery__zoom:focus-visible .cp-gallery__zoom-icon {
  opacity: 1;
}

.cp-gallery__counter {
  position: absolute;
  inset-block-end: 12px;
  inset-inline-end: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(18, 18, 18, 0.6);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  direction: ltr;
  pointer-events: none;
}

.cp-gallery__thumbs {
  display: flex;
  gap: 8px;
  overflow: auto;
  scrollbar-width: none;
  padding-block: 2px;
}

.cp-gallery__thumbs::-webkit-scrollbar {
  display: none;
}

.cp-gallery__thumb {
  flex: none;
  width: 64px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: calc(var(--cp-media-radius) * 0.6);
  border: 2px solid transparent;
  opacity: 0.65;
  transition:
    opacity 0.2s ease,
    border-color 0.2s ease;
}

.cp-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cp-gallery__thumb:hover,
.cp-gallery__thumb.is-active {
  opacity: 1;
}

.cp-gallery__thumb.is-active {
  border-color: var(--cp-text);
}

@media (min-width: 990px) {
  .cp-gallery__thumb {
    width: 76px;
  }

  .cp-gallery--thumbs-side {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .cp-gallery--thumbs-side .cp-gallery__main {
    order: 2;
  }

  .cp-gallery--thumbs-side .cp-gallery__thumbs {
    flex-direction: column;
    max-height: min(640px, 70vh);
  }

  /* Grid and stacked layouts show every image at once on large screens. */
  .cp-gallery--grid .cp-gallery__track,
  .cp-gallery--stacked .cp-gallery__track {
    display: grid;
    grid-auto-flow: row;
    grid-auto-columns: auto;
    overflow: visible;
    scroll-snap-type: none;
    gap: 10px;
  }

  .cp-gallery--grid .cp-gallery__track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cp-gallery--grid .cp-gallery__slide:first-child {
    grid-column: 1 / -1;
  }

  .cp-gallery--stacked .cp-gallery__track {
    grid-template-columns: minmax(0, 1fr);
  }

  .cp-gallery--grid .cp-slider__arrow,
  .cp-gallery--stacked .cp-slider__arrow,
  .cp-gallery--grid .cp-gallery__counter,
  .cp-gallery--stacked .cp-gallery__counter,
  .cp-gallery--grid .cp-gallery__thumbs,
  .cp-gallery--stacked .cp-gallery__thumbs {
    display: none;
  }
}

/* Lightbox */

.cp-modal--lightbox .cp-modal__overlay {
  background: rgba(0, 0, 0, 0.88);
}

.cp-lightbox {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 56px 16px 20px;
  outline: none;
  pointer-events: none;
}

.cp-lightbox > * {
  pointer-events: auto;
}

.cp-lightbox__image {
  max-width: 100%;
  max-height: calc(100vh - 150px);
  max-height: calc(100dvh - 150px);
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}

.cp-lightbox__close {
  position: absolute;
  inset-block-start: 12px;
  inset-inline-end: 12px;
  background: #fff;
  color: #121212;
}

.cp-lightbox__nav {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
}

.cp-lightbox__nav .cp-icon-btn {
  background: #fff;
  color: #121212;
}

.cp-lightbox__nav [data-lightbox-counter] {
  direction: ltr;
}

/* --- Options -------------------------------------------------------------- */

.cp-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cp-option {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.cp-option__label {
  display: flex;
  gap: 6px;
  padding: 0;
  margin-block-end: 8px;
  font-size: 0.92rem;
  font-weight: 600;
}

.cp-option__selected {
  font-weight: 400;
  color: var(--cp-text-soft);
}

.cp-option__values {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cp-option__missing {
  display: none;
  margin-block-start: 6px;
  font-size: 0.82rem;
  color: var(--cp-error);
}

.cp-option.is-missing .cp-option__missing {
  display: block;
}

.cp-option.is-missing .cp-option__values,
.cp-option.is-missing .cp-select {
  animation: cp-nudge 0.4s ease;
}

@keyframes cp-nudge {
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}

.cp-pill {
  position: relative;
  cursor: pointer;
}

.cp-pill > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 44px;
  padding: 8px 16px;
  border: var(--cp-input-border, 1px) solid var(--cp-line);
  border-radius: var(--cp-input-radius);
  background: var(--cp-bg);
  font-size: 0.92rem;
  font-weight: 500;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease;
}

.cp-pill:hover > span {
  border-color: var(--cp-text);
}

.cp-pill input:checked + span {
  border-color: var(--cp-text);
  background: var(--cp-text);
  color: var(--cp-bg);
}

.cp-pill input:focus-visible + span,
.cp-swatch input:focus-visible ~ .cp-swatch__color,
.cp-swatch--image input:focus-visible + img {
  outline: 2px solid var(--cp-text);
  outline-offset: 2px;
}

.cp-pill.is-unavailable > span {
  color: var(--cp-text-faint);
  text-decoration: line-through;
  background-image: linear-gradient(to top right, transparent calc(50% - 0.5px), var(--cp-line) 50%, transparent calc(50% + 0.5px));
}

.cp-pill.is-unavailable input:checked + span {
  color: var(--cp-bg);
  opacity: 0.6;
}

.cp-pill--radio > span {
  justify-content: flex-start;
  gap: 10px;
  padding-inline-start: 12px;
}

.cp-pill--radio > span::before {
  content: '';
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  flex: none;
}

.cp-pill--radio input:checked + span::before {
  border-width: 5px;
}

.cp-swatch {
  position: relative;
  cursor: pointer;
}

.cp-swatch__color {
  display: block;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--cp-swatch, #ddd);
  border: 1px solid color-mix(in srgb, var(--cp-text) 18%, transparent);
  box-shadow: 0 0 0 3px var(--cp-bg) inset;
  transition: box-shadow 0.2s ease;
}

.cp-swatch input:checked ~ .cp-swatch__color {
  box-shadow:
    0 0 0 3px var(--cp-bg) inset,
    0 0 0 2px var(--cp-text);
}

.cp-swatch--image img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--cp-input-radius);
  border: 2px solid var(--cp-line);
  transition: border-color 0.2s ease;
}

.cp-swatch--image input:checked + img {
  border-color: var(--cp-text);
}

.cp-swatch.is-unavailable {
  opacity: 0.4;
}

.cp-swatch.is-unavailable::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top right, transparent calc(50% - 1px), var(--cp-text) 50%, transparent calc(50% + 1px));
  border-radius: inherit;
  pointer-events: none;
}

.cp-upload {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1.5px dashed var(--cp-line);
  border-radius: var(--cp-input-radius);
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.cp-upload:hover,
.cp-upload:focus-within {
  border-color: var(--cp-text);
}

.cp-upload__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--cp-text) 6%, var(--cp-bg));
  flex: none;
}

.cp-upload__text {
  display: flex;
  flex-direction: column;
  font-size: 0.92rem;
  font-weight: 500;
  min-width: 0;
}

.cp-upload__name {
  font-weight: 400;
  font-size: 0.82rem;
  color: var(--cp-text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Inventory ------------------------------------------------------------ */

.cp-inventory {
  --cp-stock-color: var(--cp-success);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cp-inventory[data-state='low'] {
  --cp-stock-color: #e8590c;
}

.cp-inventory[data-state='out'] {
  --cp-stock-color: var(--cp-error);
}

.cp-inventory__text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--cp-stock-color);
}

.cp-inventory__dot {
  position: relative;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.cp-inventory:not([data-state='out']) .cp-inventory__dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: currentColor;
  animation: cp-ping 1.8s ease-out infinite;
}

@keyframes cp-ping {
  to {
    transform: scale(2.6);
    opacity: 0;
  }
}

.cp-inventory__bar {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--cp-text) 9%, var(--cp-bg));
  overflow: hidden;
}

.cp-inventory__bar::after {
  content: '';
  display: block;
  width: var(--cp-stock, 50%);
  height: 100%;
  border-radius: inherit;
  background: var(--cp-stock-color);
  transition: width 0.4s ease;
}

.cp-inventory[data-state='out'] .cp-inventory__bar {
  display: none;
}

/* --- Offers (quantity breaks and bundles) --------------------------------- */

.cp-offers {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cp-offers__heading {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
}

.cp-offers__heading::before,
.cp-offers__heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--cp-line);
}

.cp-offer {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
  row-gap: 10px;
  padding: 14px;
  border: 1.5px solid var(--cp-line);
  border-radius: var(--cp-card-radius);
  background: var(--cp-bg);
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}

.cp-offer:hover {
  border-color: color-mix(in srgb, var(--cp-accent) 55%, var(--cp-line));
}

.cp-offer:has(.cp-offer__input:checked) {
  border-color: var(--cp-accent);
  background: var(--cp-accent-soft);
  box-shadow: 0 0 0 1px var(--cp-accent);
}

.cp-offer:has(.cp-offer__input:focus-visible) {
  outline: 2px solid var(--cp-text);
  outline-offset: 2px;
}

.cp-offer__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.cp-offer__radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--cp-text-faint);
  transition: border 0.15s ease;
}

.cp-offer__input:checked + .cp-offer__radio {
  border: 6px solid var(--cp-accent);
}

.cp-offer__main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.cp-offer__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  line-height: 1.3;
}

.cp-offer__meta {
  font-size: 0.82rem;
  color: var(--cp-text-soft);
}

.cp-offer__prices {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.25;
}

.cp-offer__price {
  font-weight: 700;
  font-size: 1.05rem;
}

.cp-offer__compare {
  font-size: 0.82rem;
  color: var(--cp-text-faint);
}

.cp-offer__flag {
  position: absolute;
  inset-block-start: 0;
  inset-inline-end: 14px;
  transform: translateY(-50%);
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--cp-accent);
  color: var(--cp-bg);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  /* A long label stays inside its offer: it is shortened with an ellipsis. */
  max-width: calc(100% - 28px);
  overflow: hidden;
  text-overflow: ellipsis;
}

.cp-offer--highlight {
  margin-block-start: 6px;
}

.cp-offer__items {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-block-start: 10px;
  border-block-start: 1px dashed var(--cp-line);
}

.cp-offer__item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
}

.cp-offer__item-media {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  overflow: hidden;
  background: color-mix(in srgb, var(--cp-text) 5%, var(--cp-bg));
}

.cp-offer__item-media img,
.cp-offer__item-media svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cp-offer__item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cp-offer__item-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cp-offer__item-variant {
  font-size: 0.8rem;
  color: var(--cp-text-soft);
}

.cp-offer__item-price {
  font-weight: 600;
}

/* --- Buy area and COD form ------------------------------------------------ */

.cp-buy {
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-margin-top: calc(var(--cp-header-height, 0px) + 16px);
}

.cp-buy__row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.cp-buy__row .cp-btn {
  flex: 1;
}

.cp-buy__row .cp-quantity {
  height: 100%;
}

.cp-cod {
  display: block;
  scroll-margin-top: calc(var(--cp-header-height, 0px) + 16px);
}

.cp-cod__form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cp-cod--inline.cp-cod--card .cp-cod__form,
.cp-cod--inline.cp-cod--highlight .cp-cod__form {
  padding: clamp(14px, 3.5vw, 22px);
  border-radius: var(--cp-card-radius);
  border: 1.5px solid var(--cp-line);
  background: var(--cp-surface, var(--cp-bg));
}

.cp-cod--inline.cp-cod--card .cp-cod__form {
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.06);
}

.cp-cod--inline.cp-cod--highlight .cp-cod__form {
  border: 2px solid var(--cp-accent);
  background: var(--cp-accent-soft);
}

.cp-cod__head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
}

.cp-cod__title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
}

.cp-cod__subtitle {
  font-size: 0.9rem;
  color: var(--cp-text-soft);
}

.cp-cod--popup .cp-cod__head {
  text-align: start;
}

.cp-cod--popup .cp-cod__title {
  justify-content: flex-start;
}

.cp-cod__product {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--cp-input-radius);
  background: color-mix(in srgb, var(--cp-text) 4%, var(--cp-bg));
}

.cp-cod__product-media {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--cp-bg);
}

.cp-cod__product-media img,
.cp-cod__product-media svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cp-cod__product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cp-cod__product-name {
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cp-cod__product-variant {
  font-size: 0.82rem;
  color: var(--cp-text-soft);
}

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

.cp-cod__field {
  grid-column: 1 / -1;
  margin: 0;
}

@media (min-width: 480px) {
  .cp-cod__field--half {
    grid-column: span 1;
  }
}

.cp-cod__field .cp-field__label {
  font-size: 0.86rem;
}

.cp-cod__phone {
  display: flex;
  direction: ltr;
}

.cp-cod__phone .cp-cod__dial {
  flex: none;
  width: auto;
  max-width: 116px;
  padding-inline: 10px 26px;
  border-start-end-radius: 0;
  border-end-end-radius: 0;
  border-inline-end: 0;
  background-color: color-mix(in srgb, var(--cp-text) 4%, var(--cp-bg));
}

.cp-cod__phone .cp-cod__dial:not([hidden]) + .cp-input {
  border-start-start-radius: 0;
  border-end-start-radius: 0;
  padding-inline-start: 12px;
}

.cp-cod__phone .cp-field__icon {
  display: none;
}

.cp-field--icon .cp-cod__phone .cp-input {
  padding-inline-start: 14px; /* no icon in this control */
}

/* RTL pages. The dial code + number control is one left-to-right unit (+212 then the number),
   so the number starts right after the code. Without a visible dial code, the number is
   aligned to the right like the other fields (see base.css). The icon is hidden in both cases. */
[dir='rtl'] .cp-field--icon .cp-cod__phone .cp-input[dir='ltr'] {
  padding-left: 14px;
  padding-right: 14px;
}

[dir='rtl'] .cp-field--icon .cp-cod__phone .cp-cod__dial:not([hidden]) + .cp-input[dir='ltr'] {
  padding-left: 12px;
  text-align: left;
}

.cp-cod__quantity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cp-cod__quantity .cp-field__label {
  margin: 0;
}

.cp-cod__summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--cp-input-radius);
  background: color-mix(in srgb, var(--cp-text) 4%, var(--cp-bg));
  font-size: 0.93rem;
}

.cp-cod--highlight .cp-cod__summary {
  background: var(--cp-bg);
}

.cp-cod__summary .cp-summary-row--total {
  padding-block-start: 8px;
  border-block-start: 1px dashed var(--cp-line);
}

.cp-cod__secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--cp-text-soft);
  text-align: center;
}

.cp-cod__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cp-cod-modal .cp-modal__body {
  padding: var(--cp-cod-pad, 16px);
}

/* Popup mode: the order button stays visible while the form scrolls. */
.cp-cod--popup .cp-cod__actions {
  position: sticky;
  inset-block-end: calc(-1 * var(--cp-cod-pad, 16px)); /* cancels the modal body padding */
  z-index: 2;
  margin: 0 calc(-1 * var(--cp-cod-pad, 16px)) calc(-1 * var(--cp-cod-pad, 16px));
  padding: 12px var(--cp-cod-pad, 16px) calc(var(--cp-cod-pad, 16px) + env(safe-area-inset-bottom, 0px));
  border-block-start: 1px solid var(--cp-line);
  background: var(--cp-bg);
}

/* --- Info blocks ---------------------------------------------------------- */

.cp-icon-list__heading {
  margin-block-end: 10px;
  font-weight: 700;
}

.cp-icon-list__items {
  display: grid;
  gap: 10px;
}

.cp-icon-list--grid .cp-icon-list__items {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cp-icon-list--inline .cp-icon-list__items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.cp-icon-list__item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.35;
}

.cp-icon-list--grid .cp-icon-list__item {
  padding: 10px 12px;
  border-radius: var(--cp-input-radius);
  background: color-mix(in srgb, var(--cp-text) 4%, var(--cp-bg));
}

.cp-icon-list__icon {
  flex: none;
  color: var(--cp-accent);
}

.cp-product__countdown {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 12px 14px;
  border-radius: var(--cp-input-radius);
  background: color-mix(in srgb, var(--cp-sale) 8%, var(--cp-bg));
  color: var(--cp-text);
}

.cp-product__countdown-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.92rem;
}

.cp-product__countdown-heading .cp-icon {
  color: var(--cp-sale);
}

.cp-product__delivery {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--cp-line);
  border-radius: var(--cp-input-radius);
  font-size: 0.92rem;
}

.cp-product__delivery-icon {
  flex: none;
  color: var(--cp-accent);
}

.cp-product__testimonial {
  display: flex;
  gap: 12px;
  margin: 0;
  padding: 14px;
  border-radius: var(--cp-card-radius);
  background: color-mix(in srgb, var(--cp-text) 4%, var(--cp-bg));
  font-size: 0.92rem;
}

.cp-product__testimonial-avatar {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.cp-product__testimonial blockquote {
  margin: 4px 0;
  line-height: 1.5;
}

.cp-product__testimonial figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.86rem;
}

.cp-product__verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  color: var(--cp-success);
}

.cp-product__share {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cp-product__share-label {
  margin-inline-end: 6px;
  font-size: 0.9rem;
  font-weight: 600;
}

/* --- Sticky buy bar ------------------------------------------------------- */

.cp-sticky-bar {
  position: fixed;
  inset-inline: 0;
  inset-block-end: 0;
  z-index: 60;
  display: block;
  padding-block: 10px calc(10px + env(safe-area-inset-bottom, 0px));
  border-block-start: 1px solid var(--cp-line);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.1);
  transform: translateY(110%);
  visibility: hidden;
  transition:
    transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
    visibility 0s linear 0.35s;
}

.cp-sticky-bar.is-visible:not(.is-suppressed) {
  transform: none;
  visibility: visible;
  transition-delay: 0s;
}

.cp-sticky-bar__inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cp-sticky-bar__media {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  overflow: hidden;
  background: color-mix(in srgb, var(--cp-text) 5%, var(--cp-bg));
}

.cp-sticky-bar__media img,
.cp-sticky-bar__media svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cp-sticky-bar__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.cp-sticky-bar__title {
  font-weight: 600;
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cp-sticky-bar__variant {
  font-size: 0.78rem;
  color: var(--cp-text-soft);
}

.cp-sticky-bar__price {
  font-size: 0.92rem;
}

.cp-sticky-bar__button {
  flex: none;
  min-height: 46px;
  padding-inline: 18px;
}

@media (max-width: 749px) {
  .cp-sticky-bar--no-mobile {
    display: none;
  }

  .cp-sticky-bar__title {
    display: none;
  }

  .cp-sticky-bar__button {
    flex: 1.4;
  }

  .cp-sticky-bar__info {
    flex: 1;
  }
}

@media (min-width: 750px) {
  .cp-sticky-bar--no-desktop {
    display: none;
  }

  .cp-sticky-bar--top {
    inset-block: var(--cp-header-height, 0px) auto;
    padding-block: 10px;
    border-block-start: 0;
    border-block-end: 1px solid var(--cp-line);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    transform: translateY(-130%);
    z-index: 40;
  }

  .cp-sticky-bar__button {
    min-width: 240px;
  }
}

/* Keep page content (footer) reachable above the bar. */
body {
  padding-block-end: var(--cp-sticky-bar-height, 0px);
}

@media (prefers-reduced-motion: reduce) {
  .cp-sticky-bar {
    transition: none;
  }

  .cp-inventory__dot::after,
  .cp-option.is-missing .cp-option__values {
    animation: none;
  }
}

/* --- COD form: optional texts --------------------------------------------- */

.cp-cod__note {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--cp-text-soft);
  text-align: center;
}

.cp-cod--popup .cp-cod__note {
  text-align: start;
}

.cp-cod__info {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.cp-cod__info--soft,
.cp-cod__info--highlight {
  padding: 10px 12px;
  border-radius: var(--cp-input-radius);
  background: color-mix(in srgb, var(--cp-text) 4%, var(--cp-bg));
}

.cp-cod__info--highlight {
  background: var(--cp-accent-soft);
  border: 1px dashed color-mix(in srgb, var(--cp-accent) 45%, transparent);
}

.cp-cod__info-icon {
  flex: none;
  display: inline-flex;
  margin-block-start: 1px;
  color: var(--cp-accent);
}

.cp-cod__info-text {
  flex: 1 1 0;
  min-width: 0;
}

.cp-cod__info-text > :first-child {
  margin-block-start: 0;
}

.cp-cod__info-text > :last-child {
  margin-block-end: 0;
}

/* Popup: texts placed under the order button come after the sticky button area. */
.cp-cod--popup.cp-cod--has-after .cp-cod__actions {
  margin-block-end: 0;
  padding-block-end: 12px;
}

/* --- COD form: custom design (theme settings > Order form) ---------------- */
/* The class sits on the inline form and on the popup panel. It only re-maps the
   theme tokens to the seller's values, so every element keeps its normal rules. */

.cp-cod-custom {
  --cp-bg: var(--cod-bg);
  --cp-bg-fill: var(--cod-bg);
  --cp-surface: var(--cod-bg);
  --cp-text: var(--cod-text);
  --cp-border: var(--cod-border);
  --cp-line: var(--cod-border);
  --cp-btn-bg: var(--cod-btn-bg);
  --cp-btn-text: var(--cod-btn-text);
  --cp-btn-radius: var(--cod-btn-radius);
  --cp-input-radius: var(--cod-input-radius);
  --cp-text-soft: color-mix(in srgb, var(--cod-text) 68%, var(--cod-bg));
  --cp-text-faint: color-mix(in srgb, var(--cod-text) 45%, var(--cod-bg));
  --cp-accent-soft: color-mix(in srgb, var(--cp-accent) 10%, var(--cod-bg));
  color: var(--cod-text);
}

.cp-cod-custom .cp-cod__form {
  gap: var(--cod-gap);
}

.cp-cod-custom .cp-cod__fields {
  gap: min(var(--cod-gap), 16px);
}

.cp-cod-custom.cp-cod--inline .cp-cod__form {
  padding: min(var(--cod-padding), 6vw);
  border: var(--cod-border-width) solid var(--cod-border);
  border-radius: var(--cod-radius);
  background: var(--cod-bg);
}

.cp-cod-custom .cp-input,
.cp-cod-custom .cp-select,
.cp-cod-custom .cp-textarea {
  background-color: var(--cod-input);
}

.cp-cod-custom .cp-cod__title {
  font-size: var(--cod-title-size);
}

.cp-cod-custom .cp-cod__subtitle,
.cp-cod-custom .cp-cod__note,
.cp-cod-custom .cp-cod__info,
.cp-cod-custom .cp-cod__field .cp-field__label {
  font-size: var(--cod-text-size);
}

.cp-cod-custom .cp-cod__secure {
  font-size: calc(var(--cod-text-size) * 0.9);
}

.cp-cod-custom .cp-cod__submit {
  font-size: var(--cod-btn-size);
}

/* Popup: the panel carries the custom design. */
.cp-cod-modal .cp-modal__panel.cp-cod-custom {
  --cp-cod-pad: clamp(12px, var(--cod-padding), 24px);
  background: var(--cod-bg);
  border-start-start-radius: var(--cod-radius);
  border-start-end-radius: var(--cod-radius);
}

@media (min-width: 750px) {
  .cp-cod-modal .cp-modal__panel.cp-cod-custom {
    border-radius: var(--cod-radius);
  }
}
