/**
 * Base Styles
 *
 * Reset and foundational styles.
 *
 * @package Advanced_Customer_Account
 */

/* Box sizing */
.aca-app *,
.aca-app *::before,
.aca-app *::after {
    box-sizing: border-box;
}

/* App container reset */
.aca-app {
    font-family: var(--aca-font-family);
    font-size: var(--aca-font-size-base);
    line-height: var(--aca-line-height-normal);
    color: var(--aca-color-gray-900);
    background-color: var(--aca-color-gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
.aca-app h1,
.aca-app h2,
.aca-app h3,
.aca-app h4,
.aca-app h5,
.aca-app h6 {
    margin: 0;
    font-weight: var(--aca-font-weight-semibold);
    line-height: var(--aca-line-height-tight);
    color: var(--aca-color-gray-900);
}

.aca-app h1 {
    font-size: var(--aca-font-size-2xl);
}

.aca-app h2 {
    font-size: var(--aca-font-size-xl);
}

.aca-app h3 {
    font-size: var(--aca-font-size-lg);
}

.aca-app p {
    margin: 0 0 var(--aca-spacing-4);
}

.aca-app p:last-child {
    margin-bottom: 0;
}

/* Links */
.aca-app a {
    color: var(--aca-color-primary);
    text-decoration: none;
    transition: color var(--aca-transition-fast);
}

.aca-app a:hover,
.aca-app a:focus {
    color: var(--aca-color-primary-dark);
    text-decoration: underline;
}

/* Lists */
.aca-app ul,
.aca-app ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Buttons reset */
.aca-app button {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
}

.aca-app button:focus {
    outline: 2px solid var(--aca-color-primary);
    outline-offset: 2px;
}

.aca-app button:focus:not(:focus-visible) {
    outline: none;
}

.aca-app button:focus-visible {
    outline: 2px solid var(--aca-color-primary);
    outline-offset: 2px;
}

/* Form elements reset */
.aca-app input,
.aca-app select,
.aca-app textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

/* Address styling */
.aca-app address {
    font-style: normal;
}

/* Screen reader only */
.aca-app .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Required asterisk */
.aca-app .required {
    color: var(--aca-color-error);
    margin-left: 2px;
}

/* Images */
.aca-app img {
    max-width: 100%;
    height: auto;
}

/* Tables */
.aca-app table {
    width: 100%;
    border-collapse: collapse;
}

.aca-app th {
    text-align: left;
    font-weight: var(--aca-font-weight-semibold);
}

/* Selection */
.aca-app ::selection {
    background-color: var(--aca-color-primary-bg);
    color: var(--aca-color-primary-dark);
}

/* ==========================================================================
   WooCommerce My Account Override
   ========================================================================== */

/* Hide WooCommerce default navigation when ACA is active */
.aca-myaccount-active .woocommerce-MyAccount-navigation {
    display: none !important;
}

/* Make WooCommerce content full width */
.aca-myaccount-active .woocommerce-MyAccount-content {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Reset any WooCommerce account layout flex/grid */
.aca-myaccount-active .woocommerce-account .woocommerce {
    display: block !important;
}

/* Ensure the ACA app has proper dimensions */
.aca-myaccount-active #aca-root {
    width: 100%;
    min-height: 600px;
}
