/* Common Flip Card Styles - Used on PLP, PDP, Home Page, and anywhere else */

/* Flip Card Wrapper */
.rx-product-card-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  perspective: 1000px;
  z-index: 1;
  display: block;
}

.rx-product-card-wrapper.rx-has-subscription {
  min-height: 400px;
}

/* WooCommerce Product Items */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
  position: relative;
  overflow: hidden;
}

.woocommerce ul.products li.product .rx-product-card-wrapper,
.woocommerce-page ul.products li.product .rx-product-card-wrapper {
  width: 100%;
  height: 100%;
  box-sizing: border-box;padding-bottom: 25px;
}

/* Showcase Cards (Home Page) */
.rx-showcase-card .rx-product-card-wrapper {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

/* Flip Card Front and Back */
.rx-product-card-wrapper .rx-flip-card-front {
  position: relative;
  width: 100%;
  height: 100%;
}

.rx-product-card-wrapper .rx-flip-card-front,
.rx-product-card-wrapper .rx-flip-card-back {
  position: relative;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.rx-product-card-wrapper .rx-flip-card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotateY(180deg);
  background: #ffffff;
  padding: 20px;
  padding-top: 48px;
  padding-right: 20px;
  border-radius: 8px;
  box-shadow: none;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 10;
  box-sizing: border-box;
}

.rx-product-card-wrapper.rx-flipped .rx-flip-card-front {
  transform: rotateY(180deg);
}

.rx-product-card-wrapper.rx-flipped .rx-flip-card-back {
  transform: rotateY(0deg);
}

/* Close Button */
.rx-flip-card-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 0;
  transition: opacity 0.2s ease;
}

.rx-flip-card-close:hover {
  opacity: 0.7;
}

.rx-flip-card-close svg {
  width: 20px;
  height: 20px;
  color: #000000;
}

/* Back Card Content */
.rx-flip-card-back-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 0;
  padding-right: 0;
  width: 100%;
  box-sizing: border-box;
}

/* Payment Plan Section */
.rx-payment-plan-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 0;
  position: relative;
}

.rx-payment-plan-title {
  font-size: 12px !important;
  font-weight: 500;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
  flex-shrink: 0;
}

.rx-payment-plan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: -13px;
}

/* Subscription Options */
.rx-subscription-options {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rx-subscription-option {
  margin: 0;
  padding: 0;
}

body .woocommerce-page label {
  margin-bottom: 0.3em;
}

.rx-subscription-label {
  display: flex;
  cursor: pointer;
  padding: 11px 9px;
  border: 1px solid #e3E3E3;
  border-radius: 8px;
  transition: all 0.2s ease;
  background: #ffffff;
}

.rx-subscription-label:hover {
  border-color: #d1d5db;
  background: #f9fafb;
}

.rx-subscription-label input[type="radio"] {
  display: inline-block;
  margin-right: 8px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #EAB67A;
  vertical-align: middle;
  flex-shrink: 0;
}

.rx-subscription-label input[type="radio"]:checked + .rx-subscription-option-content {
  color: #000000;
  flex-grow: 1;
}

.rx-subscription-label.checked {
  border-color: #E69F71;
  background: #FFFCF6;
}

.rx-subscription-option-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rx-subscription-option-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.rx-subscription-option-title {
  font-size: 12px;
  font-weight: 500;
  color: #333333;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rx-popular-badge {
  display: inline-block;
  background: #E69F71;
  color: #ffffff;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 4px 8px;
  border-radius: 50px;
  margin-left: 8px;
}

.rx-subscription-option-price {
  font-size: 14px;
  font-weight: 600;
  color: #333333;
}

.rx-subscription-option-price-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.rx-subscription-regular-price {
  font-size: 14px;
  color: #999999;
  text-decoration: line-through;
}

.rx-subscription-sale-price {
  font-size: 18px;
  font-weight: 600;
  color: #333333;
}

.rx-subscription-period-selector {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.rx-subscription-period-label {
  font-size: 12px;
  font-weight: 500;
  color: #666666;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rx-subscription-period-dropdown {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 14px;
  background: #ffffff;
  color: #333333;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.rx-subscription-period-dropdown:hover {
  border-color: #d1d5db;
}

.rx-subscription-period-dropdown:focus {
  outline: none;
  border-color: #000000;
}

/* Quantity Controls */
.rx-flip-card-qty-wrapper {
  flex-shrink: 0;
}

.rx-flip-card-qty-controls {
  display: flex;
  align-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 50px;
  overflow: hidden;
  background: #ffffff;
}

.rx-flip-card-qty-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: #ffffff;
  color: #333333;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
  padding: 0;
  flex-shrink: 0;
}

.rx-flip-card-qty-btn:hover {
  background: #f9fafb;
}

.rx-flip-card-qty-btn:active {
  background: #e5e7eb;
}

.rx-flip-card-qty-minus {
  border-right: 1px solid #e5e7eb;
}

.rx-flip-card-qty-plus {
  border-left: 1px solid #e5e7eb;
}

.rx-flip-card-qty-input {
  width: 38px;
  text-align: center;
  border: none !important;
  border-left: 1px solid #e5e7eb !important;
  border-right: 1px solid #e5e7eb !important;
  border-radius: 0;
  padding: 5px 8px;
  font-size: 14px;
  font-weight: 500;
  background: #ffffff;
  appearance: textfield;
  -moz-appearance: textfield;
  margin: 0;
  box-shadow: none;
}

.rx-flip-card-qty-input::-webkit-outer-spin-button,
.rx-flip-card-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Actions */
.rx-flip-card-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
}

.rx-flip-card-add-to-cart,
.rx-flip-card-view-details {
  width: 100%;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 50px;
  text-align: center;
  text-decoration: none;
  display: block;
  transition: all 0.2s ease;
}

.rx-flip-card-add-to-cart {
  background: linear-gradient(90deg, #FDCEBB -12.71%, #FFEDBF 100%);
  color: #333;
  border: 0px solid transparent;
}

.rx-flip-card-add-to-cart:hover {
  background-color: #333333;
  border-color: #333333;
}

.rx-flip-card-add-to-cart:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.rx-flip-card-view-details {
  background-color: transparent;
  color: #728486;
  border: 1px solid #728486;
  border-radius: 50px;
}

.rx-flip-card-view-details:hover {
  background-color: #f9fafb;
}

/* Buy Now Button */
.rx-buy-now-button {
  display: inline-block;
  padding: 10px 20px;
  background-color: #000;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 600;
  text-align: center;
  margin-top: 10px;
  border: none;
  cursor: pointer;
  width: 100%;
  transition: background-color 0.2s ease;
}

.rx-buy-now-button:hover {
  background-color: #333333;
}

/* Loader Styles */
.rx-loader {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: rx-spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes rx-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Cart Messages */
.rx-cart-message {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #000000;
  color: #ffffff;
  padding: 16px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  font-size: 14px;
  font-weight: 500;
  animation: rx-slide-in 0.3s ease-out;
  max-width: 300px;
  opacity: 0;
  transform: translateX(100%);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.rx-cart-message.rx-show {
  opacity: 1;
  transform: translateX(0);
}

.rx-cart-message.error,
.rx-cart-message.rx-cart-message-error {
  background: #dc2626;
}

@keyframes rx-slide-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Responsive Styles */
@media (max-width: 768px) {
  .rx-product-card-wrapper.rx-has-subscription {
    min-height: 1px;
  }

  .rx-flip-card-back {
    padding: 16px;
  }

  .rx-subscription-option-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .rx-subscription-option-price {
    font-size: 20px;
  }

  .rx-payment-plan-header {
    /* flex-direction: column; */
    align-items: flex-start;
  }
}

@media (max-width:767px) {
.rx-subscription-option-content{    max-width: calc(100% - 26px);}
.rx-subscription-option-price-wrapper{flex-direction: column;}

.rx-flip-card-add-to-cart, .rx-flip-card-view-details{font-size: 12px;}

}

@media (max-width: 580px) {

  /* flip card css */


.rx-showcase-card{
  padding: 20px 0 !important;
}

.rx-subscription-option-header {
  flex-direction: row !important;
}

.rx-subscription-option-content {
  flex-direction: row !important;
}

.rx-flip-card-back-content{
  gap: 0 !important;
}

.rx-product-card-wrapper.rx-has-subscription {
  min-height: none !important;
}

.rx-showcase-image-wrapper img {
  min-height: auto !important; 
  max-height: none !important ; 
  height: auto !important;

}

body.woocommerce ul.products, body.woocommerce-page ul.products {
  grid-template-columns: repeat(1, 1fr);
  gap: 12px;
}

.rx-subscription-options{
  gap: 0 !important;
  margin-bottom: 0 !important;
}


.woocommerce-page label {
  margin-bottom: -0.3em !important;
}


}

