/* Base Layout Styles */
.profile-container {
    margin: 20px auto;
    padding: 0 5px;
}

.profile-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 30px;
}

/* Sidebar Styles — scoped under .profile-sidebar to avoid shop drawer collisions */
.profile-sidebar {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 22px 18px;
    height: fit-content;
    border: 1px solid var(--border-color, #e5e7eb);
}

.profile-sidebar .sidebar-header {
    display: flex;
    align-items: center;
    padding-bottom: 18px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
}

.profile-sidebar .sidebar-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    margin-right: 0;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--border-color, #e5e7eb);
}

.profile-sidebar .sidebar-user-meta {
    min-width: 0;
}

.profile-sidebar .sidebar-user-name {
    font-weight: 600;
    color: var(--secondary-color);
    font-size: 16px;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-sidebar .sidebar-user-email {
    font-size: 12px;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

/* Sidebar Menu */
.profile-sidebar .sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.profile-sidebar .sidebar-menu-item {
    margin-bottom: 6px;
}

.profile-sidebar .sidebar-menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 8px;
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
    min-height: 44px;
}

.profile-sidebar .sidebar-menu-link:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

.profile-sidebar .sidebar-menu-link.active {
    background-color: var(--light-color, #f3f4f6);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

.profile-sidebar .sidebar-menu-icon {
    margin-right: 0;
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.profile-sidebar .sidebar-menu-label {
    font-size: 14px;
    line-height: 1.2;
}

/* Profile Card Styles */
.profile-card {
    background-color: #fff;
    box-shadow: var(--shadow-md);
    border-radius: 8px;
    padding: 30px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

/* Profile Data Styles */
.profile-data {
    margin-top: 20px;
}

.profile-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.profile-label {
    color: var(--secondary-color);
    font-weight: 500;
    display: block;
    margin-bottom: 5px;
}

.profile-value {
    color: var(--text-color);
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--secondary-color);
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 16px;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.2);
}

/* Button Styles */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
}

/* Alert Styles */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Password Field Styles */
.password-field {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-color);
}

/* Logout Link */
.profile-sidebar .logout-link {
    color: #b91c1c;
    text-decoration: none;
    margin-top: 14px;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-top: 1px solid var(--border-color);
    border-radius: 8px;
    min-height: 44px;
}

.profile-sidebar .logout-link .sidebar-menu-icon {
    width: 20px;
    text-align: center;
}

.profile-sidebar .logout-link:hover {
    color: #c41016;
    background-color: #fef2f2;
}

/* Shared account layouts that reuse the sidebar column */
.orders-layout,
.order-layout,
.track-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 30px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .profile-layout,
    .orders-layout,
    .order-layout,
    .track-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .profile-card {
        grid-template-columns: 1fr;
    }

    .profile-sidebar {
        padding: 14px 12px;
        border-radius: 10px;
        position: sticky;
        top: 8px;
        z-index: 5;
    }

    .profile-sidebar .sidebar-header {
        padding-bottom: 12px;
        margin-bottom: 12px;
    }

    .profile-sidebar .sidebar-avatar {
        width: 40px;
        height: 40px;
    }

    .profile-sidebar .sidebar-user-name {
        font-size: 14px;
    }

    .profile-sidebar .sidebar-menu {
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
        margin: 0 -2px;
    }

    .profile-sidebar .sidebar-menu::-webkit-scrollbar {
        display: none;
    }

    .profile-sidebar .sidebar-menu-item {
        margin-bottom: 0;
        flex: 0 0 auto;
    }

    .profile-sidebar .sidebar-menu-link {
        flex-direction: row;
        text-align: left;
        padding: 10px 14px;
        white-space: nowrap;
        border-left: none;
        border: 1px solid var(--border-color, #e5e7eb);
        border-radius: 999px;
        background: #f8fafc;
        min-height: 44px;
    }

    .profile-sidebar .sidebar-menu-link.active {
        background-color: var(--light-color, #f3f4f6);
        border-color: var(--primary-color);
        color: var(--primary-color);
    }

    .profile-sidebar .sidebar-menu-icon {
        margin-right: 0;
        margin-bottom: 0;
        font-size: 14px;
    }

    .profile-sidebar .sidebar-menu-label {
        font-size: 13px;
    }

    .profile-sidebar .logout-link {
        margin-top: 10px;
        padding: 10px 12px;
        border-radius: 999px;
        justify-content: center;
        border: 1px solid #fecaca;
        background: #fef2f2;
    }
}
