/* Container for the entire account layout */
.woocommerce-account .woocommerce {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    max-width: 100%;
    overflow-x: hidden;
}

/* Sidebar */
.account-sidebar {
    flex: 0 0 300px;
    border-right: 1px solid #e0e0e0;
    padding: 20px;
    background-color: #ffffff;
    box-sizing: border-box;
    min-height: 100vh;
}

/* Hide default WooCommerce navigation */
nav.woocommerce-MyAccount-navigation {
    display: none;
}

/* Main content area */
.woocommerce-MyAccount-content {
    flex: 1;
    min-width: 0;
    padding: 20px;
    box-sizing: border-box;
}

/* Account Header */
.account-sidebar strong#account-name {
    font-size: 110%;
    display: block;
    margin-bottom: 5px;
}

.account-sidebar p#account-email {
    font-size: smaller;
    margin: 0 0 10px 0;
    color: #666;
}

/* Logout Button */
.account-sidebar a#account-logout,
.logout-button {
    background-color: #ddd;
    color: #333;
    padding: 8px 16px;
    font-size: 14px;
    border: none;
    border-radius: 4px;
    margin: 10px auto 20px;
    display: block;
    width: fit-content;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.account-sidebar a#account-logout:hover,
.logout-button:hover {
    background-color: #ccc;
    text-decoration: none;
}

/* Menu Items */
.account-sidebar .menu-item {
    padding: 0;
    border-top: 1px solid #e0e0e0;
    background: none;
    box-shadow: none;
}

.account-sidebar .menu-item:first-child {
    border-top: none;
}

.account-sidebar .menu-item a {
    color: #777777;
    display: block;
    padding: 12px 10px;
    font-size: 16px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}

.account-sidebar .menu-item a:hover,
.account-sidebar .menu-item a.active {
    color: #000000;
    background-color: #f5f5f5;
    text-decoration: none;
}

/* SVG Icons */
.account-sidebar .svg-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 8px;
    display: inline-block;
}

/* Banner Ad */
.account-banner-ad {
    margin-top: 20px;
    padding: 15px 10px;
    text-align: center;
    border-top: 1px solid #e0e0e0;
}

.account-banner-ad .banner-image {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.account-banner-ad .banner-image:hover {
    opacity: 0.9;
}

.account-banner-ad a {
    display: block;
    text-decoration: none;
}

/* Tablet Responsive (768px - 1024px) */
@media only screen and (min-width: 769px) and (max-width: 1024px) {
    .account-sidebar {
        flex: 0 0 250px;
        padding: 15px;
    }
    
    .woocommerce-MyAccount-content {
        padding: 15px;
    }
    
    .account-sidebar .menu-item a {
        padding: 10px 8px;
        font-size: 15px;
    }
    
    .account-sidebar .svg-icon {
        width: 14px;
        height: 14px;
        margin-right: 6px;
    }
    
    /* Fix WooCommerce orders table overflow on tablet */
    .woocommerce-orders-table,
    .woocommerce-MyAccount-orders,
    .shop_table_responsive {
        width: 100%;
        overflow-x: auto;
        display: block;
        white-space: nowrap;
    }
    
    .woocommerce-orders-table table,
    .shop_table_responsive table {
        width: 100%;
        min-width: 600px;
    }
    
    .woocommerce-orders-table .woocommerce-button,
    .shop_table_responsive .woocommerce-button {
        white-space: nowrap;
        min-width: 80px;
    }
}

/* Don't fuck with the default form styling - WooCommerce handles it fine */

/* Don't mess with buttons either */

/* Mobile Responsive (up to 768px) */
@media only screen and (max-width: 768px) {
    .woocommerce-account .woocommerce {
        flex-direction: column;
        overflow-x: hidden;
    }
    
    .account-sidebar {
        flex: none;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        padding: 15px;
        min-height: auto;
    }
    
    .woocommerce-MyAccount-content {
        padding: 15px;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .account-sidebar .menu-item a {
        padding: 12px 10px;
        font-size: 16px;
    }
    
    .account-banner-ad {
        margin-top: 15px;
        padding: 10px;
    }
    
    /* Prevent horizontal scrolling on mobile */
    * {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Fix WooCommerce orders table overflow */
    .woocommerce-orders-table,
    .woocommerce-MyAccount-orders,
    .shop_table_responsive {
        width: 100%;
        overflow-x: auto;
        display: block;
        white-space: nowrap;
    }
    
    .woocommerce-orders-table table,
    .shop_table_responsive table {
        width: 100%;
        min-width: 600px; /* Ensure minimum width to show all columns */
    }
    
    /* Make sure action buttons are visible */
    .woocommerce-orders-table .woocommerce-button,
    .shop_table_responsive .woocommerce-button {
        white-space: nowrap;
        min-width: 80px;
    }
}
