/**
 * WooCommerce Overrides - Markite Child Theme
 * 
 * Organization by Page/Section:
 * 1. Global WooCommerce Components (Messages, Buttons, Forms)
 * 2. Shop Page (Product Listing)
 * 3. Single Product Page
 * 4. Cart Page
 * 5. Checkout Page
 * 6. Order Pages (Thank You, My Account Orders)
 * 7. Mini Cart (Widget)
 * 8. Responsive Design
 * 
 * @package markite-child
 * @since 2.0.0
 * @updated December 16, 2024
 */

/* =============================================================================
   1. GLOBAL WOOCOMMERCE COMPONENTS
   ============================================================================= */

/* ----- Messages ----- */
.woocommerce-error::before,
.woocommerce-info::before,
.woocommerce-message::before {
  content: unset;
}

.woocommerce-error::after,
.woocommerce-info::after,
.woocommerce-message::after {
  clear: unset;
  content: unset;
}

.woocommerce-error,
.woocommerce-info,
.woocommerce-message {
  padding-left: 20px;
}

.woocommerce-error li{
  padding-bottom: 20px;
}

.woocommerce-message {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  background: #f0f9f8;
}

.woocommerce-message::before {
  color: var(--accent-color);
  font-size: 1.2rem;
}

.woocommerce-message .m-btn {
  margin-left: auto;
  white-space: nowrap;
}

/* ----- Buttons ----- */
.woocommerce #respond input#submit,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.restore-item {
  padding: 14px 26px !important;
  background: var(--accent-color) !important;
  color: var(--bs-white) !important;
  border: unset !important;
  border-radius: unset !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  letter-spacing: 0.5px !important;
  text-transform: none !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.woocommerce #respond input#submit:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.restore-item:hover {
  -webkit-box-shadow: 0px 14px 20px 0px rgba(37, 17, 124, 0.16);
  -moz-box-shadow: 0px 14px 20px 0px rgba(37, 17, 124, 0.16);
  box-shadow: 0px 14px 20px 0px rgba(37, 17, 124, 0.16);
}

button.button {
  width: 100%;
}

/* ----- Forms ----- */
.woocommerce form .form-row select
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea {
  height: 40px;
  border: 1px solid #eaedff;
}

.woocommerce form.checkout_coupon,
.woocommerce form.login,
.woocommerce form.register {
  border-radius: unset; 
}

/* ----- Tables ----- */
.woocommerce table.shop_table tbody th,
.woocommerce table.shop_table tfoot td,
.woocommerce table.shop_table tfoot th,
.woocommerce-table__product-name,
.woocommerce-table__product-table {
  padding-left: unset !important;
  border-bottom: 1px !important;
}

/* ----- Price Components (Global) ----- */
.woocommerce-Price-amount.amount.markite-price-amount {
  display: inline-flex;
  align-items: baseline;
}

.markite-price-wrapper {
  display: inline-block;
}

.markite-currency-symbol {
  font-size: inherit;
  font-weight: inherit;
}

/* Sale Price */
.markite-sale-price-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.markite-regular-price,
del .woocommerce-Price-amount.amount {
  color: #999;
  font-weight: 400;
  text-decoration: line-through;
  font-size: 0.9em;
}

.markite-sale-price,
ins .woocommerce-Price-amount.amount {
  color: var(--accent-color, #005D82);
  font-weight: 700;
  text-decoration: none;
  background: none;
}

/* Subscription Price */
.markite-subscription-price {
  display: inline-block;
}

.markite-variable-subscription-price {
  display: inline-block;
}

/* =============================================================================
   2. SHOP PAGE (Product Listing)
   ============================================================================= */

/* Product Ordering Dropdown */
.woocommerce .woocommerce-ordering {
  margin: 0;
}

.woocommerce-ordering .orderby,
.form-select.orderby {
  border-radius: unset;
  padding-top: 9px;
  padding-bottom: 9px;
  caret-color: #0089B2;
  color: var(--accent-color);
  border: 1px solid #C3DCCF;
  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='%230089B2' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Product Quantity Display */
strong.product-quantity {
  color: var(--accent-color);
}

/* Product Card Prices (Shop Grid) */
.custom-product-price .woocommerce-Price-amount.amount {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-color, #005D82);
}

.custom-product-price .woocommerce-Price-amount.amount:contains("0.00"),
.woocommerce-Price-amount.amount[data-price="0"] {
  color: var(--button-free, #E0D575);
}

/* =============================================================================
   3. SINGLE PRODUCT PAGE
   ============================================================================= */

/* Product Price */
.single-product .price .woocommerce-Price-amount.amount {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-color, #005D82);
}

.single-product .price del .woocommerce-Price-amount.amount {
  font-size: 1.2rem;
  color: #999;
}

.single-product .price ins .woocommerce-Price-amount.amount {
  font-size: 1.5rem;
  color: var(--accent-color, #005D82);
}

/* =============================================================================
   4. CART PAGE
   ============================================================================= */

/* Cart Table - Alternating Row Colors */
.woocommerce-cart-form__cart-item.cart_item:nth-child(even) {
  background-color: #F0F0F0;
}

/* Cart Item Price */
.markite-cart-item-price {
  display: inline-block;
}

.markite-cart-item-price .woocommerce-Price-amount.amount {
  font-weight: 500;
}

/* Cart Variation Attributes */
dl.variation {
  display: block !important;
  margin: 0.5rem 0 0 !important;
  padding: 0 !important;
  font-size: 0.82em !important;
  color: #555 !important;
  line-height: 1.8 !important;
}

dl.variation dt {
  font-weight: 600 !important;
  text-transform: capitalize !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline !important;
  float: none !important;
}

dl.variation dd {
  margin: 0 0 0 0.25rem !important;
  padding: 0 !important;
  text-align: left !important;
  display: inline !important;
  float: none !important;
}

dl.variation dd p {
  margin: 0 !important;
  display: inline !important;
}

dl.variation dt::after {
  content: "" !important;
}

dl.variation dd::after {
  content: "" !important;
  display: block !important;
}

/* Trial Badge */
.trial-badge {
  display: inline-block !important;
  white-space: nowrap !important;
  background: #d97706 !important;
  color: white !important;
  padding: 2px 8px !important;
  border-radius: 12px !important;
  font-size: 0.75em !important;
  margin-left: 6px !important;
  vertical-align: middle !important;
  line-height: 1.4 !important;
}

/* Cart Item Subtotal */
.markite-cart-item-subtotal {
  display: inline-block;
}

.markite-cart-item-subtotal .woocommerce-Price-amount.amount {
  font-weight: 600;
  color: var(--accent-color, #005D82);
}

/* Cart Totals Table */
#add_payment_method .cart-collaterals .cart_totals tr td,
#add_payment_method .cart-collaterals .cart_totals tr th,
.woocommerce-cart .cart-collaterals .cart_totals tr td,
.woocommerce-cart .cart-collaterals .cart_totals tr th,
.woocommerce-checkout .cart-collaterals .cart_totals tr td,
.woocommerce-checkout .cart-collaterals .cart_totals tr th {
  border-top: 0px solid #e9e6ed;
}

.woocommerce .cart_totals table.shop_table th{
  border-bottom: 1px solid #e9e6ed !important;
}

.cart-subtotal th,
.cart-subtotal td {
  border-bottom: 1px solid #e9e6ed !important;
}

.cart_totals .woocommerce-Price-amount.amount {
  font-weight: 600;
}

/* =============================================================================
   5. CHECKOUT PAGE
   ============================================================================= */

/* Checkout Forms */
.select2-dropdown{
  height: 40px;
  border: 1px solid #e9e6ed !important;
}

.select2-results{
  background-color: #fff !important;
  border: 1px solid #e9e6ed;
}

/* Payment Section */
#add_payment_method #payment,
.woocommerce-cart #payment,
.woocommerce-checkout #payment {
  background: rgba(129,110,153,.14);
  border-radius: unset;
}

/* Product Quantity Display */
td.product-quantity.text-center{
  color:#0089B2 !important;
}

/* Checkout Order Review Prices */
.woocommerce-checkout-review-order-table .woocommerce-Price-amount.amount {
  font-weight: 500;
}

.woocommerce-checkout-review-order-table .order-total .woocommerce-Price-amount.amount {
  font-size: 1.2rem;
  font-weight: 700;
}

/* Pay-for-Order Table Alignment */
#order_review .shop_table th.product-total,
#order_review .shop_table td.product-subtotal,
#order_review .shop_table tfoot td {
  text-align: right;
}

#order_review .shop_table td,
#order_review .shop_table th {
 
  vertical-align: middle;
}

#order_review .shop_table thead th {
  border-bottom: 2px solid #e9e6ed;
}

#order_review .shop_table tfoot th {
  text-align: left;
}

/* =============================================================================
   6. ORDER PAGES (Thank You & My Account Orders)
   ============================================================================= */

/* Order Overview */
.woocommerce-order-overview.woocommerce-thankyou-order-details.order_details {
  padding-left: unset;
}

/* Order Item Price */
.markite-order-item-price {
  display: inline-block;
}

/* =============================================================================
   7. MINI CART (Widget)
   ============================================================================= */

/* Mini Cart Item Price */
.woocommerce-mini-cart-item .woocommerce-Price-amount.amount {
  font-size: 0.9rem;
  font-weight: 500;
}

/* Mini Cart Total */
.woocommerce-mini-cart__total .woocommerce-Price-amount.amount {
  font-weight: 700;
  color: var(--accent-color, #005D82);
}

/* =============================================================================
   8. RESPONSIVE DESIGN - MOBILE FIRST APPROACH
   ============================================================================= */

/* Mobile devices (767px and below) */
@media (max-width: 767px) {
  /* Messages */
  .woocommerce-message {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .woocommerce-message .m-btn {
    margin-left: 0;
    width: 100%;
  }
  
  /* Shop Grid Prices */
  .custom-product-price .woocommerce-Price-amount.amount {
    font-size: 1rem;
  }
  
  /* Single Product Prices */
  .single-product .price .woocommerce-Price-amount.amount {
    font-size: 1.25rem;
  }
  
  .single-product .price del .woocommerce-Price-amount.amount {
    font-size: 1rem;
  }
  
  /* Checkout Order Total */
  .order-total .woocommerce-Price-amount.amount {
    font-size: 1.1rem;
  }
}

/* ==========================================================================
   Checkout Terms & Conditions
   ========================================================================== */

/* Terms and conditions checkbox links styling */
.woocommerce-terms-and-conditions-wrapper .woocommerce-terms-and-conditions-link,
.woocommerce-terms-and-conditions-wrapper .woocommerce-privacy-policy-link {
  text-decoration: underline !important;
  color: inherit;
}

.woocommerce-terms-and-conditions-wrapper .woocommerce-terms-and-conditions-link:hover,
.woocommerce-terms-and-conditions-wrapper .woocommerce-privacy-policy-link:hover {
  text-decoration: underline !important;
  opacity: 0.8;
}

/* Ensure the terms checkbox text styling matches the design */
.woocommerce-terms-and-conditions-wrapper .woocommerce-form__label-for-checkbox span {
  font-style: normal;
}

/* ==========================================================================
   Order-Pay Login Override
   ========================================================================== */

body.woocommerce-order-pay .page-area {
  padding-top: 0;
  padding-bottom: 40px;
}

body.woocommerce-order-pay .page-area .markite-page-content > .post-entry {
  margin-top: 0;
}

.geovonic-order-pay-login {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Pay-for-order table: centre the quantity column */
form#order_review .shop_table td.product-quantity,
form#order_review .shop_table th.product-quantity {
  text-align: left;
}