/* Mobile Navigation Bar */
.jcw-mobile-nav {
    display: none;
}

@media (max-width: 991px) {
    .jcw-mobile-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: #ffffff;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
        z-index: 1000;
        justify-content: space-between;
        align-items: center;
        padding: 10px 15px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--jcw-border, #EADFD2);
    }
    
    /* Ensure body has padding so content isn't hidden behind the bar */
    body {
        padding-bottom: calc(60px + env(safe-area-inset-bottom));
    }
}

.jcw-mobile-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--jcw-text-light, #6B5B52);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    flex: 1;
    transition: color 0.2s ease;
}

.jcw-mobile-nav__item:hover,
.jcw-mobile-nav__item:focus {
    color: var(--jcw-secondary, #D8A24A);
    outline: none;
}

.jcw-mobile-nav__item svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.8px;
}

.jcw-mobile-nav__icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Category Flyout & Account Popup Overlay */
.jcw-categories-overlay,
.jcw-account-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(28, 15, 10, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s ease;
}

.jcw-categories-overlay--active,
.jcw-account-overlay--active {
    opacity: 1;
    visibility: visible;
}

/* Slide up panels */
.jcw-categories-flyout,
.jcw-account-popup {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    max-height: 85vh;
    background: #ffffff;
    border-radius: 24px 24px 0 0;
    z-index: 1050;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
    transition: bottom 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.jcw-categories-flyout--active,
.jcw-account-popup--active {
    bottom: 0;
}

/* Headers */
.jcw-categories-flyout__header,
.jcw-account-popup__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--jcw-border, #EADFD2);
}

.jcw-categories-flyout__header h3,
.jcw-account-popup__header h3 {
    margin: 0;
    font-size: 18px;
    font-family: var(--font-heading);
    color: var(--jcw-primary, #3A2418);
}

.jcw-close-categories-trigger,
.jcw-close-account-trigger {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--jcw-text-light, #6B5B52);
    transition: color 0.2s ease;
}

.jcw-close-categories-trigger:hover,
.jcw-close-account-trigger:hover {
    color: var(--jcw-primary, #3A2418);
}

/* Content Areas */
.jcw-categories-flyout__content,
.jcw-account-popup__content {
    padding: 16px 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Category Grid */
.jcw-category-thumbnails-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (min-width: 480px) {
    .jcw-category-thumbnails-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 992px) {
    .jcw-categories-flyout,
    .jcw-account-popup {
        max-width: 600px;
        left: 50%;
        transform: translate(-50%, -50%);
        max-height: 80vh;
        border-radius: 24px;
        top: 50%;
        bottom: auto;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .jcw-account-popup {
        max-width: 440px !important;
    }

    .jcw-categories-flyout--active,
    .jcw-account-popup--active {
        opacity: 1;
        visibility: visible;
    }
}

.jcw-category-thumbnail-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    gap: 12px;
    background: var(--jcw-light-bg, #F8F3ED);
    border-radius: 12px;
    padding: 16px;
    transition: transform 0.3s ease, background 0.3s ease;
}

.jcw-category-thumbnail-card:hover {
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(58, 36, 24, 0.08);
}

.jcw-category-thumbnail-img-wrap {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #ffffff;
    box-shadow: 0 4px 12px rgba(58, 36, 24, 0.05);
}

.jcw-category-thumbnail-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.jcw-category-thumbnail-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--jcw-primary, #3A2418);
    text-align: center;
}

/* ── Premium Account Popup Styling & Tabs ── */
.jcw-account-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    background: var(--jcw-light-bg, #F8F3ED);
    padding: 4px;
    border-radius: 8px;
}

.jcw-account-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--jcw-text-light, #6B5B52);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.jcw-account-tab.jcw-account-tab--active {
    background: #ffffff;
    color: var(--jcw-primary, #3A2418);
    box-shadow: 0 2px 8px rgba(58, 36, 24, 0.08);
}

/* Hide native WooCommerce headings as we use tabs now */
.jcw-account-popup__content h2 {
    display: none !important;
}

/* Toggle visibility based on active tab wrapper attribute */
.jcw-account-forms-wrapper[data-active-tab="login"] .u-column2,
.jcw-account-forms-wrapper[data-active-tab="register"] .u-column1 {
    display: none !important;
}

/* Hide auto-injected Nextend button inside the form to prevent duplicates */
body .jcw-account-popup__content form.woocommerce-form .nsl-container,
body .jcw-account-popup__content form.register .nsl-container,
body .jcw-account-popup__content form.login .nsl-container {
    display: none !important;
}

/* Hide WooCommerce password strength meter (appears as an ugly blue box) */
body .jcw-account-popup__content .woocommerce-password-strength,
body .jcw-account-popup__content .woocommerce-password-hint {
    display: none !important;
}

.jcw-account-popup__scroll,
.jcw-account-forms-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.jcw-account-popup__content .u-columns.col2-set {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100% !important;
}

.jcw-account-popup__content .u-column1,
.jcw-account-popup__content .u-column2,
.jcw-account-popup__content .col-1,
.jcw-account-popup__content .col-2 {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

.jcw-account-popup__content .woocommerce-form {
    padding: 0;
    border: none;
    margin: 0;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.jcw-account-popup__content .woocommerce-form-row,
.jcw-account-popup__content .form-row {
    margin-bottom: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
    box-sizing: border-box !important;
}

.jcw-account-popup__content label {
    display: block;
    font-size: 12px !important;
    font-weight: 600;
    color: var(--jcw-text, #2D1A10);
    margin-bottom: 4px !important;
}

.jcw-account-popup__content .woocommerce-Input,
.jcw-account-popup__content input[type="text"],
.jcw-account-popup__content input[type="email"],
.jcw-account-popup__content input[type="password"] {
    width: 100% !important;
    max-width: 100% !important;
    padding: 10px 14px !important;
    border: 1px solid var(--jcw-border, #EADFD2);
    border-radius: 6px;
    background: #ffffff;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--jcw-text, #2D1A10);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box !important;
}

.jcw-account-popup__content .woocommerce-Input:focus,
.jcw-account-popup__content input[type="text"]:focus,
.jcw-account-popup__content input[type="email"]:focus,
.jcw-account-popup__content input[type="password"]:focus {
    outline: none;
    border-color: var(--jcw-secondary, #D8A24A);
    box-shadow: 0 0 0 3px rgba(216, 162, 74, 0.1);
}

body .jcw-account-popup__content button.woocommerce-button,
body .jcw-account-popup__content button.woocommerce-Button,
body .jcw-account-popup__content .woocommerce-Button {
    background: var(--jcw-primary, #3A2418) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    padding: 10px 20px !important;
    border-radius: 6px !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.3s ease;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px !important;
}

body .jcw-account-popup__content button.woocommerce-button:hover,
body .jcw-account-popup__content button.woocommerce-Button:hover,
body .jcw-account-popup__content .woocommerce-Button:hover {
    background: var(--jcw-secondary, #D8A24A) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(216, 162, 74, 0.2) !important;
}

/* Nextend Social Login Integration */
.jcw-social-login-wrapper {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.jcw-social-login-wrapper a,
.jcw-social-login-wrapper .nsl-container,
.jcw-social-login-wrapper .nsl-container-block,
.jcw-social-login-wrapper .nsl-container-buttons,
.jcw-social-login-wrapper .nsl-button {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
}

.jcw-account-popup__content .nsl-container {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.jcw-account-popup__content .nsl-container-block {
    width: 100% !important;
    max-width: 100% !important;
}

.jcw-account-popup__content .nsl-container-block .nsl-button {
    border-radius: 6px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05) !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
    border: 1.5px solid var(--jcw-secondary, #D8A24A) !important;
    background: #ffffff !important;
}

.jcw-account-popup__content .nsl-container-block .nsl-button:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(216, 162, 74, 0.15) !important;
    background: #fafafa !important;
}

/* Elegant "OR" Separator */
.jcw-login-separator {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 16px 0 !important;
    color: var(--jcw-text-light, #6B5B52) !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 1.5px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.jcw-login-separator::before,
.jcw-login-separator::after {
    content: '' !important;
    flex: 1 !important;
    border-bottom: 1px solid var(--jcw-border, #EADFD2) !important;
}

.jcw-login-separator::before {
    margin-right: 12px !important;
}

.jcw-login-separator::after {
    margin-left: 12px !important;
}

/* Remember me checkbox & Lost password links */
.jcw-account-popup__content .woocommerce-form-login__rememberme {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    margin: 4px 0 10px !important;
    font-weight: 500 !important;
    font-size: 13px !important;
}

.jcw-account-popup__content .woocommerce-form-login__rememberme input {
    margin: 0 !important;
    width: auto !important;
}

.jcw-account-popup__content .lost_password {
    text-align: center;
    margin-top: 10px !important;
    margin-bottom: 0 !important;
}

.jcw-account-popup__content .lost_password a {
    color: var(--jcw-secondary, #D8A24A) !important;
    font-size: 13px !important;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.jcw-account-popup__content .lost_password a:hover {
    color: var(--jcw-primary, #3A2418) !important;
    text-decoration: underline;
}

/* Privacy Policy Text Styling */
.woocommerce-privacy-policy-text p {
    font-size: 14px !important;
    color: var(--jcw-text-light, #6B5B52) !important;
    line-height: 1.5 !important;
}

/* Password Input Show/Hide Styling */
.jcw-account-popup__content .password-input {
    position: relative !important;
    display: block !important;
    width: 100% !important;
}

.jcw-account-popup__content input[type="password"] {
    padding-right: 52px !important;
}

body .jcw-account-popup__content .show-password-input {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--jcw-secondary, #D8A24A) !important;
    width: auto !important;
    height: auto !important;
    text-indent: 0 !important;
    position: absolute !important;
    top: 50% !important;
    right: 14px !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    cursor: pointer !important;
    z-index: 10 !important;
    display: block !important;
    transition: color 0.2s ease !important;
}

body .jcw-account-popup__content .show-password-input:hover,
body .jcw-account-popup__content .password-input .show-password-input:hover,
body .jcw-account-popup__content .password-input span.show-password-input:hover,
body .jcw-account-popup__content .password-input a.show-password-input:hover {
    color: var(--jcw-primary, #3A2418) !important;
    background: transparent !important;
    background-color: transparent !important;
    text-decoration: none !important;
}

body .jcw-account-popup__content .show-password-input:focus,
body .jcw-account-popup__content .show-password-input:active,
body .jcw-account-popup__content .password-input .show-password-input:focus,
body .jcw-account-popup__content .password-input .show-password-input:active {
    color: var(--jcw-secondary, #D8A24A) !important;
    background: transparent !important;
    background-color: transparent !important;
    text-decoration: none !important;
}

body .jcw-account-popup__content .show-password-input::after,
body .jcw-account-popup__content .show-password-input::before {
    display: none !important;
    content: "" !important;
}

/* ── Logged-in Account Menu Flyout Drawer ── */
.jcw-account-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(33, 20, 14, 0.4); /* Dark chocolate transparent overlay */
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s ease;
}

.jcw-account-menu-overlay--active {
    opacity: 1;
    visibility: visible;
}

.jcw-account-menu-flyout {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    max-height: 85vh;
    background: #ffffff;
    border-radius: 24px 24px 0 0;
    z-index: 1050;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
    transition: bottom 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.jcw-account-menu-flyout--active {
    bottom: 0;
}

.jcw-account-menu-flyout__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--jcw-border, #EADFD2);
}

.jcw-account-menu-flyout__header h3 {
    margin: 0;
    font-size: 18px;
    font-family: var(--font-heading);
    color: var(--jcw-primary, #3A2418);
}

.jcw-close-account-menu-trigger {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--jcw-text, #2D1A10);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.jcw-close-account-menu-trigger:hover {
    color: var(--jcw-secondary, #D8A24A);
}

.jcw-account-menu-flyout__content {
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}

/* User Welcome Bar inside flyout */
.jcw-account-menu-welcome {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #FAF6F0;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(58, 36, 24, 0.04);
    margin-bottom: 20px;
}

.jcw-user-avatar img {
    border-radius: 50%;
    border: 2px solid #FFF;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: block;
}

.jcw-user-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.jcw-user-name {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    color: var(--jcw-primary, #3A2418);
    line-height: 1.2;
    margin-bottom: 3px;
}

.jcw-user-email {
    font-size: 12px;
    color: var(--jcw-text-light, #6B5B52);
    line-height: 1;
}

/* Menu list style */
.jcw-account-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.jcw-account-menu-list li {
    margin: 0 0 8px 0;
    padding: 0;
}

.jcw-account-menu-list li a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 10px;
    background: #FCFAF7;
    color: var(--jcw-primary, #3A2418);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1.5px solid transparent;
}

.jcw-account-menu-list li a svg {
    color: var(--jcw-secondary, #D8A24A);
    transition: transform 0.3s ease;
}

.jcw-account-menu-list li a:hover {
    background: #FAF6F0;
    border-color: rgba(216, 162, 74, 0.2);
}

.jcw-account-menu-list li a:hover svg {
    transform: scale(1.08);
}

/* Logout link special style */
.jcw-account-menu-list li.jcw-logout-item a {
    background: #FFF0F0;
    color: #A32A2A;
}

.jcw-account-menu-list li.jcw-logout-item a svg {
    color: #A32A2A;
}

.jcw-account-menu-list li.jcw-logout-item a:hover {
    background: #FCE6E6;
    border-color: rgba(163, 42, 42, 0.15);
}
