/*
 * Abacus Lite - Buttons & Forms Utility Styles
 * Version: 2.3 - Cleaned & Simplified
 * This file contains ONLY base styles for form elements and buttons.
 * All theme-specific overrides have been moved to overrides.css
 */

/* ==========================================================================
   Base Button Style
   - Apply the .button class to any <a> or <button> tag for this style.
   ========================================================================== */
.button,
.btn,
input[type="submit"],
input[type="button"],
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--border-radius);
  background: var(--color-accent);
  color: white;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
  white-space: nowrap;
  min-height: 44px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.button:hover,
.btn:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
button:hover {
  background: var(--color-link-hover);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ==========================================================================
   WooCommerce Specific Button Fixes
   ========================================================================== */

/* Login button styling */
.woocommerce input[type="submit"],
.woocommerce button[type="submit"],
.woocommerce .button,
.woocommerce-form-login input[type="submit"],
.woocommerce-form-register input[type="submit"] {
  background: var(--color-link) !important;
  color: white !important;
  border: none !important;
  padding: 0.875rem 1.75rem !important;
  font-weight: 600 !important;
  font-size: 1rem !important;
  border-radius: var(--border-radius) !important;
  transition: all 0.2s ease !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 44px !important;
  cursor: pointer !important;
}

.woocommerce input[type="submit"]:hover,
.woocommerce button[type="submit"]:hover,
.woocommerce .button:hover,
.woocommerce-form-login input[type="submit"]:hover,
.woocommerce-form-register input[type="submit"]:hover {
  background: var(--color-link-hover) !important;
  color: white !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
  text-decoration: none !important;
}

/* Add to cart buttons */
.single_add_to_cart_button,
.add_to_cart_button,
.woocommerce .single_add_to_cart_button {
  background: var(--color-link) !important;
  color: white !important;
  border: none !important;
  padding: 1rem 2rem !important;
  font-weight: 700 !important;
  font-size: 1.1rem !important;
  border-radius: var(--border-radius) !important;
  transition: all 0.2s ease !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 48px !important;
  cursor: pointer !important;
  width: 100% !important;
}

.single_add_to_cart_button:hover,
.add_to_cart_button:hover,
.woocommerce .single_add_to_cart_button:hover {
  background: var(--color-link-hover) !important;
  color: white !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
  text-decoration: none !important;
}

/* Checkout button */
.woocommerce #payment #place_order,
.woocommerce .checkout-button {
  background: var(--color-link) !important;
  color: white !important;
  border: none !important;
  padding: 1rem 2rem !important;
  font-weight: 700 !important;
  font-size: 1.1rem !important;
  border-radius: var(--border-radius) !important;
  transition: all 0.2s ease !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 48px !important;
  cursor: pointer !important;
  width: 100% !important;
}

.woocommerce #payment #place_order:hover,
.woocommerce .checkout-button:hover {
  background: var(--color-link-hover) !important;
  color: white !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
  text-decoration: none !important;
}

/* ==========================================================================
   Form Styles
   ========================================================================== */

form .form-row {
  margin-bottom: 1.5rem;
}

form .form-row:last-child {
  margin-bottom: 0;
}

form .button,
form .btn,
form input[type="submit"] {
  margin-top: 1rem;
}

/* Base styles for text inputs, textareas, and selects */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
textarea,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: var(--font-body);
    transition: all 0.2s ease;
    background-color: #fdfdfd;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
textarea:focus,
select:focus {
    border-color: var(--color-link);
    box-shadow: 0 0 0 3px rgba(65, 105, 225, 0.15);
    outline: none;
}

/* ==========================================================================
   WooCommerce Form Fixes
   ========================================================================== */

/* WooCommerce form inputs */
.woocommerce form .form-row input[type="text"],
.woocommerce form .form-row input[type="email"],
.woocommerce form .form-row input[type="password"],
.woocommerce form .form-row textarea,
.woocommerce form .form-row select {
    width: 100% !important;
    padding: 0.75rem 1rem !important;
    border: 1px solid #ddd !important;
    border-radius: var(--border-radius) !important;
    font-size: 1rem !important;
    font-family: var(--font-body) !important;
    transition: all 0.2s ease !important;
    background-color: #fdfdfd !important;
    color: var(--color-text) !important;
}

.woocommerce form .form-row input[type="text"]:focus,
.woocommerce form .form-row input[type="email"]:focus,
.woocommerce form .form-row input[type="password"]:focus,
.woocommerce form .form-row textarea:focus,
.woocommerce form .form-row select:focus {
    border-color: var(--color-link) !important;
    box-shadow: 0 0 0 3px rgba(65, 105, 225, 0.15) !important;
    outline: none !important;
}

/* WooCommerce form labels */
.woocommerce form .form-row label {
    font-weight: 500 !important;
    margin-bottom: 0.5rem !important;
    display: block !important;
    color: var(--color-text) !important;
}

/* Remember me checkbox */
.woocommerce-form-login .form-row-wide {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    margin-bottom: 1rem !important;
}

.woocommerce-form-login .form-row-wide input[type="checkbox"] {
    width: auto !important;
    margin-right: 0.5rem !important;
}

.woocommerce-form-login .form-row-wide label {
    margin-bottom: 0 !important;
    font-weight: 400 !important;
}

/* Lost password link */
.woocommerce-LostPassword a {
    color: var(--color-link) !important;
    text-decoration: none !important;
    font-weight: 500 !important;
}

.woocommerce-LostPassword a:hover {
    color: var(--color-link-hover) !important;
    text-decoration: underline !important;
}

/* ==========================================================================
   Password Visibility Toggle Button - FIXED
   ========================================================================== */

/* Password field container positioning */
.woocommerce .form-row.woocommerce-form-row--wide,
.woocommerce .form-row-wide {
    position: relative !important;
}

.woocommerce .form-row.woocommerce-form-row--wide input[type="password"],
.woocommerce .form-row-wide input[type="password"] {
    padding-right: 3rem !important;
}

/* Show/Hide password button - FIXED POSITIONING */
.show-password-input,
.hide-password-input,
.password-toggle,
.woocommerce-password-toggle,
.password-visibility-toggle,
.woocommerce-password-strength-toggle {
    position: absolute !important;
    right: 8px !important;
    top: 50% !important;
    transform: translateY(-25%) !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    padding: 0.25rem !important;
    font-size: 1rem !important;
    line-height: 1 !important;
    color: #666 !important;
    width: auto !important;
    height: auto !important;
    min-height: auto !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    transition: color 0.2s ease !important;
    z-index: 5 !important;
}

.show-password-input:hover,
.hide-password-input:hover,
.password-toggle:hover,
.woocommerce-password-toggle:hover,
.password-visibility-toggle:hover,
.woocommerce-password-strength-toggle:hover {
    color: var(--color-link) !important;
    background: transparent !important;
    transform: translateY(-25%) !important;
    box-shadow: none !important;
}

/* Eye icon using CSS */
.show-password-input::before,
.password-toggle::before,
.woocommerce-password-toggle::before,
.password-visibility-toggle::before,
.woocommerce-password-strength-toggle::before {
    content: "👁" !important;
    font-size: 1.2rem !important;
    display: inline-block !important;
}

.hide-password-input::before {
    content: "🙈" !important;
    font-size: 1.2rem !important;
    display: inline-block !important;
}

/* Text-based approach (if emojis don't work) */
.show-password-input.text-toggle::before,
.password-toggle.text-toggle::before,
.woocommerce-password-toggle.text-toggle::before {
    content: "Show" !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    display: inline-block !important;
}

.hide-password-input.text-toggle::before {
    content: "Hide" !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    display: inline-block !important;
}

/* Fallback for empty buttons in password fields */
.woocommerce .form-row button:empty,
.woocommerce .form-row input[type="button"]:empty,
.woocommerce .form-row .button:empty {
    position: relative !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.woocommerce .form-row button:empty::before,
.woocommerce .form-row input[type="button"]:empty::before,
.woocommerce .form-row .button:empty::before {
    content: "👁" !important;
    font-size: 1.2rem !important;
    display: inline-block !important;
    color: #666 !important;
}

.woocommerce .form-row button:empty:hover::before,
.woocommerce .form-row input[type="button"]:empty:hover::before,
.woocommerce .form-row .button:empty:hover::before {
    color: var(--color-link) !important;
}

/* Additional selectors for broader compatibility */
input[type="password"] + .dashicons,
input[type="password"] + button,
input[type="password"] + .toggle-password {
    position: absolute !important;
    right: 10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    padding: 0.5rem !important;
    font-size: 1rem !important;
    color: #666 !important;
    width: auto !important;
    height: auto !important;
    min-height: auto !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

input[type="password"] + .dashicons::before,
input[type="password"] + button::before,
input[type="password"] + .toggle-password::before {
    content: "👁" !important;
    font-size: 1.2rem !important;
    display: inline-block !important;
}

input[type="password"] + .dashicons:hover,
input[type="password"] + button:hover,
input[type="password"] + .toggle-password:hover {
    color: var(--color-link) !important;
    background: transparent !important;
    transform: translateY(-50%) !important;
    box-shadow: none !important;
}