/* ==========================================================================
   Mahnik Gallery - Custom Responsive WooCommerce & UI Stylesheet
   Designed for Mobile First E-Commerce Experience
   ========================================================================== */

/* 1. Global Reset & Mobile Viewport Protection */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

* {
  box-sizing: border-box;
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* iOS Safari prevent zoom on focus */
@media screen and (max-width: 768px) {
  input[type="text"],
  input[type="search"],
  input[type="tel"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Hide scrollbar utility */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* 2. Responsive WooCommerce Product Grid Reset (Bypassing float issues) */
.woocommerce ul.products {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 0.75rem !important;
  padding: 0 !important;
  margin: 0 !important;
  list-style: none !important;
  width: 100% !important;
}

@media (min-width: 640px) {
  .woocommerce ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 1.25rem !important;
  }
}

@media (min-width: 768px) {
  .woocommerce ul.products {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 1.5rem !important;
  }
}

@media (min-width: 1024px) {
  .woocommerce ul.products {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 1.5rem !important;
  }
}

.woocommerce ul.products li.product {
  float: none !important;
  width: 100% !important;
  margin: 0 !important;
  clear: none !important;
  position: relative !important;
}

/* 3. WooCommerce Inputs & Form Controls */
.woocommerce-input-wrapper {
  width: 100%;
  display: block;
}

.woocommerce form .form-row {
  padding: 0 !important;
  margin: 0 0 1rem 0 !important;
  width: 100% !important;
  float: none !important;
  display: block !important;
  clear: both !important;
}

.woocommerce form .form-row label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
  color: #44403c;
}

html.dark .woocommerce form .form-row label {
  color: #d6d3d1;
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.mahnik-input {
  width: 100% !important;
  min-height: 2.75rem;
  border-radius: 0.875rem !important;
  border: 1px solid #e5e1d3 !important;
  background-color: #ffffff !important;
  padding: 0.625rem 1rem !important;
  font-size: 0.875rem !important;
  color: #3d321d !important;
  outline: none !important;
  transition: all 0.2s ease !important;
  font-family: inherit !important;
}

.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus,
.woocommerce form .form-row select:focus,
.mahnik-input:focus {
  border-color: #8c6d31 !important;
  box-shadow: 0 0 0 2px rgba(140, 109, 49, 0.15) !important;
}

html.dark .woocommerce form .form-row input.input-text,
html.dark .woocommerce form .form-row textarea,
html.dark .woocommerce form .form-row select,
html.dark .mahnik-input {
  background-color: #1c1917 !important;
  border-color: #292524 !important;
  color: #f5f5f4 !important;
}

/* Desktop 2-column form rows */
@media (min-width: 640px) {
  .woocommerce form .form-row-first {
    width: calc(50% - 0.5rem) !important;
    float: right !important;
    clear: right !important;
  }
  .woocommerce form .form-row-last {
    width: calc(50% - 0.5rem) !important;
    float: left !important;
    clear: left !important;
  }
}

/* 4. Luxury Buttons (Gold & Stone) */
.button.primary,
.woocommerce #respond input#submit.alt,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt,
.mahnik-btn-primary {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  background-color: #8c6d31 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 0.875rem !important;
  border-radius: 9999px !important;
  padding: 0.75rem 1.5rem !important;
  min-height: 2.75rem !important;
  border: none !important;
  cursor: pointer !important;
  transition: all 0.2s ease-in-out !important;
  box-shadow: 0 4px 12px rgba(140, 109, 49, 0.2) !important;
  text-align: center !important;
  touch-action: manipulation !important;
}

.button.primary:hover,
.woocommerce #respond input#submit.alt:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce input.button.alt:hover,
.mahnik-btn-primary:hover {
  background-color: #735926 !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(140, 109, 49, 0.3) !important;
}

.mahnik-btn-secondary {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  background-color: #ffffff !important;
  color: #6e5d42 !important;
  font-weight: 600 !important;
  font-size: 0.875rem !important;
  border-radius: 9999px !important;
  padding: 0.75rem 1.25rem !important;
  min-height: 2.75rem !important;
  border: 1px solid #edebe1 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  touch-action: manipulation !important;
}

.mahnik-btn-secondary:hover {
  background-color: #f3f0e2 !important;
  border-color: #d8d3c0 !important;
}

html.dark .mahnik-btn-secondary {
  background-color: #1c1917 !important;
  color: #d6d3d1 !important;
  border-color: #292524 !important;
}

html.dark .mahnik-btn-secondary:hover {
  background-color: #292524 !important;
}

/* 5. Touch Friendly Quantity Selector */
.quantity {
  display: inline-flex !important;
  align-items: center !important;
  border: 1px solid #edebe1 !important;
  border-radius: 0.75rem !important;
  overflow: hidden !important;
  background: #ffffff !important;
  height: 2.75rem !important;
}

.quantity input.qty {
  width: 2.75rem !important;
  text-align: center !important;
  border: none !important;
  font-weight: 700 !important;
  font-size: 0.875rem !important;
  background: transparent !important;
  color: inherit !important;
  padding: 0 !important;
  margin: 0 !important;
  outline: none !important;
  -moz-appearance: textfield;
}

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

.quantity-nav-btn {
  background: #fcfbf7 !important;
  border: none !important;
  width: 2.5rem !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  color: #6e5d42 !important;
  font-size: 1.25rem !important;
  font-weight: bold !important;
  transition: background 0.2s !important;
  user-select: none !important;
  touch-action: manipulation !important;
}

.quantity-nav-btn:hover,
.quantity-nav-btn:active {
  background: #f3f0e2 !important;
  color: #8c6d31 !important;
}

html.dark .quantity {
  border-color: #292524 !important;
  background: #1c1917 !important;
}

html.dark .quantity-nav-btn {
  background: #292524 !important;
  color: #d6d3d1 !important;
}

/* 6. Single Product Variations & Cart Form on Mobile */
.woocommerce form.cart {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 0.75rem !important;
  width: 100% !important;
  margin: 0 !important;
  float: none !important;
}

.woocommerce form.cart .quantity {
  flex-shrink: 0 !important;
}

.woocommerce form.cart button.single_add_to_cart_button {
  flex: 1 1 auto !important;
  min-width: 160px !important;
}

/* Variations Table Mobile Responsive Conversion */
table.variations {
  display: block !important;
  width: 100% !important;
  margin-bottom: 1rem !important;
  border: none !important;
}

table.variations tbody,
table.variations tr {
  display: block !important;
  width: 100% !important;
  border: none !important;
  margin-bottom: 0.75rem !important;
}

table.variations td {
  display: block !important;
  width: 100% !important;
  padding: 0.25rem 0 !important;
  border: none !important;
}

table.variations th,
table.variations td.label {
  display: block !important;
  width: 100% !important;
  text-align: right !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  color: #57534e !important;
  padding: 0 0 0.25rem 0 !important;
  border: none !important;
}

html.dark table.variations th,
html.dark table.variations td.label {
  color: #a8a29e !important;
}

table.variations select {
  width: 100% !important;
  height: 2.75rem !important;
  border-radius: 0.75rem !important;
  border: 1px solid #e5e1d3 !important;
  background-color: #ffffff !important;
  padding: 0.5rem 1rem !important;
  font-size: 0.875rem !important;
  outline: none !important;
  color: inherit !important;
}

html.dark table.variations select {
  background-color: #1c1917 !important;
  border-color: #292524 !important;
}

/* 7. Checkout Payment Gateways List */
.woocommerce-checkout #payment ul.payment_methods {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 0 1.5rem 0 !important;
  border: none !important;
}

.woocommerce-checkout #payment ul.payment_methods li {
  padding: 0.875rem !important;
  margin-bottom: 0.75rem !important;
  border-radius: 0.875rem !important;
  background-color: #fcfbf7 !important;
  border: 1px solid #edebe1 !important;
  font-size: 0.875rem !important;
}

html.dark .woocommerce-checkout #payment ul.payment_methods li {
  background-color: #1c1917 !important;
  border-color: #292524 !important;
}

.woocommerce-checkout #payment div.payment_box {
  margin-top: 0.75rem !important;
  padding: 0.75rem !important;
  border-radius: 0.75rem !important;
  background-color: #f3f0e2 !important;
  font-size: 0.75rem !important;
  color: #594825 !important;
  line-height: 1.6 !important;
}

html.dark .woocommerce-checkout #payment div.payment_box {
  background-color: #292524 !important;
  color: #d6d3d1 !important;
}

/* 8. Notice Messages */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  border-radius: 1rem !important;
  padding: 0.875rem 1.25rem !important;
  margin-bottom: 1.25rem !important;
  font-size: 0.875rem !important;
  border-top: none !important;
  border-bottom: none !important;
  border-left: none !important;
  border-right: 4px solid #8c6d31 !important;
  background-color: #fdfaf3 !important;
  color: #594825 !important;
  list-style: none !important;
}

.woocommerce-error {
  border-right-color: #dc2626 !important;
  background-color: #fef2f2 !important;
  color: #991b1b !important;
}

.woocommerce-message {
  border-right-color: #059669 !important;
  background-color: #ecfdf5 !important;
  color: #065f46 !important;
}

html.dark .woocommerce-message {
  background-color: #064e3b !important;
  color: #a7f3d0 !important;
}
html.dark .woocommerce-error {
  background-color: #450a0a !important;
  color: #fecaca !important;
}
html.dark .woocommerce-info {
  background-color: #292524 !important;
  color: #f5f5f4 !important;
}

/* 9. Keyframe Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 10. Responsive Cart and Checkout Tables on Mobile Devices */
@media (max-width: 768px) {
  .woocommerce table.shop_table_responsive thead,
  .woocommerce table.cart thead {
    display: none !important;
  }
  .woocommerce table.shop_table_responsive tr,
  .woocommerce table.cart tr.cart_item {
    display: block !important;
    margin-bottom: 1rem !important;
    border: 1px solid #edebe1 !important;
    border-radius: 1.25rem !important;
    padding: 1rem !important;
    background: #ffffff !important;
  }
  html.dark .woocommerce table.shop_table_responsive tr,
  html.dark .woocommerce table.cart tr.cart_item {
    border-color: #292524 !important;
    background: #1c1917 !important;
  }
  .woocommerce table.shop_table_responsive tr td,
  .woocommerce table.cart tr.cart_item td {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    text-align: left !important;
    border: none !important;
    padding: 0.5rem 0 !important;
    border-bottom: 1px dashed #f0ede3 !important;
  }
  html.dark .woocommerce table.shop_table_responsive tr td,
  html.dark .woocommerce table.cart tr.cart_item td {
    border-bottom-color: #292524 !important;
  }
  .woocommerce table.shop_table_responsive tr td:last-child,
  .woocommerce table.cart tr.cart_item td:last-child {
    border-bottom: none !important;
  }
  .woocommerce table.shop_table_responsive tr td::before,
  .woocommerce table.cart tr.cart_item td::before {
    content: attr(data-title) " ";
    font-weight: 700;
    font-size: 0.75rem;
    color: #78716c;
  }
  .woocommerce table.cart .product-thumbnail {
    display: flex !important;
    justify-content: center !important;
    border-bottom: none !important;
  }
  .woocommerce table.cart .product-thumbnail::before {
    display: none !important;
  }
  .woocommerce table.cart td.actions {
    display: block !important;
    padding: 0.75rem 0 !important;
  }
  .woocommerce table.cart td.actions .coupon {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
    width: 100% !important;
    float: none !important;
  }
  .woocommerce table.cart td.actions .coupon input.input-text {
    width: 100% !important;
    margin: 0 !important;
  }
  .woocommerce table.cart td.actions .coupon button.button {
    width: 100% !important;
  }
  .woocommerce table.cart td.actions button[name="update_cart"] {
    width: 100% !important;
    margin-top: 0.75rem !important;
  }
}

/* 11. Luxury WooCommerce Cart & Gutenberg Block Theming */
.woocommerce-cart .entry-content,
.woocommerce-cart .woocommerce {
  width: 100%;
}

.woocommerce-cart table.shop_table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

.woocommerce-cart .cart_totals table.shop_table {
  margin-bottom: 0 !important;
}

.woocommerce-cart .cart_totals table.shop_table tr th,
.woocommerce-cart .cart_totals table.shop_table tr td {
  padding: 0.75rem 0;
  border-top: 1px solid #f2efe4;
}

html.dark .woocommerce-cart .cart_totals table.shop_table tr th,
html.dark .woocommerce-cart .cart_totals table.shop_table tr td {
  border-top-color: #292524;
}

/* Modern Gutenberg WooCommerce Cart Block Styling */
.wp-block-woocommerce-cart,
.wc-block-cart {
  font-family: inherit !important;
  color: #3d321d !important;
}

html.dark .wp-block-woocommerce-cart,
html.dark .wc-block-cart {
  color: #f5f5f4 !important;
}

.wc-block-cart .wc-block-cart__main,
.wc-block-cart .wc-block-cart__sidebar {
  border-radius: 1.5rem !important;
}

.wc-block-cart .wc-block-components-sidebar-layout .wc-block-components-main {
  background: #ffffff !important;
  border: 1px solid #edebe1 !important;
  border-radius: 1.5rem !important;
  padding: 1.5rem !important;
}

html.dark .wc-block-cart .wc-block-components-sidebar-layout .wc-block-components-main {
  background: #1c1917 !important;
  border-color: #292524 !important;
}

.wc-block-cart .wc-block-components-sidebar-layout .wc-block-components-sidebar {
  background: #ffffff !important;
  border: 1px solid #edebe1 !important;
  border-radius: 1.5rem !important;
  padding: 1.5rem !important;
}

html.dark .wc-block-cart .wc-block-components-sidebar-layout .wc-block-components-sidebar {
  background: #1c1917 !important;
  border-color: #292524 !important;
}

.wc-block-components-checkout-button,
.wc-block-cart__submit-button,
.wp-block-woocommerce-cart .wc-block-cart__submit a {
  background-color: #8c6d31 !important;
  color: #ffffff !important;
  border-radius: 9999px !important;
  padding: 0.875rem 1.5rem !important;
  font-weight: 700 !important;
  font-size: 0.95rem !important;
  text-align: center !important;
  box-shadow: 0 4px 14px rgba(140, 109, 49, 0.25) !important;
  transition: all 0.2s ease !important;
}

.wc-block-components-checkout-button:hover,
.wc-block-cart__submit-button:hover,
.wp-block-woocommerce-cart .wc-block-cart__submit a:hover {
  background-color: #735926 !important;
  transform: translateY(-1px);
}

.wc-block-components-quantity-selector {
  border: 1px solid #edebe1 !important;
  border-radius: 0.75rem !important;
  background-color: #fafaf9 !important;
}

html.dark .wc-block-components-quantity-selector {
  border-color: #292524 !important;
  background-color: #292524 !important;
}

.wc-block-components-totals-item__value,
.wc-block-components-totals-footer-item__value {
  font-family: inherit !important;
  font-weight: 700 !important;
  color: #8c6d31 !important;
}

html.dark .wc-block-components-totals-item__value,
html.dark .wc-block-components-totals-footer-item__value {
  color: #fbbf24 !important;
}

/* 12. Luxury WooCommerce Checkout & Gutenberg Block Theming */
.woocommerce-checkout .woocommerce-billing-fields h3,
.woocommerce-checkout .woocommerce-shipping-fields h3,
.woocommerce-checkout .woocommerce-additional-fields h3 {
  font-size: 0.875rem !important;
  font-weight: 700 !important;
  color: #3d321d !important;
  margin-bottom: 0.75rem !important;
}

html.dark .woocommerce-checkout .woocommerce-billing-fields h3,
html.dark .woocommerce-checkout .woocommerce-shipping-fields h3,
html.dark .woocommerce-checkout .woocommerce-additional-fields h3 {
  color: #f5f5f4 !important;
}

/* Force All Checkout Fields to Be Full Width with Modern Clean Layout */
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper,
.woocommerce-checkout .woocommerce-shipping-fields__field-wrapper,
.woocommerce-checkout .woocommerce-additional-fields__field-wrapper {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.875rem !important;
  width: 100% !important;
}

.woocommerce-checkout .form-row {
  display: block !important;
  width: 100% !important;
  float: none !important;
  margin: 0 0 0.875rem 0 !important;
  padding: 0 !important;
  clear: both !important;
}

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

.woocommerce-checkout .form-row label {
  display: block !important;
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  color: #44403c !important;
  margin-bottom: 0.375rem !important;
  line-height: 1.5 !important;
}

html.dark .woocommerce-checkout .form-row label {
  color: #d6d3d1 !important;
}

.woocommerce-checkout .form-row label .required {
  color: #dc2626 !important;
  text-decoration: none !important;
  font-weight: bold !important;
}

.woocommerce-checkout .woocommerce-input-wrapper {
  display: block !important;
  width: 100% !important;
  position: relative !important;
}

.woocommerce-checkout input[type="text"],
.woocommerce-checkout input[type="tel"],
.woocommerce-checkout input[type="email"],
.woocommerce-checkout input[type="password"],
.woocommerce-checkout select,
.woocommerce-checkout textarea,
.woocommerce-checkout .select2-container--default .select2-selection--single {
  width: 100% !important;
  min-height: 2.875rem !important;
  padding: 0.625rem 1rem !important;
  background-color: #ffffff !important;
  border: 1px solid #edebe1 !important;
  border-radius: 1rem !important;
  font-size: 0.875rem !important;
  color: #1c1917 !important;
  font-family: inherit !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important;
  transition: all 0.2s ease-in-out !important;
  outline: none !important;
  box-sizing: border-box !important;
}

html.dark .woocommerce-checkout input[type="text"],
html.dark .woocommerce-checkout input[type="tel"],
html.dark .woocommerce-checkout input[type="email"],
html.dark .woocommerce-checkout input[type="password"],
html.dark .woocommerce-checkout select,
html.dark .woocommerce-checkout textarea,
html.dark .woocommerce-checkout .select2-container--default .select2-selection--single {
  background-color: #1c1917 !important;
  border-color: #292524 !important;
  color: #f5f5f4 !important;
}

.woocommerce-checkout input:focus,
.woocommerce-checkout select:focus,
.woocommerce-checkout textarea:focus {
  border-color: #8c6d31 !important;
  box-shadow: 0 0 0 3px rgba(140, 109, 49, 0.15) !important;
}

/* Custom styling for select dropdowns in RTL (استان و کشور) */
.woocommerce-checkout select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238c6d31' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: left 0.875rem center !important;
  background-size: 1rem !important;
  padding-left: 2.25rem !important;
  padding-right: 1rem !important;
  cursor: pointer !important;
}

/* Select2 support for City / State */
.woocommerce-checkout .select2-container {
  width: 100% !important;
}

.woocommerce-checkout .select2-container--default .select2-selection--single {
  height: 2.875rem !important;
  line-height: 2.875rem !important;
}

.woocommerce-checkout .select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 2.75rem !important;
  padding-right: 0 !important;
  color: inherit !important;
  text-align: right !important;
}

.woocommerce-checkout .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 2.75rem !important;
  left: 0.75rem !important;
  right: auto !important;
}

.woocommerce-checkout table.woocommerce-checkout-review-order-table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  width: 100% !important;
}

.woocommerce-checkout table.woocommerce-checkout-review-order-table th,
.woocommerce-checkout table.woocommerce-checkout-review-order-table td {
  padding: 0.625rem 0 !important;
}

.woocommerce-checkout #payment ul.wc_payment_methods {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.woocommerce-checkout #payment ul.wc_payment_methods li.wc_payment_method {
  transition: all 0.2s ease-in-out !important;
}

.woocommerce-checkout #payment ul.wc_payment_methods li.wc_payment_method input[type="radio"] {
  width: 1rem !important;
  height: 1rem !important;
  accent-color: #8c6d31 !important;
}

.woocommerce-checkout #payment .woocommerce-terms-and-conditions-wrapper {
  margin: 1rem 0 !important;
  font-size: 0.75rem !important;
  color: #78716c !important;
}

html.dark .woocommerce-checkout #payment .woocommerce-terms-and-conditions-wrapper {
  color: #a8a29e !important;
}

.woocommerce-checkout #payment .woocommerce-terms-and-conditions-wrapper input[type="checkbox"] {
  accent-color: #8c6d31 !important;
  border-radius: 0.25rem !important;
}

.woocommerce-checkout #payment #place_order {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
}

/* Modern Gutenberg WooCommerce Checkout Block Styling */
.wp-block-woocommerce-checkout,
.wc-block-checkout {
  font-family: inherit !important;
  color: #3d321d !important;
}

html.dark .wp-block-woocommerce-checkout,
html.dark .wc-block-checkout {
  color: #f5f5f4 !important;
}

.wc-block-checkout .wc-block-components-sidebar-layout .wc-block-components-main,
.wc-block-checkout .wc-block-components-sidebar-layout .wc-block-components-sidebar {
  background: #ffffff !important;
  border: 1px solid #edebe1 !important;
  border-radius: 1.5rem !important;
  padding: 1.5rem !important;
}

html.dark .wc-block-checkout .wc-block-components-sidebar-layout .wc-block-components-main,
html.dark .wc-block-checkout .wc-block-components-sidebar-layout .wc-block-components-sidebar {
  background: #1c1917 !important;
  border-color: #292524 !important;
}

.wc-block-checkout .wc-block-components-checkout-step {
  border-bottom: 1px solid #f2efe4 !important;
  padding-bottom: 1.25rem !important;
  margin-bottom: 1.25rem !important;
}

html.dark .wc-block-checkout .wc-block-components-checkout-step {
  border-bottom-color: #292524 !important;
}

.wc-block-checkout .wc-block-components-checkout-place-order-button,
.wc-block-checkout button[type="submit"] {
  background-color: #8c6d31 !important;
  color: #ffffff !important;
  border-radius: 9999px !important;
  padding: 0.875rem 1.5rem !important;
  font-weight: 700 !important;
  font-size: 0.95rem !important;
  text-align: center !important;
  box-shadow: 0 4px 14px rgba(140, 109, 49, 0.25) !important;
  transition: all 0.2s ease !important;
}

.wc-block-checkout .wc-block-components-checkout-place-order-button:hover,
.wc-block-checkout button[type="submit"]:hover {
  background-color: #735926 !important;
  transform: translateY(-1px);
}

/* ==========================================================================
   12. Luxury WooCommerce Single Product Reviews Styles
   ========================================================================== */
#reviews .commentlist {
  padding: 0 !important;
  margin: 0 !important;
  list-style: none !important;
}

#reviews .comment-respond {
  margin-top: 0 !important;
}

/* Hide WooCommerce default raw rating select / text if injected */
p.stars {
  display: none !important;
}

.woocommerce-Reviews #reply-title {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
}

.mahnik-review-submit-btn {
  background-color: #8c6d31 !important;
  color: #ffffff !important;
  border-radius: 0.75rem !important;
  padding: 0.65rem 1.75rem !important;
  font-weight: 700 !important;
  font-size: 0.875rem !important;
  box-shadow: 0 4px 14px rgba(140, 109, 49, 0.22) !important;
  transition: all 0.25s ease !important;
  border: none !important;
}

.mahnik-review-submit-btn:hover {
  background-color: #735926 !important;
  box-shadow: 0 6px 18px rgba(140, 109, 49, 0.32) !important;
  transform: translateY(-1px) !important;
}

.mahnik-star-btn svg {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.05));
}

/* ==========================================================================
   Luxury WooCommerce Ordering & Sorting Dropdown
   ========================================================================== */
.woocommerce-ordering {
  margin: 0 !important;
  float: none !important;
}

.woocommerce-result-count {
  margin: 0 !important;
  float: none !important;
  font-size: 0.75rem !important;
  color: #78716c !important;
  font-weight: 600 !important;
}

html.dark .woocommerce-result-count {
  color: #a8a29e !important;
}

.woocommerce-ordering select.orderby {
  border: 1px solid #edebe1 !important;
  background-color: #ffffff !important;
  color: #292524 !important;
  border-radius: 1rem !important;
  padding: 0.45rem 0.85rem 0.45rem 2rem !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  font-family: inherit !important;
  cursor: pointer !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  transition: all 0.2s ease !important;
  outline: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238c6d31' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: left 0.75rem center !important;
  background-size: 0.875rem !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
}

.woocommerce-ordering select.orderby:hover,
.woocommerce-ordering select.orderby:focus {
  border-color: #8c6d31 !important;
  box-shadow: 0 0 0 3px rgba(140, 109, 49, 0.15) !important;
}

html.dark .woocommerce-ordering select.orderby {
  background-color: #1c1917 !important;
  border-color: #292524 !important;
  color: #f5f5f4 !important;
}

/* ==========================================================================
   Product Card Add to Cart Button (Pill Shape with Cart Icon - In-Place State)
   ========================================================================== */
.mahnik-add-to-cart-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.375rem !important;
  background-color: #8c6d31 !important;
  color: #ffffff !important;
  border-radius: 9999px !important;
  padding: 0.375rem 0.85rem !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease !important;
  box-shadow: 0 1px 3px rgba(140, 109, 49, 0.25) !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  border: 1px solid transparent !important;
  cursor: pointer !important;
  position: relative !important;
}

.mahnik-add-to-cart-btn:hover {
  background-color: #765b26 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(140, 109, 49, 0.3) !important;
}

.mahnik-add-to-cart-btn:active {
  transform: scale(0.97) !important;
}

.mahnik-add-to-cart-btn.added {
  background-color: #059669 !important; /* Emerald green */
  border-color: #059669 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.35) !important;
}

.mahnik-add-to-cart-btn.loading {
  opacity: 0.8 !important;
  pointer-events: none !important;
}

/* COMPLETELY SUPPRESS WooCommerce's auto-injected "مشاهده سبد خرید" (View Cart) link */
a.added_to_cart,
.woocommerce a.added_to_cart,
.added_to_cart.wc-forward,
.woocommerce .added_to_cart,
a.added_to_cart.wc-forward {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  position: absolute !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

/* ==========================================================================
   Cart Page Layout Normalization (Prevent WooCommerce Float Conflicts)
   ========================================================================== */
.woocommerce-cart .woocommerce,
.woocommerce-cart .mahnik-cart-view {
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  clear: both !important;
}

.woocommerce-cart .woocommerce-cart-form {
  width: 100% !important;
  float: none !important;
  clear: none !important;
  margin: 0 !important;
}

.woocommerce-cart .cart-collaterals {
  width: 100% !important;
  float: none !important;
  clear: none !important;
  margin: 0 !important;
}

.woocommerce-cart .cart-collaterals .cart_totals {
  width: 100% !important;
  float: none !important;
  margin: 0 !important;
}

/* ==========================================================================
   Luxury Empty Cart Page Styling
   ========================================================================== */
.woocommerce-cart .cart-empty.woocommerce-info,
.woocommerce-cart p.cart-empty,
.woocommerce-cart p.return-to-shop {
  display: none !important;
}

.mahnik-empty-cart-page {
  width: 100% !important;
  max-width: 56rem !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.mahnik-empty-cat-card {
  transition: all 0.25s ease !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: space-between !important;
  height: 100% !important;
  box-sizing: border-box !important;
}

.mahnik-empty-cat-card:hover {
  border-color: #8c6d31 !important;
  box-shadow: 0 4px 14px rgba(140, 109, 49, 0.15) !important;
  transform: translateY(-2px) !important;
}

/* Force side-by-side placement of cards and neutralize stray WordPress <p> and <br> elements */
.mahnik-cart-view br,
.mahnik-empty-cart-page br,
.mahnik-empty-cat-grid br,
.mahnik-trust-grid br,
.mahnik-cart-main-grid br {
  display: none !important;
}

.mahnik-empty-cat-grid p,
.mahnik-trust-grid p,
.mahnik-cart-main-grid > p {
  display: contents !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Category cards side-by-side (2 cols on mobile, 4 cols on tablet & desktop) */
.mahnik-empty-cat-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 0.875rem !important;
  width: 100% !important;
}

@media (max-width: 640px) {
  .mahnik-empty-cat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Trust features cards side-by-side (3 cols on tablet & desktop) */
.mahnik-trust-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 0.875rem !important;
  width: 100% !important;
}

@media (max-width: 640px) {
  .mahnik-trust-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
  }
}

/* Main Cart View: Cart items card (7) and Invoice Totals card (5) side-by-side */
.mahnik-cart-main-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 1.5rem !important;
  align-items: start !important;
  width: 100% !important;
}

@media (min-width: 768px) {
  .mahnik-cart-main-grid {
    grid-template-columns: 7fr 5fr !important;
    gap: 2rem !important;
  }
}

.mahnik-cart-items-card,
.mahnik-cart-collaterals-card {
  width: 100% !important;
  min-width: 0 !important;
}



