/**
 * Custom WooCommerce Account Styling
 * Derived from reference frontend/login/login.html
 */

/* 1. Page Background & Centering */
.woocommerce-account.woocommerce-checkout-minimal {
    background-color: #f0f0f0 !important;
    min-height: 100vh;
}

/* LOGIN PAGE: flex-centered card */
.woocommerce-account.woocommerce-checkout-minimal .account-main-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0px 16px 80px;
    min-height: calc(100vh - 100px);
}

/* DASHBOARD: full-width block layout */
.woocommerce-account:not(.woocommerce-checkout-minimal) .account-main-layout,
.woocommerce-account .account-main-layout {
    display: block;
    padding: 0;
}

/* 2. Brand Logo (Added in form-login.php override) */
.brand-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 32px;
}

.brand-logo-wrap img {
    height: 60px;
    width: auto;
    object-fit: contain;
}

/* 3. The Login/Register Card */
.smasher-login-card {
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
    width: 100%;
    max-width: 480px;
    padding: 40px 36px 36px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin: 0 auto;
}

/* 4. Headlines */
.smasher-login-card h2 {
    font-size: 22px;
    font-weight: 700;
    color: #111;
    margin-bottom: 8px;
    text-align: center;
    font-family: 'Montserrat', sans-serif !important;
}

.smasher-login-card p.form-row {
    margin-bottom: 20px;
}

.smasher-login-card label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    font-family: 'Montserrat', sans-serif !important;
}

/* 5. Inputs */
.woocommerce-account .smasher-login-card input.input-text {
    width: 100% !important;
    padding: 14px 16px !important;
    border: 1.5px solid #ccc !important;
    border-radius: 6px !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 14px !important;
    color: #111 !important;
    outline: none !important;
    transition: border-color 0.2s !important;
    background: #fff !important;
}

.woocommerce-account .smasher-login-card input.input-text:focus {
    border-color: #111 !important;
    box-shadow: none !important;
}

/* 6. Buttons */
.woocommerce-account .smasher-login-card .woocommerce-button {
    width: 100% !important;
    padding: 15px !important;
    background: #111111 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: background 0.2s, transform 0.1s !important;
    letter-spacing: 0.02em !important;
    text-transform: none !important;
    margin-top: 10px;
}

.woocommerce-account .smasher-login-card .woocommerce-button:hover {
    background: #333 !important;
}

.woocommerce-account .smasher-login-card .woocommerce-button:active {
    transform: scale(0.99) !important;
}

/* Red variations (for Register if desired, or secondary actions) */
.woocommerce-account .smasher-login-card .button.btn-red {
    background: #E2231A !important;
}

.woocommerce-account .smasher-login-card .button.btn-red:hover {
    background: #c0000f !important;
}

/* 7. Links & Extras */
.woocommerce-LostPassword a {
    font-size: 13px;
    color: #E2231A !important;
    text-decoration: none;
    font-weight: 500;
}

.woocommerce-LostPassword a:hover {
    text-decoration: underline;
}

.smasher-login-card .woocommerce-form-login__rememberme {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #888;
}

/* 8. Registration Toggle Section */
.register-toggle-row {
    margin-top: 24px;
    text-align: center;
    font-size: 14px;
    color: #666;
    border-top: 1px solid #eee;
    padding-top: 24px;
}

.register-toggle-row a {
    color: #E2231A;
    font-weight: 600;
    text-decoration: none;
}

/* 9. Privacy Footer */
.login-footer {
    margin-top: 32px;
    text-align: center;
}

.login-footer a {
    font-size: 13px;
    color: #E2231A;
    text-decoration: none;
    font-weight: 500;
}

/* 10. Messages */
.woocommerce-error,
.woocommerce-message,
.woocommerce-info {
    max-width: 480px;
    margin: 10px auto 20px auto !important;
    border-radius: 6px !important;
    font-size: 13px !important;
}

/* DASHBOARD SPECIFIC (Logged in state) — grey background fills the whole page */
body.woocommerce-account:not(.woocommerce-checkout-minimal) {
    background-color: #f4f5f7;
}

.woocommerce-account:not(.woocommerce-checkout-minimal) .account-main-layout {
    display: block;
    background: transparent;
}

/* 11. Main Account Layout (Flex for Sidebar + Content) */
.smasher-account-layout {
    max-width: 1300px;
    margin: 0 auto;
    padding: 20px 30px 40px;
    /* Reduced top padding from 40px */
}

@media (max-width: 991px) {
    .smasher-account-layout {
        padding: 10px 12px 30px;
        /* Even tighter for mobile devices */
    }
}

.smasher-account-header {
    margin-bottom: 40px;
}

.smasher-account-header h2 {
    font-size: 32px;
    font-weight: 800;
    color: #111;
    margin-bottom: 8px;
    font-family: 'Montserrat', sans-serif !important;
}

.smasher-account-header p {
    color: #666;
    font-size: 16px;
}

.smasher-account-container {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

/* 12. Sidebar Navigation */
.smasher-account-nav {
    width: 300px;
    max-width: 300px;
    flex-shrink: 0;
    min-width: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px 0;
}

.smasher-account-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.smasher-nav-item {
    border-bottom: 1px solid #f2f2f2;
}

.smasher-nav-item:last-child {
    border-bottom: none;
}

.smasher-nav-item a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 25px;
    color: #333;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    font-family: 'Montserrat', sans-serif !important;
}

.smasher-nav-item i {
    font-size: 18px;
    width: 24px;
    text-align: center;
    color: #888;
    transition: color 0.2s;
}

.smasher-nav-item:hover a,
.smasher-nav-item.is-active a {
    background-color: #fceceb;
    /* Light red shade */
    color: #E2231A;
    border-left: 4px solid #E2231A;
    padding-left: 21px;
    /* Offset for the border */
}

.smasher-nav-item:hover i,
.smasher-nav-item.is-active i {
    color: #E2231A;
}

/* 13. Account Content Area */
.smasher-account-content {
    flex-grow: 1;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 40px;
    min-height: 400px;
}

/* 14. Welcome Dashboard Section */
.smasher-dashboard-welcome h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #111;
}

.smasher-dashboard-welcome p {
    color: #666;
    margin-bottom: 30px;
}

/* 15. Dashboard Action Grid */
.smasher-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.smasher-dashboard-card {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    background: #fff;
    border: 1.5px solid #eee;
    border-radius: 10px;
    padding: 24px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.smasher-dashboard-card:hover {
    border-color: #E2231A;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.smasher-dashboard-card .card-icon {
    font-size: 24px;
    color: #E2231A;
    background: #fceceb;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.smasher-dashboard-card h3 {
    font-size: 16px;
    font-weight: 700;
    color: #111;
    margin-bottom: 4px;
    margin-top: 5px;
}

.smasher-dashboard-card p {
    font-size: 13px;
    color: #888;
    line-height: 1.4;
    margin: 0;
}

/* 16. ORDER TABLES & FORMS (Global Styling) */
.woocommerce-MyAccount-content table.shop_table {
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    width: 100% !important;
}

.woocommerce-MyAccount-content table.shop_table th {
    background: #f9f9f9;
    padding: 15px 20px !important;
    font-size: 13px;
    text-transform: uppercase;
    font-weight: 700;
}

.woocommerce-MyAccount-content table.shop_table td {
    padding: 15px 20px !important;
    font-size: 14px;
}

.woocommerce-MyAccount-content .woocommerce-button.view {
    background: #111 !important;
    padding: 8px 16px !important;
    font-size: 12px !important;
}

/* ============================================================
   17. GLOBAL BOX MODEL SAFETY
   ============================================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* ============================================================
   18. MOBILE TOGGLE BAR — hidden on desktop
   ============================================================ */
.smasher-mobile-nav-bar {
    display: none;
    /* Hidden on desktop */
}

/* ============================================================
   19. MOBILE OVERLAY
   ============================================================ */
.smasher-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.smasher-nav-overlay.is-active {
    display: block;
    opacity: 1;
}

/* ============================================================
   20. MOBILE DRAWER
   ============================================================ */
.smasher-nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 290px;
    max-width: 85vw;
    height: 100%;
    background: #fff;
    z-index: 9100;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
}

.smasher-nav-drawer.is-open {
    transform: translateX(0);
}

/* Drawer Header */
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 16px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.drawer-user {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.drawer-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #eee;
}

.drawer-user-info {
    min-width: 0;
}

.drawer-name {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #111;
    font-family: 'Montserrat', sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.drawer-email {
    display: block;
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.drawer-close-btn {
    background: #f5f5f5;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    color: #333;
    flex-shrink: 0;
    transition: background 0.2s;
}

.drawer-close-btn:hover {
    background: #eee;
}

/* Drawer Navigation */
.drawer-nav {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.drawer-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.drawer-nav-item {
    border-bottom: 1px solid #f5f5f5;
}

.drawer-nav-item:last-child {
    border-bottom: none;
}

.drawer-nav-item a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    font-family: 'Montserrat', sans-serif;
}

.drawer-nav-item a i:first-child {
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: #999;
    transition: color 0.2s;
}

.drawer-nav-item a:hover,
.drawer-nav-item.is-active a {
    background: #fceceb;
    color: #E2231A;
    border-left: 4px solid #E2231A;
    padding-left: 16px;
}

.drawer-nav-item a:hover i:first-child,
.drawer-nav-item.is-active a i:first-child {
    color: #E2231A;
}

.drawer-check {
    margin-left: auto;
    font-size: 13px;
    color: #E2231A;
}

/* Prevent body scroll when drawer is open */
body.drawer-open {
    overflow: hidden;
}

/* ============================================================
   21. RESPONSIVE — Tablet & Mobile (≤ 991px)
   ============================================================ */
@media (max-width: 991px) {

    /* Show mobile toggle, hide desktop sidebar */
    .smasher-mobile-nav-bar {
        display: block;
        width: 100%;
        margin-bottom: 16px;
    }

    .smasher-account-nav {
        display: none !important;
        /* Desktop sidebar — hidden on mobile */
    }

    /* Layout: single column */
    .smasher-account-layout {
        padding: 16px 12px 40px;
    }

    .smasher-account-header {
        margin-bottom: 16px;
    }

    .smasher-account-header h2 {
        font-size: 22px;
    }

    .smasher-account-header p {
        font-size: 14px;
    }

    .smasher-account-container {
        flex-direction: column;
        gap: 0;
    }

    .smasher-account-content {
        width: 100%;
        min-height: auto;
        padding: 20px 16px;
        border-radius: 8px;
    }

    /* Cards: 1 column */
    .smasher-dashboard-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .smasher-dashboard-card {
        padding: 16px;
        gap: 14px;
    }

    .smasher-dashboard-card h3 {
        font-size: 15px;
        margin-top: 0;
    }

    .smasher-dashboard-welcome h1 {
        font-size: 20px;
    }

    .smasher-dashboard-welcome p {
        font-size: 13px;
        margin-bottom: 20px;
    }
}

/* ============================================================
   22. MOBILE TOGGLE BAR STYLES
   ============================================================ */
.smasher-nav-toggle-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1.5px solid #e5e5e5;
    border-radius: 8px;
    padding: 14px 16px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s;
}

.smasher-nav-toggle-btn:hover {
    border-color: #E2231A;
}

.toggle-icon {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
}

.toggle-icon span {
    display: block;
    width: 20px;
    height: 2px;
    background: #333;
    border-radius: 2px;
}

.toggle-label {
    flex: 1;
    min-width: 0;
}

.toggle-section {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-family: 'Montserrat', sans-serif;
}

.toggle-active {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #111;
    font-family: 'Montserrat', sans-serif;
}

.toggle-chevron {
    font-size: 12px;
    color: #888;
    transition: transform 0.3s ease;
}

/* ============================================================
   23. TINY SCREENS (320px)
   ============================================================ */
@media (max-width: 360px) {
    .smasher-account-layout {
        padding: 12px 10px 30px;
    }

    .smasher-account-content {
        padding: 16px 12px;
    }

    .smasher-dashboard-card {
        padding: 14px 12px;
        gap: 12px;
    }

    .smasher-dashboard-card .card-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

/* ============================================================
   24. ORDER TABLES — Horizontal scroll on mobile
   ============================================================ */
@media (max-width: 991px) {
    .woocommerce-MyAccount-content table.shop_table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .woocommerce-MyAccount-content table.shop_table th,
    .woocommerce-MyAccount-content table.shop_table td {
        padding: 12px 14px !important;
        font-size: 13px;
        white-space: nowrap;
    }

    .woocommerce-MyAccount-content .woocommerce-button.view {
        white-space: nowrap;
    }
}

/* ============================================================
   25. FORMS — Full width on mobile
   ============================================================ */
@media (max-width: 991px) {

    .woocommerce-MyAccount-content fieldset,
    .woocommerce-MyAccount-content .woocommerce-address-fields__field-wrapper p,
    .woocommerce-MyAccount-content .woocommerce-EditAccountForm p {
        width: 100% !important;
        float: none !important;
    }

    .woocommerce-MyAccount-content .woocommerce-Button,
    .woocommerce-MyAccount-content button[type="submit"] {
        width: 100% !important;
        text-align: center !important;
        padding: 14px !important;
    }
}