/* ====== General layout ====== */

.ao-checkout-block {
  direction: rtl;
  text-align: right;
  margin-top: 1rem;
}

/* Wrap the two main columns in nice cards */
.ao-checkout-block .wp-block-woocommerce-checkout-fields-block,
.ao-checkout-block .wp-block-woocommerce-checkout-totals-block {
  background-color: #ffffff;
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.08);
  padding: 1.5rem 1.75rem;
}

/* Reduce shadow on mobile a bit */
@media (max-width: 767.98px) {
  .ao-checkout-block .wp-block-woocommerce-checkout-fields-block,
  .ao-checkout-block .wp-block-woocommerce-checkout-totals-block {
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
    padding: 1.25rem 1.25rem;
  }
}

/* ====== Inputs / fields – rounded modern look ====== */

.ao-checkout-block .wc-block-components-text-input,
.ao-checkout-block .wc-block-components-textarea,
.ao-checkout-block .wc-block-components-select,
.ao-checkout-block .wc-block-components-phone-input {
  margin-bottom: 1rem;
}

/* Text / email / tel / number / etc */
.ao-checkout-block .wc-block-components-text-input input,
.ao-checkout-block .wc-block-components-phone-input input,
.ao-checkout-block .wc-block-components-textarea textarea,
.ao-checkout-block select,
.ao-checkout-block .wc-block-components-select select {
  width: 100%;
  border-radius: 18px;
  border: 1px solid #dde3ec;
  padding: 0.7rem 0.9rem;
  background-color: #f9fafb;
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

/* Placeholder align RTL */
.ao-checkout-block .wc-block-components-text-input input::placeholder,
.ao-checkout-block .wc-block-components-textarea textarea::placeholder {
  text-align: right;
}

/* Focus state */
.ao-checkout-block .wc-block-components-text-input input:focus,
.ao-checkout-block .wc-block-components-phone-input input:focus,
.ao-checkout-block .wc-block-components-textarea textarea:focus,
.ao-checkout-block select:focus {
  outline: none;
  border-color: var(--ao-primary, #018880);
  background-color: #ffffff;
  box-shadow: 0 0 0 1px rgba(1, 136, 128, 0.15);
}

/* Labels RTL alignment */
.ao-checkout-block .wc-block-components-text-input label,
.ao-checkout-block .wc-block-components-textarea label,
.ao-checkout-block .wc-block-components-select label {
  display: inline-block;
  margin-bottom: 0.25rem;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Inline radio / shipping/billing methods – soften borders */
.ao-checkout-block .wc-block-components-radio-control__option,
.ao-checkout-block .wc-block-components-shipping-rates-control__package {
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  padding: 0.75rem 0.9rem;
}

/* Active / selected method */
.ao-checkout-block .wc-block-components-radio-control__option.is-selected,
.ao-checkout-block .wc-block-components-shipping-rates-control__package.is-selected {
  border-color: var(--ao-primary, #018880);
  background-color: rgba(1, 136, 128, 0.04);
}

/* ====== Order summary card ====== */

.ao-checkout-block .wp-block-woocommerce-checkout-order-summary-block {
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background-color: #f9fafb;
  padding: 1.25rem 1.25rem;
}

.ao-checkout-block .wc-block-components-order-summary-item {
  border-radius: 16px;
  padding: 0.6rem 0.75rem;
}

/* ====== Submit button (place order) ====== */

.ao-checkout-block .wc-block-components-checkout-place-order-button,
.ao-checkout-block .wc-block-components-button,
.ao-checkout-block .wc-block-components-button:not(.is-secondary) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.85rem 2.3rem;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: #ffffff;
  background: linear-gradient(135deg, var(--ao-primary, #018880), #00b09b);
  box-shadow: 0 16px 40px rgba(1, 136, 128, 0.4);
  cursor: pointer;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    background 0.15s ease;
}

/* Hover */
.ao-checkout-block .wc-block-components-checkout-place-order-button:hover,
.ao-checkout-block .wc-block-components-button:not(.is-secondary):hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 55px rgba(1, 136, 128, 0.45);
}

/* Disabled */
.ao-checkout-block .wc-block-components-checkout-place-order-button:disabled,
.ao-checkout-block .wc-block-components-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

/* Secondary / link-style buttons keep it simple */
.ao-checkout-block .wc-block-components-button.is-secondary {
  background: transparent;
  box-shadow: none;
  border-radius: 999px;
  border: 1px dashed #cbd5e1;
  color: #475569;
}

/* Terms checkbox RTL tweaks */
.ao-checkout-block .wc-block-checkout__terms label {
  text-align: right;
}

/* Make sure text is RTL aligned */
body.rtl .ao-checkout-block .wc-block-checkout {
  text-align: right;
}

/* ===== Desktop layout & gap between columns ===== */
@media (min-width: 992px) {
  /* The parent checkout block becomes a 2-column grid */
  .ao-checkout-block .wp-block-woocommerce-checkout,
  .ao-checkout-block .wc-block-checkout {
    flex-wrap: nowrap;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1.1fr);
    gap: 2.5rem;          /* space BETWEEN the two columns */
  }
}

/* ===== Mobile padding so cards don't hug the edges ===== */
@media (max-width: 767.98px) {

  /* A little breathing room from the viewport edges */
  .ao-checkout-block .wp-block-woocommerce-checkout-fields-block,
  .ao-checkout-block .wp-block-woocommerce-checkout-totals-block {
    padding: 1rem 1rem !important;
  }

  /* Optional: small gap between the two sections on mobile */
  .ao-checkout-block .wp-block-woocommerce-checkout-totals-block,
  .wc-block-checkout__actions_row {
    margin-top: 1.25rem !important;
  }
  .wc-block-components-checkout-return-to-cart-button{
    margin-top: 3rem !important;
  }
}

/* === MOBILE: remove Woo's separator lines completely === */
@media (max-width: 767.98px) {

  /* Kill all the little lines Woo draws with ::before / ::after */
  .ao-checkout-block .wc-block-components-checkout-step::before,
  .ao-checkout-block .wc-block-components-checkout-step::after,
  .ao-checkout-block .wc-block-components-checkout-step__container::before,
  .ao-checkout-block .wc-block-components-checkout-step__container::after,
  .ao-checkout-block .wc-block-components-panel.has-border::before,
  .ao-checkout-block .wc-block-components-panel.has-border::after,
  .ao-checkout-block .wc-block-components-totals-wrapper::before,
  .ao-checkout-block .wc-block-components-totals-wrapper::after,
  .ao-checkout-block .wc-block-components-express-payment__title-container::before,
  .ao-checkout-block .wc-block-components-express-payment__title-container::after {
    content: none !important;
    border: 0 !important;
  }

  /* Just in case Woo used <hr> somewhere */
  .ao-checkout-block hr {
    display: none !important;
  }
}




/* ===============================
   CART PAGE: match checkout design
   =============================== */

/* RTL + general text alignment */
.ao-cart-block {
  direction: rtl;
  text-align: right;
}

/* Two main cards: items + totals (same feel as checkout) */
.ao-cart-block .wp-block-woocommerce-cart-items-block,
.ao-cart-block .wp-block-woocommerce-cart-totals-block {
  background-color: #ffffff;
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.08);
  padding: 1.5rem 1.75rem;
}

/* Desktop: 2 columns, just like checkout */
@media (min-width: 992px) {
  .ao-cart-block .wc-block-cart {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1.1fr); /* left: totals, right: items */
    gap: 2.5rem;
    align-items: flex-start;
  }

  .ao-cart-block .wp-block-woocommerce-cart-items-block,
  .ao-cart-block .wp-block-woocommerce-cart-totals-block {
    width: auto;
    max-width: 100%;
    margin: 0;
  }
}

/* Mobile: same “card” feeling, not glued to edges */
@media (max-width: 767.98px) {
  .ao-cart-block .wp-block-woocommerce-cart-items-block,
  .ao-cart-block .wp-block-woocommerce-cart-totals-block {
    padding: 1.25rem 1.25rem !important;
    border-radius: 20px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
  }

  .ao-cart-block .wp-block-woocommerce-cart-totals-block {
    margin-top: 1.25rem !important;
  }
  .wc-block-cart .wc-block-cart__submit-container--sticky{
    display: none !important;
  }
}
/* Inputs / selects inside CART (coupon, etc.) – clone checkout style */
.ao-cart-block .wc-block-components-text-input,
.ao-cart-block .wc-block-components-textarea,
.ao-cart-block .wc-block-components-select {
  margin-bottom: 0.75rem;
}

.ao-cart-block .wc-block-components-text-input input,
.ao-cart-block .wc-block-components-textarea textarea,
.ao-cart-block .wc-block-components-select select {
  width: 100%;
  border-radius: 18px;
  border: 1px solid #dde3ec;
  padding: 0.7rem 0.9rem;
  background-color: #f9fafb;
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.ao-cart-block .wc-block-components-text-input input::placeholder,
.ao-cart-block .wc-block-components-textarea textarea::placeholder {
  text-align: right;
}

.ao-cart-block .wc-block-components-text-input input:focus,
.ao-cart-block .wc-block-components-textarea textarea:focus,
.ao-cart-block .wc-block-components-select select:focus {
  outline: none;
  border-color: var(--ao-primary, #018880);
  background-color: #ffffff;
  box-shadow: 0 0 0 1px rgba(1, 136, 128, 0.15);
}

.ao-cart-block .wc-block-components-text-input label,
.ao-cart-block .wc-block-components-textarea label,
.ao-cart-block .wc-block-components-select label {
  display: inline-block;
  margin-bottom: 0.25rem;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Primary buttons (apply coupon, go to checkout, place order) – same pill style on BOTH pages */
.ao-checkout-block .wc-block-components-checkout-place-order-button,
.ao-checkout-block .wc-block-components-button:not(.is-secondary):not(.is-tertiary),
.ao-cart-block .wc-block-components-button:not(.is-secondary):not(.is-tertiary),
.ao-cart-block .wc-block-cart__submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.85rem 2.3rem;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: #ffffff;
  background: linear-gradient(135deg, var(--ao-primary, #018880), #00b09b);
  box-shadow: 0 16px 40px rgba(1, 136, 128, 0.4);
  cursor: pointer;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    background 0.15s ease;
}

.ao-checkout-block .wc-block-components-checkout-place-order-button:hover,
.ao-checkout-block .wc-block-components-button:not(.is-secondary):not(.is-tertiary):hover,
.ao-cart-block .wc-block-components-button:not(.is-secondary):not(.is-tertiary):hover,
.ao-cart-block .wc-block-cart__submit-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 55px rgba(1, 136, 128, 0.45);
}

.ao-checkout-block .wc-block-components-checkout-place-order-button:disabled,
.ao-checkout-block .wc-block-components-button:disabled,
.ao-cart-block .wc-block-components-button:disabled,
.ao-cart-block .wc-block-cart__submit-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

/* Secondary buttons on both pages – subtle outline, not ugly grey */
.ao-checkout-block .wc-block-components-button.is-secondary,
.ao-cart-block .wc-block-components-button.is-secondary {
  background: transparent;
  box-shadow: none;
  border-radius: 999px;
  border: 1px dashed #cbd5e1;
  color: #475569;
  padding-inline: 1.2rem;
}








/* === Preloader to hide English→Farsi flicker on totals (cart + checkout) === */

.wc-block-checkout.ao-digits-loading .wc-block-components-totals-wrapper,
.wc-block-cart.ao-digits-loading .wc-block-components-totals-wrapper {
  position: relative;
}

/* Hide the raw numbers while we are converting */
.wc-block-checkout.ao-digits-loading .wc-block-components-totals-item,
.wc-block-checkout.ao-digits-loading .wc-block-components-totals-footer-item,
.wc-block-cart.ao-digits-loading .wc-block-components-totals-item,
.wc-block-cart.ao-digits-loading .wc-block-components-totals-footer-item {
  visibility: hidden;
}

/* Small spinner on the totals card while digits are being processed */
.wc-block-checkout.ao-digits-loading .wc-block-components-totals-wrapper::after,
.wc-block-cart.ao-digits-loading .wc-block-components-totals-wrapper::after {
  content: "";
  position: absolute;
  inset-inline-end: 1rem;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border-radius: 999px;
  border: 2px solid rgba(148, 163, 184, 0.7);
  border-top-color: var(--ao-primary, #018880);
  animation: ao-spin 0.6s linear infinite;
}

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

/* === Empty cart: hide "New in store" products === */
.ao-cart-block .wp-block-woocommerce-empty-cart-block .wc-block-grid,
.ao-cart-block .wp-block-woocommerce-empty-cart-block .wc-block-cart__empty-cart__products {
  display: none !important;
}

/* Optional: center empty-cart message + button, RTL */
.ao-cart-block .wp-block-woocommerce-empty-cart-block .wc-block-cart__empty-cart {
  text-align: center;
  direction: rtl;
}


/* ===========================
   AliOptic – Custom empty cart overlay
   =========================== */

.ao-empty-cart-overlay {
  display: none;              /* JS adds --visible when empty */
  text-align: center;
  padding: 3rem 0 3rem;
  direction: rtl;
}

.ao-empty-cart-overlay--visible {
  display: block;
}

.ao-empty-cart-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* crying green emoji circle */
.ao-empty-cart-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 999px;
  background-color: #005244; /* your brand green */
  color: #ffffff;
  font-size: 2.4rem;
}

/* Farsi heading */
.ao-empty-cart-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0;
}

/* big light button with 🛒 */
.ao-empty-cart-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.85rem 2.6rem;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background-color: #f9fafb;
  color: #005244;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
}

.ao-empty-cart-btn:hover {
  background-color: #ffffff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

/* When our overlay is active, hide Woo's built-in empty-cart block */
.ao-cart-block.ao-empty-cart-active .wp-block-woocommerce-empty-cart-block {
  display: none !important;
}
.wp-block-woocommerce-empty-cart-block{
    display: none !important;
}


#cart-items .wc-block-components-sidebar-layout .wc-block-components-main{
  width: 100% !important;
}