/* WooCommerce pages aligned with Negah No theme */

.woo-wrap,
.woo-single-wrap {
  width: min(1100px, calc(100% - 2.4rem));
}

.woocommerce .content-card-page,
.woo-section .woocommerce {
  background: rgba(255, 250, 242, 0.88);
  border: 1px solid rgba(212, 160, 23, 0.28);
  border-radius: 24px;
  padding: clamp(1.2rem, 3vw, 2rem);
  box-shadow: var(--shadow-soft);
}

.woocommerce .woocommerce-result-count,
.woocommerce .woocommerce-ordering {
  float: none !important;
  margin: 0;
}

.woocommerce .woocommerce-result-count {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.woocommerce-page .woocommerce {
  display: flow-root;
}

/* Keep count + sort on one toolbar row */
.woo-section .woocommerce-result-count {
  display: inline-block;
  margin: 0 0 1.15rem;
}

.woo-section .woocommerce-ordering {
  display: inline-flex;
  float: left !important;
  margin: 0 0 1.15rem;
}

.woo-section ul.products {
  clear: both;
}

.woocommerce .woocommerce-ordering select,
.nn-books-page select.orderby,
.nn-catalog-sort select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  min-width: 220px;
  min-height: 46px;
  padding: 0.65rem 1.15rem 0.65rem 2.75rem;
  border: 1px solid rgba(212, 160, 23, 0.4);
  border-radius: 999px;
  background-color: #fffdf8;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1.5 1.75L6 6.25L10.5 1.75' stroke='%234c0810' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #fffdf8, #f6e7b8);
  background-position:
    left 1rem center,
    0 0;
  background-size:
    12px 8px,
    100% 100%;
  background-repeat: no-repeat;
  color: var(--brand-deep);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.4;
  box-shadow: 0 8px 20px rgba(90, 40, 20, 0.06);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  text-align: right;
  direction: rtl;
}

.woocommerce .woocommerce-ordering select:hover,
.nn-books-page select.orderby:hover,
.nn-catalog-sort select:hover {
  border-color: rgba(122, 13, 24, 0.35);
  box-shadow: 0 10px 24px rgba(122, 13, 24, 0.1);
  transform: translateY(-1px);
}

.woocommerce .woocommerce-ordering select:focus,
.nn-books-page select.orderby:focus,
.nn-catalog-sort select:focus {
  outline: none;
  border-color: rgba(122, 13, 24, 0.45);
  box-shadow: 0 0 0 4px rgba(122, 13, 24, 0.08);
}

.woocommerce ul.products {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.woocommerce nav.woocommerce-pagination ul {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  border: 0 !important;
  margin: 1.5rem 0 0 !important;
}

.woocommerce nav.woocommerce-pagination ul li {
  border: 0 !important;
  margin: 0 !important;
}

.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
  min-width: 40px;
  min-height: 40px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.7rem !important;
  border-radius: 12px !important;
  background: #fffdf8 !important;
  border: 1px solid rgba(212,160,23,0.28) !important;
  font-weight: 700;
}

.woocommerce nav.woocommerce-pagination ul li span.current {
  background: linear-gradient(135deg, #b82445, var(--brand-deep)) !important;
  color: #fff !important;
  border-color: transparent !important;
}

.woocommerce ul.products::before,
.woocommerce ul.products::after {
  display: none !important;
}

.woocommerce ul.products li.product {
  width: auto !important;
  margin: 0 !important;
  float: none !important;
  background: linear-gradient(180deg, rgba(255,250,242,0.98), rgba(247,241,230,0.92));
  border: 1px solid rgba(212,160,23,0.28);
  border-radius: 20px;
  padding: 0.85rem;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
}

.woocommerce ul.products li.product a img {
  width: 100%;
  height: var(--cover-h, 320px);
  object-fit: contain;
  background: linear-gradient(180deg, #f4ebe0, #e7d9c6);
  border-radius: 14px;
  margin-bottom: 0.8rem;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font-size: 1rem !important;
  font-weight: 700;
  padding: 0 !important;
  margin: 0 0 0.45rem !important;
  line-height: 1.55;
}

.woocommerce ul.products li.product .price {
  color: var(--brand) !important;
  font-weight: 800;
  margin-bottom: 0.7rem;
}

.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce #place_order,
.woocommerce .button.alt {
  background: linear-gradient(135deg, #b82445, var(--brand-deep)) !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: 14px !important;
  font-weight: 700 !important;
  padding: 0.75rem 1.3rem !important;
  min-height: 44px;
  box-shadow: 0 10px 24px rgba(122, 13, 24, 0.22);
}

.woocommerce a.checkout-button,
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
  border-radius: 14px !important;
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 52px !important;
  white-space: normal !important;
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce #place_order:hover {
  filter: brightness(1.05);
}

.woocommerce .quantity .qty {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.55rem 0.7rem;
  background: #fff;
  font-family: var(--font);
}

/* Cart — redesigned */
.woocommerce-cart .content-card-page {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.woocommerce-cart .content-card-page .section-head {
  margin-bottom: 1.4rem;
}

.nn-cart-empty {
  text-align: center;
  padding: clamp(2rem, 5vw, 3.5rem) 1.2rem;
  border-radius: 28px;
  background:
    linear-gradient(160deg, rgba(255,250,242,0.98), rgba(246,231,184,0.35));
  border: 1px solid rgba(212,160,23,0.3);
}

.nn-cart-empty-icon {
  width: 88px;
  height: 88px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--brand);
  background: #fffaf2;
  border: 1px solid rgba(212,160,23,0.35);
}

.nn-cart-empty h2 {
  margin: 0 0 0.5rem;
  font-size: 1.6rem;
  color: var(--brand-deep);
}

.nn-cart-empty p {
  margin: 0 auto 1.3rem;
  max-width: 34rem;
  color: var(--ink-soft);
}

.nn-cart-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: center;
}

.nn-cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.85fr);
  gap: 1.4rem;
  align-items: start;
}

.nn-cart-items-wrap {
  background: #fffdf9;
  border: 1px solid rgba(212,160,23,0.28);
  border-radius: 24px;
  padding: 1.1rem;
}

.nn-cart-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.nn-cart-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 0.9rem;
  border-radius: 16px;
  background: #fffdf8;
  border: 1px solid rgba(212,160,23,0.2);
}

.nn-cart-thumb {
  flex: 0 0 140px;
  width: 140px;
  height: 200px;
  border-radius: 12px;
  overflow: hidden;
  background: #efe4d4;
  border: 1px solid rgba(212,160,23,0.22);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nn-cart-thumb a {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

.woocommerce-cart .nn-cart-thumb img,
.nn-cart-thumb img.nn-cart-img,
.nn-cart-img {
  display: block !important;
  width: 140px !important;
  height: 200px !important;
  max-width: none !important;
  object-fit: contain !important;
  object-position: center !important;
  margin: 0 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.nn-cart-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.nn-cart-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.nn-cart-title {
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.5;
  color: var(--brand-deep);
}

.nn-cart-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

.nn-cart-cell {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  min-width: 0;
}

.nn-cart-label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.nn-cart-value,
.nn-cart-value .amount,
.nn-cart-value .woocommerce-Price-amount {
  font-size: 0.9rem !important;
  font-weight: 800;
  color: var(--brand);
  white-space: nowrap !important;
}

.nn-cart-qty-cell .quantity {
  margin: 0;
  display: inline-flex;
}

.nn-cart-qty-cell .quantity .qty {
  width: 64px;
  min-height: 34px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
}

.product-remove {
  flex-shrink: 0;
}

.nn-remove,
.woocommerce-cart a.remove.nn-remove {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  min-width: auto !important;
  width: auto !important;
  height: auto !important;
  padding: 0.25rem 0.7rem !important;
  border-radius: 999px !important;
  background: #f8e6eb !important;
  color: var(--brand-deep) !important;
  font-size: 0.8rem !important;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none !important;
}

.nn-cart-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
  padding-top: 0.95rem;
  border-top: 1px solid rgba(212,160,23,0.18);
}

.nn-cart-aside {
  position: sticky;
  top: 100px;
}

.nn-cart-summary {
  background: linear-gradient(165deg, #fffaf2 0%, #f6e7b8 100%);
  border: 1px solid rgba(212,160,23,0.4);
  border-radius: 22px;
  padding: 1.35rem 1.25rem;
}

.nn-cart-summary h2 {
  margin: 0 0 1rem;
  font-size: 1.3rem;
  color: var(--brand-deep);
}

.nn-cart-summary-rows {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.2rem;
}

.nn-cart-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px dashed rgba(122,13,24,0.14);
  font-size: 0.95rem;
}

.nn-cart-summary-row strong {
  color: var(--brand);
  font-weight: 800;
  text-align: left;
}

.nn-cart-summary-total {
  border-bottom: 0;
  padding-bottom: 0;
  font-size: 1.05rem;
}

.nn-cart-summary-total span,
.nn-cart-summary-total strong {
  font-size: 1.2rem;
  color: var(--brand-deep);
}

.nn-checkout-btn,
a.nn-checkout-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 54px !important;
  height: auto !important;
  aspect-ratio: auto !important;
  padding: 0.95rem 1.25rem !important;
  border-radius: 14px !important;
  background: linear-gradient(135deg, #b82445, var(--brand-deep)) !important;
  color: #fff !important;
  font-weight: 800 !important;
  font-size: 1.02rem !important;
  text-align: center;
  white-space: normal !important;
  box-shadow: 0 12px 26px rgba(122, 13, 24, 0.22);
  line-height: 1.45;
  box-sizing: border-box;
}

.nn-checkout-btn:hover {
  filter: brightness(1.05);
}

.nn-cart-note {
  margin: 0.85rem 0 0;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}

/* Only hide empty default collaterals wrappers without our summary */
.woocommerce-cart .cart-collaterals:not(:has(.nn-cart-summary)):empty {
  display: none !important;
}

.woocommerce-checkout table.shop_table {
  border: 1px solid rgba(212,160,23,0.25) !important;
  border-radius: 16px;
  overflow: hidden;
  background: #fffdf8;
}

.woocommerce table.shop_table th,
.woocommerce table.shop_table td {
  border-color: rgba(212,160,23,0.16) !important;
  padding: 0.95rem !important;
  font-family: var(--font);
}

@media (max-width: 900px) {
  .nn-cart-layout { grid-template-columns: 1fr; }
  .nn-cart-aside { position: static; }
  .nn-cart-item {
    align-items: flex-start;
  }
  .nn-cart-thumb {
    flex-basis: 96px;
    width: 96px;
    height: 136px;
  }
  .woocommerce-cart .nn-cart-thumb img,
  .nn-cart-thumb img.nn-cart-img,
  .nn-cart-img {
    width: 96px !important;
    height: 136px !important;
  }
  .nn-cart-top {
    flex-direction: column;
    gap: 0.4rem;
  }
  .nn-cart-row {
    gap: 0.45rem 0.85rem;
  }
  .nn-cart-value,
  .nn-cart-value .amount {
    font-size: 0.82rem !important;
  }
}

/* Checkout */
.woocommerce-checkout .col2-set,
.woocommerce-checkout #customer_details {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  margin: 0 !important;
  text-align: right;
  direction: rtl;
}

.woocommerce-checkout .col2-set .col-1,
.woocommerce-checkout .col2-set .col-2,
.woocommerce-checkout #customer_details .col-1,
.woocommerce-checkout #customer_details .col-2 {
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.woocommerce-checkout #customer_details .col-2:empty,
.woocommerce-checkout .col2-set .col-2:empty,
.woocommerce-checkout #customer_details .col-2:not(:has(.woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper > *)) {
  display: none !important;
}

.woocommerce-checkout .woocommerce-billing-fields > h3,
.woocommerce-checkout .woocommerce-additional-fields > h3,
.woocommerce-checkout #order_review_heading {
  text-align: right !important;
  margin: 0 0 1rem !important;
  color: var(--brand-deep);
}

.woocommerce-checkout .woocommerce-billing-fields__field-wrapper,
.woocommerce-checkout .woocommerce-shipping-fields__field-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1rem;
  width: 100%;
  text-align: right;
  direction: rtl;
}

.woocommerce-checkout .form-row {
  float: none !important;
  clear: none !important;
  width: 100% !important;
  margin: 0 0 0.15rem !important;
  padding: 0 !important;
  text-align: right !important;
}

.woocommerce-checkout .form-row-wide,
.woocommerce-checkout .form-row-first,
.woocommerce-checkout .form-row-last {
  width: 100% !important;
  float: none !important;
}

.woocommerce-checkout .form-row-wide {
  grid-column: 1 / -1;
}

.woocommerce-checkout .form-row-first,
.woocommerce-checkout .form-row-last {
  grid-column: auto;
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.woocommerce-checkout .select2-container .select2-selection--single {
  border: 1px solid rgba(120, 80, 40, 0.16) !important;
  border-radius: 12px !important;
  background: #fff !important;
  min-height: 46px;
  width: 100% !important;
  font-family: var(--font) !important;
  box-shadow: none !important;
  text-align: right !important;
  direction: rtl;
}

.woocommerce-checkout .select2-container {
  width: 100% !important;
  text-align: right;
}

.woocommerce-checkout .select2-container .select2-selection--single .select2-selection__rendered {
  text-align: right !important;
  direction: rtl;
  padding-right: 12px !important;
  padding-left: 28px !important;
}

.woocommerce form .form-row label {
  display: block;
  width: 100%;
  font-weight: 700;
  color: var(--ink-soft);
  text-align: right !important;
  margin-bottom: 0.35rem;
}

.woocommerce-checkout #order_review,
.woocommerce-checkout #customer_details {
  background: rgba(255,250,242,0.9);
  border: 1px solid rgba(212,160,23,0.25);
  border-radius: 18px;
  padding: 1.1rem;
  width: 100%;
  box-sizing: border-box;
}

.woocommerce-checkout #order_review {
  text-align: right;
}

.woocommerce-checkout-review-order-table {
  margin-bottom: 1rem;
  width: 100%;
}

.woocommerce-checkout #place_order {
  float: none !important;
  width: 100% !important;
  max-width: 280px;
  margin-right: 0 !important;
  margin-left: auto !important;
  display: block !important;
}

.woocommerce-form-login,
.woocommerce-checkout .woocommerce-form-login-toggle,
.woocommerce-checkout .woocommerce-account-fields {
  display: none !important;
}

@media (max-width: 640px) {
  .woocommerce-checkout .woocommerce-billing-fields__field-wrapper {
    grid-template-columns: 1fr;
  }
  .woocommerce-checkout .form-row-first,
  .woocommerce-checkout .form-row-last,
  .woocommerce-checkout .form-row-wide {
    grid-column: 1 / -1;
  }
}

.woocommerce-info,
.woocommerce-message,
.woocommerce-error {
  border-radius: 14px !important;
  border-top: 0 !important;
  border: 1px solid rgba(212,160,23,0.3) !important;
  background: #fffaf2 !important;
  font-family: var(--font);
}

.woocommerce div.product {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 2rem;
  align-items: start;
}

.woocommerce div.product > .woocommerce-tabs,
.woocommerce div.product > .related.products,
.woocommerce div.product > .upsells.products,
.woocommerce div.product > section.related,
.woocommerce div.product > section.upsells {
  grid-column: 1 / -1;
  width: 100%;
}

.woocommerce div.product div.images {
  margin: 0;
  background: linear-gradient(180deg, #f4ebe0, #e7d9c6);
  border: 1px solid rgba(212,160,23,0.3);
  border-radius: 20px;
  padding: 0.8rem;
}

.woocommerce div.product div.images img {
  width: 100%;
  height: auto !important;
  object-fit: contain !important;
  border-radius: 12px;
}

.woocommerce div.product .product_title {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 800;
  color: var(--brand-deep);
}

.woocommerce div.product p.price {
  color: var(--brand) !important;
  font-size: 1.35rem !important;
  font-weight: 800;
}

.woocommerce div.product form.cart {
  margin-top: 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
}

.woocommerce div.product .woocommerce-tabs {
  margin-top: 0.5rem;
}

.woocommerce div.product .related.products,
.woocommerce div.product section.related {
  margin-top: 0.5rem;
  padding-top: 1.4rem;
  border-top: 1px solid rgba(212,160,23,0.22);
}

.woocommerce div.product .related.products > h2,
.woocommerce div.product section.related > h2 {
  margin: 0 0 1.1rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--brand-deep);
  text-align: right;
}

.woocommerce div.product .related.products ul.products,
.woocommerce div.product section.related ul.products {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 1.15rem !important;
  margin: 0 !important;
  width: 100%;
}

.woocommerce div.product .related.products ul.products li.product,
.woocommerce div.product section.related ul.products li.product {
  width: auto !important;
  margin: 0 !important;
  float: none !important;
}

.woocommerce div.product .related.products ul.products li.product a img,
.woocommerce div.product section.related ul.products li.product a img {
  width: 100% !important;
  height: 280px !important;
  object-fit: contain !important;
  object-position: center !important;
  background: linear-gradient(180deg, #f4ebe0, #e7d9c6);
  border-radius: 14px;
}

.cart-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 40px;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: #fffaf2;
  border: 1px solid rgba(212,160,23,0.35);
  color: var(--brand-deep);
  font-size: 0.86rem;
  font-weight: 700;
}

.cart-count {
  min-width: 1.4rem;
  height: 1.4rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 0.75rem;
  padding: 0 0.35rem;
}

.woocommerce .add_to_cart_inline {
  border: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}

.woocommerce .add_to_cart_inline .button {
  margin: 0 !important;
}

@media (max-width: 980px) {
  .woocommerce ul.products { grid-template-columns: repeat(2, 1fr); }
  .woocommerce-checkout .col2-set,
  .woocommerce div.product { grid-template-columns: 1fr; }
  .woocommerce div.product .related.products ul.products,
  .woocommerce div.product section.related ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 560px) {
  .woocommerce ul.products { grid-template-columns: 1fr; }
  .cart-link-label { display: none; }
  .woocommerce div.product .related.products ul.products,
  .woocommerce div.product section.related ul.products {
    grid-template-columns: 1fr 1fr !important;
  }
  .woocommerce div.product .related.products ul.products li.product a img,
  .woocommerce div.product section.related ul.products li.product a img {
    height: 220px !important;
  }
}