/**
 * Beauty Caring Mart — v2.6.2 UI/UX Improvement Patch
 *
 * Covers:
 *  1. Button visibility: :active states so buttons never go invisible on tap/click
 *  2. .bcm-signin-btn / .bcm-add-btn full interactive state coverage
 *  3. Form field focus/error ring improvements
 *  4. Dashboard stat card accessibility + alignment
 *  5. Login / Registration panel spacing & field sizing
 *  6. Policy/FAQ/Contact/Track-Order page layout improvements
 *  7. Footer alignment corrections
 *  8. Mobile responsive padding pass
 *  9. WooCommerce button override (default WC buttons match brand)
 * 10. LiteSpeed-safe no-transform rule for button children
 */

/* ============================================================
   1. GLOBAL BUTTON RESET — no invisible active state ever
   ============================================================ */

/* All theme primary buttons — ensure tap highlight is visible,
   not transparent, and the text is NEVER white-on-white or hidden. */
.bcm-signin-btn,
.bcm-add-btn,
.bcm-slide-btn,
.bcm-mega-btn,
.bcm-wats-viewall,
.bcm-panel-cta,
.bcm-contact-submit,
button[type="submit"].bcm-signin-btn,
input[type="submit"].bcm-signin-btn {
  -webkit-tap-highlight-color: rgba(239, 125, 146, 0.22);
  position: relative;           /* contain :active pseudo-element */
  z-index: 0;                   /* own stacking context */
}

/* :active — always stay opaque with slightly darker fill */
.bcm-signin-btn:active,
button[type="submit"].bcm-signin-btn:active,
input[type="submit"].bcm-signin-btn:active {
  background: var(--bcm-primary-dark) !important;
  color: #fff !important;
  opacity: 1 !important;
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(209, 91, 114, 0.35) !important;
}

.bcm-add-btn:active {
  background: var(--bcm-primary-dark) !important;
  color: #fff !important;
  opacity: 1 !important;
  transform: translateY(1px);
}

.bcm-slide-btn:active {
  background: var(--bcm-primary-dark) !important;
  color: #fff !important;
  opacity: 1 !important;
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(233, 30, 140, 0.4) !important;
}

.bcm-mega-btn:active {
  background: var(--bcm-primary-dark) !important;
  color: #fff !important;
  opacity: 1 !important;
}

/* Outline / ghost buttons */
.bcm-outline-btn:active,
.bcm-ghost-btn:active {
  background: var(--bcm-primary-light) !important;
  color: var(--bcm-primary) !important;
  opacity: 1 !important;
}

/* WooCommerce default buttons — brand them */
.woocommerce #respond input#submit,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
  background-color: var(--bcm-primary) !important;
  color: #fff !important;
  border-radius: var(--bcm-radius) !important;
  font-weight: 700 !important;
  transition: background var(--bcm-transition), transform 0.15s !important;
}
.woocommerce #respond input#submit:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover {
  background-color: var(--bcm-primary-dark) !important;
  color: #fff !important;
}
.woocommerce #respond input#submit:active,
.woocommerce a.button:active,
.woocommerce button.button:active,
.woocommerce input.button:active {
  background-color: var(--bcm-primary-dark) !important;
  color: #fff !important;
  opacity: 1 !important;
  transform: translateY(1px);
}
.woocommerce #respond input#submit.alt,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt {
  background-color: var(--bcm-secondary) !important;
  color: #fff !important;
}
.woocommerce #respond input#submit.alt:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce input.button.alt:hover {
  background-color: #5a3028 !important;
  color: #fff !important;
}
.woocommerce #respond input#submit.alt:active,
.woocommerce a.button.alt:active,
.woocommerce button.button.alt:active,
.woocommerce input.button.alt:active {
  background-color: #5a3028 !important;
  color: #fff !important;
  opacity: 1 !important;
}

/* ============================================================
   2. FORM FIELD IMPROVEMENTS — focus rings, error states
   ============================================================ */

.bcm-form-input {
  transition: border-color 0.2s, box-shadow 0.2s !important;
  outline: none !important;
}
.bcm-form-input:focus {
  border-color: var(--bcm-primary) !important;
  box-shadow: 0 0 0 3px rgba(239, 125, 146, 0.18) !important;
  outline: none !important;
}
.bcm-form-input.error,
.bcm-form-input:invalid:not(:placeholder-shown) {
  border-color: #e53935 !important;
  box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.12) !important;
}

/* Password-strength indicator colour polish */
.bcm-pw-strength[data-strength="strong"]  { color: #4caf50 !important; }
.bcm-pw-strength[data-strength="medium"]  { color: #ff9800 !important; }
.bcm-pw-strength[data-strength="weak"]    { color: #e53935 !important; }

/* ============================================================
   3. LOGIN / REGISTER PANEL — spacing & readability
   ============================================================ */

/* Tighten left brand column on small screens */
@media (max-width: 900px) {
  .bcm-login-left { display: none !important; }
  .bcm-login-right { border-radius: 20px !important; }
}

/* Registration extended fields (Sex, DOB, Phone, NRIC) */
.bcm-reg-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 540px) {
  .bcm-reg-row { grid-template-columns: 1fr; gap: 10px; }
}

/* Make the submit button full-width on the full registration form */
.bcm-login-right form > p:last-of-type input[type="submit"],
.bcm-login-right .bcm-signin-btn {
  width: 100%;
  display: block;
  text-align: center;
}

/* Fieldset legend style (used by WooCommerce billing/shipping sections) */
.woocommerce-checkout fieldset legend,
.woocommerce-account fieldset legend {
  font-size: 16px;
  font-weight: 700;
  color: var(--bcm-text);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--bcm-primary-light);
  width: 100%;
  margin-bottom: 16px;
}

/* ============================================================
   4. DASHBOARD STAT CARDS — alignment + colour accessibility
   ============================================================ */

.bcm-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 16px;
  border-radius: var(--bcm-radius-lg);
  text-align: center;
  min-height: 110px;
}

.bcm-stat-icon {
  font-size: 26px;
  line-height: 1;
}

.bcm-stat-number {
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  color: var(--bcm-secondary);
}

.bcm-stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--bcm-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Four-up grid on all screen sizes */
.bcm-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
@media (max-width: 768px) {
  .bcm-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
@media (max-width: 400px) {
  .bcm-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}

/* Dashboard recent-orders table responsive */
@media (max-width: 680px) {
  .bcm-recent-orders-table thead { display: none; }
  .bcm-recent-orders-table tbody tr {
    display: block;
    border: 1px solid var(--bcm-border);
    border-radius: var(--bcm-radius);
    margin-bottom: 10px;
    padding: 12px;
  }
  .bcm-recent-orders-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border: none;
    font-size: 13px;
  }
  .bcm-recent-orders-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--bcm-text-muted);
    font-size: 11px;
    text-transform: uppercase;
  }
}

/* ============================================================
   5. MY ACCOUNT SIDEBAR — active state clarity
   ============================================================ */

.woocommerce-MyAccount-navigation ul { list-style: none; margin: 0; padding: 0; }
.woocommerce-MyAccount-navigation ul li a {
  display: block;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--bcm-text);
  border-left: 3px solid transparent;
  border-radius: 0 var(--bcm-radius) var(--bcm-radius) 0;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  text-decoration: none;
}
.woocommerce-MyAccount-navigation ul li a:hover {
  background: var(--bcm-primary-light);
  color: var(--bcm-primary);
  border-left-color: var(--bcm-primary-light);
}
.woocommerce-MyAccount-navigation ul li.is-active a,
.woocommerce-MyAccount-navigation ul li.current-menu-item a {
  background: var(--bcm-primary-light);
  color: var(--bcm-primary);
  border-left-color: var(--bcm-primary);
}

/* ============================================================
   6. POLICY / FAQ / CONTACT PAGE — layout & typography polish
   ============================================================ */

/* Shared page wrapper */
.bcm-page-wrap {
  max-width: var(--bcm-container, 1320px);
  margin: 0 auto;
  padding: 36px 20px 48px;
}

/* Page hero banner */
.bcm-page-hero {
  background: linear-gradient(135deg, var(--bcm-primary) 0%, var(--bcm-secondary) 100%);
  padding: 40px 24px;
  border-radius: var(--bcm-radius-lg);
  margin-bottom: 32px;
  text-align: center;
}
.bcm-page-hero h1 {
  color: #fff !important;
  font-size: clamp(22px, 4vw, 34px) !important;
  font-weight: 900 !important;
  margin: 0 !important;
  text-shadow: 0 2px 8px rgba(0,0,0,.25) !important;
}
.bcm-page-hero p {
  color: rgba(255,255,255,0.88) !important;
  margin: 10px 0 0 !important;
  font-size: 15px !important;
}

/* Content card */
.bcm-page-card {
  background: #fff;
  border: 1px solid var(--bcm-border);
  border-radius: var(--bcm-radius-lg);
  padding: 32px 36px;
  margin-bottom: 24px;
  box-shadow: var(--bcm-shadow);
}
@media (max-width: 600px) {
  .bcm-page-card { padding: 20px 16px; }
}

/* Policy page headings */
.bcm-page-card h2,
.bcm-policy-section h2 {
  font-size: clamp(16px, 2.5vw, 20px);
  font-weight: 800;
  color: var(--bcm-secondary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--bcm-primary-light);
}

.bcm-page-card h3,
.bcm-policy-section h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--bcm-text);
  margin: 18px 0 8px;
}

.bcm-page-card p,
.bcm-policy-section p {
  font-size: 14px;
  line-height: 1.75;
  color: var(--bcm-text);
  margin-bottom: 14px;
}

.bcm-page-card ul,
.bcm-policy-section ul,
.bcm-page-card ol,
.bcm-policy-section ol {
  padding-left: 20px;
  margin-bottom: 14px;
}

.bcm-page-card li,
.bcm-policy-section li {
  font-size: 14px;
  line-height: 1.75;
  color: var(--bcm-text);
  margin-bottom: 6px;
}

/* Policy inline email links */
.bcm-page-card a,
.bcm-policy-section a {
  color: var(--bcm-primary);
  font-weight: 600;
  text-underline-offset: 3px;
}
.bcm-page-card a:hover,
.bcm-policy-section a:hover { color: var(--bcm-primary-dark); }

/* ============================================================
   7. FAQ PAGE — accordion polish
   ============================================================ */

.bcm-faq-section { margin-bottom: 32px; }

.bcm-faq-category-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--bcm-secondary);
  border-left: 4px solid var(--bcm-primary);
  padding-left: 12px;
  margin-bottom: 16px;
}

.bcm-faq-item {
  border: 1px solid var(--bcm-border);
  border-radius: var(--bcm-radius);
  margin-bottom: 10px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.bcm-faq-item:hover { box-shadow: var(--bcm-shadow); }

.bcm-faq-question {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 16px 20px;
  font-size: 14px;
  font-weight: 700;
  color: var(--bcm-text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: background 0.2s, color 0.2s;
}
.bcm-faq-question:hover { background: var(--bcm-primary-light); color: var(--bcm-primary); }
.bcm-faq-question:active { background: var(--bcm-primary-light) !important; color: var(--bcm-primary) !important; opacity: 1 !important; }
.bcm-faq-question[aria-expanded="true"] { background: var(--bcm-primary-light); color: var(--bcm-primary); }
.bcm-faq-arrow { font-size: 18px; transition: transform 0.25s; flex-shrink: 0; line-height: 1; }
.bcm-faq-question[aria-expanded="true"] .bcm-faq-arrow { transform: rotate(180deg); }

.bcm-faq-answer {
  padding: 0 20px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--bcm-text);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.25s;
}
.bcm-faq-answer.open {
  max-height: 600px;
  padding: 12px 20px 16px;
}

/* ============================================================
   8. CONTACT PAGE — two-column layout & form polish
   ============================================================ */

.bcm-contact-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 32px;
  align-items: start;
}
@media (max-width: 768px) {
  .bcm-contact-grid { grid-template-columns: 1fr; gap: 24px; }
}

.bcm-contact-info-card {
  background: linear-gradient(135deg, var(--bcm-primary) 0%, var(--bcm-secondary) 100%);
  border-radius: var(--bcm-radius-lg);
  padding: 28px 24px;
  color: #fff;
}
.bcm-contact-info-card h2 { color: #fff !important; font-size: 18px !important; margin-bottom: 20px !important; }
.bcm-contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
  font-size: 14px;
}
.bcm-contact-info-item strong { display: block; font-size: 12px; opacity: 0.8; margin-bottom: 2px; }
.bcm-contact-info-item a { color: #fff; text-decoration: underline; }
.bcm-contact-info-icon { font-size: 20px; flex-shrink: 0; }

/* Contact form card */
.bcm-contact-form-card {
  background: #fff;
  border: 1px solid var(--bcm-border);
  border-radius: var(--bcm-radius-lg);
  padding: 28px;
  box-shadow: var(--bcm-shadow);
}
@media (max-width: 480px) {
  .bcm-contact-form-card { padding: 18px 14px; }
}

/* Contact submit button */
#bcm-contact-submit {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  background: var(--bcm-primary);
  color: #fff;
  border: none;
  border-radius: var(--bcm-radius);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
#bcm-contact-submit:hover { background: var(--bcm-primary-dark); }
#bcm-contact-submit:active { background: var(--bcm-primary-dark) !important; color: #fff !important; opacity: 1 !important; transform: translateY(1px); }
#bcm-contact-submit:disabled { background: #ccc; cursor: not-allowed; transform: none; }

/* ============================================================
   9. TRACK ORDER PAGE — compact form card
   ============================================================ */

.bcm-track-wrap {
  max-width: 560px;
  margin: 0 auto;
}

.bcm-track-form-card {
  background: #fff;
  border: 1px solid var(--bcm-border);
  border-radius: var(--bcm-radius-lg);
  padding: 32px;
  box-shadow: var(--bcm-shadow);
  text-align: center;
}
.bcm-track-icon { font-size: 48px; margin-bottom: 12px; }
.bcm-track-form-card h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--bcm-secondary);
  margin-bottom: 6px;
}
.bcm-track-form-card p {
  font-size: 14px;
  color: var(--bcm-text-muted);
  margin-bottom: 20px;
}

/* ============================================================
  10. FOOTER — alignment corrections
   ============================================================ */

/* Ensure footer grid columns align top, not stretch */
.bcm-footer-grid {
  align-items: start !important;
}

/* Footer headings consistent size */
.bcm-footer-col h4,
.bcm-footer-col .widget-title {
  font-size: 13px !important;
  font-weight: 800 !important;
  letter-spacing: 0.5px !important;
  text-transform: uppercase !important;
  color: #fff !important;
  margin-bottom: 14px !important;
}

/* Footer links hover underline */
.bcm-footer-col a:hover {
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
}

/* Trust badges row — centre on mobile */
.bcm-trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}
@media (max-width: 600px) {
  .bcm-trust-badges { justify-content: center; }
}

/* ============================================================
  11. MOBILE GLOBAL PADDING CORRECTIONS
   ============================================================ */

@media (max-width: 768px) {
  /* Prevent content from touching screen edges */
  .bcm-page-wrap { padding: 20px 14px 32px !important; }
  .entry-content,
  .woocommerce { padding-left: 14px !important; padding-right: 14px !important; }
}

@media (max-width: 480px) {
  /* Section headings */
  .bcm-section-title {
    font-size: clamp(18px, 5vw, 24px) !important;
  }
  /* Product card name text */
  .bcm-product-card-name { font-size: 12px !important; }
}

/* ============================================================
  12. CHECKOUT — billing/shipping form spacing
   ============================================================ */

.woocommerce-checkout .form-row {
  margin-bottom: 14px !important;
}
.woocommerce-checkout .form-row label {
  font-size: 13px !important;
  font-weight: 600 !important;
  margin-bottom: 4px !important;
  display: block !important;
}

/* Place-order button — large, obvious */
#place_order {
  background: var(--bcm-primary) !important;
  color: #fff !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  padding: 16px 32px !important;
  border-radius: 30px !important;
  width: 100% !important;
  border: none !important;
  cursor: pointer !important;
  transition: background 0.2s, transform 0.15s !important;
  box-shadow: 0 4px 16px rgba(239, 125, 146, 0.35) !important;
}
#place_order:hover { background: var(--bcm-primary-dark) !important; transform: translateY(-1px) !important; }
#place_order:active { background: var(--bcm-primary-dark) !important; color: #fff !important; opacity: 1 !important; transform: translateY(0) !important; }

/* ============================================================
  13. WISHLIST / CART BUTTONS — consistent :active behaviour
   ============================================================ */

.bcm-wishlist-btn:active,
.bcm-add-to-cart-btn:active,
.bcm-quick-view-btn:active,
.bcm-reorder-btn:active {
  opacity: 1 !important;
  background: var(--bcm-primary-light) !important;
  color: var(--bcm-primary) !important;
  transform: scale(0.96);
}

/* Qty stepper buttons */
.bcm-qty button:active {
  background: var(--bcm-primary-light) !important;
  color: var(--bcm-primary) !important;
  opacity: 1 !important;
}

/* ============================================================
  14. PRINT — hide decorative elements
   ============================================================ */
@media print {
  .bcm-header-wrap,
  .bcm-nav,
  .bcm-hero-slider,
  .bcm-promo-ticker,
  .bcm-footer,
  .bcm-quick-links-bar,
  .bcm-scroll-top { display: none !important; }
  body { font-size: 12pt !important; }
}
