/**
 * WooCommerce Senszio Customizer - Frontend Styles
 */

/* Product Custom Labels */
.wpsc-custom-label {
  background: #0073aa;
  color: #fff;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 0.8em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
  margin-bottom: 5px;
  position: relative;
  z-index: 10;
}

.wpsc-custom-label::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, #0073aa, #005a87);
  border-radius: 3px;
  z-index: -1;
}

/* Featured Badges */
.wpsc-featured-badge {
  background: #eaae4c;
  color: #000;
  padding: 6px 12px;
  border-radius: 0px;
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: inline-block;
  margin-bottom: 8px;
  position: relative;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  animation: badgeGlow 2s ease-in-out infinite alternate;
}

/* .wpsc-featured-badge::before {
  content: "★";
  margin-right: 4px;
  color: #ff6b35;
} */

@keyframes badgeGlow {
  from {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }
  to {
    box-shadow: 0 4px 8px rgba(255, 215, 0, 0.3);
  }
}

/* Product Additional Information */
.wpsc-additional-info {
  margin-top: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-left: 4px solid #0073aa;
  border-radius: 4px;
}

.wpsc-additional-info h3 {
  margin: 0 0 10px 0;
  color: #23282d;
  font-size: 1.1em;
  font-weight: 600;
}

.wpsc-additional-info-content {
  line-height: 1.6;
  color: #666;
}

.wpsc-additional-info-content p:last-child {
  margin-bottom: 0;
}

/* Individual Styles */
.wpsc-individual-styles {
  margin-top: 30px;
  padding: 20px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wpsc-individual-styles h3 {
  margin: 0 0 20px 0;
  color: #23282d;
  font-size: 1.3em;
  font-weight: 600;
  border-bottom: 2px solid #0073aa;
  padding-bottom: 10px;
}

.wpsc-style-groups {
  display: grid;
  gap: 25px;
}

.wpsc-style-group {
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  padding: 15px;
  background: #fafafa;
}

.wpsc-style-group h4 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 1.1em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wpsc-style-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.wpsc-style-option {
  border: 2px solid #e5e5e5;
  border-radius: 6px;
  padding: 12px;
  background: #fff;
  transition: all 0.3s ease;
  cursor: pointer;
}

.wpsc-style-option:hover {
  border-color: #0073aa;
  box-shadow: 0 4px 8px rgba(0, 115, 170, 0.1);
  transform: translateY(-2px);
}

.wpsc-style-option.selected {
  border-color: #0073aa;
  background: #f0f8ff;
}

.wpsc-style-image {
  text-align: center;
  margin-bottom: 10px;
}

.wpsc-style-image img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  max-height: 120px;
  object-fit: cover;
}

.wpsc-style-details {
  text-align: center;
}

.wpsc-style-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  font-weight: 500;
}

.wpsc-style-label input[type="radio"] {
  margin-bottom: 8px;
}

.wpsc-style-name {
  font-weight: 600;
  color: #333;
  margin-bottom: 5px;
}

.wpsc-style-surcharge {
  color: #0073aa;
  font-weight: 600;
  font-size: 0.9em;
}

.wpsc-style-description {
  font-size: 0.85em;
  color: #666;
  margin-top: 8px;
  line-height: 1.4;
}

/* Size Chart */
.wpsc-size-chart {
  margin-top: 30px;
  padding: 20px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wpsc-size-chart h3 {
  margin: 0 0 15px 0;
  color: #23282d;
  font-size: 1.3em;
  font-weight: 600;
  border-bottom: 2px solid #0073aa;
  padding-bottom: 10px;
}

.wpsc-size-chart-toggle {
  background: #0073aa;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.3s ease;
}

.wpsc-size-chart-toggle:hover {
  background: #005a87;
}

.wpsc-size-chart-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wpsc-size-chart-modal-content {
  background: #fff;
  padding: 30px;
  border-radius: 8px;
  max-width: 800px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

.wpsc-size-chart-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 24px;
  cursor: pointer;
  color: #666;
}

.wpsc-size-chart-close:hover {
  color: #000;
}

.wpsc-size-chart-data table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.wpsc-size-chart-data th,
.wpsc-size-chart-data td {
  padding: 12px;
  text-align: center;
  border: 1px solid #e5e5e5;
}

.wpsc-size-chart-data th {
  background: #f8f9fa;
  font-weight: 600;
  color: #333;
}

.wpsc-size-chart-data tr:nth-child(even) {
  background: #fafafa;
}

/* Category Style Groups */
.wpsc-category-style-groups {
  margin: 30px 0;
  padding: 25px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e5e5e5;
}

.wpsc-category-style-groups h2 {
  margin: 0 0 20px 0;
  color: #23282d;
  font-size: 1.5em;
  font-weight: 600;
  text-align: center;
}

.wpsc-style-groups-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.wpsc-style-group-overview {
  background: #fff;
  padding: 20px;
  border-radius: 6px;
  border: 1px solid #e5e5e5;
  text-align: center;
  transition: transform 0.3s ease;
}

.wpsc-style-group-overview:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.wpsc-style-group-overview h3 {
  margin: 0 0 10px 0;
  color: #0073aa;
  font-size: 1.2em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wpsc-style-group-overview p {
  margin: 0;
  color: #666;
  line-height: 1.5;
}

/* Cart Custom Labels */
.wpsc-cart-custom-label {
  color: #0073aa;
  font-size: 0.85em;
  font-style: italic;
  margin-left: 5px;
}

/* Product Grid Enhancements */
.woocommerce ul.products li.product {
  position: relative;
  overflow: hidden;
}

.woocommerce ul.products li.product .wpsc-custom-label,
.woocommerce ul.products li.product .wpsc-featured-badge {
  position: absolute;
  top: 0px;
  left: 0px;
  z-index: 20;
}

.woocommerce ul.products li.product .wpsc-featured-badge {
  top: 10px;
  right: 10px;
  left: auto;
}

/* Single Product Page */
.single-product .wpsc-custom-label,
.single-product .wpsc-featured-badge {
  margin-bottom: 10px;
}

.single-product .wpsc-additional-info {
  margin-top: 30px;
}

/* Custom Color Integration */
.product.has-custom-color .wpsc-custom-label {
  background: var(--wpsc-custom-color, #0073aa);
}

.product.has-custom-color .wpsc-custom-label::before {
  background: linear-gradient(
    45deg,
    var(--wpsc-custom-color, #0073aa),
    var(--wpsc-custom-color-dark, #005a87)
  );
}

/* Hover Effects */
.woocommerce ul.products li.product:hover .wpsc-featured-badge {
  transform: scale(1.05);
  transition: transform 0.3s ease;
}

.woocommerce ul.products li.product:hover .wpsc-custom-label {
  transform: translateY(-2px);
  transition: transform 0.3s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
  .wpsc-custom-label,
  .wpsc-featured-badge {
    font-size: 0.7em;
    padding: 3px 6px;
  }

  .wpsc-featured-badge {
    padding: 4px 8px;
  }

  .wpsc-additional-info {
    margin-top: 15px;
    padding: 10px;
  }

  .wpsc-additional-info h3 {
    font-size: 1em;
  }

  .wpsc-individual-styles {
    margin-top: 20px;
    padding: 15px;
  }

  .wpsc-individual-styles h3 {
    font-size: 1.1em;
  }

  .wpsc-style-options {
    grid-template-columns: 1fr;
  }

  .wpsc-style-groups-overview {
    grid-template-columns: 1fr;
  }

  .wpsc-size-chart-modal-content {
    padding: 20px;
    width: 95%;
  }

  .wpsc-size-chart-data table {
    font-size: 0.9em;
  }

  .wpsc-size-chart-data th,
  .wpsc-size-chart-data td {
    padding: 8px;
  }
}

@media (max-width: 480px) {
  .woocommerce ul.products li.product .wpsc-custom-label,
  .woocommerce ul.products li.product .wpsc-featured-badge {
    top: 5px;
    left: 5px;
    font-size: 0.65em;
    padding: 2px 4px;
  }

  .woocommerce ul.products li.product .wpsc-featured-badge {
    top: 5px;
    right: 5px;
    left: auto;
    padding: 3px 6px;
  }

  .wpsc-style-option {
    padding: 8px;
  }

  .wpsc-style-image img {
    max-height: 80px;
  }
}

/* Checkout and Cart Pages */
.woocommerce-cart .wpsc-cart-custom-label,
.woocommerce-checkout .wpsc-cart-custom-label {
  display: block;
  margin-top: 2px;
  font-size: 0.8em;
}

/* Email Styles */
.woocommerce-email .wpsc-custom-label {
  background: #0073aa !important;
  color: #fff !important;
  padding: 4px 8px !important;
  border-radius: 3px !important;
  font-size: 0.8em !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  display: inline-block !important;
  margin-bottom: 5px !important;
}

.woocommerce-email .wpsc-featured-badge {
  background: #ffd700 !important;
  color: #000 !important;
  padding: 6px 12px !important;
  border-radius: 20px !important;
  font-size: 0.75em !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
  display: inline-block !important;
  margin-bottom: 8px !important;
}

/* Theme Compatibility */
.theme-twentytwentyone .wpsc-custom-label,
.theme-twentytwentyone .wpsc-featured-badge {
  font-family: var(--font-headings);
}

.theme-twentytwentyone .wpsc-additional-info {
  background: var(--color-background);
  border-color: var(--color-primary);
}

/* WooCommerce Blocks Compatibility */
.wc-block-grid__product .wpsc-custom-label,
.wc-block-grid__product .wpsc-featured-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 20;
}

.wc-block-grid__product .wpsc-featured-badge {
  top: 10px;
  right: 10px;
  left: auto;
}

/* Accessibility */
.wpsc-custom-label:focus,
.wpsc-featured-badge:focus,
.wpsc-style-option:focus {
  outline: 2px solid #0073aa;
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .wpsc-custom-label,
  .wpsc-featured-badge {
    background: #000 !important;
    color: #fff !important;
    border: 1px solid #000 !important;
  }

  .wpsc-additional-info {
    border: 1px solid #000 !important;
    background: #fff !important;
  }

  .wpsc-individual-styles,
  .wpsc-size-chart {
    border: 1px solid #000 !important;
    background: #fff !important;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .wpsc-custom-label {
    background: #000 !important;
    color: #fff !important;
    border: 2px solid #000 !important;
  }

  .wpsc-featured-badge {
    background: #000 !important;
    color: #fff !important;
    border: 2px solid #000 !important;
  }

  .wpsc-style-option {
    border: 2px solid #000 !important;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .wpsc-featured-badge {
    animation: none;
  }

  .woocommerce ul.products li.product:hover .wpsc-featured-badge,
  .woocommerce ul.products li.product:hover .wpsc-custom-label,
  .wpsc-style-option:hover {
    transform: none;
    transition: none;
  }
}
