/**
 * Authentication-dependent styling
 * Let JavaScript control all visibility - no !important rules
 */

/* Hide all price elements by default, except auth-dependent ones which have their own rules */
.price:not(.auth-dependent),
.price-box:not(.auth-dependent) {
    display: block;
}

/* Price containers should always be visible - they contain the auth-dependent elements */
.price-container {
    display: block;
}

/* Auth-dependent elements start hidden and let JavaScript control them completely */
.auth-dependent {
    display: block;
}

/* Show logged-out elements by default - this should override the auth-dependent rule */
.auth-dependent[data-show-when-logged-out] {
    display: block;
}

/* Hide logged-in elements by default */
.auth-dependent[data-show-when-logged-in] {
    display: block;
}

/* Fallback rules for elements without auth-dependent class */
[data-show-when-logged-in]:not(.auth-dependent) {
    display: block;
}

[data-show-when-logged-out]:not(.auth-dependent) {
    display: block;
}

/* Hide authentication-required elements by default */
[data-auth-required="true"] {
    display: block;
}

/* Show authentication-not-required elements by default */
[data-auth-required="false"] {
    display: block;
}

/* Login to see price message - shown by default */
.login-to-see-price {
    display: block;
    font-style: italic;
    color: #666;
    padding: 10px 0;
}

/* Checkout container starts as guest */
#checkout.guest {
    /* Guest-specific styles can be added here */
}

#checkout.logged {
    /* Logged-in specific styles can be added here */
}

/* Smooth transitions for show/hide */
.price-container,
.price,
.price-box,
[data-auth-required],
.login-to-see-price {
    transition: opacity 0.3s ease-in-out;
}

/* Ensure lock icons display properly in checkout totals */
.checkout-index-index .opc-checkout-sidebar .price-locked .icon-lock::before,
.checkout-index-index .totals .price-locked .icon-lock::before,
.data.table.totals .price-locked .icon-lock::before {
    content: '\E835';
    font-family: "Fontello";
    display: inline-block;
    font-style: normal;
    font-weight: 400;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Style the price-locked elements in checkout */
.checkout-index-index .price-locked,
.data.table.totals .price-locked {
    display: flex;
    align-items: center;
}

.checkout-index-index .price-locked .currency,
.data.table.totals .price-locked .currency {
    margin-right: 4px;
}

.checkout-index-index .price-locked .icon-lock,
.data.table.totals .price-locked .icon-lock {
    color: #116266;
    margin-left: 4px;
}

/* Force hide price column in cart */
.checkout-cart-index .col.price,
.checkout-cart-index .col.msrp {
    display: none !important;
}

/* Specific rules for cart table auth-dependent elements */
#shopping-cart-table .item-info td[data-th="Subtotal"] .auth-dependent[data-show-when-logged-in="true"] {
    display: block;
}
