/* ==========================================================================
   1. LOGGED-OUT / AUTH CARDS (Login, Register, Lost Password)
   ========================================================================== */
.custom-myaccount-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 15px;
  width: 100%;
}

.custom-auth-card {
  background: #f9f9f9;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.03);
  box-sizing: border-box;
  margin: 0 auto;
}

.auth-title {
  font-size: 24px;
  font-weight: 700;
  color: #2d2b3a;
  margin-bottom: 24px;
  text-align: center;
}

/* Fields & Input Styling */
.auth-field-group,
.woocommerce-form .form-row {
  margin-bottom: 20px !important;
}

.custom-auth-card label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #2d2b3a;
  margin-bottom: 8px;
}

.custom-auth-card input.input-text {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  border: 1px solid #cccccc;
  border-radius: 8px;
  background-color: #ffffff;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.custom-auth-card input.input-text:focus {
  border-color: #e5456d;
  outline: none;
  box-shadow: 0 0 0 3px rgba(229, 69, 109, 0.1);
}

.custom-auth-card input[readonly] {
  background-color: #f9f9f9;
  color: #606060;
  cursor: not-allowed;
}

/* Helper Text */
.auth-helper-text {
  font-size: 13px;
  color: #606060;
  margin-top: 10px;
  line-height: 1.5;
}

/* Buttons */
.auth-primary-btn,
.custom-auth-card button.button {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  background-color: #e5456d !important;
  color: #ffffff !important;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  text-align: center;
  margin-top: 10px;
}

.auth-primary-btn:hover,
.custom-auth-card button.button:hover {
  background-color: #2d2b3a !important;
  color: #ffffff !important;
}

/* Actions & Links */
.auth-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.lost-password-link {
  color: #e5456d;
  text-decoration: none;
}

.auth-switch-back {
  text-align: center;
  margin-top: 12px;
  margin-bottom: 0;
}

/* Convert Change Email link into a full-width outlined button */
.btn-change-email {
  display: block;
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  background-color: transparent !important;
  color: #2d2b3a !important;
  border: 1px solid #2d2b3a !important;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  text-decoration: none !important;
  box-sizing: border-box;
}

.btn-change-email:hover {
  background-color: #2d2b3a !important;
  color: #ffffff !important;
  border-color: #2d2b3a !important;
}

/* ==========================================================================
   2. LOGGED-IN MY ACCOUNT LAYOUT & SIDEBAR
   ========================================================================== */

/* Main Wrapper Layout - STRICTLY LOGGED IN USERS ONLY */
.logged-in.woocommerce-account .woocommerce {
  display: flex;
  gap: 30px;
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 15px;
  box-sizing: border-box;
}

/* Sidebar Navigation Area */
.woocommerce-account .woocommerce-MyAccount-navigation {
  flex: 0 0 260px;
  background: #f9f9f9;
  border-radius: 16px;
  padding: 20px 15px;
  box-sizing: border-box;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li a {
  display: block;
  padding: 12px 20px;
  background: #ffffff;
  color: #2d2b3a;
  border-radius: 10px;
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li a:hover {
  background: #f1f3f9;
}

/* Active Menu Tab (Pink) */
.woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a {
  background: #e5456d !important;
  color: #ffffff !important;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(229, 69, 109, 0.25);
}

/* Content Area */
.woocommerce-account .woocommerce-MyAccount-content {
  flex: 1;
  background: #f9f9f9;
  border-radius: 16px;
  padding: 30px;
  box-sizing: border-box;
  min-height: 450px;
}

/* ==========================================================================
   3. DASHBOARD MAIN VIEW
   ========================================================================== */

/* Welcome Card (Pink Border) */
.dashboard-welcome-card {
  background: #fff5f7;
  border: 1px solid #fecdd3;
  border-radius: 12px;
  padding: 24px 28px;
  margin-bottom: 24px;
}

.dashboard-welcome-card h3 {
  font-size: 16px;
  color: #2d2b3a;
  margin: 0 0 4px 0;
  font-weight: 400;
}

.dashboard-welcome-card h2 {
  font-size: 22px;
  color: #2d2b3a;
  margin: 0;
  font-weight: 700;
}

/* Quick Grid Cards */
.dashboard-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.quick-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-decoration: none;
  color: #2d2b3a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
  border: 1px solid #f9f9f9;
  cursor: pointer;
}

.quick-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.06);
  border-color: #cccccc;
}

.quick-card-icon {
  color: #2d2b3a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quick-card span {
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

/* ==========================================================================
   4. RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 768px) {
  .logged-in.woocommerce-account .woocommerce {
    flex-direction: column;
    margin-top: -70px;
    padding: 0 10px !important;
  }

  /* Hide the top navigation list across ALL My Account pages on mobile */
  .woocommerce-account .woocommerce-MyAccount-navigation {
    display: none !important;
  }

  /* Tighten inner content card padding */
  .woocommerce-account .woocommerce-MyAccount-content {
    padding: 16px !important;
    min-height: auto !important;
  }

  .dashboard-quick-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   5. MY ACCOUNT ADDRESS LAYOUT
   ========================================================================== */

/* Mobile & Tablet Base Layout (1024px and below): Forced Single Column */
.woocommerce-address-fields__field-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 0;
}

.woocommerce-address-fields__field-wrapper .form-row {
  width: 100% !important;
  float: none !important;
  margin-bottom: 0 !important;
  clear: both !important;
}

/* Desktop Only Layout (Greater than 1024px): 2-Column Grid */
@media (min-width: 1025px) {
  .woocommerce-address-fields__field-wrapper .form-row-first {
    width: 48% !important;
    float: left !important;
    margin-right: 4% !important;
    clear: left !important;
  }

  .woocommerce-address-fields__field-wrapper .form-row-last {
    width: 48% !important;
    float: right !important;
    margin-right: 0 !important;
    clear: none !important;
  }

  .woocommerce-address-fields__field-wrapper .form-row-wide {
    width: 100% !important;
    float: none !important;
    clear: both !important;
  }
}

.custom-address-submit-wrap {
  margin-top: 24px;
  clear: both;
}

/* ==========================================================================
   6. EDIT ACCOUNT FORM LAYOUT
   ========================================================================== */

.custom-edit-account-form .custom-form-grid,
.custom-edit-account-form .custom-password-fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 0;
  width: 100%;
}

.custom-edit-account-form fieldset {
  border: none;
  padding: 0;
  margin: 24px 0 0 0;
}

.custom-edit-account-form legend {
  font-size: 18px;
  font-weight: 700;
  color: #2d2b3a;
  margin-bottom: 16px;
  width: 100%;
}

/* Mobile & Tablet Base Layout (1024px and below): Forced Single Column */
.custom-edit-account-form .form-row {
  width: 100% !important;
  float: none !important;
  margin-bottom: 0 !important;
  clear: both !important;
}

/* Desktop Only Layout (Greater than 1024px): 2-Column Grid */
@media (min-width: 1025px) {
  .custom-edit-account-form .form-row-first {
    width: 48% !important;
    float: left !important;
    margin-right: 4% !important;
    clear: left !important;
  }

  .custom-edit-account-form .form-row-last {
    width: 48% !important;
    float: right !important;
    margin-right: 0 !important;
    clear: none !important;
  }

  .custom-edit-account-form .form-row-wide {
    width: 100% !important;
    float: none !important;
    clear: both !important;
  }
}

.custom-save-btn-wrap {
  margin-top: 24px;
  clear: both;
}

/* Normalize Input Heights and Padding for Date Inputs */
.custom-edit-account-form input[type="date"].woocommerce-Input--date {
  height: 45px;
  min-height: 45px;
  padding: 8px 12px;
  line-height: normal;
  box-sizing: border-box;
  display: block;
  width: 100%;
}

/* Ensure inner WebKit elements inherit layout properties properly */
.custom-edit-account-form
  input[type="date"].woocommerce-Input--date::-webkit-date-and-time-value {
  min-height: 1.2em;
  display: flex;
  align-items: center;
}

/* Ensure all form inputs share identical box sizing and font settings */
.custom-edit-account-form input.input-text {
  box-sizing: border-box;
  vertical-align: middle;
}

/* Style for Locked Date of Birth Field */
.custom-edit-account-form input.readonly-dob-field {
  background-color: #f9f9f9 !important;
  color: #606060 !important;
  cursor: not-allowed;
  border-color: #cccccc;
}

.dob-locked-notice {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #606060;
}

/* ==========================================================================
   7. MY COUPONS TABLE & RESPONSIVE STYLING
   ========================================================================== */

/* Coupon Tag Styling */
.my-coupons-table .coupon-code-tag {
  background: #fff0f3;
  color: #e5456d;
  border: 1px dashed #e5456d;
  padding: 4px 10px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 14px;
  display: inline-block;
}

/* Status Badges */
.coupon-status {
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.coupon-status-active {
  color: #2e7d32;
  background: #e8f5e9;
}

.coupon-status-expired {
  color: #e5456d;
  background: #ffebee;
}

/* Responsive Mobile Layout (768px and below) */
@media (max-width: 768px) {
  .my-coupons-table {
    display: block;
    width: 100%;
  }

  .my-coupons-table thead {
    display: none; /* Hide header row on small screens */
  }

  .my-coupons-table tbody,
  .my-coupons-table tr,
  .my-coupons-table td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  .my-coupons-table tr {
    margin-bottom: 16px;
    background: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
  }

  .my-coupons-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: right;
    padding: 10px 0 !important;
    border-bottom: 1px solid #f9f9f9;
  }

  .my-coupons-table td:last-child {
    border-bottom: none;
  }

  /* Render cell titles dynamically from data-title attribute */
  .my-coupons-table td::before {
    content: attr(data-title);
    font-weight: 600;
    color: #2d2b3a;
    text-align: left;
    padding-right: 15px;
  }
}
