/* Points Dashboard - My Account Page */

.pr-point-log-wrapper {
  background: #f8f9fa;
  min-height: 100vh;
  padding: 40px 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.pr-point-log-container {
  max-width: 900px;
  margin: 0 auto;
}

.pr-points-dashboard {
  background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 40px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.pr-points-dashboard h2 {
  color: #1d2327;
  font-size: 1.8em;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 3px solid #2271b1;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Grid Layout for Points Cards */
.pr-points-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

@media (max-width: 768px) {
  .pr-points-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.pr-points-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 24px 20px;
  text-align: center;
}

.pr-points-card:hover {
  border-color: #d1d5db;
}

.pr-card-header {
  font-size: 0.7rem;
  color: #6b7280;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.pr-card-value {
  font-size: 2rem;
  font-weight: 700;
  color: #111827;
  line-height: 1;
  margin-bottom: 8px;
}

.pr-card-label {
  font-size: 0.8rem;
  color: #9ca3af;
  font-weight: 400;
}

/* Points Breakdown Section */
.pr-points-breakdown {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 25px;
}

.pr-points-breakdown h3 {
  color: #1d2327;
  font-size: 1.2em;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pr-points-breakdown ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pr-points-breakdown li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #e5e7eb;
  font-size: 1em;
}

.pr-points-breakdown li:last-child {
  border-bottom: none;
}

.pr-points-breakdown strong {
  color: #1d2327;
  font-weight: 600;
}

.pr-points-breakdown span {
  color: #374151;
  font-weight: 500;
  text-align: right;
}

.pr-points-breakdown small {
  display: block;
  font-size: 0.8em;
  color: #9ca3af;
  margin-top: 2px;
}

/* Points Note */
.pr-points-note {
  background: #eff6ff;
  border-left: 4px solid #2271b1;
  padding: 15px 20px;
  border-radius: 4px;
  color: #1e40af;
  font-size: 0.95em;
  margin: 0;
  line-height: 1.5;
}

.pr-points-note a {
  color: #2271b1;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid #2271b1;
  transition: all 0.2s ease;
}

.pr-points-note a:hover {
  color: #1e40af;
  border-bottom-color: #1e40af;
}

/* Points History Page */
.pr-points-history {
  padding: 20px 0;
}

.pr-points-history h2 {
  color: #1d2327;
  font-size: 1.8em;
  font-weight: 700;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 3px solid #2271b1;
}

.pr-points-history h3 {
  color: #1d2327;
  font-size: 1.2em;
  font-weight: 700;
  margin-top: 25px;
  margin-bottom: 15px;
}

.pr-history-info {
  background: #f3f4f6;
  border-radius: 8px;
  padding: 15px 20px;
  margin-bottom: 30px;
  color: #374151;
  font-size: 0.95em;
  line-height: 1.6;
}

.pr-history-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
}

.pr-history-list li {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 12px;
  line-height: 1.6;
  transition: all 0.2s ease;
}

.pr-history-list li:hover {
  border-color: #2271b1;
  box-shadow: 0 2px 8px rgba(34, 113, 177, 0.1);
}

.pr-history-list strong {
  color: #1d2327;
  font-weight: 600;
}

.pr-history-list small {
  display: block;
  color: #6b7280;
  margin-top: 5px;
  font-size: 0.9em;
}

.pr-points-contact {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 6px;
  padding: 15px;
  color: #92400e;
  font-size: 0.95em;
  margin-top: 30px;
}

.pr-points-contact a {
  color: #d97706;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid #d97706;
  transition: all 0.2s ease;
}

.pr-points-contact a:hover {
  color: #b45309;
  border-bottom-color: #b45309;
}

/* Responsive Design */
@media (max-width: 768px) {
  .pr-points-dashboard {
    padding: 20px;
  }

  .pr-points-dashboard h2 {
    font-size: 1.5em;
  }

  .pr-points-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .pr-card-value {
    font-size: 1.8em;
  }

  .pr-points-breakdown {
    padding: 15px;
  }

  .pr-points-breakdown li {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .pr-points-breakdown span {
    text-align: left;
  }
}

@media (max-width: 480px) {
  .pr-points-dashboard {
    padding: 15px;
    margin-bottom: 20px;
  }

  .pr-points-dashboard h2 {
    font-size: 1.3em;
    margin-bottom: 20px;
  }

  .pr-card-value {
    font-size: 1.5em;
  }

  .pr-points-breakdown h3 {
    font-size: 1em;
  }

  .pr-points-note {
    font-size: 0.85em;
    padding: 12px 15px;
  }
}

/* Cart and Checkout Points Payment */
.pr-cart-points-option,
.pr-checkout-points-option {
  background: #f8f9fa;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 15px;
  margin: 10px 0;
}

.pr-cart-points-option label,
.pr-checkout-points-option label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
  color: #1d2327;
  margin: 0;
}

.pr-cart-points-option input[type="checkbox"],
.pr-checkout-points-option input[type="checkbox"] {
  margin-right: 10px;
  transform: scale(1.2);
}

.pr-cart-points-row,
.pr-checkout-points-row {
  background: #fff8e1;
  border-top: 2px solid #ffc107;
}

.pr-cart-points-row th,
.pr-checkout-points-row th {
  padding: 15px !important;
  text-align: left !important;
}

/* Points-Only Products Styling */
.pr-points-price {
  color: #000000;
  font-weight: 400;
  font-size: 1.2em;
  text-align: center;
  display: block;
}

.pr-points-only-purchase {
  margin-top: 20px;
  display: flex;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
}

.pr-points-only-purchase .single_add_to_cart_button {
  background: #2271b1 !important;
  border-color: #2271b1 !important;
  color: white !important;
  font-weight: 600 !important;
  padding: 12px 32px !important;
  border-radius: 6px !important;
  transition: all 0.2s ease !important;
  height: 46px !important;
  line-height: 22px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  flex-grow: 0 !important;
}

.pr-points-only-purchase .single_add_to_cart_button:hover {
  background: #135e96 !important;
  border-color: #135e96 !important;
}

.pr-points-info {
  color: #666;
  font-size: 0.9em;
  margin: 0 !important;
  flex-grow: 1;
}

/* Align button with quantity selector in product form */
.pr-points-ui-wrapper {
  display: inline-flex;
  flex-direction: column;
  vertical-align: top;
  margin-left: 10px;
}

.pr-points-layout .quantity {
  margin-right: 10px !important;
  vertical-align: top;
  display: inline-block;
}

@media (max-width: 480px) {
  /* On mobile, center everything in a vertical column */
  .pr-points-layout {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important; /* Quantity left-aligned */
  }
  
  /* Reset quantity to natural width */
  .pr-points-layout .quantity {
    margin-right: 0 !important;
    margin-bottom: 12px !important;
    width: auto !important;
    flex-basis: auto !important;
  }

  /* Align the points wrapper to the left */
  .pr-points-ui-wrapper {
    margin-left: 0 !important;
    margin-top: 0 !important;
    width: 100% !important;
    align-items: flex-start !important;
    display: flex !important;
  }
  
  /* Button keeps natural width but aligns left */
  .pr-points-action-container .single_add_to_cart_button {
    width: auto !important;
    min-width: 200px;
  }
  
  .pr-points-info {
    text-align: left;
    width: 100%;
    /* Polish the text appearance */
    font-size: 0.9em !important;
    color: #555;
    margin-top: 8px !important;
  }
}

.pr-points-action-container .single_add_to_cart_button {
  margin: 0 !important;
  float: none !important;
  width: auto !important;
  flex-shrink: 0 !important;
}

.pr-points-info {
  margin: 0 !important;
  margin-top: 5px !important;
  /* subtle desktop styling */
  font-size: 0.9em; 
  color: #555;
  white-space: nowrap !important;
}


/* Ensure quantity and points button sit inline for simple and variable products */
/* COMMENTED OUT - See below
.woocommerce div.product form.cart,
.woocommerce div.product form.cart .variations_button,
.woocommerce div.product .single_variation_wrap,
.woocommerce div.product .variations_button .quantity {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  flex-wrap: nowrap !important;
}
*/

/* COMMENTED OUT - Breaks non-points products
.woocommerce div.product form.cart .quantity {
  order: 1 !important;
  margin: 0 !important;
}

.woocommerce div.product form.cart .single_add_to_cart_button[name="pr_purchase_with_points"],
.woocommerce div.product .variations_button .single_add_to_cart_button[name="pr_purchase_with_points"] {
  order: 2 !important;
  margin: 0 !important;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}
*/

.pr-insufficient-points {
  display: block;
  text-align: center;
  background: #fffaf0;
  border: 1px solid #f0e6c8;
  border-radius: 8px;
  padding: 14px 16px;
  margin: 16px 0 0 0;
  color: #111;
}

.pr-insufficient-points::before {
  content: "";
  display: none;
}

.pr-insufficient-points::after {
  display: none;
}

.pr-insufficient-points p {
  margin: 0;
  color: #111;
  font-size: 0.92rem;
  line-height: 1.5;
}

.pr-insufficient-points p:last-child {
  margin-bottom: 0;
}

.pr-points-required {
  font-size: 0.95rem;
  font-weight: 700;
  display: block;
}

.pr-points-required::before {
  display: none;
}

.pr-points-required::after {
  display: none;
}

.pr-points-available {
  font-size: 0.9rem;
  display: block;
  font-weight: 600;
  color: #111;
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid #e4d8ae;
}

.pr-earn-more {
  font-size: 0.9rem;
  margin-top: 10px;
}

/* Checkout Page - Points-Only Products */
.woocommerce-checkout .pr-checkout-points-notice {
  background: linear-gradient(135deg, #e7f3ff 0%, #f0f8ff 100%);
  border-left: 4px solid #2271b1;
  border-radius: 6px;
  padding: 15px 20px;
  margin-bottom: 25px;
  color: #0c5aa0;
  box-shadow: 0 2px 4px rgba(34, 113, 177, 0.1);
}

.pr-checkout-points-notice p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  font-weight: 500;
}

/* Hide prices for points-only items at checkout, show points instead */
.woocommerce-checkout table.shop_table td.product-total,
.woocommerce-checkout table.shop_table td.product-price {
  text-align: right;
}

/* Override price display for points-only products */
.woocommerce-checkout .pr-points-product-price {
  color: #27ae60;
  font-weight: 700;
  font-size: 1.15em;
  display: inline-block;
  padding: 2px 8px;
  background: #e8f5e9;
  border-radius: 4px;
  letter-spacing: 0.3px;
}

/* Cart item data - Payment Method indicator */
.woocommerce-checkout .woocommerce-checkout-review-order-table dl {
  margin: 8px 0;
}

.woocommerce-checkout .woocommerce-checkout-review-order-table dt {
  font-weight: 600;
  color: #1d2327;
  margin-bottom: 4px;
}

.woocommerce-checkout .woocommerce-checkout-review-order-table dd {
  margin: 0;
  color: #27ae60;
  font-weight: 600;
}
