/* ===========================================
   MegahSakti — WooCommerce Overrides
   =========================================== */

/* Shop loop products */
 ul.products {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (min-width: 640px) {
  ul.products {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }
}

@media (min-width: 1024px) {
  ul.products {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1280px) {
  ul.products {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* Product loop item */
ul.products li.product {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  float: none !important;
}

ul.products li.product a img {
  margin: 0 !important;
  border-radius: 0.75rem 0.75rem 0 0;
}

ul.products li.product .woocommerce-loop-product__title {
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: #18181B;
  padding: 0.75rem 0.75rem 0;
  line-height: 1.4;
}

ul.products li.product .price {
  font-size: 1rem;
  font-weight: 700;
  color: #303C75;
  padding: 0 0.75rem;
}

ul.products li.product .price del {
  font-size: 0.75rem;
  color: #A1A1AA;
  font-weight: 400;
}

ul.products li.product .button {
  margin: 0.5rem 0.75rem 0.75rem;
  padding: 0.5rem 1rem;
  background-color: #303C75;
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: none;
  transition: background-color 0.15s;
}

ul.products li.product .button:hover {
  background-color: #283262;
}

/* Sale badge override */
span.onsale {
  display: none !important;
}

/* Single product */
.woocommerce div.product {
  padding: 0;
}

.woocommerce div.product div.images {
  border-radius: 0.75rem;
  overflow: hidden;
}

.woocommerce div.product div.images img {
  border-radius: 0;
}

/* Cart table */
.woocommerce table.shop_table {
  border: 1px solid #E4E4E7;
  border-radius: 0.75rem;
  overflow: hidden;
}

.woocommerce table.shop_table th {
  background-color: #FAFAFA;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #71717A;
  padding: 0.75rem 1rem;
}

.woocommerce table.shop_table td {
  padding: 1rem;
  font-size: 0.875rem;
  color: #18181B;
  vertical-align: middle;
}

/* Cart quantity */
.woocommerce .quantity input {
  width: 3rem;
  height: 2.25rem;
  text-align: center;
  border: 1px solid #E4E4E7;
  border-radius: 0.375rem;
  font-size: 0.875rem;
}

/* Checkout */
.woocommerce-checkout #payment {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}

.woocommerce-checkout #payment ul.payment_methods {
  border: none;
  padding: 0;
}

.woocommerce-checkout #payment ul.payment_methods li {
  padding: 0.75rem 0;
  border-bottom: 1px solid #E4E4E7;
}

.woocommerce-checkout #payment ul.payment_methods li input[type="radio"] {
  accent-color: #303C75;
}

.woocommerce-checkout #payment div.payment_box {
  background-color: #FAFAFA;
  border: 1px solid #E4E4E7;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: #52525B;
}

/* Order received / thank you */
.woocommerce-order-received .woocommerce {
  text-align: center;
}

/* My account */
.woocommerce-account .woocommerce-MyAccount-navigation {
  margin-bottom: 2rem;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid #E4E4E7;
  padding-bottom: 0;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li {
  margin: 0;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li a {
  display: block;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #71717A;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a,
.woocommerce-account .woocommerce-MyAccount-navigation ul li.current a {
  color: #303C75;
  border-bottom-color: #303C75;
}

.woocommerce-account .woocommerce-MyAccount-content {
  font-size: 0.875rem;
}

/* Pagination */
.woocommerce nav.woocommerce-pagination ul {
  display: flex;
  gap: 0.25rem;
  justify-content: center;
  border: none;
}

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

.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  border: 1px solid #E4E4E7;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: #3F3F46;
  background: white;
  transition: all 0.15s;
}

.woocommerce nav.woocommerce-pagination ul li a:hover {
  border-color: #303C75;
  color: #303C75;
}

.woocommerce nav.woocommerce-pagination ul li span.current {
  background-color: #303C75;
  color: white;
  border-color: #303C75;
}

/* Star rating */
.star-rating {
  display: inline-flex;
  gap: 1px;
}

.star-rating span {
  color: #FBBF24;
}

/* Breadcrumb override */
.woocommerce-breadcrumb {
  font-size: 0.75rem;
  color: #71717A;
  margin-bottom: 1rem;
}

.woocommerce-breadcrumb a {
  color: #71717A;
  transition: color 0.15s;
}

.woocommerce-breadcrumb a:hover {
  color: #303C75;
}

/* Product search ordering */
.woocommerce-ordering {
  margin: 0 !important;
}

.woocommerce-ordering select {
  padding: 0.375rem 2rem 0.375rem 0.75rem;
  border: 1px solid #E4E4E7;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  background-color: white;
  color: #18181B;
}

/* Result count */
.woocommerce-result-count {
  font-size: 0.875rem;
  color: #71717A;
}


/* Force btn-primary overrides for WooCommerce */
.woocommerce a.btn-primary,
.woocommerce button.btn-primary,
a.btn-primary,
button.btn-primary {
  background-color: #303C75 !important;
  color: #ffffff !important;
  text-decoration: none !important;
  border: none !important;
}
.woocommerce a.btn-primary:hover,
.woocommerce button.btn-primary:hover,
a.btn-primary:hover,
button.btn-primary:hover {
  background-color: #283262 !important;
  color: #ffffff !important;
  text-decoration: none !important;
}

/* Force btn-ghost overrides */
.woocommerce a.btn-ghost,
.woocommerce button.btn-ghost,
a.btn-ghost,
button.btn-ghost {
  text-decoration: none !important;
}

/* Override WooCommerce default link underlines in cart/checkout */
.woocommerce a:not(.btn-primary):not(.btn-ghost):not(.product-card):not(.section-link) {
  text-decoration: none;
}
.woocommerce a:not(.btn-primary):not(.btn-ghost):not(.product-card):not(.section-link):hover {
  text-decoration: underline;
}

/* Cart page overrides */
body.woocommerce-cart .btn-primary {
  background-color: #303C75 !important;
  color: #ffffff !important;
  text-decoration: none !important;
  border: none !important;
}
body.woocommerce-cart .btn-primary:hover {
  background-color: #283262 !important;
  color: #ffffff !important;
}
body.woocommerce-cart a { text-decoration: none !important; }



/* Checkout two-column layout */
@media (min-width: 768px) {
  form.checkout.woocommerce-checkout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 1.5rem;
    align-items: start;
  }
  form.checkout.woocommerce-checkout > #customer_details {
    grid-column: 1;
  }
  form.checkout.woocommerce-checkout > #order_review_heading,
  form.checkout.woocommerce-checkout > #order_review {
    grid-column: 2;
  }
  form.checkout.woocommerce-checkout > .woocommerce-notices-wrapper,
  form.checkout.woocommerce-checkout > .woocommerce-checkout::before {
    grid-column: 1 / -1;
  }
}

/* Checkout two-column grid layout */
.ms-checkout-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
@media (min-width: 768px) {
  .ms-checkout-grid {
    flex-direction: row;
    align-items: flex-start;
  }
  .ms-checkout-left {
    flex: 1;
    min-width: 0;
  }
  .ms-checkout-right {
    width: 340px;
    flex-shrink: 0;
  }
  .ms-checkout-card--sticky {
    position: sticky;
    top: 6rem;
  }
}
.ms-checkout-card {
  background: #ffffff;
  border: 1px solid #F4F4F5;
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.ms-checkout-card-title {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #18181B;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #F4F4F5;
}
.ms-checkout-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 9999px;
  background-color: #303C75;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Hide ship-to-different-address checkbox (shipping is primary) */
#ship-to-different-address {
  display: none !important;
}

/* Shipping section styling - always show */
form.checkout.woocommerce-checkout .col-2 {
  border: 1px solid #F4F4F5;
  border-radius: 0.75rem;
  padding: 1.25rem;
  background: #ffffff;
  margin-top: 0;
}
form.checkout.woocommerce-checkout .col-2 h3 {
  font-size: 0.875rem !important;
  font-weight: 700 !important;
  color: #18181B !important;
  margin-bottom: 1rem !important;
  padding-bottom: 0.75rem !important;
  border-bottom: 1px solid #F4F4F5 !important;
}

/* Customer details override column layout */
#customer_details {
  display: block !important;
  width: 100% !important;
  float: none !important;
}
#customer_details .col-1,
#customer_details .col-2 {
  display: block !important;
  width: 100% !important;
  float: none !important;
}
#customer_details .col-1 + .col-2 {
  margin-top: 0 !important;
}
/* Hide billing section */
#customer_details .col-1 {
  display: none !important;
}

/* Billing & Shipping section headers */
.ms-checkout-section h3,
#customer_details h3,
.woocommerce-checkout-billing h3,
.woocommerce-checkout-shipping h3 {
  font-size: 0.875rem !important;
  font-weight: 700 !important;
  color: #18181B !important;
  margin-bottom: 1rem !important;
  padding-bottom: 0.75rem !important;
  border-bottom: 1px solid #F4F4F5 !important;
}

/* Form fields */
.woocommerce-checkout .form-row {
  margin-bottom: 0.875rem !important;
}
.woocommerce-checkout .form-row label {
  font-size: 0.8125rem !important;
  font-weight: 500 !important;
  color: #3F3F46 !important;
  margin-bottom: 0.25rem !important;
  display: block !important;
}
.woocommerce-checkout .form-row label .required {
  color: #EF4444 !important;
}
.woocommerce-checkout .form-row input.input-text,
.woocommerce-checkout .form-row select,
.woocommerce-checkout .form-row textarea {
  width: 100% !important;
  height: 2.5rem !important;
  border-radius: 0.5rem !important;
  border: 1px solid #E4E4E7 !important;
  padding: 0 0.75rem !important;
  font-size: 0.875rem !important;
  background-color: #FAFAFA !important;
  color: #18181B !important;
  transition: border-color 0.15s, background-color 0.15s !important;
  outline: none !important;
  box-shadow: none !important;
}
.woocommerce-checkout .form-row input.input-text:focus,
.woocommerce-checkout .form-row select:focus,
.woocommerce-checkout .form-row textarea:focus {
  border-color: #303C75 !important;
  background-color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(48,60,117,0.1) !important;
}
.woocommerce-checkout .form-row textarea {
  height: 5rem !important;
  padding: 0.5rem 0.75rem !important;
  resize: vertical !important;
}
.woocommerce-checkout .form-row p.description {
  font-size: 0.75rem !important;
  color: #A1A1AA !important;
  margin-top: 0.25rem !important;
}

/* Select2 */
.woocommerce-checkout .form-row .select2-container,
.woocommerce-checkout .form-row .select2-container--default {
  border-radius: 0.5rem !important;
  border: 1px solid #E4E4E7 !important;
  height: 2.5rem !important;
  background: #FAFAFA !important;
}
.woocommerce-checkout .form-row .select2-container .select2-selection {
  height: 2.5rem !important;
  border: none !important;
  border-radius: 0.5rem !important;
  line-height: 2.5rem !important;
  background: transparent !important;
}
.woocommerce-checkout .form-row .select2-container .select2-selection__rendered {
  line-height: 2.5rem !important;
  padding-left: 0.75rem !important;
  font-size: 0.875rem !important;
  color: #18181B !important;
}
.woocommerce-checkout .form-row .select2-container .select2-selection__arrow {
  height: 2.5rem !important;
}
.woocommerce-checkout .form-row .select2-container--open .select2-selection,
.woocommerce-checkout .form-row .select2-container--focus .select2-selection {
  border-color: #303C75 !important;
  box-shadow: 0 0 0 3px rgba(48,60,117,0.1) !important;
}

/* Create account checkbox */
.woocommerce-checkout #account_password {
  margin-top: -0.25rem !important;
}

/* =============================================
   ORDER REVIEW (sidebar-like)
   ============================================= */

#order_review_heading {
  display: none !important;
}

/* Order review + payment sticky on right */
@media (min-width: 1024px) {
  .woocommerce-checkout #order_review,
  .woocommerce-checkout #payment {
    position: sticky !important;
    top: 6rem !important;
  }
}

#order_review,
.woocommerce-checkout-review-order {
  background: #ffffff !important;
  border: 1px solid #F4F4F5 !important;
  border-radius: 0.75rem !important;
  padding: 1.25rem !important;
}

/* Order table */
.woocommerce-checkout-review-order-table {
  border: none !important;
  margin-bottom: 0.75rem !important;
}
.woocommerce-checkout-review-order-table th {
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  color: #71717A !important;
  padding: 0.375rem 0 !important;
  border: none !important;
  text-transform: none !important;
}
.woocommerce-checkout-review-order-table td {
  font-size: 0.8125rem !important;
  color: #18181B !important;
  padding: 0.375rem 0 !important;
  border: none !important;
}
.woocommerce-checkout-review-order-table td.product-name {
  font-weight: 500 !important;
}
.woocommerce-checkout-review-order-table .product-name .quantity {
  color: #71717A !important;
  font-weight: 400 !important;
}
.woocommerce-checkout-review-order-table tr.cart-subtotal td,
.woocommerce-checkout-review-order-table tr.shipping td,
.woocommerce-checkout-review-order-table tr.order-total td {
  border-top: 1px solid #F4F4F5 !important;
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
}
.woocommerce-checkout-review-order-table tr.order-total td {
  border-top: 1px solid #E4E4E7 !important;
  padding-top: 0.75rem !important;
}
.woocommerce-checkout-review-order-table .woocommerce-Price-amount {
  font-weight: 600 !important;
}
.woocommerce-checkout-review-order-table tr.order-total .woocommerce-Price-amount {
  font-weight: 700 !important;
  color: #303C75 !important;
  font-size: 1.125rem !important;
}

/* Shipping methods in order review */
.woocommerce-checkout-review-order-table .shipping {
  border-top: none !important;
}
.woocommerce-checkout-review-order-table .shipping td {
  padding: 0.25rem 0 !important;
}

/* =============================================
   PAYMENT METHODS
   ============================================= */

#payment {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
}
#payment ul.payment_methods {
  border: none !important;
  padding: 0 !important;
  margin: 0 0 0.75rem 0 !important;
}
#payment ul.payment_methods li {
  border: 1px solid #E4E4E7 !important;
  border-radius: 0.75rem !important;
  padding: 0.75rem 1rem !important;
  margin-bottom: 0.5rem !important;
  background: #ffffff !important;
  transition: border-color 0.15s, background-color 0.15s !important;
}
#payment ul.payment_methods li:has(input:checked) {
  border-color: #303C75 !important;
  background: #F0F1F8 !important;
}
#payment ul.payment_methods li input[type="radio"],
#payment ul.payment_methods li input[type="checkbox"] {
  margin-right: 0.5rem !important;
  accent-color: #303C75 !important;
}
#payment ul.payment_methods li label {
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  color: #18181B !important;
  cursor: pointer !important;
  padding: 0 !important;
}
#payment div.payment_box {
  background: #FAFAFA !important;
  border: 1px solid #E4E4E7 !important;
  border-radius: 0.75rem !important;
  padding: 0.75rem 1rem !important;
  margin-top: 0.5rem !important;
  font-size: 0.8125rem !important;
  color: #71717A !important;
  line-height: 1.5 !important;
}

/* Place order button in order review */
#payment #place_order,
.woocommerce-checkout-review-order .place-order {
  display: none !important;
}

/* =============================================
   SHIPPING METHODS
   ============================================= */

.woocommerce-shipping-methods {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
.woocommerce-shipping-methods li {
  border: 1px solid #E4E4E7 !important;
  border-radius: 0.75rem !important;
  padding: 0.75rem 1rem !important;
  margin-bottom: 0.5rem !important;
  background: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  transition: border-color 0.15s !important;
}
.woocommerce-shipping-methods li:has(input:checked) {
  border-color: #303C75 !important;
  background: #F0F1F8 !important;
}
.woocommerce-shipping-methods li input[type="radio"] {
  margin-right: 0.5rem !important;
  accent-color: #303C75 !important;
}
.woocommerce-shipping-methods li label {
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  color: #18181B !important;
  cursor: pointer !important;
  flex: 1 !important;
  margin: 0 !important;
  padding: 0 !important;
}
.woocommerce-shipping-methods li label .amount {
  font-weight: 600 !important;
  color: #303C75 !important;
}

/* Hide the dropdown #shipping_method */
#shipping_method {
  display: none !important;
}

/* =============================================
   MOBILE CHECKOUT
   ============================================= */

@media (max-width: 1023px) {
  #order_review,
  .woocommerce-checkout-review-order {
    border: 1px solid #F4F4F5 !important;
    border-radius: 0.75rem !important;
    padding: 1.25rem !important;
    margin-top: 1rem !important;
  }
}

/* =============================================
   CHECKOUT PAGE FULL-WIDTH OVERRIDE
   ============================================= */

body.woocommerce-checkout .btn-primary {
  background-color: #303C75 !important;
  color: #ffffff !important;
  text-decoration: none !important;
  border: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 0.75rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background-color 0.15s;
  cursor: pointer;
  width: 100%;
}
body.woocommerce-checkout .btn-primary:hover {
  background-color: #283262 !important;
}
body.woocommerce-cart .prose { max-width: none !important; }
