/* WooCommerce Custom Embroidery - Frontend Styles */

.wc-embroidery-container {
  background: #f9f9f9;
  border: 2px solid #6c4ab6;
  border-radius: 10px;
  padding: 25px;
  margin: 20px 0;
}

.wc-embroidery-header {
  background: #6c4ab6;
  color: white;
  padding: 15px 20px;
  margin: -25px -25px 20px -25px;
  border-radius: 8px 8px 0 0;
}

.wc-embroidery-header h3 {
  margin: 0 0 5px 0;
  font-size: 20px;
  font-weight: 600;
}

.embroidery-subtitle {
  margin: 0;
  font-size: 14px;
  opacity: 0.9;
}

.wc-embroidery-options {
  margin-top: 20px;
}

.embroidery-option {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.embroidery-option:hover {
  border-color: #6c4ab6;
  background: #f5f3ff;
}

.embroidery-option input[type="checkbox"] {
  margin-right: 12px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #6c4ab6;
}

.embroidery-option span {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
}

.embroidery-option .price {
  color: #6c4ab6;
  font-weight: 600;
  margin-left: auto;
}

/* Checked state for options */
.embroidery-option input[type="checkbox"]:checked ~ span:first-of-type {
  color: #6c4ab6;
  font-weight: 600;
}

/* Text Fields */
.embroidery-text-fields,
.embroidery-icon-fields {
  background: white;
  padding: 20px;
  border-radius: 8px;
  margin: 15px 0;
  border: 2px solid #e0e0e0;
}

/* Side Selection */
.side-selection-group {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 2px solid #f0f0f0;
}

.side-selection-group > label {
  display: block;
  margin-bottom: 12px;
  font-weight: 600;
  color: #333;
  font-size: 15px;
}

.side-options {
  display: flex;
  gap: 15px;
}

.side-option {
  flex: 1;
  cursor: pointer;
}

.side-option input[type="radio"] {
  display: none;
}

.side-option span {
  display: block;
  padding: 12px 20px;
  background: #f5f5f5;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  text-align: center;
  font-weight: 500;
  transition: all 0.3s ease;
}

.side-option input[type="radio"]:checked + span {
  background: #6c4ab6;
  color: white;
  border-color: #6c4ab6;
  box-shadow: 0 2px 8px rgba(108, 74, 182, 0.3);
}

.side-option:hover span {
  border-color: #6c4ab6;
}

.text-field-group {
  margin-bottom: 20px;
  position: relative;
}

.text-field-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
}

.text-field-group input[type="text"] {
  width: 100%;
  padding: 12px;
  padding-right: 60px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.3s ease;
}

.text-field-group input[type="text"]:focus {
  outline: none;
  border-color: #6c4ab6;
}

.char-count {
  position: absolute;
  right: 12px;
  bottom: 12px;
  font-size: 12px;
  color: #999;
}

/* Color Options */
.text-color-group,
.font-type-group {
  margin-bottom: 20px;
}

.text-color-group > label:first-child,
.font-type-group > label:first-child {
  display: block;
  margin-bottom: 10px;
  font-weight: 500;
  color: #333;
}

.color-options,
.font-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.color-options label,
.font-options label {
  cursor: pointer;
}

.color-options input[type="radio"],
.font-options input[type="radio"] {
  display: none;
}

.color-swatch {
  display: inline-block;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  border: 3px solid transparent;
  transition: all 0.3s ease;
}

.color-options input[type="radio"]:checked + .color-swatch {
  border-color: #6c4ab6;
  box-shadow: 0 0 0 2px white, 0 0 0 4px #6c4ab6;
}

.font-preview {
  display: inline-block;
  padding: 8px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  background: white;
  transition: all 0.3s ease;
}

.font-options input[type="radio"]:checked + .font-preview {
  border-color: #6c4ab6;
  background: #f5f3ff;
  color: #6c4ab6;
}

/* Icon Grid Wrapper - Scrollable Container */
.icon-grid-wrapper {
  position: relative;
  margin-bottom: 20px;
}

.icon-grid-wrapper h4 {
  margin-bottom: 12px;
}

/* Icon Grid - Scrollable */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 12px;
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px;
  background: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
}

/* Custom Scrollbar */
.icon-grid::-webkit-scrollbar {
  width: 8px;
}

.icon-grid::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.icon-grid::-webkit-scrollbar-thumb {
  background: #6c4ab6;
  border-radius: 4px;
}

.icon-grid::-webkit-scrollbar-thumb:hover {
  background: #5a3d9a;
}

/* Firefox Scrollbar */
.icon-grid {
  scrollbar-width: thin;
  scrollbar-color: #6c4ab6 #f1f1f1;
}

.icon-option {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.icon-option input[type="radio"] {
  display: none;
}

/* Icon Preview - Image Background */
.icon-preview-image {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 90px;
  height: 90px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: white;
  background-size: 60%;
  background-position: center;
  background-repeat: no-repeat;
  transition: all 0.3s ease;
}

/* Icon Preview - SVG */
.icon-preview-svg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 90px;
  height: 90px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: white;
  padding: 15px;
  transition: all 0.3s ease;
}

.icon-preview-svg svg {
  width: 100%;
  height: 100%;
  color: #333;
}

/* Selected Icon State */
.icon-option input[type="radio"]:checked + .icon-preview-image,
.icon-option input[type="radio"]:checked + .icon-preview-svg {
  border-color: #6c4ab6;
  background-color: #f5f3ff;
  box-shadow: 0 2px 8px rgba(108, 74, 182, 0.3);
  transform: scale(1.05);
}

.icon-option input[type="radio"]:checked + .icon-preview-svg svg {
  color: #6c4ab6;
}

/* Icon Label */
.icon-label {
  margin-top: 8px;
  font-size: 11px;
  text-align: center;
  color: #666;
  font-weight: 500;
  line-height: 1.3;
}

.icon-option input[type="radio"]:checked ~ .icon-label {
  color: #6c4ab6;
  font-weight: 600;
}

/* Custom Logo Upload */
.custom-logo-upload {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid #e0e0e0;
}

.custom-logo-upload h4 {
  margin-bottom: 15px;
  color: #333;
}

.upload-logo-btn {
  background: #6c4ab6;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.3s ease;
}

.upload-logo-btn:hover {
  background: #5a3d9a;
}

.upload-preview {
  margin-top: 15px;
  padding: 15px;
  background: #f9f9f9;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.upload-preview img {
  border: 2px solid #e0e0e0;
  border-radius: 6px;
}

.remove-logo-btn {
  background: #dc3545;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}

.remove-logo-btn:hover {
  background: #c82333;
}

.custom-logo-upload .description {
  margin-top: 10px;
  font-size: 12px;
  color: #666;
  line-height: 1.6;
}

/* Total Price Display */
.embroidery-total-price {
  margin: 15px 0;
  padding: 15px;
  background: linear-gradient(135deg, #6c4ab6 0%, #8b5cf6 100%);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(108, 74, 182, 0.2);
}

.embroidery-total-price strong {
  color: white;
  font-size: 16px;
}

.embroidery-total-price .total-amount {
  color: white;
  font-size: 20px;
  font-weight: 700;
}

/* Note */
.embroidery-note {
  margin-top: 15px;
  padding: 12px;
  background: #fff3cd;
  border-left: 4px solid #ffc107;
  color: #856404;
  font-size: 13px;
  border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
  .wc-embroidery-container {
      padding: 15px;
  }
  
  .wc-embroidery-header {
      margin: -15px -15px 15px -15px;
      padding: 12px 15px;
  }
  
  .icon-grid {
      grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
      max-height: 240px;
  }
  
  .icon-preview-image,
  .icon-preview-svg {
      width: 70px;
      height: 70px;
  }
  
  .side-options {
      flex-direction: column;
  }
}