/* ================================================================
   MTAJRI THEME — WOOCOMMERCE.CSS
   Fine-grained WooCommerce overrides layered on top of main.css
   ================================================================ */

/* ── Ratings ── */
.star-rating { direction: rtl; }
.star-rating span::before,
.wc-block-components-product-rating__stars::before {
  color: #f97316 !important;
}
.woocommerce-product-rating { margin-bottom: 12px; }

/* ── Sale Flash ── */
.woocommerce span.onsale {
  position: absolute;
  top: 10px;
  right: 10px;
  left: auto;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  z-index: 2;
  min-height: auto;
  min-width: auto;
  line-height: 1.6;
}

/* ── Quantity Input ── */
.woocommerce .quantity input.qty {
  text-align: center;
  padding: 10px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 16px;
  width: 68px;
  background: #fff;
  color: #1a1a2e;
  font-family: inherit;
  direction: ltr; /* numbers are always LTR */
}

/* ── Product Tabs ── */
.woocommerce div.product .woocommerce-tabs ul.tabs::before { border-bottom-color: #e5e7eb; }
.woocommerce div.product .woocommerce-tabs ul.tabs li.active a { color: #f97316; }
.woocommerce div.product .woocommerce-tabs ul.tabs li.active { border-color: #e5e7eb; background: #fff; }
.woocommerce div.product .woocommerce-tabs ul.tabs li a:hover { color: #f97316; }

/* ── Single Product Gallery ── */
.woocommerce-product-gallery__image { border-radius: 12px; overflow: hidden; }
.woocommerce-product-gallery .flex-viewport { border-radius: 12px; overflow: hidden; }
.woocommerce-product-gallery ol.flex-control-thumbs li img {
  border-radius: 6px;
  opacity: .6;
  transition: opacity .2s;
  border: 2px solid transparent;
}
.woocommerce-product-gallery ol.flex-control-thumbs li img.flex-active,
.woocommerce-product-gallery ol.flex-control-thumbs li img:hover {
  opacity: 1;
  border-color: #f97316;
}

/* ── Checkout Fields ── */
.woocommerce-billing-fields__field-wrapper,
.woocommerce-shipping-fields__field-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}
.woocommerce-billing-fields__field-wrapper .form-row-wide,
.woocommerce-shipping-fields__field-wrapper .form-row-wide { grid-column: 1 / -1; }
@media (max-width: 600px) {
  .woocommerce-billing-fields__field-wrapper,
  .woocommerce-shipping-fields__field-wrapper { grid-template-columns: 1fr; }
}

/* ── Cart Table ── */
.woocommerce-cart-form .remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fef2f2;
  color: #ef4444 !important;
  font-size: 13px;
  font-weight: 700;
  transition: background .2s;
  border: 1px solid #fecaca;
}
.woocommerce-cart-form .remove:hover { background: #ef4444; color: #fff !important; opacity: 1; }

/* ── Mini Cart (widget) ── */
.widget_shopping_cart .cart_list { list-style: none; padding: 0; }
.widget_shopping_cart .cart_list li { padding: 10px 0; border-bottom: 1px solid #f3f4f6; font-size: 13px; }
.widget_shopping_cart .cart_list li a { color: #1a1a2e; font-weight: 600; }
.widget_shopping_cart .cart_list li a:hover { color: #f97316; opacity: 1; }
.widget_shopping_cart .woocommerce-mini-cart__buttons { display: flex; gap: 8px; margin-top: 14px; }
.widget_shopping_cart .woocommerce-mini-cart__buttons a { flex: 1; text-align: center; }
.widget_shopping_cart .woocommerce-mini-cart__total { font-size: 15px; font-weight: 700; padding: 10px 0; }

/* ── Notices (WooCommerce) ── */
.woocommerce-message,
.woocommerce-error,
.woocommerce-info { direction: rtl; }
.woocommerce-message .button { margin-right: 0; margin-left: 8px; }

/* ── Account Page ── */
.woocommerce-account .addresses .title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.woocommerce-account address { font-style: normal; font-size: 14px; color: #374151; line-height: 1.7; }
.woocommerce-orders-table th { font-size: 13px; color: #374151; font-weight: 700; text-align: right; padding: 10px 12px; border-bottom: 2px solid #e5e7eb; }
.woocommerce-orders-table td { padding: 12px; border-bottom: 1px solid #f3f4f6; font-size: 14px; text-align: right; }
.woocommerce-orders-table .order-status { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.woocommerce-orders-table .wc-processing { background: #eff6ff; color: #1d4ed8; }
.woocommerce-orders-table .wc-completed { background: #f0fdf4; color: #166534; }
.woocommerce-orders-table .wc-cancelled, .woocommerce-orders-table .wc-failed { background: #fef2f2; color: #991b1b; }
.woocommerce-orders-table .wc-on-hold { background: #fffbeb; color: #92400e; }

/* ── Product category pages ── */
.woocommerce-product-category-description { margin-bottom: 24px; color: #6b7280; font-size: 14px; }

/* ── No products ── */
.woocommerce-info.woocommerce-no-products-found { text-align: center; padding: 40px; }

/* ── Order received / Thank you page ── */
.woocommerce-order { text-align: center; }
.woocommerce-order-overview { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; margin: 24px 0; }
.woocommerce-order-overview li { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px 24px; font-size: 14px; }
.woocommerce-order-overview strong { display: block; font-size: 18px; color: #f97316; }

/* ── Pagination ── */
.woocommerce-pagination { text-align: center; margin-top: 40px; }
.woocommerce-pagination ul { display: inline-flex; gap: 4px; list-style: none; padding: 0; }
.woocommerce-pagination ul li a,
.woocommerce-pagination ul li span {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 8px;
  font-size: 14px; font-weight: 500;
  border: 1px solid #e5e7eb; color: #374151;
  transition: all .2s;
}
.woocommerce-pagination ul li a:hover { background: #fff7ed; border-color: #f97316; color: #f97316; opacity: 1; }
.woocommerce-pagination ul li span.current { background: #f97316; color: #fff; border-color: #f97316; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .woocommerce div.product { display: block; }
  .woocommerce div.product .woocommerce-product-gallery { margin-bottom: 28px; }
  .woocommerce div.product p.price { font-size: 22px; }

  /* Product tabs: horizontal scroll instead of wrap */
  .woocommerce .woocommerce-tabs .wc-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .woocommerce .woocommerce-tabs .wc-tabs::-webkit-scrollbar { display: none; }
  .woocommerce .woocommerce-tabs .wc-tabs li a { white-space: nowrap; }

  /* Order overview: 2-col */
  .woocommerce-order-overview { grid-template-columns: repeat(2,1fr); display: grid; }
}

@media (max-width: 600px) {
  /* Billing fields: single column */
  .woocommerce-billing-fields__field-wrapper,
  .woocommerce-shipping-fields__field-wrapper {
    grid-template-columns: 1fr;
  }

  /* Order overview: stack */
  .woocommerce-order-overview { grid-template-columns: 1fr; }
  .woocommerce-order-overview li { padding: 10px 14px; }

  /* My account navigation pills */
  .woocommerce-account .woocommerce-MyAccount-navigation ul li { margin: 0; }
}

@media (max-width: 480px) {
  /* Mini cart buttons stack */
  .widget_shopping_cart .woocommerce-mini-cart__buttons {
    flex-direction: column;
  }
}
