.product-monogram__modal {
  position: fixed;
  z-index: 99999;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.95);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.product-monogram__modal[open] {
  visibility: visible;
  opacity: 1;
}

.product-monogram__container {
  position: relative;
  z-index: 100000;
  background: #ffffff;
  width: 100%;
  max-width: 550px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1rem 2rem 2rem;
  border-radius: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.product-monogram__header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 0.5rem;
}

.product-monogram__close-button {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.product-monogram__content {
  margin-bottom: 1.5rem;
}

.product-monogram__preview {
  margin-bottom: 2rem;
  position: relative;
  width: 100%;
}

.product-monogram__preview-image {
  position: relative;
  width: 100%;
  border: 1px solid #e0e0e0;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1rem;
  background-color: #f9f9f9;
}

.product-monogram__product-image {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
}

.product-monogram__letter-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: serif;
  font-size: 5rem;
  color: white;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
  z-index: 2;
}

.product-monogram__section {
  margin-bottom: 1.5rem;
}

.product-monogram__section-title {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
  color: #333;
}

.product-monogram__styles {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.product-monogram__style-svg {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}

.product-monogram__style-svg svg {
  width: 100%;
  height: 100%;
  max-width: 40px;
  display: block;
}

.product-monogram__style-option {
  min-width: 65px;
  height: 40px;
  border: 1px solid #e0e0e0;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #f9f9f9;
  padding: 0 10px;
}

.product-monogram__style-ab,
.product-monogram__style-abc {
  font-family: serif;
}

.product-monogram__style-katie {
  font-family: 'Arial', sans-serif;
  font-style: italic;
  font-size: 1rem;
}

.product-monogram__style-circle {
  width: 30px;
  height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.product-monogram__style-option:hover {
  border-color: #999;
  background: #f5f5f5;
}

.product-monogram__style-option.product-monogram__selected {
  border: 2px solid #d93939;
  background: #fff;
}

.product-monogram__text-field {
  margin-bottom: 1rem;
}

.product-monogram__text-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #e0e0e0;
  border-radius: 0;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.product-monogram__character-count {
  font-size: 0.85rem;
  color: #666;
  text-align: right;
}

.product-monogram__colors {
  display: flex;
  gap: 1rem;
  margin: 1rem 0;
  padding: 0.5rem 0;
  align-items: center;
}

.product-monogram__color-option {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  border: 1px solid #ddd;
  display: block !important;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.product-monogram__color-option:hover {
  transform: scale(1.05);
}

.product-monogram__color-option.product-monogram__selected {
  outline: 2px solid #000;
  outline-offset: 2px;
  transform: scale(1.05);
}

.product-monogram__color-white {
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
}

.product-monogram__color-black {
  background-color: #000000;
}

.product-monogram__color-blue {
  background-color: #1a4692;
}

.product-monogram__color-green {
  background-color: #1d5e41;
}

.product-monogram__color-pink {
  background-color: #ff0080;
}

.product-monogram__checkbox-container {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.product-monogram__checkbox {
  margin-top: 0.2rem;
  width: 18px;
  height: 18px;
}

.product-monogram__checkbox-label {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.4;
}

.product-monogram__notice {
  padding: 0;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
  color: #555;
  line-height: 1.4;
}

.product-monogram__add-to-cart {
  width: 100%;
  background-color: #2557a7;
  color: #fff;
  border: none;
  padding: 1rem;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 0;
  transition: background-color 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.product-monogram__add-to-cart:hover {
  background-color: #1c4584;
}

.product-monogram__add-to-cart:disabled {
  background-color: #2557a7;
  opacity: 0.7;
  cursor: not-allowed;
}

/* Add to Cart button loading animation */
.product-monogram__add-to-cart .loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-right: 8px;
  vertical-align: middle;
}

.product-monogram__add-to-cart .spinner {
  animation: rotate 2s linear infinite;
  transform-origin: center center;
  width: 100%;
  height: 100%;
}

.product-monogram__add-to-cart .path {
  stroke: #ffffff;
  stroke-dasharray: 150, 200;
  stroke-dashoffset: -10;
  animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes dash {
  0% {
    stroke-dasharray: 1, 200;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 89, 200;
    stroke-dashoffset: -35px;
  }
  100% {
    stroke-dasharray: 89, 200;
    stroke-dashoffset: -124px;
  }
}

.product-monogram__add-to-cart .add-to-cart-text {
  vertical-align: middle;
}

@media screen and (max-width: 749px) {
  .product-monogram__container {
    max-width: 95%;
    margin: 0 auto;
    padding: 1rem 1.5rem 1.5rem;
  }

  .product-monogram__styles {
    gap: 0.5rem;
  }

  .product-monogram__style-option {
    min-width: 55px;
    height: 35px;
  }

  .product-monogram__preview-image {
    max-height: 250px;
  }

  .product-monogram__letter-overlay {
    font-size: 4rem;
  }
}
