/* Membership Wrapper Frontend Styles */

/* Membership Selection on Product Page */
.mw-membership-selection {
    margin: 25px 0;
    padding: 25px;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.mw-membership-selection h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 1.2em;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.mw-subject-selection,
.mw-duration-selection {
    margin-bottom: 20px;
}

.mw-subject-selection label,
.mw-duration-selection label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #444;
}

.mw-select {
    width: 100%;
    max-width: 400px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 14px;
    color: #333;
    transition: border-color 0.3s;
}

.mw-select:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,115,170,0.2);
}

#mw-duration-details {
    margin-top: 15px;
    padding: 15px;
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    animation: mw-fadein 0.3s;
}

@keyframes mw-fadein {
    from { opacity: 0; }
    to { opacity: 1; }
}

.mw-selection-summary p {
    margin: 5px 0;
    color: #555;
}

.mw-selection-summary strong {
    color: #333;
}

.mw-existing-warning {
    margin-top: 10px;
    padding: 10px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    color: #856404;
    font-size: 14px;
}

/* User Memberships Page */
.mw-user-memberships {
    margin: 30px 0;
}

.mw-user-memberships h2 {
    margin-bottom: 25px;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.mw-no-memberships {
    text-align: center;
    padding: 40px;
    background: #f9f9f9;
    border: 2px dashed #ddd;
    border-radius: 5px;
}

.mw-no-memberships p {
    margin: 10px 0;
    color: #666;
}

.mw-memberships-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.mw-membership-card {
    padding: 20px;
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.mw-membership-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.mw-membership-card.expiring-soon {
    border-left: 4px solid #f0ad4e;
    background: #fffce5;
}

.mw-subject-title {
    margin-top: 0;
    margin-bottom: 15px;
    color: #0073aa;
    font-size: 1.3em;
}

.mw-membership-details {
    margin: 15px 0;
}

.mw-detail {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.mw-detail:last-child {
    border-bottom: none;
}

.mw-detail .label {
    color: #666;
    font-weight: 500;
}

.mw-detail .value {
    color: #333;
    font-weight: bold;
}

.mw-detail .value.warning {
    color: #d9534f;
}

.mw-status {
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.mw-renewal-notice {
    margin-top: 15px;
    padding: 10px;
    background: #fff3cd;
    border-radius: 4px;
    text-align: center;
}

.mw-renewal-notice p {
    margin: 0 0 10px 0;
    color: #856404;
}

.mw-memberships-summary {
    margin-top: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #e9ecef;
}

/* Subjects List Shortcode */
.mw-subjects-list {
    display: grid;
    gap: 25px;
    margin: 30px 0;
}

.mw-subjects-list.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.mw-subjects-list.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.mw-subjects-list.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.mw-subject-card {
    padding: 25px;
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.mw-subject-header {
    margin-bottom: 20px;
}

.mw-subject-card .mw-subject-title {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
    font-size: 1.4em;
}

.mw-subject-description {
    color: #666;
    line-height: 1.6;
    margin: 0;
}

.mw-duration-options {
    margin: 20px 0;
    flex-grow: 1;
}

.mw-duration-options h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #555;
    font-size: 1.1em;
}

.mw-duration-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mw-duration-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.mw-duration-item:last-child {
    border-bottom: none;
}

.mw-duration-days {
    color: #333;
    font-weight: 500;
}

.mw-duration-price {
    color: #0073aa;
    font-weight: bold;
}

.mw-subject-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.mw-purchase-button {
    display: inline-block;
    padding: 12px 25px;
    background: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
    transition: background 0.3s;
    width: 100%;
    border: none;
    cursor: pointer;
}

.mw-purchase-button:hover {
    background: #005a87;
    color: white;
}

/* Protected Content Messages */
.mw-protected-content-message {
    padding: 30px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 5px;
    text-align: center;
    color: #6c757d;
    font-size: 1.1em;
}

.mw-login-required {
    padding: 30px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 5px;
    text-align: center;
}

.mw-login-required p {
    margin: 10px 0;
    color: #856404;
}

.mw-login-required .button {
    margin: 0 5px;
}

/* WooCommerce Account Integration */
.mw-account-memberships .membership-status {
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.mw-account-memberships .days-remaining.warning {
    color: #d9534f;
    font-weight: bold;
}

.mw-account-memberships .expiring-soon {
    background: #fffce5;
}

.mw-renewal-suggestions {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 5px;
}

.mw-renewal-suggestions h3 {
    margin-top: 0;
    color: #333;
}

.mw-renewal-suggestions ul {
    list-style: none;
    padding: 0;
    margin: 15px 0 0 0;
}

.mw-renewal-suggestions li {
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mw-renewal-suggestions li:last-child {
    border-bottom: none;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .mw-memberships-grid,
    .mw-subjects-list.columns-2,
    .mw-subjects-list.columns-3,
    .mw-subjects-list.columns-4 {
        grid-template-columns: 1fr;
    }
    
    .mw-membership-selection {
        padding: 15px;
    }
    
    .mw-select {
        max-width: 100%;
    }
    
    .mw-detail {
        flex-direction: column;
    }
    
    .mw-detail .label,
    .mw-detail .value {
        width: 100%;
        margin-bottom: 5px;
    }
}

/* Animation for selection changes */
.mw-fade-in {
    animation: mw-fadein 0.3s ease-in;
}

@keyframes mw-fadein {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}


/* ============================================
   AGGRESSIVE FIX: Hide cross-sells on cart page
   ============================================ */

/* Hide ALL cross-sells and upsells on cart and checkout */
.woocommerce-cart .cross-sells,
.woocommerce-cart .upsells,
.woocommerce-cart .cart-collaterals .cross-sells,
.woocommerce-cart .cart-collaterals .upsells,
.woocommerce-checkout .cross-sells,
.woocommerce-checkout .upsells,
.woocommerce-cart section.related,
.woocommerce-cart section.upsells,
.woocommerce-cart .woocommerce-cross-sells,
.woocommerce-cart .storefront-new-in-store,
.woocommerce-cart .new-in-store,
.cart-collaterals .cross-sells,
.cross-sells,
.upsells,
.related.products,
.up-sells.products,
.woocommerce-cart .cart-collaterals .cart_totals .cross-sells {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
    pointer-events: none !important;
}

/* Show cart items properly */
.woocommerce-cart .cart_item {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
}

/* Ensure cart totals are visible */
.woocommerce-cart .cart_totals {
    display: block !important;
    position: relative !important;
    left: auto !important;
}

/* Clean up cart page */
.woocommerce-cart .cart-collaterals {
    clear: both;
    display: block !important;
    position: relative !important;
    left: auto !important;
}



