/**
 * Frontend Pricing Styles
 * Prefix: .wppe-
 */

/* Global Font size reset to 16px */
:root {
  --wp--preset--font-size--large: 16px !important;
  --wp--preset--font-size--medium: 16px !important;
  --wp--preset--font-size--normal: 16px !important;
  --wp--preset--font-size--small: 14px !important;
}

/* Base Paragraph and text override */
p, .entry-content p, .entry-summary p {
  font-size: 16px !important;
}

#woo-print-pricing-wrapper {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  color: #334155; /* Slate 700 */
  margin: 2rem auto;
  width: 100%;
  font-size: 16px !important;
}

# woo-print-pricing-wrapper p, 
#woo-print-pricing-wrapper li, 
#woo-print-pricing-wrapper div,
#woo-print-pricing-wrapper span,
#woo-print-pricing-wrapper td,
#woo-print-pricing-wrapper th {
  font-size: 16px !important;
}

@media screen and (max-width: 768px) {
  p, .entry-content p, .entry-summary p,
  #woo-print-pricing-wrapper,
  #woo-print-pricing-wrapper p, 
  #woo-print-pricing-wrapper li, 
  #woo-print-pricing-wrapper div,
  #woo-print-pricing-wrapper span,
  #woo-print-pricing-wrapper td,
  #woo-print-pricing-wrapper th {
    font-size: 15px !important;
  }
}

#woo-print-pricing-wrapper * {
  box-sizing: border-box;
}

/* Header */
.wppe-header {
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
}

.wppe-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1e293b; /* Slate 800 */
  margin: 0;
}

/* Groups and Options */
.wppe-group-card {
  background: #ffffff;
  margin-bottom: 1.5rem;
}

.wppe-group-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b; /* Slate 500 */
  margin-bottom: 0.75rem;
}

.wppe-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
}

.wppe-option-label {
  position: relative;
  cursor: pointer;
  display: block;
  min-width: 0;
}

.wppe-option-input {
  user-select: none;
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.wppe-option-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem 1.25rem;
  border: 2px solid #eaeaea;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  height: 100%;
  text-align: center;
}

.wppe-option-input:checked + .wppe-option-inner {
  background: #ffffff;
  border-color: #000088; /* Indigo 600 */
}

.wppe-option-img-wrapper {
  width: 48px;
  height: 48px;
  margin-bottom: 0.5rem;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wppe-option-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.wppe-option-name {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
  line-height: 1.25;
  white-space: normal;
  overflow: hidden;
  width: 100%;
}

.wppe-option-input:checked + .wppe-option-inner .wppe-option-name {
  color: #000088;
}

.wppe-option-price-tag {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #000088;
  background: #e0e7ff;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  white-space: nowrap;
}

/* Selection Indicator */
.wppe-selection-indicator {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  background: #ffffff;
}

.wppe-selection-indicator::after {
  content: '';
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  opacity: 0;
  margin-bottom: 2px;
  transition: opacity 0.2s;
}

.wppe-option-input:checked + .wppe-option-inner .wppe-selection-indicator {
  background: #000088;
  border-color: #000088;
}

.wppe-option-input:checked + .wppe-option-inner .wppe-selection-indicator::after {
  opacity: 1;
}

/* Summary Card */
.wppe-summary-card {
  background: #fff; /* Slate 900 */
  color: #f8fafc;
  border-radius: 0.5rem;
  overflow: hidden;
  margin-top: 2rem;
  border: 1px solid #c3c3c3;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}


.wppe-summary-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #505050; /* Slate 400 */
  padding: 5px 10px;
  border-bottom: 1px solid #e2e2e2;
  padding-bottom: 0.5rem;
}

.wppe-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 10px;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  color: #000; /* Slate 300 */
  white-space: nowrap;
  gap: 10px;
}

.wppe-summary-row.accent-row {
  border-top: 1px solid #e2e2e2;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
}

.wppe-summary-val {
  font-family: monospace;
  font-weight: 500;
  color: #000000;
}

.wppe-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 1.5rem;
  padding-top: 1rem;
  padding:  10px;
  border-top: 1px solid #bcbcbc;
}

.wppe-total-label {
  font-size: 1rem;
  font-weight: 600;
  color: #000000;
}

.wppe-total-price {
  font-size: 1.875rem;
  font-weight: 700;
  color: #000000;
  line-height: 1;
  transition: color 0.3s ease;
}

.wppe-total-price.highlight {
  color: #818cf8; /* Indigo 400 */
}

.wppe-special-tag {
  font-size: 0.75rem;
  background: rgba(74, 222, 128, 0.1);
  color: #4ade80;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  margin-left: 0.5rem;
  display: inline-block;
}


/* Dropdown Styles */
.wppe-option-dropdown {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23334155' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 12px;
  padding-right: 2.5rem;
}

.wppe-option-dropdown:hover {
  border-color: #cbd5e1;
}

.wppe-option-dropdown:focus {
  outline: none;
  border-color: #000088;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.wppe-option-dropdown option {
  padding: 0.5rem;
}

/* Animations */
.animate-fadeIn {
  animation: wppeFadeIn 0.3s ease-out forwards;
}

@keyframes wppeFadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Bulk Pricing Table */
.wppe-bulk-pricing-info {
  margin-top: 1rem;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 0.5rem;
  font-size: 0.8rem;
}

.wppe-bulk-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
}

.wppe-bulk-pricing-info h4 {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #505050;
  letter-spacing: 0.05em;
}

.wppe-bulk-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  border: none;
  border-radius: 9999px;
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wppe-bulk-toggle:hover {
  background: #e2e8f0;
  color: #334155;
}

.wppe-bulk-toggle svg {
  width: 12px;
  height: 12px;
  color: #94a3b8;
}

.wppe-bulk-table-container {
  border-top: 1px solid #f1f5f9;
  padding-bottom: 0.5rem;
}

.wppe-bulk-table {
  width: 100%;
  border-collapse: collapse;
}

#woo-print-pricing-wrapper .wppe-bulk-table th,
#woo-print-pricing-wrapper .wppe-bulk-table td {
  padding: 0.4rem 0.5rem !important;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
}

.wppe-bulk-table th {
  font-weight: 600;
  color: #334155;
  background: #f8fafc;
  font-size: 0.75rem;
}

.wppe-bulk-table td {
  color: #475569;
}

.wppe-bulk-table tr:last-child td {
  border-bottom: none;
}

form.cart .button{
  border-radius: 6px!important;
  padding: 1rem 2.5rem!important;
  border: 1px solid #cdcdcd!important;
  background: #ededed;
  color: #000;
  width: 100%;
  font-family: inherit!important;
}

form.cart>.single_add_to_cart_button{
  grid-column: 2 / -1!important;
  width: 100%!important;
  padding: 1rem 2.5rem!important;
  background: #000!important;
  border-radius: 6px!important;
}

/* Mobile Responsive: Row Layout */
@media screen and (max-width: 480px) {
  .wppe-options-grid {
    grid-template-columns: 1fr !important;
    gap: 0.5rem;
  }

  .wppe-option-inner {
    flex-direction: row !important;
    justify-content: flex-start !important;
    text-align: left !important;
    padding: 0.75rem !important;
    gap: 12px;
  }

  .wppe-option-img-wrapper {
    margin-bottom: 0 !important;
    flex-shrink: 0;
  }

  .wppe-option-details {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-width: 0;
  }

  .wppe-option-name {
    font-size: 0.9rem;
    white-space: normal;
  }

  .wppe-option-price-tag {
    margin-top: 4px;
    align-self: flex-start;
  }

  .wppe-selection-indicator {
    position: static !important;
    margin-left: auto;
    flex-shrink: 0;
  }

  .woocommerce div.product form.cart .button {
    padding: 0.5rem 1.5rem;
  }
}

.woocommerce-product-gallery {
    position: sticky!important;
    top: 100px;
}