/* Admin Simulator Wrapper */
.wmbm-admin-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
}

.wmbm-settings-column {
    flex: 1;
    min-width: 300px;
}

.wmbm-preview-column {
    width: 375px;
    flex: 0 0 375px;
    position: relative;
}

.wmbm-phone-simulator {
    width: 375px;
    height: 700px;
    background: #f0f0f0;
    border: 12px solid #333;
    border-radius: 40px;
    position: sticky;
    top: 50px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.wmbm-phone-header {
    height: 30px;
    background: #333;
    width: 100%;
    position: relative;
    z-index: 2;
}

.wmbm-phone-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 20px;
    background: #333;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
}

.wmbm-phone-screen {
    flex: 1;
    background: #fff;
    position: relative;
    background-image: linear-gradient(to bottom, #f9f9f9, #ececec);
    overflow: hidden;
    /* Contain the absolute menu */
}

.wmbm-phone-screen::before {
    content: 'Site Preview';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ccc;
    font-size: 24px;
    font-weight: bold;
}

/* =========================================
   Frontend Styles Mirror (Scoped) 
   ========================================= */

/* Override vars for preview using the container ID as scope */
/* Override vars for preview using the container ID as scope */
#wmbm-preview-wrapper {
    width: 100%;
    position: absolute;
    bottom: 0;
    left: 0;
    line-height: 1.5;
    /* Default Reset */
}

/* Explicit Reset for Simulator Elements to avoid Admin conflicts */
/* We do NOT use * because it kills pseudo :before elements needed for dashicons */
#wmbm-preview-wrapper div,
#wmbm-preview-wrapper ul,
#wmbm-preview-wrapper li,
#wmbm-preview-wrapper a,
#wmbm-preview-wrapper span,
#wmbm-preview-wrapper i {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    line-height: normal;
}

#wmbm-preview-wrapper ul,
#wmbm-preview-wrapper li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

#wmbm-preview-wrapper a {
    text-decoration: none !important;
    box-shadow: none !important;
    border: none !important;
}

/* The exact styles from frontend, but we force wmbm-container to be absolute inside the simulator */
#wmbm-preview-wrapper .wmbm-container {
    position: absolute !important;
    /* Force absolute within phone screen */
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 60px;
    /* var(--wmbm-height) */
    background-color: var(--wmbm-bg, #fff);
    /* Uses the var inherited from wrapper or defined here */
    border-top-left-radius: var(--wmbm-radius, 0px);
    border-top-right-radius: var(--wmbm-radius, 0px);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
    display: block !important;
    /* Ensure visible */
    padding: 0 !important;
}

#wmbm-preview-wrapper .wmbm-nav {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 10px !important;
    height: 100% !important;
}

#wmbm-preview-wrapper .wmbm-item {
    flex: 1;
    text-align: center;
    margin: 0 !important;
    padding: 0 !important;
}

#wmbm-preview-wrapper .wmbm-item a {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    color: var(--wmbm-icon, #666);
    font-size: 10px !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    line-height: normal !important;
}

/* Specificity over !important */
#wmbm-preview-wrapper .wmbm-item i,
#wmbm-preview-wrapper .wmbm-item i:before {
    font-family: "dashicons" !important;
    font-size: 22px;
    width: 22px;
    height: 22px;
    line-height: 22px;
    display: inline-block;
    margin-bottom: 4px;
    vertical-align: middle;
    text-align: center;
    color: inherit;
    /* Ensure it takes the parent link color */
    font-style: normal;
    font-weight: 400;

    /* Reset other potential WP Admin styles */
    box-shadow: none;
    background: transparent;
    padding: 0;
    border: none;
    text-decoration: none;
    text-transform: none;
}

#wmbm-preview-wrapper .wmbm-item.active a {
    color: var(--wmbm-active, #008080);
}

/* Cart Item Styling */
#wmbm-preview-wrapper .wmbm-cart-item {
    position: relative;
    top: -15px !important;
    overflow: visible !important;
    /* Ensure bubble shows */
}

#wmbm-preview-wrapper .wmbm-cart-encircle {
    background: var(--wmbm-bg, #fff);
    border-radius: 50% !important;
    padding: 5px !important;
    display: inline-block !important;
}

#wmbm-preview-wrapper .wmbm-cart-encircle a {
    background: var(--wmbm-active, #008080);
    color: #fff !important;
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    justify-content: center !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2) !important;
    display: flex !important;
    align-items: center !important;
}

#wmbm-preview-wrapper .wmbm-cart-icon-wrap {
    position: relative !important;
    display: block !important;
    width: auto !important;
    height: auto !important;
}

#wmbm-preview-wrapper .wmbm-cart-encircle i {
    color: #fff !important;
    margin: 0 !important;
}

#wmbm-preview-wrapper .wmbm-label-cart {
    display: none !important;
}

#wmbm-preview-wrapper .wmbm-cart-count {
    position: absolute !important;
    top: -8px !important;
    right: -8px !important;
    background: var(--wmbm-bubble-bg, #ff0000);
    color: var(--wmbm-bubble-text, #fff);
    font-size: 10px !important;
    font-weight: bold !important;
    width: 18px !important;
    height: 18px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid #fff !important;
    line-height: 18px !important;
    padding: 0 !important;
    z-index: 5;
    font-family: sans-serif !important;
    /* Count shouldn't be dashicons */
}