/**
 * WooCommerce Custom Styles for MadrissCosmoderma Theme
 * Luxury Clinical Skincare Aesthetic: 1550px Container, Warm Tones, Crisp Typography
 */

/* ==========================================================================
   1. GLOBAL WOOCOMMERCE LAYOUT & NOTICES
   ========================================================================== */

.woocommerce .theme-page-content,
.woocommerce-page .theme-page-content {
  max-width: 1550px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

/* Notices & Alerts */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  padding: 1rem 1.5rem !important;
  margin-bottom: 2rem !important;
  border-radius: 0.75rem !important;
  border: 1px solid transparent !important;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  font-size: 0.95rem !important;
  line-height: 1.6 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 1rem !important;
}

.woocommerce-message::before,
.woocommerce-info::before,
.woocommerce-error::before {
  display: none !important;
}

.woocommerce-message {
  background-color: #fff1e5 !important;
  color: #25190a !important;
  border-color: #ffdcc5 !important;
  border-left: 4px solid #99461c !important;
}

.woocommerce-info {
  background-color: #ffebd5 !important;
  color: #2d1604 !important;
  border-color: #f6dfc5 !important;
  border-left: 4px solid #2d1604 !important;
}

.woocommerce-error {
  background-color: #ffdad6 !important;
  color: #93000a !important;
  border-color: #ffdad6 !important;
  border-left: 4px solid #ba1a1a !important;
  list-style: none !important;
}

.woocommerce-message .button,
.woocommerce-info .button {
  background-color: #2d1604 !important;
  color: #ffffff !important;
  padding: 0.5rem 1.25rem !important;
  border-radius: 0.5rem !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  transition: all 0.2s ease !important;
  float: none !important;
}

.woocommerce-message .button:hover,
.woocommerce-info .button:hover {
  background-color: #99461c !important;
  color: #ffffff !important;
}

/* ==========================================================================
   2. FORM CONTROLS & INPUTS
   ========================================================================== */

.woocommerce form .form-row {
  margin-bottom: 1.25rem;
  box-sizing: border-box !important;
  max-width: 100% !important;
}

.woocommerce form .form-row-first,
.woocommerce form .form-row-last {
  width: 100% !important;
  float: none !important;
  box-sizing: border-box !important;
}

@media (min-width: 640px) {
  .woocommerce form .form-row-first {
    width: calc(50% - 0.75rem) !important;
    float: left !important;
  }
  .woocommerce form .form-row-last {
    width: calc(50% - 0.75rem) !important;
    float: right !important;
  }
}

.woocommerce form .form-row-wide {
  clear: both !important;
  width: 100% !important;
  box-sizing: border-box !important;
  float: none !important;
}

.woocommerce form .clear,
.woocommerce-address-fields__field-wrapper::after,
.woocommerce-billing-fields__field-wrapper::after,
.woocommerce-shipping-fields__field-wrapper::after,
.woocommerce-additional-fields__field-wrapper::after,
.woocommerce-EditAccountForm::after,
.woocommerce form::after {
  content: "";
  display: table;
  clear: both;
}

.woocommerce form .form-row label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #25190a;
  margin-bottom: 0.4rem;
}

.woocommerce form .form-row .required {
  color: #ba1a1a;
  text-decoration: none;
}

.woocommerce form input[type="text"],
.woocommerce form input[type="email"],
.woocommerce form input[type="tel"],
.woocommerce form input[type="password"],
.woocommerce form select,
.woocommerce form textarea {
  width: 100% !important;
  height: 3rem;
  padding: 0.65rem 1rem !important;
  background-color: #ffffff !important;
  border: 1px solid #d4c3ba !important;
  border-radius: 0.5rem !important;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  font-size: 0.95rem !important;
  color: #25190a !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
  box-sizing: border-box !important;
}

.woocommerce form textarea {
  height: 7rem !important;
  resize: vertical;
}

.woocommerce form input[type="text"]:focus,
.woocommerce form input[type="email"]:focus,
.woocommerce form input[type="tel"]:focus,
.woocommerce form input[type="password"]:focus,
.woocommerce form select:focus,
.woocommerce form textarea:focus {
  border-color: #99461c !important;
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(153, 70, 28, 0.15) !important;
}

.woocommerce form fieldset {
  border: 1px solid rgba(212, 195, 186, 0.4) !important;
  border-radius: 0.75rem !important;
  padding: 1.5rem !important;
  margin-top: 1.5rem !important;
  margin-bottom: 1.5rem !important;
  background-color: #fff8f4;
}

.woocommerce form fieldset legend {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: #25190a;
  padding: 0 0.5rem;
}

/* Primary Form Buttons */
.woocommerce button.button,
.woocommerce input.button,
.woocommerce a.button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 3rem !important;
  padding: 0 1.75rem !important;
  background-color: #2d1604 !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 0.5rem !important;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  cursor: pointer !important;
  transition: all 0.25s ease !important;
  text-decoration: none !important;
}

.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce a.button:hover {
  background-color: #99461c !important;
  color: #ffffff !important;
}

.woocommerce button.button.alt,
.woocommerce input.button.alt,
.woocommerce a.button.alt {
  background-color: #99461c !important;
  color: #ffffff !important;
}

.woocommerce button.button.alt:hover,
.woocommerce input.button.alt:hover,
.woocommerce a.button.alt:hover {
  background-color: #ff9564 !important;
  color: #2d1604 !important;
}

/* ==========================================================================
   3. MY ACCOUNT PAGE (LOGIN, REGISTER, DASHBOARD, ORDERS)
   ========================================================================== */

/* ==========================================================================
   3. MY ACCOUNT & AUTHENTICATION PAGES
   ========================================================================== */

/* Auth Container (Login / Register) */
.madriss-auth-container {
  width: 100%;
  max-width: 1550px;
  margin: 1.5rem auto 3rem auto;
  box-sizing: border-box;
}

#customer_login {
  width: 100%;
}

#customer_login .u-column1,
#customer_login .u-column2 {
  float: none !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Clear WooCommerce core legacy floats in auth */
.col2-set::after,
.col2-set::before {
  display: none !important;
}

/* My Account 2-Column Dashboard Layout */
.madriss-myaccount-wrapper {
  display: flex !important;
  flex-direction: column !important;
  gap: 2rem !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  align-items: stretch !important;
}

@media (min-width: 1024px) {
  .madriss-myaccount-wrapper {
    flex-direction: row !important;
    gap: 2.5rem !important;
    align-items: flex-start !important;
  }

  .madriss-myaccount-sidebar {
    width: 300px !important;
    flex-shrink: 0 !important;
    position: sticky !important;
    top: 6.5rem !important;
  }

  .madriss-myaccount-main {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
}

/* Reset any core WooCommerce float overrides on account */
.woocommerce-account .woocommerce-MyAccount-navigation {
  float: none !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  margin: 0 !important;
}

.woocommerce-account .woocommerce-MyAccount-content {
  float: none !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  overflow: hidden !important;
}

/* Select2 Form Controls to prevent horizontal overflow */
.select2-container {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.select2-container .select2-selection--single {
  height: 3rem !important;
  border: 1px solid #d4c3ba !important;
  border-radius: 0.5rem !important;
  background-color: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  box-sizing: border-box !important;
  max-width: 100% !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 2.8rem !important;
  padding-left: 1rem !important;
  padding-right: 1.5rem !important;
  color: #25190a !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 3rem !important;
  right: 0.75rem !important;
}

.select2-dropdown {
  border-color: #d4c3ba !important;
  border-radius: 0.5rem !important;
  box-shadow: 0 4px 20px rgba(45, 22, 4, 0.08) !important;
  z-index: 99999 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.woocommerce-MyAccount-content p {
  color: #50453d;
  line-height: 1.7;
}

.woocommerce-MyAccount-content a {
  color: #99461c;
  text-decoration: underline;
}

.woocommerce-MyAccount-content a:hover {
  color: #2d1604;
}

/* Orders Table */
.woocommerce-table--order-history {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 1.5rem;
  border: 1px solid rgba(212, 195, 186, 0.4);
  border-radius: 0.75rem;
  overflow: hidden;
}

.woocommerce-table--order-history th {
  background-color: #fff1e5;
  color: #2d1604;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 1rem 1.25rem;
  text-align: left;
}

.woocommerce-table--order-history td {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(212, 195, 186, 0.3);
  font-size: 0.95rem;
  color: #25190a;
}

/* Addresses Section */
.woocommerce-Addresses {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

@media (min-width: 768px) {
  .woocommerce-Addresses {
    grid-template-columns: 1fr 1fr;
  }
}

.woocommerce-Address {
  background: #fff8f4;
  padding: 1.5rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(212, 195, 186, 0.4);
}

.woocommerce-Address header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   4. CART PAGE (TABLE, COUPON, TOTALS)
   ========================================================================== */

.woocommerce-cart .woocommerce {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 1024px) {
  .woocommerce-cart .woocommerce {
    grid-template-columns: 1fr 420px;
    align-items: start;
  }
}

/* Cart Table */
.woocommerce table.cart {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background-color: #ffffff;
  border: 1px solid rgba(212, 195, 186, 0.4);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(45, 22, 4, 0.02);
}

.woocommerce table.cart th {
  background-color: #fff1e5;
  color: #2d1604;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 1rem 1.25rem;
  border: none;
}

.woocommerce table.cart td {
  padding: 1.25rem;
  border-top: 1px solid rgba(212, 195, 186, 0.25);
  vertical-align: middle;
}

.woocommerce table.cart td.product-thumbnail img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 0.5rem;
}

.woocommerce table.cart td.product-name a {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: #25190a;
  text-decoration: none;
}

.woocommerce table.cart td.product-name a:hover {
  color: #99461c;
}

.woocommerce table.cart td.product-price,
.woocommerce table.cart td.product-subtotal {
  font-weight: 600;
  color: #2d1604;
}

.woocommerce table.cart .actions {
  padding: 1.5rem !important;
  background-color: #fff8f4;
}

.woocommerce table.cart .actions .coupon {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  float: left;
}

.woocommerce table.cart .actions .coupon input[type="text"] {
  width: 180px !important;
  height: 2.75rem;
}

/* Cart Collaterals / Totals */
.cart-collaterals .cart_totals {
  width: 100% !important;
  float: none !important;
  background: #ffffff;
  padding: 2rem;
  border-radius: 1rem;
  border: 1px solid rgba(212, 195, 186, 0.4);
  box-shadow: 0 4px 20px rgba(45, 22, 4, 0.03);
}

.cart_totals h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 500;
  color: #25190a;
  margin-top: 0;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(212, 195, 186, 0.3);
}

.cart_totals table.shop_table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.cart_totals table.shop_table th,
.cart_totals table.shop_table td {
  padding: 0.85rem 0;
  border-top: 1px solid rgba(212, 195, 186, 0.2);
}

.cart_totals .wc-proceed-to-checkout a.checkout-button {
  display: flex !important;
  width: 100% !important;
  height: 3.5rem !important;
  background-color: #99461c !important;
  color: #ffffff !important;
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
  border-radius: 0.75rem !important;
}

.cart_totals .wc-proceed-to-checkout a.checkout-button:hover {
  background-color: #2d1604 !important;
}

/* Empty Cart */
.cart-empty.woocommerce-info {
  text-align: center;
  padding: 3rem 2rem !important;
  background: #ffffff !important;
  border-radius: 1rem !important;
}

.return-to-shop {
  text-align: center;
  margin-top: 1.5rem;
}

/* ==========================================================================
   5. CHECKOUT PAGE (BILLING, SHIPPING, REVIEW ORDER, PAYMENT)
   ========================================================================== */

.woocommerce-checkout form.checkout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 1024px) {
  .woocommerce-checkout form.checkout {
    grid-template-columns: 1fr 480px;
    align-items: start;
  }
}

.woocommerce-checkout #customer_details {
  background: #ffffff;
  padding: 2.5rem;
  border-radius: 1rem;
  border: 1px solid rgba(212, 195, 186, 0.4);
  box-shadow: 0 4px 20px rgba(45, 22, 4, 0.03);
}

.woocommerce-checkout #customer_details h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 500;
  color: #25190a;
  margin-top: 0;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(212, 195, 186, 0.3);
}

/* Order Review Stage */
#order_review_heading {
  display: none;
}

#order_review {
  background: #ffffff;
  padding: 2rem;
  border-radius: 1rem;
  border: 1px solid rgba(212, 195, 186, 0.4);
  box-shadow: 0 4px 20px rgba(45, 22, 4, 0.03);
}

#order_review table.shop_table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

#order_review table.shop_table th {
  background-color: #fff1e5;
  color: #2d1604;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.75rem 1rem;
}

#order_review table.shop_table td {
  padding: 0.85rem 1rem;
  border-top: 1px solid rgba(212, 195, 186, 0.2);
}

/* Payment Methods */
#payment {
  background-color: #fff8f4 !important;
  border-radius: 0.75rem !important;
  padding: 1.25rem !important;
  margin-top: 1.5rem !important;
}

#payment ul.payment_methods {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 0 1.25rem 0 !important;
  border-bottom: 1px solid rgba(212, 195, 186, 0.3) !important;
}

#payment ul.payment_methods li {
  margin-bottom: 0.75rem !important;
}

#payment ul.payment_methods li label {
  font-weight: 600 !important;
  color: #25190a !important;
  cursor: pointer !important;
}

#payment div.payment_box {
  background-color: #ffffff !important;
  color: #50453d !important;
  padding: 1rem !important;
  border-radius: 0.5rem !important;
  margin-top: 0.5rem !important;
  border: 1px solid rgba(212, 195, 186, 0.4) !important;
  font-size: 0.85rem !important;
}

#payment div.payment_box::before {
  display: none !important;
}

#place_order {
  width: 100% !important;
  height: 3.5rem !important;
  background-color: #99461c !important;
  color: #ffffff !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
  border-radius: 0.75rem !important;
  margin-top: 1rem !important;
}

#place_order:hover {
  background-color: #2d1604 !important;
}

/* ==========================================================================
   6. WOOCOMMERCE GUTENBERG BLOCKS (CART & CHECKOUT BLOCKS SUPPORT)
   ========================================================================== */

.wp-block-woocommerce-cart,
.wp-block-woocommerce-checkout {
  max-width: 1550px !important;
  width: 100% !important;
  margin: 0 auto !important;
}

.wc-block-components-checkout-place-order-button,
.wc-block-cart__submit-button {
  background-color: #99461c !important;
  color: #ffffff !important;
  border-radius: 0.75rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  transition: all 0.25s ease !important;
}

.wc-block-components-checkout-place-order-button:hover,
.wc-block-cart__submit-button:hover {
  background-color: #2d1604 !important;
}
